Database data import method and device, equipment and storage medium
By generating and using initial data templates to automatically import data into the database, the problems of inefficiency and high error rates of traditional manual operations are solved, and efficient and accurate database data import is achieved.
Patent Information
- Application Number
- CN202411736987.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional database data import methods rely on manual operations, such as copy and paste, which leads to inefficient and error-prone large-scale data import tasks.
By obtaining the data size value of the data to be imported, the type of the target database and the IP address, the corresponding initial data template is generated, the data to be imported is imported into the template, the basic template information is obtained to modify the database link, and the data template is uploaded to the database to realize automated data import.
It improves the success rate and matching degree of data import, reduces human errors, and improves import efficiency and data integrity.
Smart Images

Figure CN119513180A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data import, and in particular to a method, device, equipment and storage medium for importing data into a database. Background Art
[0002] In today's digital age, data storage and management are crucial to the operation of enterprises and organizations. With the continuous development of information technology, a large amount of data is generated and collected, and how to effectively import this data into the database has become a key issue.
[0003] The traditional way of importing data into a database usually relies on manual operations, such as data entry through simple copy and paste. For large-scale data import tasks, manual operations are almost impossible, not only inefficient but also prone to errors. Summary of the invention
[0004] In view of this, the present application provides a method, apparatus, device and storage medium for importing data into a database, which is used to solve the problem that the traditional way of importing data into a database usually relies on manual operation, such as entering data by simple copying and pasting. For large-scale data import tasks, manual operation is almost impossible, which is not only inefficient but also prone to errors.
[0005] To achieve the above objectives, the proposed solution is as follows:
[0006] In a first aspect, a method for importing data into a database comprises:
[0007] Obtaining the data to be imported, and determining the data size value of the data to be imported;
[0008] Get the type and IP address of the target database;
[0009] Generate an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value;
[0010] Importing the data to be imported into the initial data template to obtain a target data template;
[0011] Acquire basic template information of the target data template, and modify the link of the target database using the basic template information;
[0012] The target data template is uploaded to the target database according to the modified link to implement database import of the data to be imported.
[0013] Preferably, determining the data size value of the data to be imported includes:
[0014] Determine each piece of sub-data in the data to be imported;
[0015] respectively determining the data length, data precision and data type of each piece of the sub-data;
[0016] Calculate the data value of each sub-data according to the data length, data precision and data type;
[0017] The data values of the sub-data are summed up to obtain the data size value of the data to be imported.
[0018] Preferably, generating an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value includes:
[0019] Set multiple data fields;
[0020] Setting a field type for each of the data fields respectively;
[0021] Establish a blank data template according to the type of the target database, and define the blank data template using each of the data fields and each of the field types to obtain a first data template;
[0022] The first data template is set using the IP address and the data size value to obtain an initial data template.
[0023] Preferably, the step of setting the first data template by using the IP address and the data size value to obtain an initial data template includes:
[0024] Marking the first data template using the IP address to obtain a second data template;
[0025] A template format is determined based on the data size value, and the second data template is set using the template format to obtain an initial data template.
[0026] Preferably, determining the template format based on the data size value includes:
[0027] Determine whether the data size value is greater than a preset first threshold;
[0028] If the data size value is not less than the first threshold, selecting a comma separated value file format as a template format;
[0029] If the data size value is smaller than the first threshold, the table format is selected as the template format.
[0030] Preferably, the step of importing the data to be imported into the initial data template to obtain a target data template further includes:
[0031] Obtain user requirements, and set field constraints according to the user requirements;
[0032] Using the constraint condition to constrain the initial data template;
[0033] Under the constraints of the field constraints, the data to be imported is imported into the initial data template to obtain a target data template.
[0034] Preferably, the step of importing the data to be imported into the initial data template under the constraints of the field constraints to obtain the target data template includes:
[0035] Determine each piece of sub-data in the data to be imported;
[0036] Determine whether each piece of the sub-data satisfies the field constraint condition;
[0037] Import each piece of sub-data satisfying the field constraint into the initial data template to obtain a target data template.
[0038] In a second aspect, a data import device for a database includes:
[0039] A data size value determination module, used to obtain the data to be imported and determine the data size value of the data to be imported;
[0040] Type and IP address acquisition module, used to obtain the type and IP address of the target database;
[0041] An initial data template generating module, used to generate an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value;
[0042] A target data template determination module, used for importing the data to be imported into the initial data template to obtain a target data template;
[0043] A link modification module, used to obtain basic template information of the target data template and modify the link of the target database using the basic template information;
[0044] The uploading module is used to upload the target data template to the target database according to the modified link to realize the database import of the data to be imported.
[0045] In a third aspect, a data import device for a database includes a memory and a processor;
[0046] The memory is used to store programs;
[0047] The processor is used to execute the program to implement each step of the method for importing data into a database as described in any one of the first aspects.
[0048] In a fourth aspect, a storage medium stores a computer program thereon, wherein when the computer program is executed by a processor, the steps of the method for importing data into a database as described in any one of the first aspects are implemented.
[0049] It can be seen from the above technical scheme that the present application obtains the data to be imported and determines the data size value of the data to be imported; obtains the type and IP address of the target database; generates an initial data template corresponding to the target database based on the type, IP address and data size value of the target database; imports the data to be imported into the initial data template to obtain a target data template; obtains basic template information of the target data template, and uses the basic template information to modify the link of the target database; uploads the target data template to the target database according to the modified link to realize the database import of the data to be imported. After obtaining the data to be imported, the solution first imports it into the constructed data template. The data template can receive and save a large amount of data. It can be used as a carrier of data to help import the data into the database more completely and conveniently. It is necessary to obtain the data size value of the data to be imported, and obtain the type and IP address of the target database. An initial data template is generated based on this information. The initial data template generated in this way corresponds to the target database, which can improve the success rate and matching degree of data import. The data size value is also used when generating the data template. The data template can be edited according to the data size value to make it more suitable for the data to be imported and improve the import efficiency. The data to be imported is then imported into the initial data template to obtain the target data template. In order to make the target data template have a higher matching degree with the target database, the link of the target database is modified using the basic template information of the target data template. Finally, the target data template is uploaded to the target database, and the data in the target data template can be completely, efficiently and quickly imported into the target database. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0051] Figure 1 An optional flow chart of a method for importing data into a database provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of the structure of a data import device for a database provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of the structure of a data import device for a database provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] In today's digital age, data storage and management are crucial to the operation of enterprises and organizations. With the continuous development of information technology, a large amount of data is generated and collected, and how to effectively import this data into the database has become a key issue.
[0056] The traditional way of importing data into a database usually relies on manual operations, such as data entry through simple copy and paste. For large-scale data import tasks, manual operations are almost impossible, not only inefficient but also prone to errors.
[0057] The embodiment of the present invention provides a method for importing data into a database. The method can be applied to various computer terminals or intelligent terminals. The execution subject can be a processor or a server of the computer terminal or the intelligent terminal. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:
[0058] S1: Acquire the data to be imported, and determine the data size value of the data to be imported.
[0059] The data to be imported referred to in this application is the data that needs to be imported into the target database. The data to be imported is not limited in data type, data size or data format. Any data can be used as the data to be imported. The data to be imported can also be a collection or combination of multiple data.
[0060] The target database can be any database. This application does not limit the type of database and can import the data to be imported into any database.
[0061] After obtaining the data to be imported, it is also necessary to determine or calculate the data size value of the data to be imported. The data size value can be calculated from multiple aspects of the data information, not limited to one method. For example, it can be calculated using the memory occupied by the data, the number of characters in the data, the length of the data, etc.
[0062] Since the present application is to utilize data templates to achieve the purpose of importing data, the calculated data size value can be used to edit the data template, such as to determine the size and capacity of the data template, etc., and to determine other related configurations of the data template, etc., thereby ensuring the import data template of the data to be imported and the process of importing the target database.
[0063] S2: Get the type and IP address of the target database.
[0064] In order to make the data template more suitable for the target database, the present application also needs to establish a data template that is more matched and suitable for the target database type based on the type and IP address of the target database when establishing the data template. In addition, since the data template is the carrier of the data to be imported, the IP address of the target database is equally important. The IP address, as an identification mark for computer communication, can enable the data to be imported to be correctly routed and transmitted in the network.
[0065] S3: Generate an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value.
[0066] After obtaining the type and IP address of the target database and the data size value of the data to be imported in the above steps, a data template can be generated to obtain an initial data template.
[0067] S4: Import the data to be imported into the initial data template to obtain a target data template.
[0068] In the process of importing the data to be imported into the initial data template, you can first perform data preprocessing, such as cleaning and converting the imported data to remove errors, duplicates or unnecessary spaces, etc. You can also package the data, etc., and obtain the target data template after importing.
[0069] After all the data to be imported are imported into the initial data template, you can also perform verification and check the data in the template to ensure that all data has been imported correctly and there are no omissions or errors. If there are any problems, re-import them to ensure the integrity of the data to be imported.
[0070] S5: Obtain basic template information of the target data template, and modify the link of the target database using the basic template information.
[0071] In order to achieve a higher degree of matching between the target data template and the target database, the link of the target database is modified using the basic template information of the target data template. The basic template information may include the type of data template, the amount of data in the data template, and the form or method in which the data template specifically uploads the data to be imported. The target database can be edited or modified based on this information, specifically modifying the link of the target database.
[0072] S6: Uploading the target data template to the target database according to the modified link to implement database import of the data to be imported.
[0073] The target data template serves as the carrier of the data to be imported. After the target data template is uploaded to the target database, the data in the target data template can be automatically imported into the target database. Compared with directly importing data into the database, the integrity and correctness of the data can be guaranteed.
[0074] It can be seen from the above technical scheme that the present application obtains the data to be imported and determines the data size value of the data to be imported; obtains the type and IP address of the target database; generates an initial data template corresponding to the target database based on the type, IP address and data size value of the target database; imports the data to be imported into the initial data template to obtain a target data template; obtains basic template information of the target data template, and uses the basic template information to modify the link of the target database; uploads the target data template to the target database according to the modified link to realize the database import of the data to be imported. After obtaining the data to be imported, the solution first imports it into the constructed data template. The data template can receive and save a large amount of data. It can be used as a carrier of data to help import the data into the database more completely and conveniently. It is necessary to obtain the data size value of the data to be imported, and obtain the type and IP address of the target database. An initial data template is generated based on this information. The initial data template generated in this way corresponds to the target database, which can improve the success rate and matching degree of data import. The data size value is also used when generating the data template. The data template can be edited according to the data size value to make it more suitable for the data to be imported and improve the import efficiency. The data to be imported is then imported into the initial data template to obtain the target data template. In order to make the target data template have a higher matching degree with the target database, the link of the target database is modified using the basic template information of the target data template. Finally, the target data template is uploaded to the target database, and the data in the target data template can be completely, efficiently and quickly imported into the target database.
[0075] In the method provided in the embodiment of the present invention, the process of determining the data size value of the data to be imported is specifically described as follows:
[0076] Determine each piece of sub-data in the data to be imported;
[0077] respectively determining the data length, data precision and data type of each piece of the sub-data;
[0078] Calculate the data value of each sub-data according to the data length, data precision and data type;
[0079] The data values of the sub-data are summed up to obtain the data size value of the data to be imported.
[0080] Specifically, it can be considered that the data to be imported contains multiple sub-data. The data size value of the data to be imported needs to be calculated based on the size value of each sub-data. With the diversification of data sources, the format and structure of data are becoming more and more complex. For example, data may come from different systems, databases or file formats, and may contain various types of data, such as text, numbers, dates, images, etc. Therefore, according to the characteristics of the data, it can be considered that the factors affecting its size include data length, data precision and data type.
[0081] Different data types occupy different storage spaces. For example, integer types usually occupy a fixed number of bytes, depending on their value range. The data size of string types depends on their character encoding and the length of the string. For variable-length data types such as strings and arrays, their possible maximum length needs to be considered. For data precision, high-precision floating-point numbers will take up more storage space.
[0082] Since data length, data precision and data type belong to different indicators respectively, in order to combine and calculate these three indicators, their weights are set respectively, so as to calculate the data value of each sub-data, this application believes that data length is the indicator that most affects the data size value, so its corresponding weight is set to 0.4, and the weights of the other two indicators are set to 0.3. Finally, the data values of each sub-data are added together to obtain the data size value of the data to be imported.
[0083] The following embodiment specifically describes the process of generating an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value in the present application.
[0084] Set multiple data fields;
[0085] Setting a field type for each of the data fields respectively;
[0086] Establish a blank data template according to the type of the target database, and define the blank data template using each of the data fields and each of the field types to obtain a first data template;
[0087] The first data template is set using the IP address and the data size value to obtain an initial data template.
[0088] The process of setting the first data template by using the IP address and the data size value to obtain the initial data template includes:
[0089] Marking the first data template using the IP address to obtain a second data template;
[0090] A template format is determined based on the data size value, and the second data template is set using the template format to obtain an initial data template.
[0091] Specifically, data fields need to be configured when establishing the initial data template. They indicate what kind of data the data template can store, and each field has a clear name and meaning to avoid ambiguity and ambiguity, such as "order date", "product quantity", etc. In addition, fields can be classified and grouped to facilitate data organization and management. They can be classified according to business logic and data types, such as grouping information such as order on time and product quantity. You can also select the appropriate field type for each field, such as string, integer, date, Boolean value, etc.
[0092] A blank data template may be first created, and then the blank data template may be defined using the above-set data fields and field types to obtain a first data template; and then the first data template may be set again using the IP address and data size value to obtain an initial data template.
[0093] The IP address can be used as a label to mark the second data template and match it with the target database. Then the template format is determined according to the data size value. The template format is used to set the second data template to obtain the initial data template.
[0094] Furthermore, the specific operation method of determining the template format based on the data size value is:
[0095] Determine whether the data size value is greater than a preset first threshold;
[0096] If the data size value is not less than the first threshold, selecting a comma separated value file format as a template format;
[0097] If the data size value is smaller than the first threshold, the table format is selected as the template format.
[0098] The template formats include Excel format and comma separated value file format (CSV format). If the data size is relatively small and less than the preset first threshold, you can use the Excel template format to ensure the accuracy of data import; if the data size is relatively large and not less than the preset first threshold, you can use the CSV format, which is a text file format used to store table data. CSV files store table data in plain text, and data items are separated by commas, tabs, semicolons and other symbols.
[0099] The following embodiment explains in detail the process of importing the data to be imported into the initial data template to obtain the target data template in the present application.
[0100] Obtain user requirements, and set field constraints according to the user requirements;
[0101] Using the constraint condition to constrain the initial data template;
[0102] Under the constraints of the field constraints, the data to be imported is imported into the initial data template to obtain a target data template.
[0103] Specifically, according to user needs, business needs, data quality requirements, etc., you can also set initial constraints for the data template to constrain it. This will allow the data template to only receive the data to be imported under the constraints, preventing data confusion or unnecessary data import, such as setting fields, field value ranges, etc. Constraints can include uniqueness constraints, foreign key constraints, etc.
[0104] Wherein, under the constraint of the field constraint condition, the process of importing the data to be imported into the initial data template to obtain the target data template includes:
[0105] Determine each piece of sub-data in the data to be imported;
[0106] Determine whether each piece of the sub-data satisfies the field constraint condition;
[0107] Import each piece of sub-data satisfying the field constraint condition into the initial data template to obtain a target data template.
[0108] Furthermore, you can also set up scheduled imports to save repetitive work. For example, for some daily reports, you need to generate a copy of the day's data every day. In this case, you can set a trigger to trigger the data import process when the daily report is generated; or select a time after the daily report is generated to trigger the import at that time.
[0109] and Figure 1Corresponding to the method described above, the embodiment of the present invention also provides a data import device for a database, Figure 1 In the specific implementation of the method, the data import device of the database provided in the embodiment of the present invention can be in a computer terminal or various mobile devices, combined with Figure 2 , introduce the data import device of the database, such as Figure 2 As shown, the device may include:
[0110] A data size value determination module 10 is used to obtain the data to be imported and determine the data size value of the data to be imported;
[0111] A type and IP address acquisition module 20, used to acquire the type and IP address of the target database;
[0112] An initial data template generating module 30, configured to generate an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value;
[0113] A target data template determination module 40 is used to import the data to be imported into the initial data template to obtain a target data template;
[0114] A link modification module 50 is used to obtain basic template information of the target data template and modify the link of the target database using the basic template information;
[0115] The uploading module 60 is used to upload the target data template to the target database according to the modified link to realize the database import of the data to be imported.
[0116] It can be seen from the above technical scheme that the present application obtains the data to be imported and determines the data size value of the data to be imported; obtains the type and IP address of the target database; generates an initial data template corresponding to the target database based on the type, IP address and data size value of the target database; imports the data to be imported into the initial data template to obtain a target data template; obtains basic template information of the target data template, and uses the basic template information to modify the link of the target database; uploads the target data template to the target database according to the modified link to realize the database import of the data to be imported. After obtaining the data to be imported, the solution first imports it into the constructed data template. The data template can receive and save a large amount of data. It can be used as a carrier of data to help import the data into the database more completely and conveniently. It is necessary to obtain the data size value of the data to be imported, and obtain the type and IP address of the target database. An initial data template is generated based on this information. The initial data template generated in this way corresponds to the target database, which can improve the success rate and matching degree of data import. The data size value is also used when generating the data template. The data template can be edited according to the data size value to make it more suitable for the data to be imported and improve the import efficiency. The data to be imported is then imported into the initial data template to obtain the target data template. In order to make the target data template have a higher matching degree with the target database, the link of the target database is modified using the basic template information of the target data template. Finally, the target data template is uploaded to the target database, and the data in the target data template can be completely, efficiently and quickly imported into the target database.
[0117] Furthermore, the embodiment of the present application provides a data import device for a database. Optionally, Figure 3 The hardware structure diagram of the data import device of the database is shown. Figure 3 The hardware structure of the database data import device may include: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.
[0118] In the embodiment of the present application, the number of the processor 01 , the communication interface 02 , the memory 03 , and the communication bus 04 is at least one, and the processor 01 , the communication interface 02 , and the memory 03 communicate with each other through the communication bus 04 .
[0119] The processor 01 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0120] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory.
[0121] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following method for importing data into the database, including:
[0122] Obtaining the data to be imported, and determining the data size value of the data to be imported;
[0123] Get the type and IP address of the target database;
[0124] Generate an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value;
[0125] Importing the data to be imported into the initial data template to obtain a target data template;
[0126] Acquire basic template information of the target data template, and modify the link of the target database using the basic template information;
[0127] The target data template is uploaded to the target database according to the modified link to implement database import of the data to be imported.
[0128] Optionally, the detailed functions and extended functions of the program may refer to the description of the method for importing data into the database in the method embodiment.
[0129] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, and when the program is executed, controls the device where the storage medium is located to execute the following database data import method, including:
[0130] Obtaining the data to be imported, and determining the data size value of the data to be imported;
[0131] Get the type and IP address of the target database;
[0132] Generate an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value;
[0133] Importing the data to be imported into the initial data template to obtain a target data template;
[0134] Acquire basic template information of the target data template, and modify the link of the target database using the basic template information;
[0135] The target data template is uploaded to the target database according to the modified link to implement database import of the data to be imported.
[0136] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.
[0137] Optionally, the detailed functions and extended functions of the program may refer to the description of the method for importing data into the database in the method embodiment.
[0138] In addition, the functional modules in the various embodiments of the present disclosure can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure.
[0139] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0140] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0141] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for importing data into a database, characterized in that: include: Obtaining the data to be imported, and determining the data size value of the data to be imported; Get the type and IP address of the target database; Generate an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value; Importing the data to be imported into the initial data template to obtain a target data template; Acquire basic template information of the target data template, and modify the link of the target database using the basic template information; The target data template is uploaded to the target database according to the modified link to implement database import of the data to be imported.
2. The method according to claim 1, characterized in that The step of determining the data size of the data to be imported includes: Determine each piece of sub-data in the data to be imported; respectively determining the data length, data precision and data type of each piece of the sub-data; Calculate the data value of each sub-data according to the data length, data precision and data type; The data values of the sub-data are summed up to obtain the data size value of the data to be imported.
3. The method according to claim 1, characterized in that The generating an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value comprises: Set multiple data fields; Setting a field type for each of the data fields respectively; Establish a blank data template according to the type of the target database, and define the blank data template using each of the data fields and each of the field types to obtain a first data template; The first data template is set using the IP address and the data size value to obtain an initial data template.
4. The method according to claim 3, characterized in that: The step of setting the first data template by using the IP address and the data size value to obtain an initial data template includes: Marking the first data template using the IP address to obtain a second data template; A template format is determined based on the data size value, and the second data template is set using the template format to obtain an initial data template.
5. The method according to claim 4, characterized in that Determining a template format based on the data size value includes: Determine whether the data size value is greater than a preset first threshold; If the data size value is not less than the first threshold, selecting a comma separated value file format as a template format; If the data size value is smaller than the first threshold, the table format is selected as the template format.
6. The method according to claim 1, characterized in that The step of importing the data to be imported into the initial data template to obtain a target data template further includes: Obtain user requirements, and set field constraints according to the user requirements; Using the constraint condition to constrain the initial data template; Under the constraints of the field constraints, the data to be imported is imported into the initial data template to obtain a target data template.
7. The method according to claim 6, characterized in that The step of importing the data to be imported into the initial data template under the constraint of the field constraint to obtain a target data template includes: Determine each piece of sub-data in the data to be imported; Determine whether each piece of the sub-data satisfies the field constraint condition; Import each piece of sub-data satisfying the field constraint into the initial data template to obtain a target data template.
8. A data import device for a database, characterized in that: include: A data size value determination module, used to obtain the data to be imported and determine the data size value of the data to be imported; Type and IP address acquisition module, used to obtain the type and IP address of the target database; An initial data template generating module, used to generate an initial data template corresponding to the target database based on the type of the target database, the IP address and the data size value; A target data template determination module, used for importing the data to be imported into the initial data template to obtain a target data template; A link modification module, used to obtain basic template information of the target data template and modify the link of the target database using the basic template information; The uploading module is used to upload the target data template to the target database according to the modified link to realize the database import of the data to be imported.
9. A data import device for a database, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the method for importing data into a database as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for importing data into a database as described in any one of claims 1 to 7 is implemented.