Disclosure of Invention
The invention mainly aims to provide a data file importing method, equipment, a storage medium and a device, and aims to solve the technical problem of how to optimize the data file importing process.
In order to achieve the above object, the present invention provides a data file importing method, including the steps of:
when a data file import request is received, carrying out file extraction on the data file import request to obtain a data file to be imported;
extracting a target data table from the data file to be imported, and displaying the target data table;
receiving an operation instruction input by a user based on the target data table, and determining a target column identifier of each column in the target data table according to the operation instruction;
and determining data to be imported in the target data table according to the target column identification, and importing the data to be imported into a target server according to the target column identification.
Optionally, the step of extracting a target data table from the data file to be imported and displaying the target data table specifically includes:
acquiring a file format of the data file to be imported, and determining a data extraction script according to the file format;
data extraction is carried out on the data file to be imported through the data extraction script, and a target data table is obtained;
acquiring import data information of a target server, and determining a target display template according to the import data information and the target data table;
and displaying the target data table based on the target display template.
Optionally, the step of obtaining import data information of the target server and determining the target display template according to the import data information and the target data table specifically includes:
acquiring import data information of a target server, and determining the type of the import data according to the import data information;
generating a target page interaction component according to the imported data type, and determining the placement position information of the target page interaction component according to the target data table;
and searching an initial display template corresponding to the target data table, and adjusting the initial display template according to the placement position information to obtain a target display template.
Optionally, the step of generating a target page interaction component according to the type of the imported data and determining the placement position information of the target page interaction component according to the target data table specifically includes:
generating column identification selection buttons according to the types of the imported data, and sequencing the column identification selection buttons according to a preset sequencing mode to obtain a target page interaction component;
acquiring column coordinate information of the target data table, wherein the column coordinate information is coordinate information of each column in the target data table;
and determining the placement position information of the target page interaction component according to the column coordinate information.
Optionally, the step of receiving an operation instruction input by a user based on the target data table and determining a target column identifier of each column in the target data table according to the operation instruction specifically includes:
receiving an operation instruction input by a user based on the target data table, analyzing the operation instruction and acquiring current click position information;
and determining a current click button according to the current click position information, and determining target column identifications of all columns in the target data table according to the current click button.
Optionally, the step of determining a current click button according to the current click position information, and determining a target column identifier of each column in the target data table according to the current click button specifically includes:
determining a current click interaction component according to the current click position information and the placement position information of the target page interaction component;
determining a current click button based on the current click position information and the current click interaction component;
and determining the target column identification of each column in the target data table according to the current click button.
Optionally, the step of determining data to be imported in the target data table according to the target column identifier and importing the data to be imported into the target server according to the target column identifier specifically includes:
acquiring a column identification sample, wherein the column identification sample is a column identification of a data import template of a target server;
determining data to be imported in the target data table according to the target column identification and the column identification sample;
and determining a target data import sequence according to the target column identification, and importing the data to be imported into the target server according to the target data import sequence.
Optionally, the step of determining the data to be imported in the target data table according to the target column identifier and the column identifier sample specifically includes:
traversing the target column identification, and taking the traversed target column identification as the current column identification;
matching the current column identifier with the column identifier sample to obtain a matching result;
and after the target column identification is traversed, determining the data to be imported in the target data table according to the matching result.
Optionally, the step of determining the data to be imported in the target data table according to the matching result after the target column identifier is traversed, specifically includes:
after the target column identifier is traversed, taking the current column identifier with the matching result being successfully matched as the column identifier to be imported;
and searching data corresponding to the column identifier to be imported, and taking the data corresponding to the column identifier to be imported as the data to be imported in the target data table.
Optionally, before the step of determining a target data import order according to the target column identifier and importing the data to be imported into the target server according to the target data import order, the data file import method further includes:
acquiring the current byte number of the data to be imported, and judging whether the current byte number is smaller than a preset threshold value;
when the current byte number is smaller than the preset threshold value, format conversion is carried out on the data to be imported through a preset format conversion script, and target data are obtained;
correspondingly, the step of determining a target data import sequence according to the target column identifier and importing the data to be imported into the target server according to the target data import sequence specifically includes:
and determining a target data import sequence according to the target column identification, and importing the target data into the target server according to the target data import sequence.
Optionally, after the step of obtaining the current byte number of the data to be imported and determining whether the current byte number is smaller than a preset threshold, the data file importing method further includes:
when the number of bytes at present is greater than or equal to the preset threshold value, taking the column identifier to be imported and the data file to be imported as upload data;
correspondingly, the step of determining a target data import sequence according to the target column identifier and importing the data to be imported into the target server according to the target data import sequence specifically includes:
and determining a target data import sequence according to the target column identification, and importing the uploaded data into the target server according to the target data import sequence.
Optionally, when a data file import request is received, the step of performing file extraction on the data file import request to obtain a data file to be imported specifically includes:
when a data file import request is received, extracting an identifier of the data file import request to obtain an information identifier;
and screening the information of the data file import request according to the information identifier to obtain the data file to be imported.
In addition, to achieve the above object, the present invention further proposes a data file importing apparatus, which includes a memory, a processor, and a data file importing program stored on the memory and operable on the processor, the data file importing program being configured to implement the steps of the data file importing method as described above.
In addition, to achieve the above object, the present invention further provides a storage medium having a data file importing program stored thereon, wherein the data file importing program, when executed by a processor, implements the steps of the data file importing method as described above.
In addition, to achieve the above object, the present invention further provides a data file importing apparatus, including: the device comprises an extraction module, a display module, a determination module and an import module;
the extraction module is used for extracting the data file import request when receiving the data file import request to obtain a data file to be imported;
the display module is used for extracting a target data table from the data file to be imported and displaying the target data table;
the determining module is used for receiving an operation instruction input by a user based on the target data table and determining a target column identifier of each column in the target data table according to the operation instruction;
and the importing module is used for determining data to be imported in the target data table according to the target column identifier and importing the data to be imported into a target server according to the target column identifier.
Optionally, the display module is further configured to obtain a file format of the data file to be imported, and determine a data extraction script according to the file format;
the display module is further used for extracting data of the data file to be imported through the data extraction script to obtain a target data table;
the display module is further used for acquiring import data information of a target server and determining a target display template according to the import data information and the target data table;
the display module is further configured to display the target data table based on the target display template.
Optionally, the display module is further configured to obtain import data information of the target server, and determine an import data type according to the import data information;
the display module is further used for generating a target page interaction component according to the imported data type and determining the placement position information of the target page interaction component according to the target data table;
the display module is further configured to search for an initial display template corresponding to the target data table, and adjust the initial display template according to the placement position information to obtain a target display template.
Optionally, the display module is further configured to generate a column identifier selection button according to the type of the imported data, and sort the column identifier selection button according to a preset sorting manner to obtain a target page interaction component;
the display module is further configured to obtain column coordinate information of the target data table, where the column coordinate information is coordinate information of each column in the target data table;
and the display module is also used for determining the placement position information of the target page interaction component according to the column coordinate information.
Optionally, the determining module is further configured to receive an operation instruction input by a user based on the target data table, and analyze the operation instruction to obtain information of a current click position;
the determining module is further configured to determine a current click button according to the current click position information, and determine a target column identifier of each column in the target data table according to the current click button.
Optionally, the determining module is further configured to determine a current click interaction component according to the current click position information and the placement position information of the target page interaction component;
the determining module is further configured to determine a current click button based on the current click position information and the current click interaction component;
the determining module is further configured to determine a target column identifier of each column in the target data table according to the current click button.
In the invention, when a data file import request is received, file extraction is carried out on the data file import request to obtain a data file to be imported, a target data table is extracted from the data file to be imported, the target data table is displayed, an operation instruction input by a user based on the target data table is received, a target column identifier of each column in the target data table is determined according to the operation instruction, data to be imported in the target data table is determined according to the target column identifier, and the data to be imported is imported into a target server according to the target column identifier; compared with the existing mode that a user manually fills in imported data, the method and the device have the advantages that the data file to be imported is obtained by extracting the data file import request sent by the user, the target data form is determined according to the data file to be imported and displayed to obtain the operation instruction input by the user based on the target data form, the data to be imported in the target data form is determined according to the operation instruction, and the data to be imported is imported into the target server.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a data file importing device of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the data file import apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), and the optional user interface 1003 may further include a standard wired interface and a wireless interface, and the wired interface for the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory or a Non-volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the data file importing apparatus, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in FIG. 1, memory 1005, identified as one type of computer storage medium, may include an operating system, a network communication module, a user interface module, and a data file import program.
In the data file importing apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting user equipment; the data file importing apparatus calls a data file importing program stored in the memory 1005 through the processor 1001, and executes the data file importing method provided by the embodiment of the present invention.
Based on the above hardware structure, an embodiment of the data file importing method of the present invention is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data file importing method according to a first embodiment of the present invention, and the data file importing method according to the first embodiment of the present invention is provided.
In a first embodiment, the data file import method includes the following steps:
step S10: when a data file import request is received, file extraction is carried out on the data file import request, and a data file to be imported is obtained.
It should be understood that the execution subject of this embodiment is the data file importing device, where the data file importing device may be an electronic device such as a computer or a mobile phone, or may also be another device that can achieve the same or similar functions.
It should be noted that the data file import request may be a file import instruction input by a user through an information input interface of the data file import apparatus; the data file to be imported may be a data file input by a user through an information input interface of the data file import apparatus.
It should be understood that, the file extraction is performed on the data file import request, and obtaining the data file to be imported may be directly performing file extraction on the data file import request through a preset information extraction script to obtain the data file to be imported, where the preset information extraction script may be a file extraction script preset by a user.
Further, in order to improve the accuracy of identifying the data file to be imported, when the data file import request is received, the file extraction is performed on the data file import request to obtain the data file to be imported, and the method includes:
and acquiring the file format of the data file to be imported, determining a data extraction script according to the file format, and extracting data of the data file to be imported through the data extraction script to obtain a target data table.
Step S20: and extracting a target data table from the data file to be imported, and displaying the target data table.
It should be noted that the target data table may be a display table that displays data in the data file to be imported, and this embodiment is not limited to this.
It can be understood that the step of extracting the target data form from the data file to be imported and displaying the target data form may be directly extracting the data file through a preset form extraction script, obtaining the target data form, and displaying the target data form.
Further, in order to quickly extract a data table in a data file and display the data table and demand data of a target server through a target display template, the extracting a target data table from the data file to be imported and displaying the target data table includes:
the method comprises the steps of obtaining a file format of the data file to be imported, determining a data extraction script according to the file format, carrying out data extraction on the data file to be imported through the data extraction script, obtaining a target data form, obtaining import data information of a target server, determining a target display template according to the import data information and the target data form, and displaying the target data form based on the target display template.
Step S30: and receiving an operation instruction input by a user based on the target data table, and determining the target column identification of each column in the target data table according to the operation instruction.
It should be noted that the operation instruction may be an operation instruction input by the user through a user interaction interface of the data file importing apparatus after the user views the target data table, for example, clicking a user operation interface, and the like, which is not limited in this embodiment.
It should be understood that, receiving an operation instruction input by a user based on the target data table, and determining the target column identifier of each column in the target data table according to the operation instruction may be directly parsing the operation instruction, obtaining user behavior information, and determining the target column identifier of each column in the target data table according to the user behavior information.
Further, in practical applications, if the target column identifier of each column in the target data table is determined directly according to the operation instruction, it is inevitable that the number of objects involved in the determination process is too large, and the calculation amount is too large. In order to overcome the defect, the method for receiving an operation instruction input by a user based on the target data table and determining a target column identifier of each column in the target data table according to the operation instruction comprises the following steps:
and receiving an operation instruction input by a user based on the target data table, analyzing the operation instruction to obtain current click position information, determining a current click button according to the current click position information, and determining target column identification of each column in the target data table according to the current click button.
Step S40: and determining data to be imported in the target data table according to the target column identification, and importing the data to be imported into a target server according to the target column identification.
It can be understood that, determining data to be imported in the target data table according to the target column identifier, and importing the data to be imported into the target server according to the target column identifier may be to determine whether the target column identifier is a preset identifier, when the target column identifier is the preset identifier, taking column data corresponding to the target column identifier as the data to be imported, determining an import order of the target data according to the target column identifier, and importing the data to be imported into the target server according to the import order of the target data.
Further, in consideration of practical application, if the data to be imported is determined according to whether the target column identifier is matched with the preset identifier, it is inevitable that the matching basis involved in the determination process is fixed, and the method cannot adapt to various situations. To overcome this drawback, the determining, according to the target column identifier, data to be imported in the target data table, and importing the data to be imported into a target server according to the target column identifier includes:
acquiring a column identification sample, wherein the column identification sample is a column identification of a data import template of a target server, determining data to be imported in the target data table according to the target column identification and the column identification sample, determining a target data import sequence according to the target column identification, and importing the data to be imported into the target server according to the target data import sequence.
In a first embodiment, when a data file import request is received, file extraction is performed on the data file import request to obtain a data file to be imported, a target data table is extracted from the data file to be imported, the target data table is displayed, an operation instruction input by a user based on the target data table is received, a target column identifier of each column in the target data table is determined according to the operation instruction, data to be imported in the target data table is determined according to the target column identifier, and the data to be imported is imported into a target server according to the target column identifier; compared with the existing method for manually filling in the import data by the user, in the embodiment, the data file to be imported is obtained by extracting the data file import request sent by the user, the target data form is determined according to the data file to be imported, the target data form is displayed to obtain the operation instruction input by the user based on the target data form, the data to be imported in the target data form is determined according to the operation instruction, and the data to be imported is imported into the target server.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of the data file importing method according to the present invention, and the second embodiment of the data file importing method according to the present invention is proposed based on the first embodiment illustrated in fig. 2.
In the second embodiment, the step S10 includes:
step S101: when a data file import request is received, extracting the identifier of the data file import request to obtain an information identifier.
It should be noted that the data file import request may be a file import instruction input by a user through an information input interface of the data file import apparatus; the information identifier may be identification information for identifying the information type, which is not limited in this embodiment.
Step S102: and screening the information of the data file import request according to the information identifier to obtain the data file to be imported.
It should be understood that, the information screening of the data file import request according to the information identifier to obtain the data file to be imported may be to match the information identifier with a preset data file identifier, and when the matching is successful, the data file corresponding to the information identifier that is successfully matched is used as the data file to be imported, where the preset data file identifier may be identification information used to identify the data file.
In the second embodiment, when a data file import request is received, the data file import request is subjected to identifier extraction to obtain an information identifier, and the data file import request is subjected to information screening according to the information identifier to obtain a data file to be imported, so that the data file to be imported can be determined quickly and accurately.
In the second embodiment, the step S20 includes:
step S201: and acquiring the file format of the data file to be imported, and determining a data extraction script according to the file format.
It should be understood that obtaining the file format of the data file to be imported may be obtaining a file extension of the data file to be imported, and determining the file format of the data file to be imported according to the file extension.
It is understood that determining the data extraction script according to the file format may be to search a preset script library for a data extraction script corresponding to the file format, where the preset script library includes a corresponding relationship between the file format and the data extraction script, where the corresponding relationship between the file format and the data extraction script may be preset according to a test result, for example, when the file formats are xls, xlsx, and ods, a js-xlsx script is used as the data extraction script.
Step S202: and performing data extraction on the data file to be imported through the data extraction script to obtain a target data table.
It should be noted that the target data table may be a display table that displays data in the data file to be imported, and this embodiment is not limited to this.
It should be understood that, by performing data extraction on the data file to be imported through the data extraction script, obtaining the target data table may be by directly running the data extraction script to perform data extraction on the data file to be imported, so as to obtain the target data table.
Step S203: and acquiring import data information of the target server, and determining a target display template according to the import data information and the target data table.
The imported data information may be data information that the target server needs to import, for example, the data information that the communication server needs to import may be a user number; the target display template is a template for displaying the target data form and the target page interaction component.
It can be understood that, the step of obtaining the import data information of the target server and determining the target display template according to the import data information and the target data table may be directly aggregating the import data information above the target data table, so as to generate the target display template.
It should be understood that, in order to improve the accuracy of the target display template, the obtaining the import data information of the target server and determining the target display template according to the import data information and the target data table includes:
the method comprises the steps of obtaining import data information of a target server, determining an import data type according to the import data information, generating a target page interaction assembly according to the import data type, determining placement position information of the target page interaction assembly according to a target data form, searching an initial display template corresponding to the target data form, adjusting the initial display template according to the placement position information, and obtaining a target display template.
Step S204: and displaying the target data table based on the target display template.
It should be understood that the presenting the target data form based on the target presentation template may be presenting the target data form in a target presentation template presentation form in a user interaction interface of the data file importing device.
In a second embodiment, a file format of the data file to be imported is obtained, a data extraction script is determined according to the file format, the data extraction script is used for carrying out data extraction on the data file to be imported to obtain a target data form, import data information of a target server is obtained, a target display template is determined according to the import data information and the target data form, and the target data form is displayed based on the target display template; in the embodiment, a data extraction script is determined according to the file format of the data file to be imported, data extraction is performed through the data extraction script, a target data form is obtained, a target display template is determined based on the imported data information of the target server and the target data form, and the target data form is displayed based on the target display template, so that the data form in the data file can be extracted quickly, and the data form and the required data of the target server are displayed through the target display template.
In the second embodiment, the step S40 includes:
step S401: and acquiring a column identification sample, wherein the column identification sample is the column identification of the data import template of the target server.
It should be noted that the data import template may be a data template used for importing data that needs to be imported by the target server; the column identification of the data import template may be information identifying the kind of data that the target server needs to import.
It should be understood that obtaining column identification samples may be obtaining column identification samples in a preset column identification sample library, where the preset column identification sample library may be a database used to store column identification samples.
Step S402: and determining the data to be imported in the target data table according to the target column identification and the column identification sample.
Further, the step S402 includes:
traversing the target column identification, and taking the traversed target column identification as the current column identification;
matching the current column identifier with the column identifier sample to obtain a matching result;
and after the target column identification is traversed, determining the data to be imported in the target data table according to the matching result.
It should be understood that, matching the current column identifier with the column identifier sample to obtain a matching result may be to perform text matching on the current column identifier and the column identifier sample, and if the text similarity is greater than a preset threshold, the matching success is taken as a matching result, where the preset threshold may be set according to the actual needs of the user, for example, when the current column identifier is not recognized, and the column identifier sample is a current number and an opposite number, the matching result is a matching failure; when the current column identifier is the current number, and the column identifier sample is the current number and the opposite number, the matching result is a successful matching, which is not limited in this embodiment.
It can be understood that, the determining of the data to be imported in the target data table according to the matching result may be to use column data corresponding to the target column identifier that is successfully matched as the data to be imported.
Further, in order to improve the accuracy of identifying the data to be imported, after the target column identifier is traversed, determining the data to be imported in the target data table according to the matching result, including:
after the target column identifier is traversed, taking the current column identifier with the matching result being successfully matched as the column identifier to be imported;
and searching data corresponding to the column identifier to be imported, and taking the data corresponding to the column identifier to be imported as the data to be imported in the target data table.
Step S403: and determining a target data import sequence according to the target column identification, and importing the data to be imported into the target server according to the target data import sequence.
It should be understood that, the determining of the target data import order according to the target column identifier may be determining the target data import order according to the target column identifier and a preset import rule, where the preset import rule may be a data import rule preset by a user, and this embodiment is not limited thereto.
Further, in order to reduce the file transfer cost, before step S403, the method further includes:
acquiring the current byte number of the data to be imported, and judging whether the current byte number is smaller than a preset threshold value;
when the current byte number is smaller than the preset threshold value, format conversion is carried out on the data to be imported through a preset format conversion script, and target data are obtained;
accordingly, the step S403 includes:
and determining a target data import sequence according to the target column identification, and importing the target data into the target server according to the target data import sequence.
It should be noted that the preset format conversion script may be a JSON format conversion script.
It should be understood that when the data volume of the data to be imported is small, the data to be imported can be directly converted into the JSON format, and then the background interface is called to import the data to be imported, which is converted into the JSON format, into the target server, so as to reduce the file transfer cost.
Further, in order to improve the reliability of large file transmission, after the steps of obtaining the current byte number of the data to be imported and judging whether the current byte number is smaller than a preset threshold, the method further includes:
when the number of bytes at present is greater than or equal to the preset threshold value, taking the column identifier to be imported and the data file to be imported as upload data;
accordingly, the step S403 includes:
and determining a target data import sequence according to the target column identification, and importing the uploaded data into the target server according to the target data import sequence.
It can be understood that, when the data size of the data to be imported is large, if the format of the data to be imported is converted and then the data is transmitted, the overhead of the background is easily too large. Therefore, the column identifier to be imported and the data file to be imported can be uploaded to the target server, and the target server imports the corresponding column data according to the column identifier to be imported.
In a second embodiment, a column identifier sample is obtained, where the column identifier sample is a column identifier of a data import template of a target server, data to be imported in the target data table is determined according to the target column identifier and the column identifier sample, a target data import sequence is determined according to the target column identifier, and the data to be imported is imported into the target server according to the target data import sequence, so that the cost of importing data by a user can be reduced, and user experience is improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a data file importing method according to a third embodiment of the present invention, and the third embodiment of the data file importing method according to the present invention is proposed based on the second embodiment shown in fig. 3.
In a third embodiment, the step S203 includes:
step S2031: and acquiring the imported data information of the target server, and determining the type of the imported data according to the imported data information.
The imported data information may be data information that the target server needs to import, for example, the data information that the communication server needs to import may be a user number; the import data type may be an identifier used to classify data information that needs to be imported by the target server, for example, the import data type of the target server may be a home number, a destination number, and the like, which is not limited in this embodiment.
Step S2032: and generating a target page interaction component according to the imported data type, and determining the placement position information of the target page interaction component according to the target data table.
It should be noted that the target page interaction component may be an interface component capable of interacting with a user, for example, a pull-down menu, and the user may display a column identifier selection button by clicking an expansion button in the pull-down menu, and select a column identifier of each column of data based on the column identifier selection button, which is not limited in this embodiment.
It should be appreciated that determining the placement location information of the target page interaction component from the target data table may be directly placing the target page interaction component in an upper region of the target data table, wherein the upper region may be a region having a preset distance from a starting row of the target data table.
Further, in consideration of practical application, if the target page interaction component is directly placed in the upper area of the target data table, the target page interaction component and the target data table are not aligned, and the appearance is affected. To overcome this drawback, step S2032 includes:
generating column identification selection buttons according to the types of the imported data, and sequencing the column identification selection buttons according to a preset sequencing mode to obtain a target page interaction component;
acquiring column coordinate information of the target data table, wherein the column coordinate information is coordinate information of each column in the target data table;
and determining the placement position information of the target page interaction component according to the column coordinate information.
It should be noted that, the column identifier selection button may be a selection button used to show the data type that the target server needs to import, for example, when the data type that the target server needs to import is the home number and the opposite party number, the column identifier selection button may include the home number, the opposite party number, and three unidentified options, which is not limited in this embodiment; the preset sorting mode may be a sorting rule preset by the user for sorting the column identifier selection buttons.
In a specific implementation, for example, as shown in the schematic diagram of the column identifier selection button in fig. 5, when the imported data type is the home number and the opposite party number, the column identifier selection button a (solid line block diagram area in the figure) is displayed according to the home number, the opposite party number, and the unrecognized arrangement order, and the target page interaction component a is generated.
It is understood that the determining of the placement position information of the target page interacting component according to the column coordinate information may be determining the ordinate of the target page interacting component according to the column coordinate information, obtaining the start row coordinate of the target data table, determining the abscissa of the target page interacting component according to the start row coordinate and the preset row interval, and determining the placement position information of the target page interacting component according to the ordinate and the abscissa of the target page interacting component, for example, the placement position information of the target page interacting component A, B, C, D, E, F and G may be as shown in the column identification selection button diagram of fig. 5.
Step S2033: and searching an initial display template corresponding to the target data table, and adjusting the initial display template according to the placement position information to obtain a target display template.
It should be noted that the initial display template is a template for displaying the target data table; the target display template is a template for displaying the target data form and the target page interaction component.
It should be understood that the initial display template corresponding to the target data table may be a display template corresponding to the target data table searched in a preset display template library, where the preset display template library includes a corresponding relationship between the data table and the display template, where the corresponding relationship between the data table and the display template may be preset according to an actual requirement of a user, and this embodiment is not limited thereto.
It can be understood that the initial display template is adjusted according to the placement position information, and the target display template is obtained by determining the placement area of the target page interaction component according to the placement position information, and splicing the placement area of the target page interaction component with the initial display template.
In a specific implementation, for example, as shown in the target presentation template diagram of fig. 6, A, B, C, D, E, F and G in the diagram are target page interaction components, clicking an inverted triangle button in the target page interaction component may present column identification selection buttons of the target page interaction component, for example, in fig. 6, the column identification selection buttons include a party number, an opposite party number, and an unrecognized party, and a dashed square area in fig. 6 is a target data table presentation area, where the target page interaction component is aligned with each column position in the target data table one by one.
In a third embodiment, by obtaining import data information of a target server, determining an import data type according to the import data information, generating a target page interaction component according to the import data type, determining placement position information of the target page interaction component according to the target data form, searching for an initial display template corresponding to the target data form, and adjusting the initial display template according to the placement position information to obtain a target display template, the target display template can be automatically generated to display the target data form and the target page interaction component, so that interactivity is improved.
In the third embodiment, the step S30 includes:
step S301: and receiving an operation instruction input by a user based on the target data table, analyzing the operation instruction and acquiring the current click position information.
It should be noted that the operation instruction may be an operation instruction input by the user through a user interaction interface of the data file importing apparatus after the user views the target data table, for example, clicking a user operation interface, and the like, which is not limited in this embodiment.
Step S302: and determining a current click button according to the current click position information, and determining target column identifications of all columns in the target data table according to the current click button.
It should be noted that, the currently clicked button may be a column identifier selection button clicked by the user in the currently clicked interactive component; the target column identification may be data category information corresponding to a column identification selection button clicked by the user in the current click interaction component.
Further, in order to improve the accuracy of identifying the target column identifier, the step S302 includes:
determining a current click interaction component according to the current click position information and the placement position information of the target page interaction component;
determining a current click button based on the current click position information and the current click interaction component;
and determining the target column identification of each column in the target data table according to the current click button.
It should be noted that the current click interaction component may be an interaction component currently operated by the user, and may be at least one of the target page interaction components, which is not limited in this embodiment.
It should be understood that, the determining of the current click interaction component according to the current click position information and the placement position information of the target page interaction component may be matching the current click position information with the placement position information of the target page interaction component, and taking the target page interaction component successfully matched as the current click interaction component.
It can be understood that, the determination of the current click button based on the current click position information and the current click interaction component may be to acquire column identifier selection button position information of the current click interaction component, match the current click position information with the column identifier selection button position information, and use the column identifier selection button corresponding to the column identifier selection button position information that is successfully matched as the current click button.
It should be understood that, determining the target column identifier of each column in the target data table according to the current click button may be extracting information of the current click button to obtain the target column identifier of each column in the target data table.
In a third embodiment, by receiving an operation instruction input by a user based on the target data table and analyzing the operation instruction, current click position information is obtained, a current click button is determined according to the current click position information, and a target column identifier of each column in the target data table is determined according to the current click button, so that a target column identifier meeting user requirements can be set for each column in the target data table, and the import efficiency is improved.
Furthermore, an embodiment of the present invention further provides a storage medium, where a data file importing program is stored, and the data file importing program, when executed by a processor, implements the steps of the data file importing method as described above.
In addition, referring to fig. 7, an embodiment of the present invention further provides a data file importing apparatus, where the data file importing apparatus includes: the system comprises an extraction module 10, a display module 20, a determination module 30 and an import module 40;
the extracting module 10 is configured to, when receiving a data file import request, perform file extraction on the data file import request to obtain a data file to be imported.
The display module 20 is configured to extract a target data table from the data file to be imported, and display the target data table.
The determining module 30 is configured to receive an operation instruction input by a user based on the target data table, and determine a target column identifier of each column in the target data table according to the operation instruction.
The importing module 40 is configured to determine data to be imported in the target data table according to the target column identifier, and import the data to be imported into the target server according to the target column identifier.
In this embodiment, when a data file import request is received, performing file extraction on the data file import request to obtain a data file to be imported, extracting a target data table from the data file to be imported, displaying the target data table, receiving an operation instruction input by a user based on the target data table, determining a target column identifier of each column in the target data table according to the operation instruction, determining data to be imported in the target data table according to the target column identifier, and importing the data to be imported into a target server according to the target column identifier; compared with the existing method for manually filling in the import data by the user, in the embodiment, the data file to be imported is obtained by extracting the data file import request sent by the user, the target data form is determined according to the data file to be imported, the target data form is displayed to obtain the operation instruction input by the user based on the target data form, the data to be imported in the target data form is determined according to the operation instruction, and the data to be imported is imported into the target server.
Other embodiments or specific implementation manners of the data file importing apparatus according to the present invention may refer to the above method embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order, but rather the words first, second, third, etc. are to be interpreted as names.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., a Read Only Memory (ROM)/Random Access Memory (RAM), a magnetic disk, an optical disk), and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
The invention discloses A1 and a data file importing method, wherein the data file importing method comprises the following steps:
when a data file import request is received, carrying out file extraction on the data file import request to obtain a data file to be imported;
extracting a target data table from the data file to be imported, and displaying the target data table;
receiving an operation instruction input by a user based on the target data table, and determining a target column identifier of each column in the target data table according to the operation instruction;
and determining data to be imported in the target data table according to the target column identification, and importing the data to be imported into a target server according to the target column identification.
A2, the data file importing method as in a1, wherein the step of extracting the target data table from the data file to be imported and displaying the target data table specifically includes:
acquiring a file format of the data file to be imported, and determining a data extraction script according to the file format;
data extraction is carried out on the data file to be imported through the data extraction script, and a target data table is obtained;
acquiring import data information of a target server, and determining a target display template according to the import data information and the target data table;
and displaying the target data table based on the target display template.
A3, the data file importing method as in a2, the step of obtaining the imported data information of the target server, and determining the target display template according to the imported data information and the target data table, specifically comprising:
acquiring import data information of a target server, and determining the type of the import data according to the import data information;
generating a target page interaction component according to the imported data type, and determining the placement position information of the target page interaction component according to the target data table;
and searching an initial display template corresponding to the target data table, and adjusting the initial display template according to the placement position information to obtain a target display template.
A4, the data file importing method as in A3, wherein the step of generating a target page interaction component according to the imported data type and determining the placement position information of the target page interaction component according to the target data table specifically includes:
generating column identification selection buttons according to the types of the imported data, and sequencing the column identification selection buttons according to a preset sequencing mode to obtain a target page interaction component;
acquiring column coordinate information of the target data table, wherein the column coordinate information is coordinate information of each column in the target data table;
and determining the placement position information of the target page interaction component according to the column coordinate information.
A5, the data file importing method as in a4, where the step of receiving an operation instruction input by a user based on the target data table and determining a target column identifier of each column in the target data table according to the operation instruction specifically includes:
receiving an operation instruction input by a user based on the target data table, analyzing the operation instruction and acquiring current click position information;
and determining a current click button according to the current click position information, and determining target column identifications of all columns in the target data table according to the current click button.
A6, the data file importing method as in a5, wherein the step of determining a current click button according to the current click position information and determining a target column identifier of each column in the target data table according to the current click button specifically includes:
determining a current click interaction component according to the current click position information and the placement position information of the target page interaction component;
determining a current click button based on the current click position information and the current click interaction component;
and determining the target column identification of each column in the target data table according to the current click button.
A7, the data file importing method as in a1, where the step of determining data to be imported in the target data table according to the target column identifier and importing the data to be imported to a target server according to the target column identifier specifically includes:
acquiring a column identification sample, wherein the column identification sample is a column identification of a data import template of a target server;
determining data to be imported in the target data table according to the target column identification and the column identification sample;
and determining a target data import sequence according to the target column identification, and importing the data to be imported into the target server according to the target data import sequence.
A8, the data file importing method as in a7, wherein the step of determining the data to be imported in the target data table according to the target column identifier and the column identifier sample specifically includes:
traversing the target column identification, and taking the traversed target column identification as the current column identification;
matching the current column identifier with the column identifier sample to obtain a matching result;
and after the target column identification is traversed, determining the data to be imported in the target data table according to the matching result.
A9, the data file importing method as in A8, wherein the step of determining the data to be imported in the target data table according to the matching result after the target column identifier traversal is finished specifically includes:
after the target column identifier is traversed, taking the current column identifier with the matching result being successfully matched as the column identifier to be imported;
and searching data corresponding to the column identifier to be imported, and taking the data corresponding to the column identifier to be imported as the data to be imported in the target data table.
A10, the data file importing method according to A9, wherein before the step of determining a target data importing order according to the target column identification and importing the data to be imported into the target server according to the target data importing order, the data file importing method further comprises:
acquiring the current byte number of the data to be imported, and judging whether the current byte number is smaller than a preset threshold value;
when the current byte number is smaller than the preset threshold value, format conversion is carried out on the data to be imported through a preset format conversion script, and target data are obtained;
correspondingly, the step of determining a target data import sequence according to the target column identifier and importing the data to be imported into the target server according to the target data import sequence specifically includes:
and determining a target data import sequence according to the target column identification, and importing the target data into the target server according to the target data import sequence.
A11, the data file importing method as in a10, where after the step of obtaining the current byte number of the data to be imported and determining whether the current byte number is smaller than a preset threshold, the data file importing method further includes:
when the number of bytes at present is greater than or equal to the preset threshold value, taking the column identifier to be imported and the data file to be imported as upload data;
correspondingly, the step of determining a target data import sequence according to the target column identifier and importing the data to be imported into the target server according to the target data import sequence specifically includes:
and determining a target data import sequence according to the target column identification, and importing the uploaded data into the target server according to the target data import sequence.
A12, for example, any one of a1-a11, in the data file import method, when receiving a data file import request, the step of performing file extraction on the data file import request to obtain a data file to be imported includes:
when a data file import request is received, extracting an identifier of the data file import request to obtain an information identifier;
and screening the information of the data file import request according to the information identifier to obtain the data file to be imported.
The invention discloses B13, a data file importing device, comprising: the data file importing method comprises the following steps of storing a data file, storing a data file importing program on the storing device, and operating on the processor, wherein the data file importing program realizes the steps of the data file importing method when being executed by the processor.
The invention discloses C14, a storage medium, wherein the storage medium is stored with a data file importing program, and the data file importing program realizes the steps of the data file importing method when being executed by a processor.
The invention discloses D15, a data file importing device, comprising: the device comprises an extraction module, a display module, a determination module and an import module;
the extraction module is used for extracting the data file import request when receiving the data file import request to obtain a data file to be imported;
the display module is used for extracting a target data table from the data file to be imported and displaying the target data table;
the determining module is used for receiving an operation instruction input by a user based on the target data table and determining a target column identifier of each column in the target data table according to the operation instruction;
and the importing module is used for determining data to be imported in the target data table according to the target column identifier and importing the data to be imported into a target server according to the target column identifier.
D16, the data file importing apparatus as defined in D15, the display module further configured to obtain a file format of the data file to be imported, and determine a data extraction script according to the file format;
the display module is further used for extracting data of the data file to be imported through the data extraction script to obtain a target data table;
the display module is further used for acquiring import data information of a target server and determining a target display template according to the import data information and the target data table;
the display module is further configured to display the target data table based on the target display template.
D17, the data file importing apparatus as in D16, where the display module is further configured to obtain imported data information of a target server, and determine a type of imported data according to the imported data information;
the display module is further used for generating a target page interaction component according to the imported data type and determining the placement position information of the target page interaction component according to the target data table;
the display module is further configured to search for an initial display template corresponding to the target data table, and adjust the initial display template according to the placement position information to obtain a target display template.
D18, the data file importing apparatus as described in D17, where the display module is further configured to generate column identifier selection buttons according to the types of the imported data, and sort the column identifier selection buttons according to a preset sorting manner to obtain a target page interaction component;
the display module is further configured to obtain column coordinate information of the target data table, where the column coordinate information is coordinate information of each column in the target data table;
and the display module is also used for determining the placement position information of the target page interaction component according to the column coordinate information.
D19, the data file importing apparatus as described in D18, where the determining module is further configured to receive an operation instruction input by a user based on the target data table, and analyze the operation instruction to obtain information about a current click position;
the determining module is further configured to determine a current click button according to the current click position information, and determine a target column identifier of each column in the target data table according to the current click button.
D20, the data file importing apparatus as described in D19, where the determining module is further configured to determine a current click interaction component according to the current click position information and the placement position information of the target page interaction component;
the determining module is further configured to determine a current click button based on the current click position information and the current click interaction component;
the determining module is further configured to determine a target column identifier of each column in the target data table according to the current click button.