Intelligent conversion method and device for garbage sorting data
By generating sorting labels and encapsulating arrays, the waste sorting data is exported to an Excel spreadsheet using POI technology. This solves the problem of cumbersome waste sorting data export in existing technologies, realizes automated data aggregation and customized export, and improves data processing efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG GONGYE TECH CO LTD
- Filing Date
- 2023-04-26
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies, exporting waste sorting data into tables is quite cumbersome, and the existing Java table manipulation tool Apache POI is cumbersome to use and has a high learning curve, making it impossible to summarize and export data according to customer needs.
By acquiring waste sorting data from waste sorting equipment, generating sorting labels, encapsulating them into an array, and using POI to generate an Excel spreadsheet, the system can automatically summarize and export the data. Users can customize the mapping relationship between the summary labels and the sorting labels.
It enables customized waste sorting data aggregation based on user needs, improves data processing efficiency, simplifies the data export process, and enhances the user experience.
Smart Images

Figure CN116701505B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of waste sorting technology, and in particular relates to a method and device for intelligent conversion of waste sorting data. Background Technology
[0002] Currently, due to the promotion of waste sorting in major cities, the workload of flaking plants is increasing. In order to cope with the expansion of business and the increase in labor costs, more and more flaking plants are choosing to use intelligent sorting robots to replace manual waste sorting.
[0003] However, after using intelligent sorting robots, how to export the sorting data from the equipment according to customer needs has become a problem that needs to be solved. Currently available Java spreadsheet tools like Apache POI can export data from Excel, but their usage is cumbersome, the learning curve is steep, and they cannot summarize and export sorting label data according to customer requirements.
[0004] Therefore, it is necessary to improve existing technologies to solve the above problems. Summary of the Invention
[0005] The purpose of this invention is to provide a method and apparatus for intelligent conversion of waste sorting data, which aims to solve the technical problem that exporting waste sorting data into tables is cumbersome in the prior art.
[0006] To achieve the above objectives, embodiments of the present invention provide an intelligent conversion method for waste sorting data, comprising:
[0007] Obtain waste sorting data from waste sorting equipment, wherein the waste sorting data includes waste information and equipment information of the waste sorting equipment;
[0008] Generate sorting labels based on the device information;
[0009] Generate a package array based on the sorting labels;
[0010] The parameters within the encapsulated array are sorted, and a label array is generated;
[0011] An Excel spreadsheet is generated using POIs based on the spam information and the tag array, wherein the Excel spreadsheet is used to display the spam information and the tag array.
[0012] As a preferred embodiment, generating sorting labels based on the device information specifically includes:
[0013] Determine whether the device information has a matching preset summary tag, wherein the preset summary tag is preset;
[0014] If the determination is yes, then the corresponding sorting label is obtained according to the matched preset summary label and the preset label mapping information, wherein the label mapping information is preset;
[0015] If the result is negative, return to the step of obtaining waste sorting data from the waste sorting equipment.
[0016] As a preferred embodiment, generating a sorting and packaging array based on the sorting labels specifically includes:
[0017] An encapsulated array is generated by encapsulating the preset summary tags, the sorting tags, and the tag mapping information using a Map method.
[0018] As a preferred embodiment, the step of generating an Excel spreadsheet from the spam information and the tag array using POIs specifically includes:
[0019] The garbage information and the tag array are counted, and count information is generated;
[0020] Based on the garbage information, the tag array, and the counting information, a workbook object is generated through POI encapsulation.
[0021] An Excel spreadsheet is generated based on the workbook object.
[0022] As a preferred embodiment, generating an Excel spreadsheet based on the workbook object specifically includes:
[0023] Generate the table object of the workbook object using POI;
[0024] The row dataset is obtained, merged, and written into the corresponding table object, wherein the row dataset is generated based on the garbage information, the label array, and the count information;
[0025] Determine whether the row data set has been completely read;
[0026] If the determination is negative, return to the process of obtaining the row dataset and merging it into the corresponding table object;
[0027] If the determination is yes, then the workbook object is written to the output stream for export and an Excel spreadsheet is generated.
[0028] As a preferred embodiment, generating the table object of the workbook object via POI specifically includes:
[0029] Generate the table object of the workbook object using POI;
[0030] Determine if the table name of the table object is empty;
[0031] If the determination is yes, then the name of the table object is set to the default name;
[0032] If the determination is negative, then the table object is named according to the table name.
[0033] As a preferred embodiment, the step of obtaining the row dataset and merging it into the corresponding table object specifically includes:
[0034] Extract cell data from the row data set;
[0035] Create a cell object;
[0036] Determine whether the cell data corresponding to the cell object is empty;
[0037] If the determination is negative, then the cell data is written to the cell object;
[0038] If the determination is yes, then proceed to the step of determining whether the row data set has been completely read.
[0039] This invention also provides an intelligent waste sorting data conversion device, comprising:
[0040] The sorting data acquisition module is used to acquire waste sorting data of waste sorting equipment, wherein the waste sorting data includes waste information and equipment information of waste sorting equipment;
[0041] The sorting label generation module is used to generate sorting labels based on the device information;
[0042] A package array generation module is used to generate a package array based on the sorting labels;
[0043] The tag array generation module is used to sort the parameters in the encapsulated array and generate a tag array;
[0044] A table file generation module is used to generate an Excel table based on the garbage information and the tag array, wherein the Excel table is used to display the garbage information and the tag array.
[0045] This invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program and the processor executes the steps of the intelligent conversion method for waste sorting data.
[0046] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the intelligent waste sorting data conversion method.
[0047] The above-mentioned technical solutions of the intelligent waste sorting data conversion method and device provided in the embodiments of the present invention have at least one of the following technical effects:
[0048] This invention, in its embodiments, acquires waste sorting data from a waste sorting device, generates sorting labels based on the device information, then generates an encapsulation array based on the sorting labels, sorts the parameters within the encapsulation array, generates a label array, and finally generates an Excel spreadsheet based on the waste information and the label array. Through these steps, customization is possible according to user needs, summarizing waste sorting data to help users obtain the required waste sorting summary data. Simultaneously, by utilizing JAVA and POI technologies to summarize the waste sorting data into an Excel spreadsheet, automated data export is achieved, thereby improving data processing efficiency.
[0049] Furthermore, users can set the label mapping relationship between preset summary labels and sorting labels according to their actual needs, which is highly flexible and customizable. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention, 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 some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 A flowchart of the intelligent conversion method for waste sorting data provided in an embodiment of the present invention;
[0052] Figure 2 A flowchart for generating sorting labels based on the device information provided in an embodiment of the present invention;
[0053] Figure 3 A flowchart for generating an Excel spreadsheet provided in an embodiment of the present invention;
[0054] Figure 4 A flowchart for generating an Excel spreadsheet based on the workbook object provided in an embodiment of the present invention;
[0055] Figure 5 A flowchart for generating a table object of the workbook object provided in an embodiment of the present invention;
[0056] Figure 6 A flowchart for obtaining a set of row data provided in an embodiment of the present invention;
[0057] Figure 7This is a structural block diagram of the intelligent waste sorting data conversion device provided in an embodiment of the present invention;
[0058] The following are the labeling elements in the figure:
[0059] 11-Sorting data acquisition module; 12-Sorting label generation module; 13-Encapsulated array generation module; 14-Label array generation module; 15-Table file generation module. Detailed Implementation
[0060] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain embodiments of the present invention, and should not be construed as limiting the present invention.
[0061] In the description of the embodiments of the present invention, it should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention.
[0062] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0063] In the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of the present invention according to the specific circumstances.
[0064] In one embodiment of the present invention, such as Figure 1 As shown, a method for intelligent conversion of waste sorting data is provided, including:
[0065] Step S100: Obtain waste sorting data from the waste sorting equipment, wherein the waste sorting data includes waste information and equipment information of the waste sorting equipment.
[0066] In this step, each waste sorting device sorts different types of waste and generates waste information. The waste information, the device information, and other information are combined to generate waste sorting data.
[0067] Step S200: Generate sorting labels based on the device information.
[0068] In this step, since each waste sorting device sorts different types of waste, and the types of waste sorted by each waste sorting device are preset, the types of waste sorted by the waste sorting device can be determined based on the device information, and corresponding sorting labels can be generated.
[0069] In another embodiment of the invention, such as Figure 2 As shown, step S200: generating sorting labels based on the device information specifically includes:
[0070] Step S210: Determine whether the device information has a matching preset summary tag, wherein the preset summary tag is preset;
[0071] Step S220: If the determination is yes, then obtain the corresponding sorting label according to the matched preset summary label and the preset label mapping information, wherein the label mapping information is preset;
[0072] Step S230: If the determination is negative, return to the step of obtaining the waste sorting data of the waste sorting equipment.
[0073] In this embodiment, a preset summary label is set in advance, and the device information is matched with the preset summary label.
[0074] If there is a mismatch, it indicates that the waste sorting data of the waste sorting equipment is not the data to be collected in the Excel spreadsheet generated below, but may be the data to be collected in another Excel spreadsheet. In this case, new waste sorting data from the waste sorting equipment should be obtained again.
[0075] If a match is found, it indicates that the waste sorting data from the waste sorting device is the data to be collected in the Excel spreadsheet generated below. Then, based on the pre-set label mapping information, the corresponding sorting labels are obtained to classify the waste information. The label mapping information is the mapping relationship between the preset summary labels and the sorting labels.
[0076] Step S300: Generate an encapsulation array based on the sorting labels.
[0077] Specifically, an encapsulation array is generated by encapsulating the preset summary label, the sorting label, and the label mapping information through a Map process.
[0078] Step S400: Sort the parameters in the encapsulation array and generate a label array;
[0079] In this step, the preset summary labels and sorting labels within the encapsulated array are sorted so that they can be displayed in the Excel spreadsheet in the order set by the user.
[0080] Step S500: Generate an Excel spreadsheet using POI based on the garbage information and the tag array, wherein the Excel spreadsheet is used to display the garbage information and the tag array.
[0081] In another embodiment of the invention, such as Figure 3 As shown, step S500: generating an Excel table from the garbage information and the tag array using POIs, specifically includes:
[0082] Step S510: Count the garbage information and the tag array and generate counting information;
[0083] Step S520: Generate a workbook object by encapsulating the garbage information, the tag array, and the counting information using POI;
[0084] Step S530: Generate an Excel spreadsheet based on the workbook object.
[0085] In another embodiment of the invention, such as Figure 4 As shown, step S530: generating an Excel spreadsheet based on the workbook object specifically includes:
[0086] Step S531: Generate the table object of the workbook object using POI;
[0087] Step S532: Obtain the row dataset and merge it into the corresponding table object, wherein the row dataset is generated based on the garbage information, the label array and the counting information.
[0088] Step S533: Determine whether the row data set has been completely read;
[0089] Step S534: If the determination is negative, return to the process of obtaining the row dataset and merging it into the corresponding table object;
[0090] Step S535: If the determination is yes, then write the workbook object into the output stream to export and generate an Excel spreadsheet.
[0091] In another embodiment of the invention, such as Figure 5 As shown, step S531: generating the table object of the workbook object through POI, specifically includes:
[0092] Step S5311: Generate the table object of the workbook object using POI;
[0093] Step S5312: Determine whether the table name of the table object is empty;
[0094] Step S5313: If the determination is yes, then set the name of the table object to the default name;
[0095] Step S5314: If the determination is negative, then name the table object according to the table name.
[0096] In another embodiment of the invention, such as Figure 6 As shown, step S532: obtaining the row dataset and merging it into the corresponding table object, specifically includes:
[0097] Step S5321: Extract cell data from the row data set;
[0098] Step S5322: Create a cell object;
[0099] Step S5323: Determine whether the cell data corresponding to the cell object is empty;
[0100] Step S5324: If the determination is negative, then write the cell data into the cell object;
[0101] Step S5325: If the determination is yes, then execute the step of determining whether the row data set has been read completely.
[0102] In another embodiment of the invention, such as Figure 7 As shown, a waste sorting data intelligent conversion device is provided, including a sorting data acquisition module 11, a sorting label generation module 12, an encapsulation array generation module 13, a label array generation module 14, and a table file generation module 15.
[0103] The sorting data acquisition module 11 is used to acquire waste sorting data of waste sorting equipment, wherein the waste sorting data includes waste information and equipment information of waste sorting equipment.
[0104] The sorting label generation module 12 is used to generate sorting labels based on the device information.
[0105] The encapsulation array generation module 13 is used to generate an encapsulation array based on the sorting labels; specifically, the encapsulation array generation module 13 is used to generate an encapsulation array based on the following preset summary labels, the sorting labels, and the following label mapping information through Map encapsulation.
[0106] The tag array generation module 14 is used to sort the parameters in the encapsulated array and generate a tag array.
[0107] The table file generation module 15 is used to generate an Excel table based on the garbage information and the tag array, wherein the Excel table is used to display the garbage information and the tag array.
[0108] In another embodiment of the present invention, the sorting label generation module 12 is further configured to: determine whether there is a matching preset summary label for the device information, wherein the preset summary label is preset; if the determination is yes, obtain the corresponding sorting label according to the matching preset summary label and preset label mapping information, wherein the label mapping information is preset; if the determination is no, return to the step of obtaining the waste sorting data of the waste sorting device sorting waste.
[0109] In another embodiment of the present invention, the table file generation module 15 is further configured to count the garbage information and the tag array and generate count information; generate a workbook object by encapsulating the garbage information, the tag array and the count information through POI; and generate an Excel table based on the workbook object.
[0110] In another embodiment of the present invention, the table file generation module 15 is further configured to generate a table object of the workbook object through POI; obtain a row dataset and merge it into the corresponding table object, wherein the row dataset is generated based on the garbage information, the label array and the counting information; determine whether the row dataset has been read completely; if the determination is no, return to obtaining the row dataset and merging it into the corresponding table object; if the determination is yes, write the workbook object into the output stream for export and generate an Excel table.
[0111] In another embodiment of the present invention, the table file generation module 15 is further configured to generate a table object of the workbook object through POI; determine whether the table name of the table object is empty; if it is, set the table object name to a default name; if it is not, name the table object according to the table name.
[0112] In another embodiment of the present invention, the table file generation module 15 is further configured to extract cell data from the row data set; create a cell object; determine whether the cell data corresponding to the cell object is empty; if the determination is no, write the cell data into the cell object; if the determination is yes, execute the step of determining whether the row data set has been read completely.
[0113] In another embodiment of the present invention, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the intelligent conversion method for waste sorting data.
[0114] In another embodiment of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the intelligent conversion method for waste sorting data.
[0115] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0116] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0117] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0118] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0119] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for intelligent conversion of waste sorting data, characterized in that, include: Obtain waste sorting data from waste sorting equipment, wherein the waste sorting data includes waste information and equipment information of the waste sorting equipment; Generate sorting labels based on the device information; Generate a package array based on the sorting labels; The parameters within the encapsulated array are sorted, and a label array is generated; An Excel spreadsheet is generated using POIs based on the spam information and the tag array, wherein the Excel spreadsheet is used to display the spam information and the tag array; The step of generating sorting labels based on the device information specifically includes: Determine whether the device information has a matching preset summary tag, wherein the preset summary tag is preset; If the determination is yes, then the corresponding sorting label is obtained according to the matched preset summary label and the preset label mapping information, wherein the label mapping information is preset; If the result is negative, return to the step of obtaining waste sorting data from the waste sorting equipment; The step of generating a sorting and packaging array based on the sorting labels specifically includes: Based on the preset summary tags, the sorting tags, and the tag mapping information, a packaged array is generated through Map encapsulation. The step of generating an Excel spreadsheet from the garbage information and the tag array using POIs specifically includes: The garbage information and the tag array are counted, and count information is generated; Based on the garbage information, the tag array, and the counting information, a workbook object is generated through POI encapsulation. Generate an Excel spreadsheet based on the workbook object; The step of generating an Excel spreadsheet based on the workbook object specifically includes: Generate the table object of the workbook object using POI; The row dataset is obtained, merged, and written into the corresponding table object, wherein the row dataset is generated based on the garbage information, the label array, and the count information; Determine whether the row data set has been completely read; If the determination is negative, return to the process of obtaining the row dataset and merging it into the corresponding table object; If the determination is yes, then the workbook object is written to the output stream for export and an Excel spreadsheet is generated.
2. The intelligent conversion method for waste sorting data according to claim 1, characterized in that, The process of generating the table object of the workbook object via POI specifically includes: Generate the table object of the workbook object using POI; Determine if the table name of the table object is empty; If the determination is yes, then the name of the table object is set to the default name; If the determination is negative, then the table object is named according to the table name.
3. The intelligent conversion method for waste sorting data according to claim 1, characterized in that, The process of obtaining the row dataset and merging it into the corresponding table object specifically includes: Extract cell data from the row data set; Create a cell object; Determine whether the cell data corresponding to the cell object is empty; If the determination is negative, then the cell data is written to the cell object; If the determination is yes, then proceed to the step of determining whether the row data set has been completely read.
4. A waste sorting data intelligent conversion device, characterized in that, include: The sorting data acquisition module is used to acquire waste sorting data of waste sorting equipment, wherein the waste sorting data includes waste information and equipment information of waste sorting equipment; The sorting label generation module is used to generate sorting labels based on the device information; A package array generation module is used to generate a package array based on the sorting labels; The tag array generation module is used to sort the parameters in the encapsulated array and generate a tag array; A table file generation module is used to generate an Excel table based on the garbage information and the tag array, wherein the Excel table is used to display the garbage information and the tag array; The step of generating sorting labels based on the device information specifically includes: Determine whether the device information has a matching preset summary tag, wherein the preset summary tag is preset; If the determination is yes, then the corresponding sorting label is obtained according to the matched preset summary label and the preset label mapping information, wherein the label mapping information is preset; If the result is negative, return to the step of obtaining waste sorting data from the waste sorting equipment; The step of generating a sorting and packaging array based on the sorting labels specifically includes: Based on the preset summary tags, the sorting tags, and the tag mapping information, a packaged array is generated through Map encapsulation. The process of generating an Excel spreadsheet from the garbage information and the tag array using Points of Interest (POIs) includes: The garbage information and the tag array are counted, and count information is generated; Based on the garbage information, the tag array, and the counting information, a workbook object is generated through POI encapsulation. Generate an Excel spreadsheet based on the workbook object; The step of generating an Excel spreadsheet based on the workbook object specifically includes: Generate the table object of the workbook object using POI; The row dataset is obtained, merged, and written into the corresponding table object, wherein the row dataset is generated based on the garbage information, the label array, and the count information; Determine whether the row data set has been completely read; If the determination is negative, return to the process of obtaining the row dataset and merging it into the corresponding table object; If the determination is yes, then the workbook object is written to the output stream for export and an Excel spreadsheet is generated.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.