Method, device, apparatus and computer-readable medium for processing data

By traversing and calling preset components to determine the output results of the data display column name, the problem that the processing logic cannot be reused in the existing technology is solved, and the amount of code is reduced and the development efficiency is improved.

CN114090569BActive Publication Date: 2025-10-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010961338.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-14
Publication Date
2025-10-21
Estimated Expiration
2040-09-14

AI Technical Summary

Technical Problem

In the existing technology, processing logic cannot be reused by new business logic, which leads to an increase in the amount of code, reduced development efficiency and increased code maintenance costs.

Method used

By traversing each row of the original data in order, the display column name is obtained, and the preset component of each row of data is called to determine the output result, the result is stored in the final result set, and the document is output.

Benefits of technology

It enables the reuse of existing processing logic, avoids the increase of code volume, improves development efficiency and reduces code maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114090569B_ABST
    Figure CN114090569B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and equipment for processing data and a computer readable medium, and relates to the technical field of computers. A specific embodiment of the method comprises the following steps: sequentially traversing each row of data of original data to obtain display column names of the each row of data; for the each row of data, calling a preset component of the each row of data to determine an output result of the each row of data in the display column names; storing the output result of the 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 embodiment can reuse existing processing logic, and avoid an increase in code quantity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, apparatus, device and computer-readable medium for processing data. Background Art

[0002] When exporting data, it's often necessary to perform various processing on the original data. Different field types and their business implications require special processing, such as log format conversion. These processes are implemented in the business code based on the actual situation.

[0003] During the process of implementing the present invention, the inventors discovered that there are at least the following problems in the prior art: the existing processing logic cannot be reused by the new business logic, resulting in an increase in the amount of code. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, apparatus, device, and computer-readable medium for processing data, which can reuse existing processing logic and avoid an increase in the amount of code.

[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for processing data is provided, comprising:

[0006] Traverse each row of original data in order to obtain the display column name of each row of data;

[0007] For each row of data, calling a preset component of each row of data to determine an output result of each row of data in the display column name;

[0008] The output result of each row of data is stored in a final result set, and based on the final result set, an output document of the original data is output.

[0009] The step of sequentially traversing each row of the original data to obtain the display column name of each row of the data includes:

[0010] Traverse each row of data in the original data MAP in order;

[0011] According to the key in each row of data in the MAP, the display column name of each row of data is obtained.

[0012] The step of calling a preset component of each row of data to determine an output result of each row of data in the display column name includes:

[0013] Determining the preset component of each row of data according to the display column name of each row of data;

[0014] Calling the preset component for each row of data in multiple preset components;

[0015] The preset component of each row of data is used to read the value of each row of data in the original data MAP, and determine the output result of each row of data in the display column name.

[0016] Outputting the output document of the original data based on the final result set includes:

[0017] Modify 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;

[0018] Based on the modified final result set, an output document of the original data is output.

[0019] Outputting the output document of the original data based on the final result set includes:

[0020] Based on the correspondence between the display column names in the final result set and the output results of each row of data, the output document of the original data is output in the order.

[0021] The order is determined according to the scene in which the original data is located, or is preset.

[0022] The output document of the original data includes an output table of the original data.

[0023] According to a second aspect of an embodiment of the present invention, there is provided a device for processing data, including:

[0024] A traversal module is used to traverse each row of original data in order to obtain the display column name of each row of data;

[0025] a determination module, configured to call, for each row of data, a preset component of the data in each row, and determine an output result of the data in each row in the display column name;

[0026] The output module is used to store the output result of each row of data into a final result set, and output an output document of the original data based on the final result set.

[0027] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for processing data, including:

[0028] one or more processors;

[0029] a storage device for storing one or more programs,

[0030] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-described method.

[0031] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0032] One embodiment of the above invention has the following advantages or beneficial effects: sequentially traversing each row of original data to determine the display column name of each row of data; for each row of data, calling a preset component for each row of data to determine the output result of each row of data in the display column name; storing the output result of each row of data in 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 applicable to different data, existing processing logic can be reused, avoiding an increase in code size.

