A system and method for automatically aggregating and exporting data during data import
By combining a custom annotation module with POI and Java reflection, the automatic collection and export of Excel data is realized, which solves the problem of insufficient data analysis and collection in existing technologies and improves data management efficiency and utilization value.
Patent Information
- Application Number
- CN202310874337.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-17
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-07-17
AI Technical Summary
In existing technologies, the EXCEL import and export methods have failed to analyze and collect data in the agricultural and rural sectors, resulting in a lack of effective management during the data transfer process.
By using a custom annotation module combined with POI, and through semantic analysis and Java reflection, data can be automatically collected and exported. The @ExcelOper annotation is used to identify JavaBean properties and match and associate them with the agricultural and rural industry database to generate EXCEL files.
It simplifies the data collection process, improves data management efficiency, enables automatic data classification and labeling, and enhances the value of data utilization, especially in rural infrastructure construction, agricultural environmental protection, and agricultural e-commerce.
Smart Images

Figure CN117150336B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of computer, and particularly relates to a system and method for realizing automatic collection and export during data import. BACKGROUND
[0002] The agricultural and rural industry refers to an industry related to all aspects of agricultural production, rural construction and farmer life, including planting, animal husbandry, fishery, forestry, rural infrastructure construction, etc.
[0003] In the process of informationization construction in the agricultural and rural industry, a large amount of data is generated, and the data flow forms are various, and it is convenient and common to flow through the EXCEL mode. The data import and export can be realized by using the developed annotation of the java self-defined annotation. The traditional EXCEL import and export method does not realize the analysis and collection of data. This is the deficiency of the prior art.
[0004] Therefore, the present application provides a system and method for realizing automatic collection and export during data import to solve the above-mentioned defects in the prior art, which is very necessary. SUMMARY
[0005] The present application aims at the defects in the prior art, and provides a system and method for realizing automatic collection and export during data import to solve the above-mentioned technical problems.
[0006] To achieve the above-mentioned purpose, the present application provides the following technical scheme:
[0007] A system for realizing automatic collection and export during data import comprises:
[0008] A self-defined annotation module, which utilizes the annotation of java and combines POI to collect and export data, adds simple annotation marks to realize data import and export, and is closely combined with the agricultural and rural industry to read the data of each cell during data import, identify the data through semantic analysis, compare the data with the data in the database, calculate the data information with higher matching degree through an algorithm, and realize the data association related to the agricultural and rural industry by associating with the uploaded data primary and foreign keys.
[0009] The data collection function of the agricultural and rural industry data imported and exported through EXCEL is simplified,
[0010] The annotation data collection module, in which the annotation is named @ExcelOper, identifies the JavaBean attribute on which data needs to be collected and exported, the value of the EXCEL is read by using POI, the column of the EXCEL is bound to the JavaBean attribute added with the annotation, and the JavaBean is assigned values by using the reflection mechanism of JAVA; the assigned JavaBean is analyzed, the data matched with the imported data is obtained from the database through semantic analysis, and the data correlation is performed in the mode of taking the imported data as the main data.
[0011] The annotation data export module, in which the annotation is added to the attribute of the JavaBean on which data needs to be exported, the attribute of the current JavaBean is read during export, the EXCEL file is generated according to the attribute, the name on the annotation is taken as the column name of the EXCEL table, the data of the JavaBean is read, and the data is filled into the corresponding EXCEL cell, and the EXCEL file stream is returned after completion. The entire export process only needs to add the annotation to the JavaBean.
[0012] As a preferred, in the custom annotation module, the data is labeled by analyzing the classification with the highest matching degree, and the automatic classification of data is realized.
[0013] As a preferred, in the custom annotation module, the dictionary column is automatically recognized by using the dictionary judgment tool class to analyze each column of characters, the data is converted into the corresponding dictionary for statistical, analysis and query.
[0014] As a preferred, in the annotation data collection module, the data matched with the imported data includes pictures, origins, videos, safety indexes, production cycles or processing cycles, which are obtained from the database through semantic analysis.
[0015] As a preferred, in the annotation data collection module, the product information is classified into the categories of planting, animal husbandry, fishery and forestry during the import process, and the data is labeled, such as hot-selling products, seasonal products and geographical indication products.
[0016] The application also provides a method for realizing automatic collection and export during data import, which comprises the following steps:
[0017] Step S1: the step of customizing the annotation, which utilizes the annotation of JAVA and combines POI to collect and export data, adds simple annotation marks to realize data import and export, and is closely combined with the agricultural and rural industry, reads the data of each cell during data import, identifies the data through semantic analysis, compares the data with the data in the database, calculates the data information with a higher matching degree by using an algorithm, and realizes the data correlation related to the agricultural and rural industry by associating with the main foreign key of the uploaded data.
[0018] Simplify the import and export of agricultural and rural industry data by EXCEL to make data collection function,
[0019] Step S2: Annotate data collection. In this step, the annotation is named @ExcelOper, and the annotation is added to the JavaBean property that needs to be collected and exported. The value of EXCEL is read by POI, the column of Excel is bound to the JavaBean property with annotation, and the JavaBean is assigned value using the reflection mechanism of JAVA; the assigned JavaBean is analyzed, the data matching the imported data is obtained from the database through semantic analysis, and the data correlation is performed in the way of taking the imported data as the main data.
[0020] Step S3: Annotate the data export step. In this step, the annotation is added to the JavaBean property that needs to be exported. When exporting, the property of the current JavaBean is read, the Excel file is generated according to the property, the name on the annotation is used as the Excel table column name, the data of JavaBean is read, and the data is filled into the corresponding EXCEL cell. After completion, the Excel file stream is returned. The entire export process only needs to add the annotation on the JavaBean.
[0021] As a preferred, in step S1, the classification with the highest matching degree is analyzed, the data is labeled with data tag, and the automatic classification of data is realized.
[0022] As a preferred, in step S1, the dictionary judgment tool class is used to analyze each column of characters, automatically identify the dictionary column, convert the data into the corresponding dictionary, and provide statistics, analysis and query.
[0023] As a preferred, in step S2, the data matching the imported data obtained from the database through semantic analysis includes pictures, origin, videos, safety indicators, production cycle or processing cycle.
[0024] As a preferred, in step S2, the data is automatically classified during the import process, and the product information is classified into planting, animal husbandry, fishery and forestry, and the data is labeled, such as hot-selling products, seasonal products and geographical indication products.
[0025] The beneficial effects of this invention are that it simplifies the import and export of Excel files through annotations, requiring minimal development time and saving development costs. It closely links with agricultural and rural industry data, changing the usual practice of uploading only single data entries. This invention performs semantic analysis on uploaded data, transforming individual data points into complete sets of rich data, reducing the need for subsequent data aggregation after upload. After aggregation, individual data points become a complete set of data, which can be used for rural infrastructure construction, agricultural environmental protection, agricultural product quality and safety, or agricultural e-commerce, thereby increasing the economic benefits of agricultural products.
[0026] Furthermore, the design principle of this invention is reliable, the structure is simple, and it has a very wide range of application prospects.
[0027] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0029] Figure 1 This is a block diagram illustrating the principle of a system for automatically collecting and exporting data during import, as provided by this invention.
[0030] Figure 2 This is a flowchart of a method for automatically collecting and exporting data during data import, provided by the present invention.
[0031] Among them, 1-Custom annotation module, 2-Annotation data collection module, 3-Annotation data export module. Detailed Implementation
[0032] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. The following embodiments are explanations of the present invention, but the present invention is not limited to the following implementation methods.
[0033] Example 1:
[0034] like Figure 1 As shown in the figure, this embodiment provides a system for automatically collecting and exporting data during import, including:
[0035] The custom annotation module 1 uses Java annotations and combines POI to collect and export data, adds simple annotation marks to realize data import and export, and is closely combined with the agricultural and rural industry. When importing data, the data of each cell is read, the data is identified through semantic analysis, the data in the database is compared, the data information with a higher matching degree is calculated through an algorithm, and the data is associated with the uploaded data primary and foreign keys to realize the association of the agricultural and rural related data.
[0036] The data collection function of the agricultural and rural industry data imported and exported by EXCEL is simplified. In the custom annotation module 1, the classification with the highest matching degree is analyzed, the data is marked with a data label, and the automatic classification of the data is realized. In the custom annotation module 1, the dictionary judgment tool class is used to analyze each column of characters, the dictionary column is automatically identified, the data is converted into a corresponding dictionary, and the data is used for statistics, analysis and query.
[0037] The annotation data collection module 2 is annotated with @ExcelOper in the JavaBean attribute that needs to be collected and exported. The value of EXCEL is read by using POI, the column of Excel is bound to the annotated attribute of JavaBean, and the reflection mechanism of JAVA is used to assign values to JavaBean. The assigned JavaBean is analyzed, the data matched with the imported data is obtained from the database through semantic analysis, and the data is associated in the mode of imported data as main data. In the annotation data collection module 2, the data matched with the imported data is obtained from the database through semantic analysis, including pictures, production places, videos, safety indicators, production cycles or processing cycles. In the annotation data collection module 2, the product information is automatically classified into planting, animal husbandry, fishery and forestry during the import process, and the data is labeled, such as hot-selling products, seasonal products and geographical indication products.
[0038] The annotation data export module 3 adds an annotation mark to the attribute of the JavaBean that needs to be exported. The attribute of the current JavaBean is read during export, an Excel file is generated according to the attribute, the name on the annotation is used as the column name of the Excel table, the data of the JavaBean is read, and the data is filled into the corresponding EXCEL cell. The whole export process only needs to add an annotation mark to the JavaBean.
[0039] Embodiment 2
[0040] As shown in Figure 2 The embodiment provides a method for realizing automatic collection and export during data import, which comprises the following steps:
[0041] Step S1: a step of customizing an annotation, which uses the annotation of Java and combines POI to collect and export data, adds simple annotation marks to realize data import and export, and is closely combined with the agricultural and rural industry. When importing data, the data of each cell is read, the data is identified through semantic analysis, the data is compared with the data in the database, the data information with a higher matching degree is calculated through an algorithm, and is associated with the uploaded data primary and foreign keys to realize the data association related to the agricultural and rural industry.
[0042] The data collection function of importing and exporting agricultural and rural industry data through EXCEL is simplified. In step S1, the classification with the highest matching degree is analyzed, the data is marked with a data label, and automatic classification of data is realized. In step S1, the dictionary judgment tool class is used to analyze each column of characters, the dictionary column is automatically identified, the data is converted into the corresponding dictionary, and is used for statistics, analysis and query.
[0043] Step S2: a step of annotating data collection. In this step, the annotation name is @ExcelOper, and the annotation is marked on the JavaBean property that needs to collect and export data. The value of EXCEL is read by using POI, the column of Excel is bound with the annotated property of JavaBean, and the reflection mechanism of JAVA is used to assign values to JavaBean. The assigned JavaBean is analyzed, the data matched with the imported data is obtained from the database through semantic analysis, and the data association is performed in the mode of taking the imported data as the main data. In step S2, the data matched with the imported data is obtained from the database through semantic analysis, including pictures, production places, videos, safety indicators, production cycles or processing cycles. In step S2, the product information is automatically classified into planting, animal husbandry, fishery and forestry categories during the import process, and the data is labeled, such as hot-selling products, seasonal products and geographical indication products.
[0044] Step S3: a step of annotating exported data. In this step, the annotation mark is added to the property of the JavaBean that needs to be exported. When exporting, the property of the current JavaBean is read, the Excel file is generated according to the property, the name on the annotation is used as the column name of the Excel table, the data of the JavaBean is read, and the data is filled into the corresponding EXCEL cell. After completion, the Excel file stream is returned. The entire export process only needs to add the annotation mark on the JavaBean.
[0045] The various embodiments described in the specification can be presented with respect to a progressive manner. Each embodiment highlights differences from other embodiments. The same or similar parts or methods between embodiments can be mutually referred to each other for convenience.
[0046] Those skilled in the art will further appreciate that the units and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various examples disclosed herein have been described in general terms that are applicable to both implementations, without loss of generality. It will be appreciated that the choice of hardware or software implementation can be made by a person of ordinary skill in the art depending on the specific application and design constraints imposed on the overall system.
[0047] In several embodiments of the present application, it should be understood that the disclosed system, system and method can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, another division can be used. For example, multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces. The coupling or communication connection can be electrical, mechanical or other forms.
[0048] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0049] In addition, the functional modules in each embodiment of the present application can be integrated in one processing unit, or each module can be physically present separately, or two or more modules can be integrated in one unit.
[0050] Similarly, the processing units in each embodiment of the present application can be integrated in one functional module, or each processing unit can be physically present separately, or two or more processing units can be integrated in one functional module.
[0051] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. The term "computer-readable storage medium" includes, but is not limited to, non-transitory, tangible, and non-transitory, tangible media that store data for
[0052] Finally, it should be noted that the terms "first" and "second", and the like, are used herein only to distinguish one from another, without necessarily implying a physical or chronological order or relationship. Also, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0053] The above disclosed are only the preferred embodiments of the present application, but the present application is not limited thereto, any non-creative changes and several improvements and refinements made by those skilled in the art without departing from the principles of the present application should fall within the protection scope of the present application.
Claims
1. A system for enabling automatic consolidation and export on data import, characterized in that, Include: Custom annotation module, which uses java annotation and combines POI to collect and export data, adds simple annotation mark to realize data import and export, and closely combines with the agricultural and rural industry. When importing data, read the data of each cell, identify the data through semantic analysis, compare with the data in the database, calculate the data information with higher matching degree through algorithm, and associate with the uploaded data primary and foreign key to realize the data association related to agriculture and rural areas; The annotation data collection module, the annotation name in the module is @ExcelOper, and the annotation is marked on the JavaBean attribute that needs to be collected and exported. The value of Excel is read by using POI, the column of Excel is bound with the annotated JavaBean attribute, and the JavaBean is assigned value by using JAVA reflection mechanism; analyze the assigned JavaBean, get the matched data from the database through semantic analysis, including pictures, origin, videos, safety indicators, production cycle or processing cycle; and perform data association with the imported data as the main data; classify the product information into planting, animal husbandry, fishery and forestry categories during the import process, and label the data; The annotation export data module, which adds annotation marks to the properties of JavaBean that need to be exported. When exporting, read the properties of the current JavaBean, generate an Excel file according to the properties, use the name on the annotation as the Excel column name, read the JavaBean data, and fill the data into the corresponding EXCEL cells. Return the Excel file stream after completion.
2. The system for automatically aggregating and exporting data upon import according to claim 1, wherein, In the custom annotation module, analyze the classification with the highest matching degree, label the data, and realize automatic classification of data.
3. The system for automatically aggregating and exporting data upon import according to claim 2, wherein, In the custom annotation module, analyze each column character using a dictionary judgment tool class to automatically identify the dictionary column, convert the data into the corresponding dictionary for statistical, analysis and query.
4. A method for enabling automatic consolidation and export on data import, characterized by, The steps include: Step S1: custom annotation step, which uses java annotation and combines POI to collect and export data, adds simple annotation mark to realize data import and export, and closely combines with the agricultural and rural industry. When importing data, read the data of each cell, identify the data through semantic analysis, compare with the data in the database, calculate the data information with higher matching degree through algorithm, and associate with the uploaded data primary and foreign key to realize the data association related to agriculture and rural areas; Step S2: the step of collecting annotation data, in which an annotation named @ExcelOper is added to the JavaBean attribute that needs to collect and export data, the value of the EXCEL is read by using POI, the column of the Excel is bound with the JavaBean attribute added with the annotation, the JAVA reflection mechanism is used to assign values to the JavaBean; the JavaBean with assigned values is analyzed, the data matched with the imported data is obtained from the database through semantic analysis, including pictures, origin, videos, safety indicators, production cycle or processing cycle; and the data correlation is performed in the mode of taking the imported data as the main data; the product information is automatically classified into the categories of planting, animal husbandry, fishery and forestry during the import process, and the data is labeled at the same time; Step S3: the step of exporting data with annotations, in which the annotation is added to the attribute of the JavaBean that needs to be exported, the attribute of the current JavaBean is read during the export, the Excel file is generated according to the attribute, the name on the annotation is taken as the column name of the Excel table, the data of the JavaBean is read, and the data is filled into the corresponding EXCEL cells, and the Excel file stream is returned after completion.
5. The method of claim 4, wherein, In the step S1, the classification with the highest matching degree is analyzed, the data is labeled with a data label, and the automatic classification of the data is realized.
6. The method for automatically gathering and exporting according to claim 5, wherein, In the step S1, the dictionary judgment tool class is used to automatically identify the dictionary column by analyzing each column of characters, the data is converted into the corresponding dictionary for statistical, analysis and query.