CN111552688A - Data export method and device and electronic equipment - Google Patents

Data export method and device and electronic equipment Download PDF

Info

Publication number
CN111552688A
CN111552688A CN202010191980.3A CN202010191980A CN111552688A CN 111552688 A CN111552688 A CN 111552688A CN 202010191980 A CN202010191980 A CN 202010191980A CN 111552688 A CN111552688 A CN 111552688A
Authority
CN
China
Prior art keywords
data
format
middleware
export
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010191980.3A
Other languages
Chinese (zh)
Inventor
张文哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010191980.3A priority Critical patent/CN111552688A/en
Publication of CN111552688A publication Critical patent/CN111552688A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2443Stored procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a data export method and device and electronic equipment. Wherein, the method comprises the following steps: receiving a data export request of a client; determining structured query language middleware corresponding to the data export schema; performing sentence splicing on the table name to be queried and the field name to be queried by using the structured query language middleware to obtain a spliced character string; and inquiring target data related to the splicing character string in a database, and sending the target data to a client in a preset data format. Different data formats can be exported from the database according to the requirements of different data export modes, the data export formats are various, the types of the selectable fields are also various, the required data can be obtained without secondary processing, and the data acquisition efficiency is improved.

Description

Data export method and device and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data export method and apparatus, and an electronic device.
Background
At present, when an operator collects data, the data stored in the database needs to be exported according to required fields, but the format for exporting the data is generally a fixed format, and the export mode is relatively single.
Disclosure of Invention
The present disclosure provides a data export method, an apparatus and an electronic device, so as to at least solve the problem of a single data export mode in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a data export method, including: receiving a data export request of a client, wherein the data export request comprises: data export mode, table name to be inquired and field name to be inquired;
determining structured query language middleware corresponding to the data export schema;
performing sentence splicing on the table name to be queried and the field name to be queried by using the structured query language middleware to obtain a spliced character string;
and inquiring target data related to the splicing character string in a database, and sending the target data to a client in a preset data format, wherein the preset data format corresponds to the data export mode.
Optionally, the determining the structured query language middleware corresponding to the data export schema includes:
judging the type of a data export mode in the data export request;
and determining the structured query language middleware corresponding to the data export mode according to the type.
Optionally, the data export schema comprises an Excel schema; the structured query language middleware corresponding to the Excel mode is node-xlsx middleware; the sending the target data to the client in a predetermined data format includes:
adding the target data into a preset array according to a preset format, wherein the preset array comprises a first array formed by splicing fields to be inquired;
inserting the data in the preset array into an Excel file by using the fs plug-in of the node in the node-xlsx middleware to obtain a data file in an Excel format;
and sending the data file in the Excel format to a client.
Optionally, the derived mode comprises a Pdf mode; the structured query language middleware corresponding to the Pdf mode is markdown-Pdf middleware; the sending the target data to the client in a predetermined data format includes:
converting the target data into a data file in a Pdf format through the markdown-Pdf middleware;
and sending the data file in the Pdf format to a client.
Optionally, the export schema comprises a Word schema; the structured query language middleware corresponding to the Word mode is the offsigen middleware; the sending the target data to the client in a predetermined data format includes:
exporting the target data to a Word file by using the offseicen middleware to form a data file in a Word format;
and sending the data file in the Word format to a client.
Optionally, the derived pattern comprises a txt pattern; the structured query language middleware corresponding to the txt mode is node middleware; the sending the target data to the client in a predetermined data format includes:
creating a txt file through the fs plug-in of the node middleware;
writing the target data into the txt file to form a txt format data file;
and sending the data file in the txt format to a client.
According to a second aspect of the embodiments of the present disclosure, there is provided a data derivation apparatus including:
a receiving module configured to receive a data export request of a client, wherein the data export request comprises: data export mode, table name to be inquired and field name to be inquired;
a determination module configured to determine structured query language middleware corresponding to the data export schema;
the splicing module is configured to perform statement splicing on the table name to be queried and the field name to be queried by using the structured query language middleware to obtain a spliced character string;
and the execution module is configured to inquire target data related to the splicing character string in a database and send the target data to a client in a preset data format, wherein the preset data format corresponds to the data export mode.
Optionally, the determining module includes:
a determination unit configured to determine a type of a data export pattern in the data export request;
a determining unit configured to determine a structured query language middleware corresponding to the data export schema according to the type.
Optionally, the data export schema comprises an Excel schema; the structured query language middleware corresponding to the Excel mode is node-xlsx middleware; the execution module comprises:
the adding unit is configured to add the target data into a preset array according to a preset format, wherein the preset array comprises a first array formed by splicing fields to be inquired;
the first execution unit is configured to insert the data in the preset array into an Excel file by using the fs plug-in of the node in the node-xlsx middleware to obtain a data file in an Excel format;
the first sending unit is configured to send the data file in the Excel format to a client.
Optionally, the data derivation modes include a Pdf mode; the structured query language middleware corresponding to the Pdf mode is markdown-Pdf middleware; the execution module comprises:
a second execution unit configured to convert the target data into a data file in a Pdf format through the markdown-Pdf middleware;
a second sending unit configured to send the data file in the Pdf format to a client.
Optionally, the data export schema comprises a Word schema; the structured query language middleware corresponding to the Word mode is the offsigen middleware; the execution module comprises:
the third execution unit is configured to export the target data into a Word file by using the offsigen middleware to form a data file in a Word format;
and the third sending unit is configured to send the data file in the Word format to the client.
Optionally, the data derivation mode comprises a txt mode; the structured query language middleware corresponding to the txt mode is node middleware; the execution module comprises:
a new creation unit configured to create a txt file through an fs plug-in of the node middleware;
the fourth execution unit is configured to write the target data into a txt file to form a txt format data file;
and the fourth sending unit is configured to send the data file in the txt format to the client.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement any of the data derivation methods described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device of video commentary to perform any one of the above-mentioned data derivation methods.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product, wherein instructions of the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform any one of the data derivation methods described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the technical scheme provided by the embodiment of the disclosure, when a data export request of a client is received, a structured query language middleware corresponding to a data export mode in the data export request is determined, then language splicing is performed on a table name and a field name to be queried in the data export request by using the structured query language middleware to obtain a spliced character string, target data related to the spliced character string is queried in a database, and finally the target data is sent to the client in a preset data format. Therefore, different data formats can be exported from the database according to the requirements of different data export modes, the data export formats are various, the types of the selectable fields are also various, the required data can be obtained without secondary processing, and the data acquisition efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow chart illustrating a method of data export according to an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a data export method in accordance with an exemplary embodiment;
FIG. 3 is a block diagram illustrating a data derivation apparatus, according to an exemplary embodiment;
FIG. 4 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The embodiment of the disclosure provides a data export method, a data export device and electronic equipment, wherein the data export method can be suitable for export tasks of different data formats, and for the export tasks of different data formats, the data export can be automatically completed only by loading corresponding configuration information without rewriting programs. The embodiments of the present disclosure may be performed by a data exporting apparatus, which may be implemented by hardware and/or software, and may be generally integrated on a database server side.
FIG. 1 is a flow chart illustrating a method of data export according to an example. The data export method provided by the present embodiment may include the contents shown in steps S11 to S14.
In step S11, a data export request of the client is received.
Wherein the data export request may include: data export mode, table name to be queried and field name to be queried. As a possible implementation manner, the data export mode may be an Excel mode, the table name to be queried may be a document platform navigation, and the field name to be queried may be id, name, is _ del, and the like.
In step S12, structured query language middleware corresponding to the data export schema is determined.
In this embodiment, the structured query language middleware corresponding to the data export mode in the data export request is determined. For example, if the data export schema is Excel schema, the corresponding structured query language middleware is node-xlsx middleware.
In step S13, the structured query language middleware is used to perform sentence concatenation on the table name to be queried and the field name to be queried, so as to obtain a concatenated string.
In step S14, the database is queried for target data related to the concatenated string, and the target data is sent to the client in a predetermined data format.
Wherein the predetermined data format corresponds to a data export pattern.
In the related art, the derived data is generally in a fixed format, and when other formats are needed, secondary operations are needed by other tools.
Therefore, in the embodiment of the present disclosure, according to a data export mode in a received data export request of a client, a structured query language middleware corresponding to the data export request is determined, the structured query language middleware is used to perform language splicing on a table name and a field name to be queried in the data export request to obtain a spliced character string, data related to the spliced character string is queried in a database, and the data is sent to the client in a predetermined data format. Therefore, different data formats can be exported from the database according to the requirements of different data export modes, the data export formats are various, the optional fields are also various, the data of the required mode can be obtained without secondary processing, and the data acquisition efficiency is improved.
FIG. 2 is a flow diagram illustrating a data export method according to an example. In one possible embodiment shown in the present disclosure, determining the structured query language middleware corresponding to the preset data export mode may include the following steps.
Step S121 determines the type of data export pattern in the data export request.
In this possible implementation, the type of the data derivation mode may be a Word mode, or a Pdf mode, or another mode, which is not specifically limited in this embodiment of the disclosure.
And step S122, determining the structured query language middleware corresponding to the data export mode according to the type.
For example, if the data export mode is a Word mode, the corresponding structured query language middleware may be an offsigen middleware, and other export modes all have corresponding middleware, and the middleware corresponding to each data export mode may be one or multiple, which is not specifically limited in the embodiment of the present disclosure.
In the embodiment disclosed above, the corresponding structured query language middleware is configured for each data export mode, so that data files with different formats can be exported by the method provided by the embodiment disclosed herein, and the efficiency of data collection is improved.
In order to facilitate a user to use the data export method provided by the disclosure, the disclosure further provides that vue scaffolds are adopted at the client side for page building, and the server side uses the node for server deployment. The server node uses a routing module of an express framework to perform interface response, performs database connection through MYSQL (relational database management system) middleware, and configures the following information at a client: database address, database user name, database password, library name, port information.
The principle of database query data is specifically as follows: firstly, SQL (Structured Query Language) middleware is adopted to carry out communication link between a server and a database, a link pool is newly established through the SQL middleware after the link is successful, and a client extracts data in the database through the link pool by using a table name and a field name.
As shown in fig. 2, in a particular embodiment of the present disclosure, the data export schema comprises an Excel schema; the structured query language middleware corresponding to the Excel mode is node-xlsx middleware. Accordingly, transmitting the target data to the client in the predetermined data format may include the following steps.
And step S1411, adding the target data into a preset array according to a preset format.
The preset data comprises a first array formed by splicing fields to be inquired.
Specifically, when the data export mode is an Excel mode, determining that a structured query language middleware corresponding to the Excel mode is a node-xlsx middleware, and then performing SQL statement splicing on a table name and a field name according to the table name to be queried and the field name to be queried in a data export request sent by a client, for example, the table name sent by the client is a document platform navigation NAV, the field name is id and name, and the spliced statement is "select id, name from NAV".
And then, inquiring all data matched with the table name to be inquired and the field name to be inquired from the database through a database connection pool according to the spliced sentences. Wherein the database connection pool may be an SQL connection pool.
After the query is completed, the field names to be queried are spliced into a first array. For example, field name id and name are concatenated into an array in [ id, name ] format.
And finally, inserting the inquired data and the first array into a preset array together according to a preset format.
And step 1412, inserting the data in the preset array into the Excel file by using the fs plug-in of the node in the node-xlsx middleware to obtain a data file in an Excel format.
Specifically, the queried data is called into a cache data stream by calling let buffer (xlsxx. built ([ { name: "mySheetName", data: tableData } ], options), and then the generated cache data stream is inserted into a newly-created Excel file by using a node-carried fs plug-in, so as to generate a data file in an Excel format.
And step S1413, sending the data file in the Excel format to the client.
In the embodiment of the disclosure, all data matched with the table name to be queried and the field name to be queried are queried in the database through the node-xlsx middleware corresponding to the Excel mode, so that the required data can be rapidly searched, the data can be exported through the Excel format, a user can conveniently search and export the data, processing is not needed after the data is exported, and the efficiency is improved.
As shown in fig. 2, in a specific embodiment of the present disclosure, the data export schema includes a Pdf (portable document Format) schema; the structured query language middleware corresponding to the Pdf mode is markdown-Pdf middleware. Accordingly, transmitting the target data to the client in the predetermined data format may include the following steps.
Step S1421, converting the target data into a data file in a Pdf format through markdown-Pdf middleware.
Step S1422, sending the data file in the Pdf format to the client.
Specifically, when the data export mode is the Pdf mode, it is determined that the structured query language middleware corresponding to the Pdf mode is a markdown-Pdf middleware, then according to a table name to be queried and a field name to be queried in a data export request sent by a client, SQL statement splicing is performed on the table name and the field name, and the queried data is spliced into a character string according to a preset format, for example, the table name sent by the client is a document platform navigation NAV, the field name is id, and the character string is spliced according to a format of "id + '/n' + NAV + '/n'".
Then, the character string obtained by splicing is converted into a Pdf file by a preset method, for example, a method of markdownpdf ().from.
And finally, detecting whether the file generation is finished or not by using a callback function, and sending the data file in the Pdf format to the client by calling res.
In the embodiment of the disclosure, all data matched with the table name to be queried and the field name to be queried are queried in the database through the markdown-Pdf middleware corresponding to the Pdf mode, so that the required data can be quickly searched, the data can be exported through the Pdf format, a user can conveniently search and export the data, processing is not needed after the data is exported, and the efficiency is improved.
As shown in FIG. 2, in a particular embodiment of the present disclosure, the data export schema includes a Word schema; the structured query language middleware corresponding to the Word schema is the offsigen middleware. Accordingly, transmitting the target data to the client in the predetermined data format may include the following steps.
Step S1431, exporting the target data to a Word file by utilizing the offsigen middleware to form a data file in a Word format.
Step S1432, the data file in the Word format is sent to the client.
Specifically, when the data export mode is a Word mode, determining that a structured query language middleware corresponding to the Word mode is an offsigen middleware, calling an offsigen (docx) method to query a database according to a table name to be queried and a field name to be queried in a data export request sent by a client, splicing the searched data, then calling docx.on ('find') to export the spliced data into a Word file, finally detecting whether the data export is finished by using a callback function, and sending the generated data file in the Word format to the client after the data export is finished.
In the embodiment of the disclosure, all data matched with the table name to be queried and the field name to be queried are queried in the database through the office middleware corresponding to the Word mode, so that the required data can be quickly searched, the data can be exported through the Word format, a user can conveniently search and export the data, processing is not needed after exporting, and the efficiency is improved.
As shown in FIG. 2, in a particular embodiment of the present disclosure, the data export schema includes a txt (text document) schema; the structured query language middleware corresponding to the txt mode is node middleware. Accordingly, transmitting the target data to the client in the predetermined data format may include the following steps.
Step S1441, creating a txt file through the fs plug-in of the node middleware.
Step S1442, writing the target data into the txt file to form a txt format data file.
And step S1443, sending the data file in the txt format to the client.
Specifically, when the data export mode is a txt mode, the structured query language middleware corresponding to the txt mode is determined to be a node middleware, then, according to a table name to be queried and a field name to be queried in a data export request sent by a client, a database is queried by using the node middleware to obtain all data related to the table name and the field name, a data.txt file is newly built by using an fs plug-in of the node, the data is written into the txt file, and finally, the generated data file in the txt format is sent to the client by calling res.
In the embodiment of the disclosure, all data matched with the table name to be queried and the field name to be queried are queried in the database through the node middleware corresponding to the txt mode, so that the required data can be quickly searched, the data can be exported through the txt format, a user can conveniently search and export the data, processing is not needed after the data is exported, and the efficiency is improved.
The data export method under various data modes is described in detail in the above embodiments of the present disclosure, and the data can be queried by using the table name and the field name according to the data export method provided by the present disclosure, so that the query data is more accurate, and the data in various formats can be exported according to the requirements of the user.
Fig. 3 is a block diagram illustrating a data derivation apparatus according to an example embodiment. The data export device is used for realizing the data export method. Referring to fig. 3, the apparatus 300 may include a receiving module 301, a determining module 302, a splicing module 303, and an executing module 304.
The data exporting apparatus provided in this embodiment may refer to a process flow for executing the method shown in fig. 1 and fig. 2, and each unit/module and the other operations and/or functions in the apparatus are respectively for implementing the corresponding process flow in the data exporting method shown in fig. 1 and fig. 2, and can achieve the same or equivalent technical effects, and for brevity, no further description is provided herein.
In an embodiment of the present disclosure, the receiving module 301 is configured to receive a data export request of a client, where the data export request includes: data export mode, table name to be inquired and field name to be inquired; the determination module 302 is configured to determine structured query language middleware corresponding to a data export schema; the splicing module 303 is configured to perform sentence splicing on the table name to be queried and the field name to be queried by using the structured query language middleware to obtain a spliced character string; the execution module 304 is configured to query a database for target data related to the concatenated string, and send the target data to a client in a predetermined data format, where the predetermined data format corresponds to the data export schema.
In an optional implementation manner of the embodiment of the present disclosure, the determining module 302 may include: a determination unit configured to determine a type of a data export pattern in the data export request; a determining unit configured to determine a structured query language middleware corresponding to the data export schema according to the type.
In an optional implementation of an embodiment of the present disclosure, the data export schema includes an Excel schema; the structured query language middleware corresponding to the Excel mode is node-xlsx middleware; accordingly, the execution module may include: the adding unit is configured to add the target data into a preset array according to a preset format, wherein the preset array comprises a first array formed by splicing fields to be inquired; the first execution unit is configured to insert the data in the preset array into an Excel file by using the fs plug-in of the node in the node-xlsx middleware to obtain a data file in an Excel format; the first sending unit is configured to send the data file in the Excel format to a client.
In an optional implementation of an embodiment of the present disclosure, the data derivation mode includes a Pdf mode; the structured query language middleware corresponding to the Pdf mode is markdown-Pdf middleware; correspondingly, the execution module may further include: a second execution unit configured to convert the target data into a data file in a Pdf format through the markdown-Pdf middleware; a second sending unit configured to send the data file in the Pdf format to a client.
In an optional implementation of the embodiments of the present disclosure, the data export schema includes a Word schema; the structured query language middleware corresponding to the Word mode is the offsigen middleware; correspondingly, the execution module may further include: the third execution unit is configured to export the target data into a Word file by using the offsigen middleware to form a data file in a Word format; and the third sending unit is configured to send the data file in the Word format to the client.
In an optional implementation of an embodiment of the present disclosure, the data derivation mode includes a txt mode; the structured query language middleware corresponding to the txt mode is node middleware; correspondingly, the execution module may further include: a new creation unit configured to create a txt file through an fs plug-in of the node middleware; the fourth execution unit is configured to write the target data into a txt file to form a txt format data file; and the fourth sending unit is configured to send the data file in the txt format to the client.
Fig. 4 is a block diagram illustrating an electronic device 400 according to an example embodiment, for example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, electronic device 400 may include one or more of the following components: a processing component 402, a memory 404, a power component 406, a multimedia component 408, an audio component 410, an interface for input/output (I/O) 412, a sensor component 414, and a communication component 416.
The processing component 402 generally controls overall operation of the apparatus 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the device 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 404 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply components 406 provide power to the various components of device 400. The power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 400.
The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 400 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, audio component 410 includes a Microphone (MIC) configured to receive external audio signals when apparatus 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the apparatus 400. For example, the sensor component 414 can detect the open/closed state of the device 400, the relative positioning of components, such as a display and keypad of the apparatus 400, the sensor component 414 can also detect a change in the position of the apparatus 400 or a component of the apparatus 400, the presence or absence of user contact with the apparatus 400, orientation or acceleration/deceleration of the apparatus 400, and a change in the temperature of the apparatus 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the apparatus 400 and other devices. The apparatus 400 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the apparatus 400 to perform the method described above is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises readable program code executable by the processor 420 of the apparatus 400 to perform the data derivation method of any of the embodiments. Alternatively, the program code may be stored in a storage medium of the apparatus 400, which may be a non-transitory computer readable storage medium, for example, ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Fig. 5 is a block diagram of one type of electronic device 500 shown in the present disclosure. For example, the electronic device 500 may be provided as a server.
Referring to fig. 5, electronic device 500 includes a processing component 522 that further includes one or more processors and memory resources, represented by memory 532, for storing instructions, such as applications, that are executable by processing component 522. The application programs stored in memory 532 may include one or more modules that each correspond to a set of instructions. Further, the processing component 522 is configured to execute instructions to perform the data export method of any of the embodiments.
The electronic device 500 may also include a power component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to connect the electronic device 500 to a network, and an input/output (I/O) interface 558. The electronic device 500 may operate based on an operating system stored in memory 532, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method of data derivation, comprising:
receiving a data export request of a client, wherein the data export request comprises: data export mode, table name to be inquired and field name to be inquired;
determining structured query language middleware corresponding to the data export schema;
performing sentence splicing on the table name to be queried and the field name to be queried by using the structured query language middleware to obtain a spliced character string;
and inquiring target data related to the splicing character string in a database, and sending the target data to a client in a preset data format, wherein the preset data format corresponds to the data export mode.
2. The data export method of claim 1, wherein determining structured query language middleware corresponding to the data export schema comprises:
judging the type of a data export mode in the data export request;
and determining the structured query language middleware corresponding to the data export mode according to the type.
3. The data export method of claim 2, wherein the data export schema comprises an Excel schema; the structured query language middleware corresponding to the Excel mode is node-xlsx middleware; the sending the target data to the client in a predetermined data format includes:
adding the target data into a preset array according to a preset format, wherein the preset array comprises a first array formed by splicing fields to be inquired;
inserting the data in the preset array into an Excel file by using the fs plug-in of the node in the node-xlsx middleware to obtain a data file in an Excel format;
and sending the data file in the Excel format to a client.
4. The data derivation method according to claim 2, wherein the derivation pattern comprises a Pdf pattern; the structured query language middleware corresponding to the Pdf mode is markdown-Pdf middleware; the sending the target data to the client in a predetermined data format includes:
converting the target data into a data file in a Pdf format through the markdown-Pdf middleware;
and sending the data file in the Pdf format to a client.
5. The data derivation method of claim 2, wherein the derivation schema comprises a Word schema; the structured query language middleware corresponding to the Word mode is the offsigen middleware; the sending the target data to the client in a predetermined data format includes:
exporting the target data to a Word file by using the offseicen middleware to form a data file in a Word format;
and sending the data file in the Word format to a client.
6. The data derivation method of claim 2, wherein the derivation pattern comprises a txt pattern; the structured query language middleware corresponding to the txt mode is node middleware; the sending the target data to the client in a predetermined data format includes:
creating a txt file through the fs plug-in of the node middleware;
writing the target data into the txt file to form a txt format data file;
and sending the data file in the txt format to a client.
7. A data derivation apparatus, comprising:
a receiving module configured to receive a data export request of a client, wherein the data export request comprises: data export mode, table name to be inquired and field name to be inquired;
a determination module configured to determine structured query language middleware corresponding to the data export schema;
the splicing module is configured to perform statement splicing on the table name to be queried and the field name to be queried by using the structured query language middleware to obtain a spliced character string;
and the execution module is configured to inquire target data related to the splicing character string in a database and send the target data to a client in a preset data format, wherein the preset data format corresponds to the data export mode.
8. The data derivation apparatus of claim 7, wherein the determination module comprises:
a determination unit configured to determine a type of a data export pattern in the data export request;
a determining unit configured to determine a structured query language middleware corresponding to the data export schema according to the type.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data derivation method of any of claims 1 to 6.
10. A storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device of video commentary to perform a data derivation method as claimed in any one of claims 1 to 6.
CN202010191980.3A 2020-03-18 2020-03-18 Data export method and device and electronic equipment Pending CN111552688A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010191980.3A CN111552688A (en) 2020-03-18 2020-03-18 Data export method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010191980.3A CN111552688A (en) 2020-03-18 2020-03-18 Data export method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111552688A true CN111552688A (en) 2020-08-18

Family

ID=72004174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010191980.3A Pending CN111552688A (en) 2020-03-18 2020-03-18 Data export method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111552688A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138714A (en) * 2022-02-08 2022-03-04 上海金仕达软件科技有限公司 Data migration method and device, storage medium and electronic equipment
CN115357604A (en) * 2022-10-18 2022-11-18 天聚地合(苏州)科技股份有限公司 Data query method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103093000A (en) * 2013-02-25 2013-05-08 用友软件股份有限公司 Database query modeling system and database query modeling method
CN107798026A (en) * 2016-09-05 2018-03-13 北京京东尚科信息技术有限公司 Data query method and apparatus
CN107977351A (en) * 2017-12-28 2018-05-01 平安科技(深圳)有限公司 Electronic report forms generation method, device, computer equipment and storage medium
CN108304172A (en) * 2017-01-13 2018-07-20 北京畅游天下网络技术有限公司 A kind of web development approaches and web develop engine
US20190073388A1 (en) * 2016-03-02 2019-03-07 IntegrIT SA Improved Construction of Database Schema Models for Database Systems and Rest APIs
CN109561131A (en) * 2018-10-19 2019-04-02 深圳点猫科技有限公司 A kind of method and electronic equipment of the downloading of language based on programming excel data
CN110489445A (en) * 2019-08-02 2019-11-22 四川宏力信息科技有限责任公司 It is a kind of based on polymorphic compound mass data method for quickly querying

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103093000A (en) * 2013-02-25 2013-05-08 用友软件股份有限公司 Database query modeling system and database query modeling method
US20190073388A1 (en) * 2016-03-02 2019-03-07 IntegrIT SA Improved Construction of Database Schema Models for Database Systems and Rest APIs
CN107798026A (en) * 2016-09-05 2018-03-13 北京京东尚科信息技术有限公司 Data query method and apparatus
CN108304172A (en) * 2017-01-13 2018-07-20 北京畅游天下网络技术有限公司 A kind of web development approaches and web develop engine
CN107977351A (en) * 2017-12-28 2018-05-01 平安科技(深圳)有限公司 Electronic report forms generation method, device, computer equipment and storage medium
CN109561131A (en) * 2018-10-19 2019-04-02 深圳点猫科技有限公司 A kind of method and electronic equipment of the downloading of language based on programming excel data
CN110489445A (en) * 2019-08-02 2019-11-22 四川宏力信息科技有限责任公司 It is a kind of based on polymorphic compound mass data method for quickly querying

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114138714A (en) * 2022-02-08 2022-03-04 上海金仕达软件科技有限公司 Data migration method and device, storage medium and electronic equipment
CN115357604A (en) * 2022-10-18 2022-11-18 天聚地合(苏州)科技股份有限公司 Data query method and device
CN115357604B (en) * 2022-10-18 2023-03-07 天聚地合(苏州)科技股份有限公司 Data query method and device

Similar Documents

Publication Publication Date Title
CN106569800B (en) Front-end interface generation method and device
CN107423106B (en) Method and apparatus for supporting multi-frame syntax
JP6321306B2 (en) Similarity identification method, apparatus, terminal, program, and recording medium
CN106201734B (en) File sharing method and device
CN106547547B (en) data acquisition method and device
CN113065591B (en) Target detection method and device, electronic equipment and storage medium
US11388652B2 (en) Method and apparatus for indicating position of cell-defining synchronization signal block and searching for the same, and base station
CN111510556B (en) Call information processing method and device and computer storage medium
CN108270661B (en) Information reply method, device and equipment
CN111552688A (en) Data export method and device and electronic equipment
CN111061452A (en) Voice control method and device of user interface
CN105183571A (en) Function calling method and device
CN109992754B (en) Document processing method and device
CN113807253A (en) Face recognition method and device, electronic equipment and storage medium
CN110221813B (en) Application data connection establishment method and device, storage medium and electronic equipment
CN109445890A (en) A kind of method for showing interface, device, terminal device and storage medium
CN112988822B (en) Data query method, device, equipment, readable storage medium and product
CN111667827B (en) Voice control method and device for application program and storage medium
CN112732098B (en) Input method and related device
CN112732734A (en) Information processing method and device
CN114051157A (en) Input method and device
CN111814797A (en) Picture character recognition method and device and computer readable storage medium
CN106484261B (en) Information acquisition method and device, information transmission method and device, and terminal
CN112015281A (en) Cloud association method and related device
CN113286218B (en) Translation method and device and earphone equipment

Legal Events

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