[0033] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.

[0035] Figure 1 is a schematic diagram of the main flow of a method for processing data according to an embodiment of the present invention;

[0036] Figure 2 1 is a schematic diagram of a process for obtaining the display column name of each row of data according to an embodiment of the present invention;

[0037] Figure 3 is a schematic diagram of 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;

[0038] Figure 4 1 is a flow chart of modifying the output result of the column names displayed in the final result set according to an embodiment of the present invention;

[0039] Figure 5 is a schematic diagram of the main structure of an apparatus for processing data according to an embodiment of the present invention;

[0040] Figure 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;

[0041] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0043] When exporting data, various processing operations are required on the original data, such as converting to a log format, merging two fields into a single field, and creating hyperlinks. These operations must be implemented in the business code based on the actual situation. However, different fields require different implementations. This lack of consistent processing methods prevents existing processing logic from being reused in new business logic, increasing code size, reducing development efficiency, and increasing code maintenance costs.

[0044] In order to solve the technical problem that the existing processing logic cannot be reused by the new business logic, resulting in an increase in the amount of code, the following technical solution in the embodiment of the present invention can be adopted.

[0045] See also Figure 1 , Figure 1 This is a schematic diagram of the main process of the method for processing data according to an embodiment of the present invention, which traverses each row of data in the original data to obtain the display column name of each row of data, calls the preset component of each row of data to determine the output result of the row of data, and then outputs the output document of the original data based on the display column name and output result. Figure 1 As shown, the specific steps include:

[0046] S101 , traverse each row of original data in order to obtain the display column name of the row of data.

[0047] In an embodiment 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. The output document is a two-dimensional data document. As an example, the output document is an output table.

[0048] In the embodiment of the present invention, the original data includes multiple rows of data, each row of data has a corresponding display column name and output result. The original data can be converted into List and Map.

[0049] List is a data structure in the Java language that represents an array and can store multiple data objects in sequence. Map is a data structure in the Java language that can store and retrieve data objects as key-value pairs. Java is an object-oriented development language.

[0050] It is understandable that the original data is stored in a List format, wherein the List includes a MAP. A MAP includes each row of data.

[0051] For original data that is not stored in List or MAP format, it can be converted to be stored in List or MAP format through other means.

[0052] As an example, for data in MySQL, you can use the queryForList method of the JdbcTemplate class in the third-party spring-jdbc package to query data from MySQL and directly obtain the original data stored in List and MAP formats.

[0053] As another example, for data in Elastic-search, you can use elasticsearch-rest-high-level-client to convert the query result SearchHit into raw data stored in List and MAP formats.

[0054] It is understandable that the original data includes multiple rows of data, which are arranged in a certain order. In the process of obtaining the display column name, the order of traversing each row of data can be preset.

[0055] In the embodiment of the present invention, it is considered that the fields in the output document of the original data need to be arranged in a desired order, for example, fields with higher importance are arranged in front, and fields with lower importance are arranged in the back.

[0056] The order of traversing each row of data is determined or preset according to the scenario in which the original data is located. As an example, the scenario in which the original data is located may include counting basic employee information or displaying inventory items.

[0057] As an example, if the user wants the first column in the output document to be name and the second column to be age, the order of traversing each row of data can be determined according to the above fields.

[0058] See also Figure 2 , Figure 2 The flowchart of obtaining the display column name of each row of data according to an embodiment of the present invention specifically includes:

[0059] S201 , traverse each row of data in the original data MAP in order.

[0060] To get the display column name of each row of data, you can traverse each row of data in the original data MAP in order. MAP stores multiple rows of data in the form of key-value pairs.

[0061] S202: Obtain the display column name of each row of data according to the key in each row of data in the MAP.

[0062] The key in each row of data in MAP is the display column name of the row of data, and the value in the row of data in MAP is the parameter corresponding to the display list.

[0063] As an example, the MAP includes the key "name" in the row of data and the value "Li Si" in the row of data. Then, "name" is the display column name of the row of data, and "Li Si" is the parameter corresponding to "name".

