CN114090569A - Method, device, equipment and computer readable medium for processing data - Google Patents

Method, device, equipment and computer readable medium for processing data Download PDF

Info

Publication number
CN114090569A
CN114090569A CN202010961338.9A CN202010961338A CN114090569A CN 114090569 A CN114090569 A CN 114090569A CN 202010961338 A CN202010961338 A CN 202010961338A CN 114090569 A CN114090569 A CN 114090569A
Authority
CN
China
Prior art keywords
data
row
output
display column
column name
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
CN202010961338.9A
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 Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010961338.9A priority Critical patent/CN114090569A/en
Publication of CN114090569A publication Critical patent/CN114090569A/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/221Column-oriented storage; Management thereof
    • 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/248Presentation of query results
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The invention discloses a method, a device, equipment and a computer readable medium for processing data, and relates to the technical field of computers. One embodiment of the method comprises: traversing each row of data of the original data according to the sequence to obtain the display column name of each row of data; calling a preset component of each row of data aiming at each row of data, and determining an output result of each row of data in the display column name; and storing the output result of each row of data into a final result set, and outputting an output document of the original data based on the final result set. This embodiment enables multiplexing of existing processing logic, avoiding an increase in the amount of code.

Description

Method, device, equipment and computer readable medium for processing data
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer-readable medium for processing data.
Background
When exporting data, various processing is often required to be performed on original data, and special processing is required to be performed for different types of fields and business meanings thereof, such as: conversion of log format, etc. The above processes are implemented in the service code according to the actual situation.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: the existing processing logic cannot be multiplexed by the new service logic, resulting in an increase in the amount of code.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a computer-readable medium for processing data, which can reuse existing processing logic and avoid an increase in code amount.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of processing data, including:
traversing each row of data of the original data according to the sequence to obtain the display column name of each row of data;
calling a preset component of each row of data aiming at each row of data, and determining an output result of each row of data in the display column name;
and storing the output result of each row of data into a final result set, and outputting an output document of the original data based on the final result set.
Traversing each row of data of the original data in sequence to obtain the display column name of each row of data, comprising:
traversing each row of data in the original data MAP according to the sequence;
and acquiring the display column name of each row of data according to the keys in each row of data in the MAP.
The step of calling a preset component of each row of data and determining an output result of each row of data in the display column name aiming at each row of data comprises the following steps:
determining a preset component of each row of data according to the display column name of each row of data;
calling the preset component of each row of data in a plurality of preset components;
and reading the value of each row of data in the original data MAP by adopting the preset component of each row of data, and determining the output result of each row of data in the display column name.
Outputting, by the output document of the raw data based on the final result set, includes:
modifying the output result of the display column name of each row of data in the final result set according to the display column name of each row of data;
and outputting an output document of the original data based on the modified final result set.
Outputting, by the output document of the raw data based on the final result set, includes:
and outputting the output document of the original data according to the sequence based on the corresponding relation between the display column names in the final result set and the output results of each row of data.
The order is determined according to the scene where the original data is located, or preset.
The output document of the raw data includes an output table of the raw data.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for processing data, including:
the traversing module is used for traversing each row of data of the original data according to the sequence to obtain the display column name of each row of data;
the determining module is used for calling a preset component of each row of data aiming at each row of data and determining an output result of each row of data in the display column name;
and the output module is used for storing the output result of each row of data into a final result set and outputting the output document of the original data based on the final result set.
According to a third aspect of embodiments of the present invention, there is provided an electronic device for processing data, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method as described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method as described above.
One embodiment of the above invention has the following advantages or benefits: traversing each row of data of the original data according to the sequence to obtain the display column name of each row of data; calling a preset component of each row of data aiming at each row of data, and determining the output result of each row of data in the display column name; and storing the output result of each row of data into a final result set, and outputting an output document of the original data based on the final result set. Because the output result of the display column name is determined by the preset component and is suitable for different data, the existing processing logic can be multiplexed, and the increase of the code amount is avoided.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of processing data according to an embodiment of the invention;
FIG. 2 is a schematic flow chart of learning display column names for each row of data according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating a process for determining the output result of each row of data in the display column name according to an embodiment of the present invention;
FIG. 4 is a flow diagram illustrating a process for modifying output results for a column name displayed in a final result set, according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a main structure of an apparatus for processing data according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
When exporting data, various processes are required to be performed on the original data, such as: the conversion of log format, the combination of two fields into one field, hyperlink field, etc. are realized in service code according to practical situation. However, there are different implementations for different fields. Different fields are processed without consistent processing modes, and the existing processing logic cannot be reused by new service logic, so that the code amount is increased, the development efficiency is reduced, and the code maintenance cost is increased.
In order to solve the technical problem that the existing processing logic cannot be reused by new service logic, which results in an increase in the amount of code, the following technical scheme in the embodiment of the present invention may be adopted.
Referring to fig. 1, fig. 1 is a schematic diagram of a main flow of a method for processing data according to an embodiment of the present invention, where each row of data in original data is traversed to obtain a display column name of each row of data, a preset component of each row of data is called to determine an output result of the row of data, and an output document of the original data is output based on the display column name and the output result. As shown in fig. 1, the method specifically comprises the following steps:
s101, traversing each row of data of the original data according to the sequence to obtain the display column name of the row of data.
In embodiments of the present invention, a user may obtain raw data from a database or other data medium and need to output a document based on the raw data. Wherein the output document is a two-dimensional data document. As one example, the output document is an output table.
In the embodiment of the invention, the original data comprises a plurality of lines of data, and each line of data has a corresponding display column name and an output result. Where the raw data may be converted to lists and maps.
A List is a data structure in the Java language that represents an array that can store multiple data objects in sequence. Map is a data structure in Java language, and can store and read data objects in a key-value pair manner. Java is an object-oriented development language.
It will be appreciated that the raw data is stored in a List. Among them, the List includes MAP. One MAP includes each row of data.
For original data not stored in the List and MAP manners, the original data may be converted to be stored in the List and MAP manners in other manners.
As an example, for data in mysql, a third party spring-jdbc package JdbcTemplate-like queryForList method can be used to query data from mysql and directly obtain the original data stored in List and MAP form.
As another example, for data in an Elastic-search, then using the Elastic-search-rest-high-level-client can also convert the query result SearchHit into original data stored in List and MAP.
It will be appreciated that the original data includes a plurality of lines of data, the lines of data being arranged in a sequence. In the process of knowing the display column names, the sequence of traversing each row of data can be preset.
In embodiments of the present invention, it is contemplated that the fields in the output document of the raw data need to be arranged in a desired order. Such as: the fields with higher importance are arranged in the front; fields of lower importance are ranked later.
The sequence of traversing each row of data is determined according to the scene in which the original data is located, or is preset. As one example, the scene in which the raw data is located may include statistics of employee base information or display of inventory items.
As an example, if the user wishes to output a document in which the first column is the name and the second column is the age, the order of traversing each row of data may be determined by the fields described above.
Referring to fig. 2, fig. 2 is a schematic flowchart of a process of obtaining a display column name of each row of data according to an embodiment of the present invention, which specifically includes:
s201, traversing each row of data in the original data MAP according to the sequence.
In order to know the display column name of each row of data, each row of data in the original data MAP may be traversed in sequence. The MAP stores a plurality of lines of data in a key-value pair manner.
S202, according to keys in each row of data in the MAP, the display column name of each row of data is obtained.
The key in each row of data in the MAP is the display column name of the row of data, and the value in the row of data in the MAP is the parameter corresponding to the display list.
As an example, the MAP includes a key "name" in the row of data and a value "lie four" in the row of data, and then "name" is the display column name of the row of data and "lie four" is a parameter corresponding to "name".
In the embodiment of fig. 2, the display column name of each row of data can be known by the key of each row of data in the MAP.
As an example, a display column name of each line data is acquired.
Two MAPs are nested in the List, divided into a first MAP and a second MAP. The first MAP includes seven rows of data, respectively: put ("name", "lie four"), put ("age", "39"), put ("id", "2771999"), put ("region", "sunny zone"), put ("street", "wide channel 21 number"), put ("birthday", "1980-01-01"), and put ("score", list.
For seven rows of data in the first MAP, column names may be displayed as: a name; age; id; a region; street; carrying out birthday; score.
The second MAP includes seven rows of data, respectively: put ("name", "zhang san"), put ("age", "29"), put ("id", "2771999"), put ("region", "eastern district"), put ("street", "number 15 of anlins"), put ("birth", "1990-10-01"), and put ("score", list.
For seven rows of data in the second MAP, column names may be displayed as: a name; age; id; a region; street; carrying out birthday; score.
It can be seen that the display column names in the first MAP are the same as those in the second MAP.
And S102, calling a preset component of each row of data according to each row of data, and determining an output result of each row of data in the display column name.
For each row of data, there is a corresponding preset assembly. And the output result of each row of data in the display column name can be further determined by calling the preset component of each row of data.
Referring to fig. 3, fig. 3 is a schematic flowchart of determining an output result of each row of data in a display column name according to an embodiment of the present invention, which specifically includes the following steps:
s301, determining a preset component of each row of data according to the display column name of each row of data.
In the embodiment of the present invention, processing for each line of data may be implemented by calling a preset component. Specifically, the preset component of each row of data may be determined according to the display column name of each row of data. That is, the preset component can be determined according to the display column name.
The preset components used in the embodiments of the present invention are exemplarily described below. It should be noted that the functions of the preset components and the kinds of the preset components may be preset. The output document of the raw data may be an excel document.
In the embodiment of the invention, a Field is preset, and the Field is an abstraction of the excel cell, and a calculation method of the Field can be used for calculating and obtaining a calculation result.
The interface of Field custom logic export Field and the method for defining all the extended custom fields to be realized specifically include:
getName (), excel column name shown in this field.
getvalue (map) receives the current line data and returns the processed data.
And (4) generating a callback method when the excel is generated by using handleCell (Map, Cell), wherein the Map is the current line data, and the Cell is a Cell to be written into the excel.
isNumber (String str) judges whether the parameter value is a number.
In addition to the above defined abstraction method, Field also presets several common functions for external use:
FUNC _ MILLS _ TO _ DAY _ SCALE _2 millisecond time stamp turn DAY, two bit precision.
FUNC _ MILLS _ TO _ DAY _ SCALE _1 millisecond timestamp turns TO DAY, one bit precision.
FUNC _ MILLS _ TO _ DATE millisecond time stamp is converted TO a log string in yyyy-MM-dd format.
FUNC _ MILLS _ TO _ DATE _ TIME millisecond TIME stamp transfer yyyy-MM-dd HH MM ss format log string.
In addition, a BaseField is set, and the Field abstract class is inherited, so that a part of methods are realized. Exemplarily, BaseField includes the following 11. Among other things, in embodiments of the present invention, components include fields and basefields.
(1)SingleKeyField
Simple fields, support the following three ways to handle raw values:
the first method is as follows: returning directly to original value (default)
The second method comprises the following steps: and converting the current value through an external Function < T, R >, wherein the original value type is T, the returned result type is R, and the Function can use the Function preset in the Field and can also define and expand by itself.
The third method comprises the following steps: if the current original value is of the List type, the first element value is converted in the same manner as described in the second mode.
(2)TimeSpanField
And a time interval calculation field which can specify two dates beginndate and endDate, and calculates and outputs a time interval of the two dates according to the specified time unit (second, minute, hour, etc.).
(3)TimeExcludingHolidaysField
Similar to TimeSpanField, except that holidays are eliminated, only weekdays are calculated.
(4)KeyValuePickerField
And the key value pair selector field specifies two fields key, k1 and k2 of the current data line in the Map and injects a BiPredicate function, and returns v1 and v2 values when v1 and v2 corresponding to k1 and k2 meet the BiPredicate condition.
(5)SelectorField
And the multi-value selector circularly acquires the value of the key and returns the first value meeting Predicate under the condition of specifying a plurality of keys.
(6)TemplateHyperLinkField
And the hyperlink field specifies a hyperlink template and a dynamic parameter params, and replaces variables of the hyperlink template according to the value of the dynamic parameter params in the current data line to generate a final hyperlink cell in excel.
(7)ListJoinerField
And the List type data splicing field specifies a key with a type of List, returns a plurality of values v1 … vn, and returns after being connected by an externally specified separator.
(8)DualListJoinerField
And a double list type data splicing field, wherein two keys with types of list are specified. k1, k2 return k1, v1 and v2 corresponding to k2, and the values of v1 and v2 are spliced and returned in an externally specified splicing manner Bifunction.
(9)ListMaxValueField
Specifying list type data, the data types being necessarily comparable, selecting the maximum value to return
(10)ListMinValueField
Specifying list type data, the data types must be comparable, and choosing the minimum value to return.
(11)ListSumValueField:
Specifying list type data, wherein the data type is the type of the necessary numerical value, calculating the sum of the numerical values and returning.
In an embodiment of the present invention, the above-described components may be employed to determine the output result in the display column name.
S302, calling preset components of each row of data in the plurality of preset components.
After determining the preset component of the line of data, the preset component of the line of data may be invoked among a plurality of preset components. As one example, upon determining that the preset component of the row of data is a SingleKeyField, the SingleKeyField may be invoked from a plurality of preset components.
S303, reading the value in each row of data in the MAP by adopting the preset component of each row of data, and determining the output result of each row of data in the display column name.
The purpose of invoking the preset component is to compute the output result in the display column name based on the values in each row of data in the MAP.
Following the above example, the first row of data in the first MAP is: put ("name", "Liquad"), based on the display column name ", determines the component to be a SingleKeyField. Calling SingleKeyField from a plurality of preset components, reading the value 'lie four' in the line of data, and determining that the output result of the line of data in 'name' is: and 4, plum four.
In the embodiment of fig. 3, the output result of each row of data in the display column name is further determined by the preset component of the row of data.
As an example, an output result of each line of data is obtained. Continuing with the example above, where two MAPs are nested in the List, divided into a first MAP and a second MAP. The seven line data included in the first MAP is the same as above, and the seven line data included in the second MAP is the same as above.
For the first row of data, such as: put ("name", "Liquad"), using a preset component SingleKeyField, directly reads the value with key as name and outputs it onto the column with excel name ".
For the second row of data, such as: put ("age", "39"), using a preset component SingleKeyField, directly reads the value of key age and outputs it onto the column with excel name "age".
For the fourth line data and the fifth line data, for example: put ("region", "sunny area"), put ("street", "wide channel 21"), adopt preset assembly dualdisingjoinfield, read key as the value of region and street, output to the column named "address" of excel through direct splicing.
For the seventh row of data, for example: put ("score", List. newarraylist (68,99,86)), using a preset component List maxvalluefield, read a data List whose key is score, pick the maximum value, and output to the column with excel name "highest score".
For the seventh row of data, for example: put ("score", List. newArrayList (68,99,86)), using the preset component ListMinValueField, read the data List with key as score, pick the minimum value, and output to the column with excel name "lowest score
For the third row of data, such as: put ("id", "2771999"), using the preset component template HyperLinkField, reads the value with key as id, and uses the template as the final link, and outputs it in hyperlink format onto the column with excel name as "link field".
S103, storing the output result of each row of data into a final result set, and outputting an output document of the original data based on the final result set.
The output results for each row of data may be stored in a final result set. And storing the final result set in the memory. And then, the final result set is persisted in a hard disk, and an output document of the original data is output based on the final result set.
In one embodiment of the present invention, the output document of the original data may be output in the order of traversing each line of data of the original data. Specifically, the output document of the original data is output in the above order based on the correspondence relationship between the display column name in the final result set and the output result of each line of data.
Referring to table 1, table 1 is an output document continuing the above example, in which two MAPs are nested in a List, divided into a first MAP and a second MAP. The seven line data included in the first MAP is the same as above, and the seven line data included in the second MAP is the same as above.
TABLE 1
Name (I) Age (age) Address Highest score Lowest score Linking fields
Li Si 39 Wide canal in open ward area No. 21 99 68 2771999
Zhang San 29 Dongchuan Anlenlin No. 15 100 58 2771999
From table 1, it can be known that the sequence of each row of data traversing the original data is: first line, second line, fourth line, fifth line, seventh line and third line, then the display column names in the output document are in the order: name, age, address, highest score, lowest score, and link fields.
In one embodiment of the invention, some output results in the final result set need to be modified, such as: and modifying the text format of the output result. Can be implemented by calling a component.
Referring to fig. 4, fig. 4 is a schematic flow chart of an output result of modifying a final result set and displaying column names according to an embodiment of the present invention, which specifically includes:
s401, according to the display column name of each row of data, output results of the display column names of each row of data in the final result set are modified.
And determining the output result to be modified in the final result set according to the display column name of each data. As an example, for an output result showing a column name as a link field, the font needs to be modified to number 4.
And modifying the output result of the display column name of the row of data in the final result set according to a preset modification requirement.
S402, outputting an output document of the original data based on the modified final result set.
And according to the modified final result set, outputting an output document of the original data after the hard disk is durably.
In the embodiment of fig. 4, by modifying the output result of displaying the column names, it is possible to output an output document that meets the requirements.
In the above embodiment, each row of data of the original data is traversed in sequence to obtain the display column name of each row of data; calling a preset component of each row of data aiming at each row of data, and determining the output result of each row of data in the display column name; and storing the output result of each row of data into a final result set, and outputting an output document of the original data based on the final result set. Because the output result of the display column name is determined by the preset component and is suitable for different data, the existing processing logic can be multiplexed, and the increase of the code amount is avoided.
Referring to fig. 5, fig. 5 is a schematic diagram of a main structure of an apparatus for processing data according to an embodiment of the present invention, where the apparatus for processing data may implement a method for processing data, and as shown in fig. 5, the apparatus for processing data specifically includes:
and the traversing module 501 is configured to traverse each row of data of the original data in sequence to obtain a display column name of each row of data.
A determining module 502, configured to call a preset component of each row of data for each row of data, and determine an output result of each row of data in the display column name.
An output module 503, configured to store the output result of each row of data in a final result set, and output an output document of the original data based on the final result set.
In an embodiment of the present invention, the traversal module 501 is specifically configured to traverse each row of data in the original data MAP in sequence;
and acquiring the display column name of each row of data according to the keys in each row of data in the MAP.
In an embodiment of the present invention, the determining module 502 is specifically configured to determine the preset component of each row of data according to the display column name of each row of data;
calling the preset component of each row of data in a plurality of preset components;
and reading the value of each row of data in the original data MAP by adopting the preset component of each row of data, and determining the output result of each row of data in the display column name.
In an embodiment of the present invention, the output module 503 is specifically configured to modify, according to the display column name of each row of data, the output result of the display column name of each row of data in the final result set;
and outputting an output document of the original data based on the modified final result set.
In an embodiment of the present invention, the output module 503 is specifically configured to output the output document of the original data according to the sequence based on a corresponding relationship between the display column name in the final result set and the output result of each row of data.
In an embodiment of the present invention, the order is determined according to a scene in which the original data is located, or is preset.
In one embodiment of the invention, the output document of the raw data comprises an output table of the raw data.
Fig. 6 illustrates an exemplary system architecture 600 of a method of processing data or an apparatus for processing data to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for processing data provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the apparatus for processing data is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a transmitting unit, an obtaining unit, a determining unit, and a first processing unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the sending unit may also be described as a "unit sending a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
traversing each row of data of the original data according to the sequence to obtain the display column name of each row of data;
calling a preset component of each row of data aiming at each row of data, and determining an output result of each row of data in the display column name;
and storing the output result of each row of data into a final result set, and outputting an output document of the original data based on the final result set.
According to the technical scheme of the embodiment of the invention, each row of data of the original data is traversed according to the sequence to obtain the display column name of each row of data; calling a preset component of each row of data aiming at each row of data, and determining the output result of each row of data in the display column name; and storing the output result of each row of data into a final result set, and outputting an output document of the original data based on the final result set. Because the output result of the display column name is determined by the preset component and is suitable for different data, the existing processing logic can be multiplexed, and the increase of the code amount is avoided.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of processing data, comprising:
traversing each row of data of the original data according to the sequence to obtain the display column name of each row of data;
calling a preset component of each row of data aiming at each row of data, and determining an output result of each row of data in the display column name;
and storing the output result of each row of data into a final result set, and outputting an output document of the original data based on the final result set.
2. The method of processing data according to claim 1, wherein said traversing each row of data of the original data in order to learn a display column name of said each row of data comprises:
traversing each row of data in the original data MAP according to the sequence;
and acquiring the display column name of each row of data according to the keys in each row of data in the MAP.
3. The method for processing data according to claim 1, wherein the calling a preset component of each row of data for each row of data to determine an output result of each row of data in the display column name comprises:
determining a preset component of each row of data according to the display column name of each row of data;
calling the preset component of each row of data in a plurality of preset components;
and reading the value of each row of data in the original data MAP by adopting the preset component of each row of data, and determining the output result of each row of data in the display column name.
4. The method of processing data according to claim 1, wherein said outputting an output document of said raw data based on said final result set comprises:
modifying the output result of the display column name of each row of data in the final result set according to the display column name of each row of data;
and outputting an output document of the original data based on the modified final result set.
5. The method of processing data according to claim 1, wherein said outputting an output document of said raw data based on said final result set comprises:
and outputting the output document of the original data according to the sequence based on the corresponding relation between the display column names in the final result set and the output results of each row of data.
6. A method of processing data according to claim 1 or 5, wherein the order is determined or preset according to the scene in which the original data is located.
7. The method of processing data according to claim 1, wherein the output document of the raw data comprises an output table of the raw data.
8. An apparatus for processing data, comprising:
the traversing module is used for traversing each row of data of the original data according to the sequence to obtain the display column name of each row of data;
the determining module is used for calling a preset component of each row of data aiming at each row of data and determining an output result of each row of data in the display column name;
and the output module is used for storing the output result of each row of data into a final result set and outputting the output document of the original data based on the final result set.
9. An electronic device for processing data, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202010961338.9A 2020-09-14 2020-09-14 Method, device, equipment and computer readable medium for processing data Pending CN114090569A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010961338.9A CN114090569A (en) 2020-09-14 2020-09-14 Method, device, equipment and computer readable medium for processing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010961338.9A CN114090569A (en) 2020-09-14 2020-09-14 Method, device, equipment and computer readable medium for processing data

Publications (1)

Publication Number Publication Date
CN114090569A true CN114090569A (en) 2022-02-25

Family

ID=80295822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010961338.9A Pending CN114090569A (en) 2020-09-14 2020-09-14 Method, device, equipment and computer readable medium for processing data

Country Status (1)

Country Link
CN (1) CN114090569A (en)

Similar Documents

Publication Publication Date Title
CN111447257B (en) Message conversion method and device
CN107491382B (en) Log output method and device
CN110706093A (en) Accounting processing method and device
CN110858202A (en) Method and device for generating where clause in database query statement
CN110795147A (en) Interface protocol file management method and device
CN113626223A (en) Interface calling method and device
CN113076153A (en) Interface calling method and device
CN111427899A (en) Method, device, equipment and computer readable medium for storing file
CN112818026A (en) Data integration method and device
CN113190517B (en) Data integration method and device, electronic equipment and computer readable medium
CN110888869A (en) Data processing method and device
CN110764769B (en) Method and device for processing user request
CN110705271B (en) System and method for providing natural language processing service
CN114090569A (en) Method, device, equipment and computer readable medium for processing data
CN115858905A (en) Data processing method and device, electronic equipment and storage medium
CN114003659A (en) Data synchronization method, data synchronization device, electronic equipment, storage medium and program product
CN113505131A (en) Method and device for adjusting data sorting
CN112559646A (en) Report downloading method and device
CN111831179A (en) Signing method, device and computer readable medium
CN112825107B (en) Method and device for generating chart
CN112988857A (en) Service data processing method and device
CN112671877B (en) Data processing method and device
CN113742334A (en) Data processing method and device
CN113282688A (en) Method, device, equipment and computer readable medium for displaying data
CN117609226A (en) Information stream data storage method and device, electronic equipment and readable medium

Legal Events

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