CN112131289A - Data processing method and device, electronic equipment and storage medium - Google Patents

Data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112131289A
CN112131289A CN202010827529.6A CN202010827529A CN112131289A CN 112131289 A CN112131289 A CN 112131289A CN 202010827529 A CN202010827529 A CN 202010827529A CN 112131289 A CN112131289 A CN 112131289A
Authority
CN
China
Prior art keywords
data
adapter
metadata
item
output
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
CN202010827529.6A
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.)
Wuhan Kuangshi Jinzhi Technology Co ltd
Beijing Kuangshi Technology Co Ltd
Beijing Megvii Technology Co Ltd
Original Assignee
Wuhan Kuangshi Jinzhi Technology Co ltd
Beijing Kuangshi 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 Wuhan Kuangshi Jinzhi Technology Co ltd, Beijing Kuangshi Technology Co Ltd filed Critical Wuhan Kuangshi Jinzhi Technology Co ltd
Priority to CN202010827529.6A priority Critical patent/CN112131289A/en
Publication of CN112131289A publication Critical patent/CN112131289A/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/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications

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)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a data processing method, a data processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: performing primary processing on data to be processed to obtain a metadata item and metadata contents corresponding to the metadata item respectively; analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item; and filling the analyzed data content into a preset template, and exporting the filled template to a designated storage space. By adopting the technical scheme of the embodiment of the invention, the data of the data sources with different file formats can be processed and exported, and the personalized requirements of users can be met.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage medium.
Background
Currently, the required data needs to be exported from a plurality of data sources, and generally, the required data needs to be exported from data sources adopting different file formats, for example, the data sources adopting Excel file format, txt file format and csv file format.
In the related art, a more common data derivation method is as follows: and exporting the data in the corresponding format in the database of the application system by one key through an export button arranged in the application system. However, on one hand, such a method can only export data for several data sources with specific file formats, that is, only export data for specific data structures, and cannot flexibly adapt to data sources with multiple file formats. On the other hand, the format of the exported data may not meet the requirements of the user, and the user is required to modify the data manually, so that the efficiency of exporting the data is reduced.
Disclosure of Invention
In view of the above problems, embodiments of the present invention provide a data processing method, apparatus, electronic device and storage medium, so as to overcome the above problems or at least partially solve the above problems.
In a first aspect of the embodiments of the present invention, a data processing method is provided, where the method includes:
performing primary processing on data to be processed to obtain a metadata item and metadata content corresponding to the metadata item;
analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item;
and filling the analyzed data content into a preset template, and exporting the filled template to a designated storage space.
Optionally, before performing preliminary processing on the data to be processed, the method further includes:
responding to the detected data export request, analyzing the data export request, and determining a storage path of a target data source to which the data to be processed belongs;
and reading the data to be processed from the target data source according to the storage path of the target data source.
Optionally, performing preliminary processing on data to be processed to obtain a metadata item and metadata content corresponding to the metadata item, including:
determining the type of a target data source to which the data to be processed belongs;
and converting the data to be processed according to a conversion mode corresponding to the type of the target data source to obtain the metadata item and the metadata content corresponding to the metadata item.
Optionally, the preset adapter combination corresponding to the metadata item includes a plurality of connected adapters; analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item, wherein the analysis comprises the following steps:
inputting the metadata content corresponding to the metadata item into one or more input adapters in a preset adapter combination corresponding to the metadata item, wherein the input adapters are adapters without upstream adapters adjacent to the input adapters;
performing content conversion on data content input to each adapter in a preset adapter combination corresponding to the metadata item according to a preset conversion rule built in the adapter, and taking the data content obtained after conversion as the input of a downstream adapter adjacent to the adapter under the condition that the downstream adapter adjacent to the adapter exists;
and determining the data content obtained by converting one or more output adapters in the preset adapter combination corresponding to the metadata item into analyzed data content and data item, wherein the output adapter is an adapter without a downstream adapter adjacent to the output adapter.
Optionally, the filling the parsed data content into a preset template includes:
under the condition that the type of the preset template is a data file template, filling the analyzed data content into a list item corresponding to the analyzed data item to obtain a data file; the data file template comprises at least one list item;
and/or determining a plurality of corresponding output items according to a plurality of preset naming items included in the picture file template under the condition that the type of the preset template is the picture file template, and filling the analyzed data content into the corresponding output items to obtain a picture output file, wherein the name of one preset naming item corresponds to the name of one output item.
Optionally, the adapters in the preset adapter combination include at least one of: the system comprises an identity card adapter, a mobile phone number adapter, a time adapter, a dictionary data adapter, a picture adapter and a related data adapter;
the input end of the identity card adapter is connected with at least two metadata items, one metadata item is a death identification item, the other metadata item is an identity card number item, the output end of the identity card adapter is connected with at least two output items, one output item is a birth date output item, and the other output item is a gender output item;
the input end of the mobile phone number adapter is connected with at least one metadata item including a mobile phone number item, the output end of the mobile phone number adapter is connected with at least two output items, wherein one output item is a home output item, and the other output item is a communication network output item to which the mobile phone number belongs;
the input end of the time adapter is connected with at least one type of metadata item, and the output end of the time adapter is connected with at least one type of data output item;
the dictionary data adapter is used for editing the metadata content corresponding to the input metadata item according to a preset logic expression and/or a preset interception expression and outputting the edited metadata content;
the picture adapter is used for acquiring an original picture according to original picture storage address information corresponding to the connected metadata item, processing the original picture and outputting the storage address information of the processed picture;
the associated data adapter is used for acquiring other metadata contents associated with the metadata contents according to the metadata contents corresponding to the connected metadata items.
In a second aspect of the embodiments of the present invention, there is provided a data processing apparatus, including:
the processing module is used for carrying out primary processing on data to be processed to obtain a metadata item and metadata contents corresponding to the metadata item;
the analysis module is used for analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item;
and the export module is used for filling the analyzed data content into a preset template and exporting the filled template to the designated storage space.
In a third aspect of the embodiments of the present invention, an electronic device is further disclosed, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when executed, the processor implements the data processing method according to the first aspect of the present embodiment.
In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is further disclosed, which stores a computer program for causing a processor to execute the data processing method according to the first aspect of the embodiments of the present invention.
In the embodiment of the invention, the data to be processed can be subjected to primary processing to obtain a metadata item and metadata contents corresponding to the metadata item; analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item; and then, filling the analyzed data content into a preset template, and exporting the filled template to a specified storage space.
The embodiment of the invention at least comprises the following advantages:
on one hand, because the data to be processed is subjected to preliminary processing, so that a uniform metadata item and metadata contents corresponding to the metadata item are obtained, the data of different data structures from different data sources can be converted into a uniform data structure, and the data of the data sources in various different file formats can be processed and exported.
On the other hand, the corresponding metadata content is analyzed through the preset adapter combination corresponding to the metadata item, and the analyzed data content is filled into the preset template. Therefore, the user can select the corresponding adapter according to the self requirement, and then the metadata content can be analyzed into the content of the data format required by the user through the selected adapter, so that the exported data format meets the personalized requirement of the user and can be directly used by the user, the user is prevented from editing and modifying the exported data again manually, the user experience is optimized, and the data export efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a diagram of an implementation environment in one embodiment of the invention;
FIG. 2 is a block diagram of a data export tool in accordance with an embodiment of the present invention;
FIG. 3 is a flow chart of steps of a data processing method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a mapping relationship between different default adapter combinations and metadata items according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating steps performed by a default adapter combination to parse metadata content according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating a mapping relationship between each list item in a data file template and an analyzed data item according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating data files and data items output by preset adapter combinations after being filled into a template according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating a mapping relationship between each default named item in the image file template and each parsed data item according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating data contents outputted by the preset adapter combination being filled into a picture file template according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanying figures are described in detail below, and it is apparent that the embodiments described are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The data derivation in the related art has three problems:
firstly, the file format of the targeted data source is single, or only the xls file can be simply exported, when the picture file is needed, the picture can be only nested in a certain column of the xls file, but when the user wants to separate xls from the picture, the operation is often difficult to achieve.
Secondly, the flexibility of data export is poor, and if a user wants to export a csv file or an pdt file, the situation is often difficult to meet, the Excel file needs to be manually converted again through other tools, so that the operation is troublesome, and the formats are difficult to unify.
Thirdly, the format of the exported data cannot meet the requirements of users. For example, for a user who is "Male and Female in age" and wants to show the money in English by Female/Male, or for a place in a money format that wants to avoid errors and to mark the money by capitalized numerals, many tools cannot realize a derivation method that conforms to the user's habit.
In view of the above, the present invention proposes at least one of the following core concepts to solve at least one of the above problems: the method comprises the steps of carrying out primary processing on data to be processed to convert the data to be processed into a metadata item and metadata contents corresponding to the metadata item, then analyzing the metadata contents through a preset adapter combination corresponding to the metadata item, and filling the data contents obtained through analysis into a preset template. On one hand, data of data sources with different data structures are converted into a uniform data structure through preliminary processing; on the other hand, through the preset adapter combination corresponding to each metadata item, the metadata content can be analyzed into the data content which conforms to the data format required by the user, so that the exported data conforms to the requirements of the user.
Referring to fig. 1, a diagram of an implementation environment of an embodiment of the present application is shown, as shown in fig. 1, including a terminal device 101, where a data export tool 102 is configured on the terminal device 101. The data export tool 102 may obtain data from a plurality of data sources 103, where the data sources 103 may include data sources 1 to 3 located in the terminal device 101 (i.e., local storage space), and may also include data source 4 located in a server in the internet or data source 5 in another terminal device.
Referring to fig. 2, a schematic diagram of a framework of a data export tool 101 according to an embodiment of the present application is shown, which includes a data source configuration module, a data processing module, a data content parsing module, and a data export module. Wherein the interaction between the above modules may be as indicated by the arrows in fig. 2.
The overall concept of the embodiments of the present application is briefly described as follows with reference to fig. 2:
when data needs to be exported, a user can configure the path of the data source in the data source configuration module, so that the data export tool can acquire the data from the corresponding data source according to the configured path. The data processing module may be configured to process data of different data structures obtained from corresponding data sources to convert the data into a data structure in a unified format. The data content analysis module can be used for sending the data with the uniform format into a corresponding adapter for conversion, and finally exporting the data content output by the adapter to a corresponding position in a preset template through the data export module.
When the data is exported, a user can configure a data acquisition path of the data in the data source configuration module in advance and select a required adapter in the data adapter module to form an adapter combination, and after the user determines that the configuration is completed, the user sends a data export request, so that the data export tool can export the data according to the data acquisition path configured by the user and the selected adapter combination.
Before describing the data processing method of the present application, how to configure the data acquisition path is described first.
As shown in fig. 2, the data source configuration module includes three types of data sources, which are a relational database, a data source of an HTTP interface, and a local data file. When configuring the data acquisition path, for data sources of different file formats, statements adopted when configuring the data acquisition path may be different, and when implementing:
if the data source is the HTTP interface data source, the data acquisition path configured by the user is the HTTP address of the data source; if the data source is the Ftp data source, the data acquisition path configured by the user is the information of the address of the Ftp, the Ftp user name, the password port number and the like; if the query is a relational database such as Oracle, Mysql or DB2, the configured data acquisition path is a database address, a database username and password, and a correct Sql statement for queryable data.
The process of configuring the data acquisition path by different data sources is as follows:
for the data source of the HTTP interface, the data in the HTTP interface is generally data stored in a network server. Thus, in configuring the data fetch address, the data fetch address may include: the URL address may also include related configuration items such as a request header, a page tag, a page size, a data type, a data item tag, and the like. The data type may include a JSON type and an XML type. The data item flags are used to flag each row of data based on the data type.
Wherein, part of the data request needs to be configured with TOKEN at the request header, and if not, the configuration item needs to be ignored. If the data volume requested to the HTTP data source is large, a paging flag and a paging size may be set to acquire data from the HTTP data source in multiple times in a paging manner, and the data volume requested each time does not exceed the set paging size.
For a data source of a relational database, the data stored in the relational database is typically located in the database. Thus, in configuring the data fetch address, the data fetch address may include: the IP address of the database, the database port number (if not provided, the type database default port number is used), the database username, and the password. Of course, related configuration items, such as SQL query statements, may also be included. The SQL query statement is used for querying the required data from the relational database.
For data sources that are locally stored data files, the data sources store local data files, for example, files stored in a hard disk of the terminal device 101. In this case, when configuring the data acquisition address, the data acquisition address may include: the file address may also include related configuration items such as file type, header, data delimiter, and the like.
The data files can be divided into FTP files and local files, wherein the FTP files refer to files stored on the space platform and can be understood as files stored in a corresponding cloud. And in the case that the data file is a local file, the file address is the storage path of the file in the terminal device 101.
The file types in the configuration items comprise two file types of 'text file' and 'EXCEL file'. The header refers to taking the first line of data in the data file as a metadata item; if there is no header, it indicates that the default metadata item is used. In the case where the file type is a text file, if the data separator is used to divide the data content, for example, the data content "name three" is divided into "name/three" by the separator "/" to divide the data content representing different meanings.
When the data acquisition path is configured for data export, the data to be processed can be acquired from the corresponding data source. As shown in fig. 2, the specific process of the data derivation tool acquiring the data to be processed from each data source is as follows: responding to the detected data export request, analyzing the data export request, and determining a storage path of a target data source to which the data to be processed belongs; and reading the data to be processed from the target data source according to the storage path of the target data source.
In this embodiment, the target data source may be at least one of the following data sources: an Oracle data source, a Mysql data source, a data source for HTTP interface, an Ftp data source, and a local file data source. The data export request may be generated after a user determines that configuration of a data acquisition path and an adapter is completed, where the to-be-processed data refers to data to be exported and stored in a data source, and a storage path of a target data source to which the to-be-processed data belongs is the configured data acquisition path.
In practice, the data export request may carry a data acquisition path and a related configuration item, and the data export tool may analyze the data export request to acquire the data acquisition path, so as to read the data to be processed from the corresponding target data source according to the data acquisition path.
After the data to be processed is acquired from the target data source, the data to be processed can be processed, so that data expected by a user can be output to the user. Referring to fig. 3, a flowchart illustrating steps of a data processing method in an embodiment is shown, and as shown in fig. 3, a process of processing acquired data to be processed specifically includes:
step S301: and performing primary processing on data to be processed to obtain a metadata item and metadata content corresponding to the metadata item.
In practice, since different data sources may be in different file formats (e.g., JSON format, XML format), the data to be processed obtained from different data sources may have different data structures. In this embodiment, the preliminary processing on the data to be processed may refer to: the method comprises the steps of converting data to be processed with different data structures into data of a metadata model, wherein the metadata model is a data structure which mainly comprises metadata items and metadata contents. The metadata item represents the attribute name of the data, the metadata content represents the specific value corresponding to the data attribute, and the metadata content has multiple data types: string type, boolean type, integer type, floating point type.
For example, if the data to be processed is a data structure in JSON format, attribute names of JSON, such as username, usergee, isEnabled, averageValue, may be used as metadata items, and a value "Tom" corresponding to username, a value 18 corresponding to usergee, a value true corresponding to isEnabled, and a value 98.72 corresponding to averageValue may be used as metadata contents. If the data to be processed is a data structure of a data file type, if the data to be processed contains a header, the name defined by the header can be used as a metadata item; if there are no headers, each column can be used as a metadata item, e.g., Col [1], Col [2], … ….
Step S302: and analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item.
In this embodiment, the preset adapter combination may include at least one adapter, and the at least one adapter may be connected to each other so as to be combined into the adapter combination. Different adapters in the preset adapter combination can be used for analyzing the metadata content corresponding to the same metadata item into data in different formats, so that the same data content can be presented in a diversified manner. For example, for a metadata item "date of birth" whose metadata content is the time "11/13/1956", this time may be parsed into data content of age "64" (numerical format) or "old" (textual format) for different adapters.
In a specific implementation, the connection relationship between at least one adapter may form an analysis path for analyzing the metadata content corresponding to the metadata item, and then the metadata content corresponding to the metadata item may be analyzed by using each adapter arranged on the analysis path according to the analysis path. Wherein an adapter may correspond to at least one metadata item.
When the metadata content is analyzed, each adapter in the preset adapter combination can convert the data content input to the adapter into a single or multiple output items with the same meaning but different expression forms according to a pre-configured conversion rule, that is, the meaning represented by the output single or multiple output items is the same as the meaning represented by the input data content, but the data format of the output items is different from that of the data content, so that the metadata content can be presented in a multi-element manner according to the requirements of a user.
For example, the input data content is data in the UNIX time stamp format, and the output item output after analysis by the adapter is in the character string time format such as "yyyy year MM month dd day HH MM minute ss second", so as to conform to the reading habit of the user.
In this embodiment, by using the adapters in the preset adapter combination, the metadata content corresponding to each metadata item can be correspondingly converted, so that the metadata content is converted into data in a data format required by the user, and the user requirements are further met.
Step S303: and filling the analyzed data content into a preset template, and exporting the filled template to a designated storage space.
In this embodiment, the parsed data content is an output item output by each adapter in the preset adapter combination, where the parsed data content may include a plurality of parsed data contents, that is, a plurality of output items. The preset template may refer to a derived template defined from a single or multiple output items of a preset adapter combination.
The preset template may include positions for filling the analyzed data contents, and in specific implementation, the mapping module may map each analyzed data content with a corresponding position in the preset template, so as to form a corresponding relationship between each data content and each position in the preset template, and further fill the analyzed data contents into the preset template according to the corresponding relationship.
In this embodiment, a storage path for exporting data may be preset, and after each data content is filled into a preset template, the filled template may be exported to a designated storage space according to the storage path.
By adopting the technical scheme of the embodiment of the invention, on one hand, the data to be processed is subjected to preliminary processing, so that the data to be processed with different data structures are arranged into a uniform metadata model, and therefore, the data of different file formats from different data sources can be converted into a uniform file format, and the data of data sources with different file formats can be processed and exported. On the other hand, the corresponding metadata content is analyzed through the preset adapter combination corresponding to the metadata item, and the analyzed data content is filled into the preset template. Therefore, the user can select the corresponding adapter according to the self requirement, and then the metadata content can be analyzed into the content of the data format required by the user through the selected adapter, so that the exported data format meets the user requirement and can be directly used by the user, the situation that the user artificially edits and modifies the exported data again is avoided, the user experience is optimized, and the data export efficiency is improved.
Hereinafter, a process of data preliminary processing, a process of parsing metadata contents, and a process of filling parsed data contents into a preset template are respectively described in detail.
In an embodiment, a process of performing preliminary processing on data to be processed is shown, and when the data to be processed is subjected to the preliminary processing to obtain a metadata item and metadata contents respectively corresponding to the metadata item, a type of a target data source to which the data to be processed belongs may be determined; and converting the data to be processed according to a conversion mode corresponding to the type of the target data source to obtain the metadata item and the metadata content corresponding to the metadata item.
In this embodiment, the preliminary processing refers to a process of converting data to be processed with different data structures into metadata models, where in the process of converting data to be processed with different data structures into data of metadata models, conversion may be performed according to types of target data sources to which the data to be processed belongs, that is, different types of target data sources may correspond to different conversion modes.
In specific implementation, for a target data source of a database type, in this case, the obtained to-be-processed data may be data queried through an SQL statement, such as "SELECT t.code, t.name, t.age, t.birthday from table t limit 5, 10", and each line of data in the queried to-be-processed data may be used as a metadata entry, and each line of data is metadata content.
For a target data source of the HTTP type, the acquired data to be processed may be in a JSON format or an XML format, and then the data to be processed may be correspondingly converted according to different data formats. If the data to be processed is data in the JSON format, for example, the following data:
Figure BDA0002636762730000111
it is possible to convert JSON-type data to be processed using FastJson developed in JAVA, taking name and age as items of metadata, and the values "lie four", "28" at the back as metadata contents.
If the data to be processed is data in XML format, for example, the following data are used:
Figure BDA0002636762730000112
the < name >, < age > are data item flags configured when configuring the data acquisition path, which flags indicate which rows are included by themselves. For example, < name > zhanthree </name > indicates that "zhanthree" is contained by < name >. The XML-type data to be processed may be converted using SAX and DOM, with the data item tag as the metadata item and the content contained by the data item tag as the metadata content.
For a target data source of a data file type, the type of the acquired to-be-processed data may be a local text file type or a local Excel file type.
For the data to be processed of the text file type, the TXT file type, the CSV file type, and the like are generally used as main data, the data stored in these files is one data per line, the data entries are distinguished by line feed, each line of data is separated by a special symbol, and the file format of CSV and comma separated value is taken as an example: zhang three, male, 14, bridge Engineer. Each column is data separated by commas, by other special symbols, such as spaces (), tabs (), vertical bars (|), etc. A collection of data columns, Col [ n ], is obtained, n representing the number of columns, and each column is metadata content, defined as Col [1], Col [2], …. Wherein, if the first row title is configured, the item of the metadata is the content of the first row Col [ n ]; if not configured, COL [1], COL [2], COL [3] are used as metadata items by default.
For the to-be-processed data of the Excel file type, when the configuration of the acquisition path is performed, it may be configured to specifically acquire data of which columns, and then the data of the configured columns is derived from the local file, for example, if the nth column to the mth column are configured as derived data, then the data of the nth column to the mth column in the local file is acquired, then the content of each column from the nth column to the mth column, that is, the set Col [ N ], may be the metadata content, N represents the data of the column, and then each column is the metadata content, which is defined as Col [1] and Col [2] … …. Of course, if the first behavior title is configured when the acquisition path configuration is performed, the content of the first row Col [ n ] in the data to be processed is used as the metadata item; in other cases, COL [1], COL [2], COL [3] may be used as metadata items by default.
By adopting the embodiment, the data to be processed acquired from different target data sources can be correspondingly converted according to the types of the target data sources, so that the results of the data acquired from different data sources can be converted into the data structure of the metadata model, and the method can be suitable for various data sources.
Next, a process of parsing the metadata content will be described, and first, a preset adapter combination used in the present application will be described in detail.
As shown in fig. 2, the various adapters in this embodiment may include: the preset adapter combination can comprise at least one of the above adapters, and each adapter is introduced as follows:
the input end of the identity card adapter is connected with at least two metadata items, one metadata item is a death identification item, the other metadata item is an identity card number item, the output end of the identity card adapter is connected with at least two output items, one output item is a birth date output item, and the other output item is a gender output item.
Since one metadata item of the identity card adapter is a death identification item, the other metadata item is an identity number item. For the item of the ID card number, province information, city information, district and county information, birth year, month and day information, affiliation place information and gender information can be analyzed according to the definition rule of the ID card number, and single or multiple information can be selected as an output item. For the death-identifying item, if the death identifier is True, no parsing work is done and all output items are empty.
The input end of the mobile phone number adapter is connected with at least one metadata item including a mobile phone number item, the output end of the mobile phone number adapter is connected with at least two output items, one of the output items is a home output item, and the other output item is a communication network output item to which the mobile phone number belongs.
Certainly, the mobile phone number adapter may also analyze the mobile communication network information to which the mobile user belongs, such as china mobile, china telecom, china unicom, and home location information, to the input mobile phone number. In practice, a single or multiple of the above information items may be selected as output items.
Wherein the input end of the time adapter is connected with at least one type of metadata item, and the output end of the time adapter is connected with at least one data type of output item.
The metadata items connected with the time adapter can be time type metadata items, and specifically can include a UNIX time stamp format and a character string time format, wherein the character string time format includes a character string time format such as "yyy year MM month dd day HH hour MM minute ss second", "yyyy-MM-dd HH: MM: ss", and the like. The time adapter can convert the content corresponding to the metadata item into output items of various data types according to the specified configuration rule. For example, conversion to other time formats: for example, only the time format of year, month and day is included as an output item (yyyy-MM-dd). Conversion to digital: e.g. the value of the difference between the two entries and the current time, or with reference to the value of the difference in time (years, days, hours, seconds). Convert to time in other time zones and may configure the display in a specified time format.
The dictionary data adapter is used for editing the metadata content corresponding to the input metadata item according to a preset logic expression and/or a preset interception expression, and outputting the edited metadata content.
For the dictionary data adapter, the value of the metadata content of an accessed metadata item can be converted into another value as an output item according to the configuration set by the user, and the truncated configuration of the user can comprise a logic expression and an interception expression.
For logical expressions
Figure BDA0002636762730000141
In other words, four elements are included, the first being a metadata item (E); the second is a logical symbol (L) comprising equal, not equal, greater, less, inclusive; third is the reference value (C); and the fourth is the output value (B). These four elementsBy combining elements, i.e. by logical sign of item value
Figure BDA0002636762730000142
And a reference value is logically determined (L
Figure BDA0002636762730000143
For example: a metadata item indicating "sex", a logical symbol "equal to" as a second element, reference values of "1" and "0", and output values of "male" and "female". When the value of the metadata content is equal to "1", the output item is "male", and when the value is equal to "0", the output item is "female".
Another example is: a metadata item representing a score, the value of the metadata content is more than or equal to 90, and the output item is 'excellent'; 80 is less than or equal to the value of the metadata content <90, the output item is "good".
For truncated expressions
Figure BDA0002636762730000144
In other words, three elements are included, the first being a metadata item (E); the second is the intercept function Sub (a, b), a and b respectively start index (contain) and end index (do not contain); and the third is the output value (B). Combining the three elements, namely intercepting the value of the metadata content corresponding to the metadata item from the starting position (a) to the ending position (b) through an intercepting function (Sub (a, b)), but not including the character corresponding to the b position, and taking the intercepted value as a return output value
Figure BDA0002636762730000145
For example, a metadata item indicating "version information" whose naming rule is, for example, "v.1.0 _20200101_ 001", after adaptation by the truncation expression, takes the time part in the version information as an output item, the truncation function is set to Sub (6,14), the first bit is calculated from 0, and the truncated value is "20200101".
The picture adapter is used for acquiring an original picture according to original picture storage address information corresponding to the connected metadata items, processing the original picture and outputting the storage address information of the processed picture.
In this embodiment, the picture adapter is mainly used for obtaining a picture, one corresponding metadata item of the picture adapter is capable of obtaining the picture, the adapter is capable of obtaining the picture according to the original picture storage address information in the metadata item, and converting the original picture according to the data type of the original picture, in practice, the size, resolution, picture format, picture storage path and other attributes of the picture can also be configured, so that the converted picture is stored in a specified storage address, and after the storage is successful, the stored storage address information can be output.
The method for acquiring and processing the original picture by the picture adapter comprises the following steps:
the first mode is as follows: if the original image is stored in the database, the data type is BLOB type and TEXT type; the BLOB type is a binary byte format for storing pictures, and the TEXT type is a string storage after BASE64 encoding is performed again on a byte basis, so that the bytes of the original picture can be converted into pictures using Java file stream API, the string of BASE64 can be decoded into bytes using Java file stream API of BASE64Decoder under sun.
The second mode is as follows: and if the original picture is stored in the HTTP website, acquiring the original picture by using a uniform resource identifier mode. Uniform Resource Identifier (URI) is a string used to identify the name of a certain internet Resource, and its format: [ protocol name ]: /[ user name ] [ password ] @ [ server address ]: [ server port number ]/[ path ]? [ query string ] # [ fragment ID ]. And according to the picture URI address specified by the accessed metadata item, obtaining the picture file.
The associated data adapter is used for acquiring other metadata contents associated with the metadata contents according to the metadata contents corresponding to the connected metadata items.
The meaning of other metadata contents related to the metadata contents is that other related data is obtained through a configured SQL query script or an HTTP query interface according to one or more received metadata items. For example: and receiving a metadata item which represents the 'department code' and corresponds to the metadata content of '01254', and taking the queried department name 'human resource department' corresponding to '01254' as an output item through an associated data adapter.
In specific implementation, for the SQL query script, the query language used by the SQL query may be configured in advance, and then the associated data adapter executes the query language by using the metadata content as a query condition according to the input metadata content, thereby obtaining associated data. When a plurality of pieces of data are returned in the query result, only the first piece of data can be taken. Example (c): receiving a metadata item representing "department code", wherein the attribute name of the item is deptCode, the associated data "department name" needs to be acquired through an SQL query script, and the SQL query script can be set to "SELECT depth. And the value of the name column of the query result is the name of the department, and the value is used as an output item.
In particular, for the HTTP query interface, the interface may be configured to request the address URL, the request method may be GET or POST, and one or more attributes in the response message body are used as output items. When the request method is GET, the request parameters are written behind the request address URL, and the format is as follows: http:// [ service address ]: service port ]/[ path ]? Parameter name $ { element }. When the request method is POST, the request parameters may be written in the request address URL, may be written in the request message body, the request message body is in JSON format, and identifies which attributes are used as output items through the EL expression.
For example, when a corresponding one represents a "department code" metadata item, the attribute name of the item is deptCode, the request address URL: http://127.0.0.1:8080/deptinfo, the request method is POST, $ { deptCode } is used as the value of the request parameter deptCode, and the request message body is:
Figure BDA0002636762730000161
if the returned message body is the following message body, the expression $ { data. deptName } is used as an output item, and the meaning of the expression is that the value of the attribute deptName under the attribute data is obtained from the returned message body and is used as an output value.
Figure BDA0002636762730000162
The various adapters can be used for analyzing the metadata contents corresponding to different metadata items, and as can be seen from the description of the adapters, the adapters can be used for analyzing the input metadata contents into data with the same meaning but different expression forms according to the attributes of the metadata contents, that is, the metadata contents are presented in a diversified manner, so that the corresponding requirements of users are met.
In practice, for each data export, the data export tool may combine at least one adapter selected by the user at the current time into a preset adapter combination. The preset combination of adapters may be formed by connecting at least one of the adapters according to a corresponding connection relationship. In this way, the preset adapter combination includes at least one adapter, so that the metadata content can be parsed by using each adapter in the preset adapter combination.
In one embodiment, the parsing process of the metadata content is schematically illustrated by fig. 4 and 5. Fig. 4 shows a schematic diagram of a mapping relationship between different preset adapter combinations and a metadata item, and fig. 5 shows a flowchart of a step of analyzing a metadata content by a preset adapter combination. With reference to fig. 4 and fig. 5, a detailed process of how to parse the metadata content corresponding to the metadata item through the preset adapter combination corresponding to the metadata item is as follows:
in practice, after processing the data to be processed, a plurality of metadata items and metadata contents respectively corresponding to the plurality of metadata items may be obtained, and accordingly, a plurality of preset adapter combinations may also be included, so that each preset adapter combination may correspond to at least one metadata item in the plurality of metadata items, where different metadata items may correspond to different preset adapter combinations.
Referring to fig. 4, a diagram of correspondence between preset adapter combinations and metadata items in an embodiment is shown, as can be seen from fig. 4, a plurality of metadata items can be obtained through processing, one preset adapter combination may correspond to one or more metadata items, for example, preset adapter combination 3 may correspond to metadata item a and metadata item B, and preset adapter combination 2 may correspond to metadata item F and metadata item G and metadata item H.
In combination with the mapping diagram shown in fig. 4, in a specific implementation, a connection relationship between at least one adapter in the preset adapter combination may form an analysis path for analyzing the metadata content, for example, as indicated by an arrow in fig. 4, in practice, for the metadata content corresponding to each metadata item, each adapter provided on the analysis path may be used to analyze the metadata content according to the analysis path of the preset adapter combination corresponding to the metadata item.
Referring to fig. 5, fig. 5 is a flowchart illustrating a step of parsing metadata content by using a preset adapter combination in this embodiment, and specifically may include the following steps:
step S3021: and inputting the metadata content corresponding to the metadata item into one or more input adapters in a preset adapter combination corresponding to the metadata item, wherein the input adapters are adapters without an upstream adapter adjacent to the input adapters.
It is understood that references to adjacent in this embodiment refer to being connected.
In this embodiment, an adapter having no upstream adapter adjacent to the input adapter may be understood as an adapter at the initial end of the parsing path in the preset adapter combination, as shown in fig. 4, for the preset adapter combination 3, the input adapter is an adapter 3.1, and it is seen that the adapter 301 is an adapter at the initial point on the parsing path.
Fig. 4 only shows the case where the input adapter is a single adapter, but according to actual requirements, the case where the input adapter is a plurality of adapters is not excluded.
In this embodiment, for a single metadata item, the metadata content corresponding to the metadata item may be input to an input adapter in a preset adapter combination.
Step S3022: and performing content conversion on the data content input to the adapter through each adapter in the preset adapter combination corresponding to the metadata item according to a preset conversion rule built in the adapter, and taking the data content obtained after conversion as the input of a downstream adapter adjacent to the adapter under the condition that the downstream adapter adjacent to the adapter exists.
In this embodiment, for each adapter in the preset adapter combination, the data content input to the adapter may be the data content output by an upstream adjacent adapter in the parsing path. And the data content output by the adapter can be used as the input of the adapter adjacent to the downstream of the analysis path, and/or can be directly output as an output item. In this way, it can be understood that the parsing path formed by each adapter in the preset adapter combination may include a plurality of path branches, and each path branch outputs one output item. For example, as shown in fig. 4, there are three path branches, respectively: adapter 3.1-adapter 3.3, adapter 3.1-adapter 3.2, then three path branches output three output items respectively.
In practice, for one adapter in the preset adapter combination, which can convert the input data content into one or more output items, one or more output items may be all used as the input or all as the output of the next adapter, or some of the output items may be used as the input of the next adapter, and another part may be used as the output.
For example, as shown in fig. 4, for an adapter 3.2 in a preset adapter combination 3.1, the content input to the adapter 3.2 may be data content 3.1-1 output by the adapter 3.1, and then the adapter 3.2 may convert the data content 3.1-1 according to a preset conversion rule configured by itself, and further directly output the converted data 3.2-2, and input the converted data 3.2-1 to a downstream adapter 3.3.
The process of converting the input data content by each adapter according to the preset conversion rule has been described in detail in the introduction of each adapter, and the specific process may refer to the description of the adapter, which is not described herein again.
Step S3023: and determining the data content obtained by converting one or more output adapters in the preset adapter combination corresponding to the metadata item into analyzed data content and data item, wherein the output adapter is an adapter without a downstream adapter adjacent to the output adapter.
In this embodiment, the number of output adapters in the preset adapter combination may be multiple or one, and the output adapter, which is an adapter without a downstream adapter adjacent to the output adapter, may be understood as: the adapter at the output side in the parsing path of the predetermined adapter combination, more specifically, can be understood as an adapter at the output side of each path branch in the parsing path, such as adapter 3.3 and adapter 3.3, both at the output side of the path branch.
It can be understood that, since each adapter in the preset adapter combination can convert the input data content into one or more output items, and one or more output items can be all used as the input or all as the output of the next adapter, or some of the output items in the multiple output items can be used as the input of the next adapter and another part as the output, the output adapter in this embodiment can also be understood as: and the adapter can be used for directly outputting the converted data content in the preset adapter combination.
In specific implementation, the data content converted by the output adapter may be used as the data content output by the preset adapter combination. When the output adapter analyzes the input data content according to the built-in conversion rule, the data items may be obtained by analyzing the data items together, for example, when the identification number "51138219451217 ×", the identification number is analyzed as "12/17/1945", "sichuan", and the data items such as "date of birth", "region", etc. associated with the output data content may be output.
Taking the preset adapter combination 3 in fig. 4 as an example, the process of parsing the metadata content by the preset adapter combination is described as follows:
as shown in fig. 4, the preset adapter combination 3 includes an identification card adapter 3.1, a time adapter 3.2, and a dictionary adapter 3.3. Wherein, the output end of the ID card adapter 3.1 is respectively connected with the time adapter 3.2 and the dictionary adapter 3.3, and the output end of the time adapter 3.2 is connected with the dictionary adapter 3.3.
First, the metadata item a is an identification number and the metadata item B is a death identifier, both of which are used as input items for the adapter 3.1.
If the identity card adapter 3.1 checks that the item B is true, all output items of the item B are null. If the id card adaptor 3.1 checks that the item B is empty or not true, the metadata content "51138219451217 × corresponding to the metadata item a is split to generate output items 3.1-1 and 3.1-2, where the output items 3.1-1 are" 19451217 ", the output items 3.1-2 are" 1 ", 1 indicates" male ", and 2 indicates" female ".
Thereafter, the output items 3.1-1 "19451217" generate the output items 3.2-1 "65" (age) by the elapsed time adapter 3.2, while the elapsed time adapter 3.2 generates the output items 3.2-2 "1945 12/17" (date format). The output item 3.2-1 "65" is passed through the dictionary adapter 3.3 to generate the output item 3.3-1 "old" (age group). Output items 3.1-2 "1" (male) are passed through dictionary adapter 3.3 to generate output items 3.3-2 "male" (gender name).
Finally, in the preset adapter combination 3, the output item 3.2-2 "12/17 1945", the output item 3.3-1 "old", and the output item 3.3-2 "male" outputted by the time adapter 3.2 may be used as the final output data content, and the matched data items "date of birth", "age group", and "sex" may be outputted.
Therefore, through the adapter combination 3, the id number can be analyzed into three data contents representing different meanings, which are respectively: the data content of the birth date, the data content of the gender name and the data content of the age group are presented in a diversified way, so that the requirement of a user on the data format of the derived data is met.
It should be understood that the foregoing exemplary description is only an example, and does not represent a limitation on the types of adapters in the preset adapter combination of the present application, and in practice, the preset adapter combination may not be limited to the above three adapters, but may also be other types of adapters, for example, a picture adapter, where there is a picture adapter, the picture adapter may output storage address information of the acquired picture in the local, and then may read out the picture according to the storage address information and output the picture.
Next, a process of filling the parsed data content into a preset template in the embodiment of the present application will be described. In an embodiment, as shown in fig. 2, the preset templates may include two data file templates, one is a data file template for exporting the table data, and the other is a picture file template for exporting the picture, and for two different templates, mapping relationships between data contents obtained after parsing and corresponding items in the preset template may be determined first, and the data contents obtained after parsing are filled according to the mapping relationships, so as to complete exporting the data contents. Specifically, the method comprises the following steps:
and under the condition that the type of the preset template is a data file template, filling the analyzed data content into a list item corresponding to the analyzed data item to obtain a data file.
And under the condition that the type of the preset template is the picture file template, determining a plurality of corresponding output items according to a plurality of preset naming items included in the picture file template, and filling the analyzed data content into the corresponding output items to obtain a picture output file, wherein the name of one preset naming item corresponds to the name of one output item.
First, for a data file template, in this embodiment, a file type of the data file template may be an excel file type, and the preset template may include a plurality of list items, where the plurality of list items are locations for filling data contents. In particular, each list item may correspond to a column of data in the file template. The first row in each column of data may correspond to the data item parsed by the preset adapter combination, and the remaining rows in a column of data correspond to the data content of the data item. Then, the preset adapter combinations may be correspondingly filled with the data content and the data items output by the preset adapter combinations according to the corresponding manner.
Referring to fig. 6, a mapping relationship diagram of each list item in the data file template and the parsed data item is shown. In fig. 6, list items col [1] -col [9] are corresponding list items, and the position of [ content ] is the position where data content needs to be filled.
For example, as shown in fig. 7, a schematic diagram of each data content and data item output by the preset adapter combination 3 after being filled into the file template is shown, as shown in fig. 7, the first row of each column corresponds to one data item, for example, the first row of F columns corresponds to "birth date", the first row of G columns corresponds to "age group", and the first row of H columns corresponds to "gender"; the remaining rows of each column correspond to respective data content, e.g., column F, the second row corresponding to "12 month 17 day 1945," column G, the first row corresponding to "old" and column H, the first row corresponding to "male".
Secondly, for the picture file template, after the picture adapter acquires the picture file according to the corresponding metadata item, the acquired picture file can be named according to the picture file template and the data content output by the preset adapter combination, so that a picture output file is obtained.
Specifically, the picture file template may be understood as: and the naming template of the picture file to be exported, namely the picture file template is used for indicating the data content output by combining the preset adapters, and the data content is combined according to the requirement of the naming specification to serve as the name of the picture file to be exported. The output item can be understood as a data filling position in the picture file template.
In specific implementation, the picture file template may include a plurality of preset naming items, and the plurality of preset naming items have a sequential order. One preset naming item can correspond to one output item, one output item can correspond to one analyzed data item, and one analyzed data item corresponds to one corresponding analyzed data content, so that the analyzed data content can be filled into the corresponding output item, and the name of the picture can be obtained.
As shown in fig. 8, a mapping relationship diagram between each preset naming item in the picture file template and each parsed data item is shown, in fig. 8, Part _ 1-Part _8 are output items corresponding to the corresponding preset naming item, i.e. filling positions, and adjacent preset naming items may be separated by a separator, for example, by a separator "/". The output item 1.2-1 is the parsed data item.
Illustratively, as shown in fig. 9, a schematic diagram of the image file template filled with the data content and data items output by the preset adaptor combination 3 is shown, as shown in fig. 9, three naming items are included, which are "date of birth", "age group" and "gender", respectively, and then the name of the image of the outputted character avatar is "12.12.17.1945.
Therefore, in the embodiment of the application, the preset template may include a data file template and a picture file template, so that each data content analyzed by the preset adapter combination may be filled in the data file template to export a data file, such as an excel file, and each data content analyzed by the preset adapter combination may also be filled in the picture file template to export a picture file.
And when exporting the picture file, can carry on the automatic name to the picture file outputted, avoid the manual work to name the picture file outputted, thus has raised the efficiency of exporting the data.
Based on the same inventive concept, referring to fig. 10, a schematic structural diagram of a data processing apparatus according to an embodiment of the present application is shown, and as shown in fig. 10, the data processing apparatus may specifically include the following modules:
the processing module 1001 is configured to perform preliminary processing on data to be processed to obtain a metadata item and metadata content corresponding to the metadata item;
the analysis module 1002 is configured to analyze the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item;
the export module 1003 is configured to fill the analyzed data content into a preset template, and export the filled template to the specified storage space.
Optionally, the apparatus may further include the following modules:
the response module is used for responding to the detected data export request, analyzing the data export request and determining a storage path of a target data source to which the data to be processed belongs;
and the reading module is used for reading the data to be processed from the target data source according to the storage path of the target data source.
Optionally, the processing module 1001 may specifically include the following units:
the type determining unit is used for determining the type of a target data source to which the data to be processed belongs;
and the conversion unit is used for converting the data to be processed according to a conversion mode corresponding to the type of the target data source to obtain the metadata item and the metadata content corresponding to the metadata item.
Optionally, the preset adapter combination corresponding to the metadata item includes a plurality of connected adapters; the parsing module 1002 may specifically include the following units:
the input unit is used for inputting the metadata content corresponding to the metadata item into one or more input adapters in a preset adapter combination corresponding to the metadata item, and the input adapters are adapters without upstream adapters adjacent to the input adapters;
a conversion unit, configured to perform content conversion on data content input to each adapter in a preset adapter combination corresponding to the metadata item according to a preset conversion rule built in the adapter, and use the data content obtained after conversion as an input of a downstream adapter adjacent to the adapter when there is a downstream adapter adjacent to the adapter;
and the output unit is used for determining the data content obtained by converting one or more output adapters in the preset adapter combination corresponding to the metadata item into the analyzed data content and data item, and the output adapter is an adapter without a downstream adapter adjacent to the output adapter.
Optionally, the deriving module 1003 may specifically include the following units:
the first exporting unit is used for filling the analyzed data content into a list item corresponding to the analyzed data item to obtain a data file under the condition that the type of the preset template is a data file template;
and the second exporting unit is used for determining a plurality of corresponding output items according to a plurality of preset naming items included in the picture file template under the condition that the type of the preset template is the picture file template, and filling the analyzed data content into the corresponding output items to obtain a picture output file, wherein the name of one preset naming item corresponds to the name of one output item.
Optionally, the preset adapter combination comprises at least one of: the system comprises an identity card adapter, a mobile phone number adapter, a time adapter, a dictionary data adapter, a picture adapter and a related data adapter; wherein:
the input end of the identity card adapter is connected with at least two metadata items, one metadata item is a death identification item, the other metadata item is an identity card number item, the output end of the identity card adapter is connected with at least two output items, one output item is a birth date output item, and the other output item is a gender output item;
the input end of the mobile phone number adapter is connected with at least one metadata item including a mobile phone number item, the output end of the mobile phone number adapter is connected with at least two output items, wherein one output item is a home output item, and the other output item is a communication network output item to which the mobile phone number belongs;
the input end of the time adapter is connected with at least one type of metadata item, and the output end of the time adapter is connected with at least one type of data output item; the dictionary data adapter is used for editing the metadata content corresponding to the input metadata item according to a preset logic expression and/or a preset interception expression and outputting the edited metadata content;
the picture adapter is used for acquiring an original picture according to original picture storage address information corresponding to the connected metadata item, processing the original picture and outputting the storage address information of the processed picture;
the associated data adapter is used for acquiring other metadata contents associated with the metadata contents according to the metadata contents corresponding to the connected metadata items.
For the embodiment of the data processing device, since it is basically similar to the embodiment of the data processing method, the description is relatively simple, and for relevant points, reference may be made to part of the description of the embodiment of the data processing method.
An embodiment of the present invention further provides an electronic device, which may include: one or more processors; and one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform one or more data processing methods according to embodiments of the invention.
Embodiments of the present invention further provide a computer-readable storage medium, which stores a computer program to enable a processor to execute the data processing method according to the embodiments of the present invention.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. 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 terminal that comprises the element.
The data processing method, the data processing apparatus, the electronic device, and the storage medium according to the present invention are described in detail above, and a specific example is applied in the description to explain the principles and embodiments of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (9)

1. A method of data processing, the method comprising:
performing primary processing on data to be processed to obtain a metadata item and metadata content corresponding to the metadata item;
analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item;
and filling the analyzed data content into a preset template, and exporting the filled template to a designated storage space.
2. The method of claim 1, wherein prior to the preliminary processing of the data to be processed, the method further comprises:
responding to the detected data export request, analyzing the data export request, and determining a storage path of a target data source to which the data to be processed belongs;
and reading the data to be processed from the target data source according to the storage path of the target data source.
3. The method according to claim 1, wherein the preliminary processing is performed on the data to be processed to obtain a metadata item and metadata content corresponding to the metadata item, and the method comprises:
determining the type of a target data source to which the data to be processed belongs;
and converting the data to be processed according to a conversion mode corresponding to the type of the target data source to obtain the metadata item and the metadata content corresponding to the metadata item.
4. The method according to any one of claims 1 to 3, wherein the preset adapter combination corresponding to the metadata item comprises a plurality of connected adapters; analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item, wherein the analysis comprises the following steps:
inputting the metadata content corresponding to the metadata item into one or more input adapters in a preset adapter combination corresponding to the metadata item, wherein the input adapters are adapters without upstream adapters adjacent to the input adapters;
performing content conversion on data content input to each adapter in a preset adapter combination corresponding to the metadata item according to a preset conversion rule built in the adapter, and taking the data content obtained after conversion as the input of a downstream adapter adjacent to the adapter under the condition that the downstream adapter adjacent to the adapter exists;
and determining the data content obtained by converting one or more output adapters in the preset adapter combination corresponding to the metadata item into analyzed data content and data item, wherein the output adapter is an adapter without a downstream adapter adjacent to the output adapter.
5. The method according to any one of claims 1 to 3, wherein the populating the parsed data content into the preset templates includes:
under the condition that the type of the preset template is a data file template, filling the analyzed data content into a list item corresponding to the analyzed data item to obtain a data file; the data file template comprises at least one list item;
and/or determining a plurality of corresponding output items according to a plurality of preset naming items included in the picture file template under the condition that the type of the preset template is the picture file template, and filling the analyzed data content into the corresponding output items to obtain a picture output file, wherein the name of one preset naming item corresponds to the name of one output item.
6. The method according to any one of claims 1-5, wherein the adapters of the predetermined adapter set comprise at least one of: the system comprises an identity card adapter, a mobile phone number adapter, a time adapter, a dictionary data adapter, a picture adapter and a related data adapter;
the input end of the identity card adapter is connected with at least two metadata items, one metadata item is a death identification item, the other metadata item is an identity card number item, the output end of the identity card adapter is connected with at least two output items, one output item is a birth date output item, and the other output item is a gender output item;
the input end of the mobile phone number adapter is connected with at least one metadata item including a mobile phone number item, the output end of the mobile phone number adapter is connected with at least two output items, wherein one output item is a home output item, and the other output item is a communication network output item to which the mobile phone number belongs;
the input end of the time adapter is connected with at least one type of metadata item, and the output end of the time adapter is connected with at least one type of data output item;
the dictionary data adapter is used for editing the metadata content corresponding to the input metadata item according to a preset logic expression and/or a preset interception expression and outputting the edited metadata content;
the picture adapter is used for acquiring an original picture according to original picture storage address information corresponding to the connected metadata item, processing the original picture and outputting the storage address information of the processed picture;
the associated data adapter is used for acquiring other metadata contents associated with the metadata contents according to the metadata contents corresponding to the connected metadata items.
7. A data processing apparatus, characterized in that the apparatus comprises:
the processing module is used for carrying out primary processing on data to be processed to obtain a metadata item and metadata contents corresponding to the metadata item;
the analysis module is used for analyzing the metadata content corresponding to the metadata item through a preset adapter combination corresponding to the metadata item;
and the export module is used for filling the analyzed data content into a preset template and exporting the filled template to the designated storage space.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the data processing method according to any one of claims 1 to 6 when executed.
9. A computer-readable storage medium, characterized in that it stores a computer program causing a processor to execute the data processing method according to any one of claims 1-6.
CN202010827529.6A 2020-08-17 2020-08-17 Data processing method and device, electronic equipment and storage medium Pending CN112131289A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010827529.6A CN112131289A (en) 2020-08-17 2020-08-17 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010827529.6A CN112131289A (en) 2020-08-17 2020-08-17 Data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112131289A true CN112131289A (en) 2020-12-25

Family

ID=73851690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010827529.6A Pending CN112131289A (en) 2020-08-17 2020-08-17 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112131289A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114564919A (en) * 2022-02-17 2022-05-31 成都飞机工业(集团)有限责任公司 Unmanned aerial vehicle control file conversion method, device, equipment and storage medium
CN114880308A (en) * 2022-07-12 2022-08-09 山东中创软件商用中间件股份有限公司 Metadata processing method, device and medium based on big data
CN115168363A (en) * 2022-07-29 2022-10-11 北京远舢智能科技有限公司 Metadata processing method and device, electronic equipment and storage medium
CN115543584A (en) * 2022-11-25 2022-12-30 苏州魔视智能科技有限公司 Data processing method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110275861A (en) * 2019-06-25 2019-09-24 北京明略软件系统有限公司 Date storage method and device, storage medium, electronic device
CN111008211A (en) * 2019-12-06 2020-04-14 北京百分点信息科技有限公司 Visual interface creating method and device, readable storage medium and electronic equipment
CN106202452B (en) * 2016-07-15 2020-05-26 复旦大学 Unified data resource management system and method for big data platform
US20200201865A1 (en) * 2018-12-19 2020-06-25 Sap Se Unified metadata model translation framework

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202452B (en) * 2016-07-15 2020-05-26 复旦大学 Unified data resource management system and method for big data platform
US20200201865A1 (en) * 2018-12-19 2020-06-25 Sap Se Unified metadata model translation framework
CN110275861A (en) * 2019-06-25 2019-09-24 北京明略软件系统有限公司 Date storage method and device, storage medium, electronic device
CN111008211A (en) * 2019-12-06 2020-04-14 北京百分点信息科技有限公司 Visual interface creating method and device, readable storage medium and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114564919A (en) * 2022-02-17 2022-05-31 成都飞机工业(集团)有限责任公司 Unmanned aerial vehicle control file conversion method, device, equipment and storage medium
CN114880308A (en) * 2022-07-12 2022-08-09 山东中创软件商用中间件股份有限公司 Metadata processing method, device and medium based on big data
CN115168363A (en) * 2022-07-29 2022-10-11 北京远舢智能科技有限公司 Metadata processing method and device, electronic equipment and storage medium
CN115543584A (en) * 2022-11-25 2022-12-30 苏州魔视智能科技有限公司 Data processing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN112131289A (en) Data processing method and device, electronic equipment and storage medium
US20210081611A1 (en) Methods and systems for language-agnostic machine learning in natural language processing using feature extraction
CN109933752B (en) Method and device for exporting electronic document
CN117056471A (en) Knowledge base construction method and question-answer dialogue method and system based on generation type large language model
JP2005284334A (en) Web page update notification method and apparatus
CN110781183B (en) Processing method and device for incremental data in Hive database and computer equipment
US20100076937A1 (en) Feed processing
CN113626223A (en) Interface calling method and device
US20140280352A1 (en) Processing semi-structured data
WO2022134878A1 (en) Data processing method and apparatus, data querying method and apparatus, electronic device, and storage medium
US20180300424A1 (en) Systems and methods for providing structured markup content retrievable by a service that provides rich search results
CN112463261B (en) Interface calling method, device, electronic equipment, medium and product
JP6095487B2 (en) Question answering apparatus and question answering method
CN113568923A (en) Method and device for querying data in database, storage medium and electronic equipment
CN112905178A (en) Method, device, equipment and medium for generating business function page
CN109614592B (en) Text processing method and device, storage medium and electronic equipment
CN115065945B (en) Short message link generation method and device, electronic equipment and storage medium
CN113127776A (en) Breadcrumb path generation method and device and terminal equipment
CN108196921B (en) Document development method and device, computer equipment and storage medium
JP2007041983A (en) Application form creation program and application form creation apparatus
CN112149391B (en) Information processing method, information processing apparatus, terminal device, and storage medium
CN109739923A (en) A kind of method and system that data import
CN113485942B (en) Automatic testing method and device based on independent modules
CN115712411A (en) Method and device for generating user-defined serial number
CN114860946A (en) Method and device for generating map network

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