[0064] exist Figure 2 In the embodiment, the display column name of each row of data can be obtained through the key of each row of data in the MAP.

[0065] The following example illustrates how to obtain the display column name for each row of data.

[0066] Two MAPs are nested in List, divided into the first MAP and the second MAP. The first MAP includes seven rows of data: put("name","Li Si"), put("age","39"), put("id","2771999"), put("region","Chaoyang District"), put("street","No. 21 Guangqu Road"), put("birth","1980-01-01"), and put("score", List.newArrayList(68,99,86)).

[0067] For the seven rows of data in the first MAP, the displayed column names are: name; age; id; region; street; birth; score.

[0068] The second MAP includes seven rows of data, namely: put("name","Zhang San"), put("age","29"), put("id","2771999"), put("region","Dongcheng District"), put("street","No. 15, Anlelin Road"), put("birth","1990-10-01") and put("score", List.newArrayList(100,77,58)).

[0069] For the seven rows of data in the second MAP, the displayed column names are: name; age; id; region; street; birth; score.

[0070] It can be seen that the display column names in the first MAP are the same as the display column names in the second MAP.

[0071] S102: For each row of data, call the preset component of each row of data to determine the output result of each row of data in the display column name.

[0072] For each row of data, there is a corresponding preset component. By calling the preset component of each row of data, the output result of each row of data in the display column name can be determined.

[0073] See also Figure 3 , Figure 3 1 is a flow chart of determining the output result of each row of data in the display column name according to an embodiment of the present invention, which specifically includes the following steps:

[0074] S301. Determine the preset component for each row of data according to the display column name of each row of data.

[0075] In the embodiment of the present invention, the processing of each row of data can be achieved by calling a preset component. Specifically, the preset component of each row of data can be determined based on the display column name of each row of data. In other words, the preset component can be determined based on the display column name.

[0076] The following is an exemplary description of the preset components used in the embodiments of the present invention. It should be noted that the functions and types of the preset components can be pre-set. The output document of the original data can be an Excel document.

[0077] In the embodiment of the present invention, a Field is preset. Field is an abstraction of an Excel cell, and its calculation method can be called to calculate and obtain the calculation result.

[0078] Field custom logic exports the field interface and defines the methods that all extended custom fields must implement, including:

[0079] getName(): The Excel column name displayed in this field.

[0080] getValue(Map map): Receives the current row data and returns the processed data.

[0081] handleCell(Map map, Cell cell): callback method when generating Excel, map is the current row data, cell is the cell to be written to Excel.

[0082] isNumber(String str): Determines whether the parameter value is a number.

[0083] In addition to the abstract methods defined above, Field also presets several public functions for external use:

[0084] FUNC_MILLS_TO_DAY_SCALE_2: Convert millisecond timestamp to day, two digits of precision.

[0085] FUNC_MILLS_TO_DAY_SCALE_1: Convert millisecond timestamp to day, one digit of precision.

[0086] FUNC_MILLS_TO_DATE: Converts millisecond timestamp to a log string in yyyy-MM-dd format.

[0087] FUNC_MILLS_TO_DATE_TIME: Converts millisecond timestamp to a log string in the format of yyyy-MM-dd HH:mm:ss.

[0088] In addition, a BaseField is set to inherit the Field abstract class and implement some methods. For example, BaseField includes the following 11 types. Among them, in this embodiment of the present invention, the components include Field and BaseField.

[0089] (1)SingleKeyField

[0090] Simple fields support the following three ways to process raw values:

[0091] Method 1: Return the original value directly (default)

[0092] Method 2: Through external Function<T,R> To convert the current value, the original value type is T, and the return result type is R. Function can use the preset Function in Field or define its own extension.

[0093] Method 3: If the current original value is of List type, the first element value is converted in the same way as described in Method 2.

[0094] (2)TimeSpanField

[0095] The time interval calculation field can specify two dates, beginDate and endDate, and calculate the time interval between the two dates and output it based on the specified time unit (seconds, minutes, hours, etc.).

[0096] (3)TimeExcludingHolidaysField

[0097] Similar to TimeSpanField, except that holidays are excluded and only weekdays are counted.

[0098] (4)KeyValuePickerField

[0099] The key-value pair selector field specifies the two fields key, k1 and k2, of the current data row in the Map and injects a BiPredicate function. When v1 and v2 corresponding to k1 and k2 meet the BiPredicate condition, the values ​​of v1 and v2 are returned.

[0100] (5)SelectorField

[0101] A multi-value selector, when multiple keys are specified, loops through the keys to get their values ​​and returns the first value that satisfies the Predicate.

[0102] (6)TemplateHyperLinkField

[0103] Hyperlink field, specify the hyperlink template and dynamic parameter params, replace the variables of the hyperlink template according to the value of the dynamic parameter params in the current data row, and generate the final hyperlink cell in Excel.

[0104] (7)ListJoinerField

[0105] List type data splicing field, specifies the key type as list, returns multiple values ​​v1...vn, concatenated with an externally specified delimiter.

[0106] (8)DualListJoinerField

[0107] A double list type data concatenation field specifies two list type keys. k1 and k2 return the corresponding v1 and v2 of k1 and k2, concatenating the values ​​of v1 and v2 using an externally specified concatenation method, BiFunction, and returning the result.

[0108] (9)ListMaxValueField

[0109] Specify list type data, the data type must be comparable, select the maximum value and return

[0110] (10)ListMinValueField

[0111] Specifies list type data, the data type must be comparable, and the minimum value is selected and returned.

[0112] (11)ListSumValueField:

[0113] Specify list type data, which must be a numeric type, and calculate and return the sum of the values.

[0114] In an embodiment of the present invention, the above components may be used to determine the output results in the display column names.

[0115] S302: Call a preset component for each row of data from a plurality of preset components.

[0116] After determining the preset component of the row of data, the preset component of the row of data can be called from multiple preset components. As an example, after determining that the preset component of the row of data is SingleKeyField, SingleKeyField can be called from multiple preset components.

[0117] S303: Using the preset component of each row of data, read the value of each row of data in the MAP, and determine the output result of each row of data in the display column name.

[0118] The purpose of calling the preset component is to calculate the output result in the display column name based on the value in each row of data in MAP.

[0119] Continuing with the above example, the first row of data in the first MAP is put("name", "Li Si"). Based on the displayed column name "name", the component is determined to be a SingleKeyField. SingleKeyField is called from multiple preset components to read the value "Li Si" in the row of data. The output result for the "name" column in the row of data is determined to be: Li Si.

[0120] exist Figure 3 In the embodiment, the output result of each row of data in the display column name is determined by the preset component of the row of data.

[0121] The following example illustrates how to obtain the output results for each row of data. Continuing with the previous example, two MAPs are nested within the List, forming the first MAP and the second MAP. The first MAP contains the same seven rows of data as above, and the second MAP contains the same seven rows of data as above.

[0122] For the first row of data, such as put("name", "Li Si"), the preset component SingleKeyField is used to directly read the value of the key name and output it to the Excel column named "Name".

[0123] For the second row of data, such as put("age", "39"), the preset component SingleKeyField is used to directly read the value of the key age and output it to the Excel column named "Age".

[0124] For the fourth and fifth rows of data, such as put("region", "Chaoyang District") and put("street", "No. 21 Guangqu Road"), the preset component DualListJoinerField is used to read the values ​​of the keys region and street, and directly splice them and output them to the Excel column named "Address".

[0125] For the seventh row of data, such as put("score", List.newArrayList(68,99,86)), the preset component ListMaxValueField is used to read the data List with the key score, select the maximum value, and output it to the Excel column named "Highest Score".

[0126] For the seventh row of data, such as put("score", List.newArrayList(68,99,86)), use the preset component ListMinValueField to read the data list with the key score, select the minimum value, and output it to the Excel column named "Minimum Score".

[0127] For the third row of data, such as put("id","2771999"), the preset component TemplateHyperLinkField is used to read the value with the key id, and use the template to create the final link, which is output in the hyperlink format to the Excel column named "Link Field".

[0128] S103: Store the output result of each row of data into a final result set, and output an output document of the original data based on the final result set.

[0129] The output results of each row of data can be stored in a final result set. The final result set is stored in memory. The final result set is then persisted to the hard disk, and the output document of the original data is output based on the final result set.

[0130] In one embodiment of the present invention, the output document of the original data can be output in the order of traversing each row of the original data. Specifically, based on the correspondence between the display column names in the final result set and the output results of each row of data, the output document of the original data is output in the above order.

[0131] See Table 1, which is the output document of the above example, wherein two MAPs are nested in List, namely the first MAP and the second MAP. The first MAP includes seven rows of data, which are the same as above, and the second MAP includes seven rows of data, which are the same as above.

[0132] Table 1

[0133] Name age address highest score Lowest score Link Field Li Si 39 No. 21 Guangqu Road, Chaoyang District 99 68 2771999 Zhang San 29 No. 15, Anlelin Road, Dongcheng District 100 58 2771999

[0134] From Table 1, we can see that the order of traversing each row of the original data is: first row, second row, fourth row, fifth row, seventh row and third row, and the column names displayed in the output document are in the following order: name, age, address, highest score, lowest score and link field.

[0135] In one embodiment of the present invention, some output results in the final result set need to be modified, such as modifying the text format of the output results, which can be achieved by calling a component.

[0136] See also Figure 4 , Figure 4 The figure is a flow chart of modifying the output result of the column names displayed in the final result set according to an embodiment of the present invention, which specifically includes:

[0137] S401: Modify 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.

[0138] Based on the display column name of each data point, determine the output results that need to be modified in the final result set. For example, for the output results whose display column name is a link field, the font size needs to be changed to 4.

[0139] Modify the output result of the displayed column name of the row of data in the final result set according to the preset modification requirements.

[0140] S402: Output an output document of the original data based on the modified final result set.

[0141] According to the modified final result set, after persisting it on the hard disk, the output document of the original data is output.

[0142] exist Figure 4 In the embodiment, by modifying the output result of displaying the column names, an output document that meets the requirements can be output.

[0143] In the above embodiment, each row of original data is sequentially traversed to determine the display column name for each row of data. For each row of data, a preset component is called to determine the output result of each row of data in the display column name. The output result of each row of data is stored in a final result set, and based on the final result set, an output document of the original data is output. Because the output result of the display column name is determined by the preset component, it is applicable to different data, allowing the reuse of existing processing logic and avoiding the increase of code volume.

[0144] See also Figure 5 , Figure 5Schematic diagram of the main structure of the apparatus for processing data according to an embodiment of the present invention. The apparatus for processing data can implement a method for processing data, such as Figure 5 As shown, the device for processing data specifically includes:

[0145] The traversal module 501 is used to traverse each row of original data in order to obtain the display column name of each row of data.

[0146] The determination module 502 is 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.

[0147] The output module 503 is configured to store the output result of each row of data into a final result set, and output an output document of the original data based on the final result set.

[0148] In one 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;

[0149] According to the key in each row of data in the MAP, the display column name of each row of data is obtained.

[0150] In one embodiment of the present invention, the determination 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;

[0151] Calling the preset component for each row of data in multiple preset components;

[0152] The preset component of each row of data is used to read the value of each row of data in the original data MAP, and determine the output result of each row of data in the display column name.

[0153] In one embodiment of the present invention, the output module 503 is specifically configured to modify 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;

[0154] Based on the modified final result set, an output document of the original data is output.

[0155] In one embodiment of the present invention, the output module 503 is specifically configured to output the output document of the original data in the order based on the correspondence between the display column names in the final result set and the output results of each row of data.

[0156] In one embodiment of the present invention, the order is determined according to the scene in which the original data is located, or is preset.

[0157] In one embodiment of the present invention, the output document of the original data includes an output table of the original data.

[0158] Figure 6 An exemplary system architecture 600 is shown to which the method for processing data or the apparatus for processing data according to the embodiments of the present invention can be applied.

[0159] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0160] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0161] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0162] Server 605 may be a server that provides various services, such as a backend management server (for example only) that supports shopping websites browsed by users using terminal devices 601, 602, and 603. The backend management server may analyze and process received data such as product information query requests, and feed back processing results (for example, target push information and product information—for example only) to the terminal device.

[0163] It should be noted that the method for processing data provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the device for processing data is generally set in the server 605 .

[0164] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0165] Reference below Figure 7 , which shows a schematic structural diagram of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0166] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the system 700 are also stored in the RAM 703. The CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0167] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 708 including a hard disk; and a communication section 709 including a network interface card such as a LAN card or a modem. 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, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read therefrom can be installed into the storage section 708 as needed.

[0168] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from a removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0169] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.

[0170] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0171] The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The modules described may also be provided in a processor. For example, they may be described as follows: a processor includes a sending unit, an acquisition unit, a determination unit, and a first processing unit. The names of these units do not, in some cases, limit the units themselves. For example, the sending unit may also be described as a "unit that sends a request for obtaining an image to the connected server."

[0172] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiments, or may exist independently without being incorporated into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device includes:

[0173] Traverse each row of original data in order to obtain the display column name of each row of data;

[0174] For each row of data, calling a preset component of each row of data to determine an output result of each row of data in the display column name;

[0175] The output result of each row of data is stored in a final result set, and based on the final result set, an output document of the original data is output.

[0176] According to the technical solution of an embodiment of the present invention, each row of original data is sequentially traversed to obtain the display column name of each row of data; for each row of data, a preset component is called to determine the output result of each row of data in the display column name; the output result of each row of data is stored in a final result set, and based on the final result set, an output document of the original data is output. Because the output result of the display column name is determined by the preset component, it is applicable to different data, so existing processing logic can be reused, avoiding the increase of code volume.

[0177] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A method for processing data, characterized in that include: Traverse each row of original data in order to obtain the display column name of each row of data; Determining the preset component of each row of data according to the display column name of each row of data; Calling the preset component for each row of data in multiple preset components; Using the preset components of each row of data, read the values ​​in each row of data in the original data MAP, and determine the output results of each row of data in the display column name; the components include Field, Field custom logic export field interface, and methods for defining all extended custom field implementations; The output result of each row of data is stored in a final result set, and based on the final result set, an output document of the original data is output.

2. The method for processing data according to claim 1, characterized in that: The step of sequentially traversing each row of the original data to obtain the display column name of each row of the data includes: Traverse each row of data in the original data MAP in order; According to the key in each row of data in the MAP, the display column name of each row of data is obtained.

3. The method for processing data according to claim 1, characterized in that: Outputting the output document of the original data based on the final result set includes: Modify 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; Based on the modified final result set, an output document of the original data is output.

4. The method for processing data according to claim 1, characterized in that: Outputting the output document of the original data based on the final result set includes: Based on the correspondence between the display column names in the final result set and the output results of each row of data, the output document of the original data is output in the order.

5. The method for processing data according to claim 1 or 4, characterized in that: The order is determined according to the scene in which the original data is located, or is preset.

6. The method for processing data according to claim 1, characterized in that: The output document of the original data includes an output table of the original data.

7. A device for processing data, characterized in that: include: A traversal module is used to traverse each row of original data in order to obtain the display column name of each row of data; a determination module, configured to determine a preset component for each row of data according to a display column name of each row of data; Calling the preset component for each row of data in multiple preset components; Using the preset components of each row of data, read the values ​​in each row of data in the original data MAP, and determine the output results of each row of data in the display column name; the components include Field, Field custom logic export field interface, and methods for defining all extended custom field implementations; The output module is used to store the output result of each row of data into a final result set, and output an output document of the original data based on the final result set.

8. An electronic device for processing data, characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.