A method, device and storage medium for processing battery charging and discharging data
By introducing a battery charge and discharge data processing method in the Apache Spark environment, Pandas UDF has been solved in the problem of low processing efficiency in multi-input scenarios, and efficient merging and splitting of multiple two-dimensional tabular data is achieved, which improves processing efficiency.
Patent Information
- Application Number
- CN202411654564.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-19
AI Technical Summary
In Apache Spark application environment, Pandas' user-defined functions (UDFs) only support single input and single output, resulting in inefficient processing when facing complex tasks with multiple inputs or large amounts of input data.
By introducing a processing method for battery charging and discharging data in a distributed computing system, the method includes merging and splitting multiple two-dimensional tabular data to realize the conversion of the data structure, and thereby improving processing efficiency.
This method can greatly improve the processing efficiency of data structure conversion of multiple data under the distributed processing framework, and realize the simultaneous processing of multiple tabular data.
Smart Images

Figure CN119166316B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and storage medium for processing battery charging and discharging data. Background Art
[0002] Apache Spark is a computing engine designed for large-scale data processing. It is suitable for parallel processing of big data tasks and is a widely used distributed processing framework. In the application environment of Apache Spark, data processing packages such as Pandas are needed to realize the conversion of data structures between the stand-alone environment and the distributed processing framework; however, the user-defined function (Pandas UDF) in Pandas can only process one input data at a time, that is, it only supports the "single input and single output" situation. When facing complex tasks with multiple inputs or a large amount of input data, there is a problem of low processing efficiency. Summary of the invention
[0003] The embodiments of the present application provide a method, device and storage medium for processing battery charging and discharging data, which can greatly improve the processing efficiency of data structure conversion of multiple data under a distributed processing framework.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for processing battery charge and discharge data, the method comprising:
[0006] In response to a data processing instruction of a master device in a distributed computing system, charge and discharge analysis processing is performed on the to-be-analyzed data of a target power-consuming device using a battery as a power source, thereby obtaining at least two two-dimensional table-type data; wherein the two-dimensional table-type data represents table-type data that supports processing in a single-machine environment;
[0007] Merging at least two two-dimensional table data to obtain a merged table;
[0008] In response to a first data restoration instruction of the master device, the merged table is split to obtain at least two first table data; wherein the first table data represents table data that supports processing by a distributed computing system and has the same content as the two-dimensional table data.
[0009] In this embodiment, when the first device receives the data processing instruction from the main device, it indicates that the main device assigns the task of charging and discharging data analysis to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical device to obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical device. Then the first device can merge the at least two two-dimensional table data to obtain a merged table. Then, when the main device assigns the task of splitting the table to the first device, that is, when the first device receives the first data restoration instruction from the main device, the first device can split the merged table to obtain at least two first table data in the corresponding format of the distributed computing system. In this way, the format conversion of multiple two-dimensional table data can be completed at the same time, that is, the simultaneous processing of multiple table data is realized, which greatly improves the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical devices under the distributed processing framework.
[0010] In some embodiments of the present application, the merged table representation supports the table transmitted and read by the devices in the distributed computing system; the method further includes:
[0011] In response to the first transmission instruction of the master device, the merged table is sent, so that the second device splits the merged table to obtain at least two first table data.
[0012] In this embodiment, the first device can merge and convert the format of multiple two-dimensional table data, so that the obtained merged table can support transmission and reading by various devices in the distributed computing system. Then, when the merged table is split, if the main device determines that the splitting is performed by the second device, the first device can send the merged table to the second device upon receiving the first transmission instruction from the main device, and the second device will complete the splitting task of the merged table, thereby effectively improving the processing capability of multiple input data.
[0013] In some embodiments of the present application, the at least two first tabular data include a first amount of tabular data and a second amount of tabular data; the method further includes:
[0014] In response to a first splitting instruction of the master device, splitting a part of the merged table to obtain a first amount of table data;
[0015] In response to the second transmission instruction of the master device, the merged table is sent, so that the second device splits part of the merged table to obtain a second amount of table data.
[0016] In this embodiment, if the main device determines that the task of splitting the merged table is to be completed jointly by the first device and the second device, the first device can send the merged table to the second device while splitting part of the table, and the second device will complete the splitting and restoration of the other part of the table, which can effectively improve the processing efficiency of splitting tables with large amounts of data.
[0017] In some embodiments of the present application, at least two two-dimensional table data are merged to obtain a merged table, including:
[0018] Merge the field name information and field type information in each of the at least two two-dimensional table data into one row to obtain a field merge row;
[0019] Merge data values of fields in each of at least two two-dimensional table data into one row to obtain a merged data value row;
[0020] Determines which tables to merge based on field merge rows and data value merge rows.
[0021] In this embodiment, when merging tables, the field name information of each two-dimensional table type data in at least two two-dimensional table type data can be first merged into one row to obtain a field merged row, and the data values of the fields of each two-dimensional table type data can be merged into one row to obtain a data value merged row. In this way, the merged table can be determined based on the field merged row and the data value merged row, thereby improving the processing efficiency of multi-table type data.
[0022] In some embodiments of the present application, determining a merged table based on a field merge row and a data value merge row includes:
[0023] Generate data merge columns based on field merge rows and data value merge rows;
[0024] Generate a table name merge column according to the first table name information corresponding to the field merge row and the second table name information corresponding to the data value merge row; wherein the first table name information represents the table name of the two-dimensional table data corresponding to the field merge row; and the second table name information represents the table name of the two-dimensional table data corresponding to the data value merge row;
[0025] Determine the merged table based on the data merge column and table name merge column.
[0026] In this embodiment, the first device can generate a data merged column based on the field merged rows and data value merged rows corresponding to each two-dimensional table type data, and then generate a table name merged column based on the table name of the table to which each field merged row and data value merged row belongs, thereby forming a merged table based on the table name merged column and the data merged column. The merged table thus obtained can not only contain detailed information of all two-dimensional table type data, but also contain a table name merged column that can trace the table to which each field merged row and data value merged row belongs, thereby improving the operability of the battery charging and discharging data processing method.
[0027] In some embodiments of the present application, the merged table is split to obtain at least two first table data, including:
[0028] Get the target field merged rows and target data value merged rows corresponding to the same table name information in the table name merged column in the merged table;
[0029] Determine the table to be restored based on the target field merge row and the target data value merge row;
[0030] The first table data is determined based on the table to be restored.
[0031] In this embodiment, when splitting the first table data, the field merged rows and data value merged rows with the same table name information in the merged table can be first used as the target field merged rows and target data value merged rows, and the table to be restored can be determined based on the target field merged rows and target data value merged rows, that is, these field merged rows and data value merged rows belong to the same original two-dimensional table data, and then the final first table data can be obtained based on each table to be restored, effectively realizing the output of multiple tables in the corresponding format of the distributed computing system.
[0032] In some embodiments of the present application, determining the first table data based on the table to be restored includes:
[0033] Get the field type information corresponding to each field name information in the target field merge row;
[0034] Perform data recovery processing on the data values of each field in the target data value merge row according to the field type information to obtain the target format data value merge row;
[0035] The first table data is determined based on the mapping relationship between each field name information in the target field merge row and each data value in the target format data value merge row.
[0036] In this embodiment, after obtaining the table to be restored, the data value of each field in the table can be restored based on the field type information of each field, so as to obtain a merged row of data values in a target format. The target format is a format corresponding to the field types of each field in the original two-dimensional table data under a distributed computing system. Then, according to each field name information in the merged row of the target field, the corresponding data value can be determined in the merged row of data values in the target format, and the first table data can be restored based on the mapping relationship between each field name information and the corresponding data value, thereby realizing the splitting and restoration of the table data and improving the processing efficiency.
[0037] In a second aspect, an embodiment of the present application provides a method for processing battery charge and discharge data, the method comprising:
[0038] Sending a data processing instruction so that the first device responds to the data processing instruction, performs charge and discharge analysis processing on the to-be-analyzed data of the target electric device using the battery as power, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table; the first device represents any slave device in the distributed computing system;
[0039] A first data restoration instruction is sent to the first device, so that the first device splits the merged table in response to the first data restoration instruction to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data.
[0040] In this embodiment, when the main device assigns the task of charging and discharging data analysis to the first device, it can send a data processing instruction to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical equipment in response to the data processing instruction, and obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical equipment, and merge the at least two two-dimensional table data to obtain a merged table; and then when the main device assigns the task of splitting the table to the first device, it can send a first data restoration instruction to the first device, so that the first device splits the merged table to obtain at least two first table data in the corresponding format of the distributed computing system, thereby completing the format conversion of multiple two-dimensional table data at the same time, that is, realizing the simultaneous processing of multiple table data, which greatly improves the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical equipment under the distributed processing framework.
[0041] In some embodiments, the merged table representation supports a table for transmission and reading by a device in a distributed computing system; the method further comprises:
[0042] Sending a first transmission instruction so that the first device sends the merged table to a second device in response to the first transmission instruction; wherein the second device represents a slave device different from the first device in the distributed computing system;
[0043] A second data restoration instruction is sent, so that the second device splits the merged table in response to the second data restoration instruction to obtain at least two first table data.
[0044] In this embodiment, the first device can merge and format multiple two-dimensional table data, so that the obtained merged table can support transmission and reading by various devices in the distributed computing system. Then, when the merged table is split, if the main device determines that the split is performed by the second device, it will send a first transmission instruction to the first device, so that the first device sends the merged table to the second device. At the same time, the main device will send a second data restoration instruction to the second device, so that the second device completes the task of splitting the merged table, thereby effectively improving the processing capability of multiple input data.
[0045] In some embodiments of the present application, the at least two first tabular data include a first amount of tabular data and a second amount of tabular data; the method further includes:
[0046] Sending a first splitting instruction, so that the first device splits a part of the merged table in response to the first splitting instruction to obtain a first amount of table data;
[0047] sending a second transmission instruction so that the first device sends the merged table to the second device in response to the second transmission instruction;
[0048] A second splitting instruction is sent, so that the second device splits a part of the merged table in response to the second splitting instruction to obtain a second amount of table data.
[0049] In this embodiment, if the main device determines that the task of splitting the merged table is to be completed jointly by the first device and the second device, the main device will send a second transmission instruction and a first splitting instruction to the first device, and send a second splitting instruction to the second device, so that the first device responds to the first splitting instruction, splits part of the table therein, and sends the merged table to the second device, and the second device completes the splitting and restoration of the other part of the table, which can effectively improve the processing efficiency of splitting tables with large amounts of data.
[0050] In a third aspect, an embodiment of the present application provides a first device, including an analyzing unit, a merging unit, and a splitting unit;
[0051] The analysis unit is used to respond to the data processing instruction of the master device in the distributed computing system, perform charge and discharge analysis and processing on the to-be-analyzed data of the target power-consuming device using the battery as the power source, and obtain at least two two-dimensional table data; wherein the two-dimensional table data represents the table data supporting the processing in a single-machine environment; the first device represents any slave device other than the master device in the distributed computing system;
[0052] A merging unit, used for merging at least two two-dimensional table data to obtain a merged table;
[0053] The splitting unit is used to split the merged table in response to the first data restoration instruction of the main device to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data.
[0054] In this embodiment, when the first device receives the data processing instruction from the main device, it indicates that the main device assigns the task of charging and discharging data analysis to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical device to obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical device. Then the first device can merge the at least two two-dimensional table data to obtain a merged table. Then, when the main device assigns the task of splitting the table to the first device, that is, when the first device receives the first data restoration instruction from the main device, the first device can split the merged table to obtain at least two first table data in the corresponding format of the distributed computing system. In this way, the format conversion of multiple two-dimensional table data can be completed at the same time, that is, the simultaneous processing of multiple table data is realized, which greatly improves the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical devices under the distributed processing framework.
[0055] In a fourth aspect, an embodiment of the present application provides a master device, the master device comprising a first sending unit;
[0056] The first sending unit is used to send a data processing instruction so that the first device responds to the data processing instruction, performs charge and discharge analysis on the data to be analyzed of the target electrical equipment powered by a battery, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table; and sends a first data restoration instruction so that the first device responds to the first data restoration instruction to split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data; the first device represents any slave device in the distributed computing system.
[0057] In this embodiment, when the main device assigns the task of charging and discharging data analysis to the first device, it can send a data processing instruction to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical equipment, and obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical equipment, and merge the at least two two-dimensional table data to obtain a merged table; and then when the main device assigns the task of splitting the table to the first device, it can send a first data restoration instruction to the first device, so that the first device splits the merged table to obtain at least two first table data in the corresponding format of the distributed computing system, thereby completing the format conversion of multiple two-dimensional table data at the same time, that is, realizing the simultaneous processing of multiple table data, which greatly improves the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical equipment under the distributed processing framework.
[0058] In a fifth aspect, an embodiment of the present application provides a first device, including a first processor and a first memory storing instructions executable by the first processor; when the instructions are executed by the first processor, the method for processing battery charging and discharging data in the first aspect is implemented.
[0059] In a sixth aspect, an embodiment of the present application provides a main device, including a second processor and a second memory storing instructions executable by the second processor; when the instructions are executed by the second processor, the method for processing battery charge and discharge data in the second aspect is implemented.
[0060] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a first processor, the method for processing battery charge and discharge data in the first aspect is implemented; when the computer program is executed by a second processor, the method for processing battery charge and discharge data in the second aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below.The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application.
[0062] Figure 1 Schematic diagram of the implementation process of the method for processing battery charging and discharging data proposed in the embodiment of the present application Figure 1 ;
[0063] Figure 2 Schematic diagram of the implementation process of the method for processing battery charging and discharging data proposed in the embodiment of the present application Figure 2 ;
[0064] Figure 3Schematic diagram of the implementation process of the method for processing battery charging and discharging data proposed in the embodiment of the present application Figure 3 ;
[0065] Figure 4 Schematic diagram of the implementation process of the method for processing battery charging and discharging data proposed in the embodiment of the present application Figure 4 ;
[0066] Figure 5 Schematic diagram of the implementation process of the method for processing battery charging and discharging data proposed in the embodiment of the present application Figure 5 ;
[0067] Figure 6 Schematic diagram of the implementation process of the method for processing battery charging and discharging data proposed in the embodiment of the present application Figure 6 ;
[0068] Figure 7 Schematic diagram of the implementation process of the method for processing battery charging and discharging data proposed in the embodiment of the present application Figure 7 ;
[0069] Figure 8 Schematic diagram of the composition structure of the first device proposed in the embodiment of the present application Figure 1 ;
[0070] Fig. 9 Schematic diagram of the composition structure of the first device proposed in the embodiment of the present application Figure 2 ;
[0071] Fig.10 Schematic diagram of the composition structure of the main device proposed in the embodiment of the present application Figure 1 ;
[0072] Fig.11 Schematic diagram of the composition structure of the main device proposed in the embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0073] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for ease of description, only the parts related to the related applications are shown in the drawings.
[0074] In the Apache Spark environment, Pandas' user-defined functions only support a single-input, single-output mode. Complex data processing tasks that require multiple outputs usually require the use of an external database for management. This approach not only increases the complexity of the system, but also introduces additional input / output (I / O) overhead and potential data consistency issues, thereby reducing the data processing capabilities and efficiency of related devices.
[0075] In order to solve the current problem, the embodiment of the present application proposes a method, device and storage medium for processing battery charging and discharging data, wherein a first device responds to a data processing instruction of a master device in a distributed computing system, merges at least two two-dimensional table data to obtain a merged table; wherein the two-dimensional table data represents table data that supports processing in a single-machine environment; in response to a first data restoration instruction of the master device, the merged table is split to obtain at least two first table data; wherein the first table data represents table data that supports processing by a distributed computing system and has the same content as the two-dimensional table data. It can be seen that in the present application, when the main device in the distributed computing system assigns the task of charging and discharging data analysis to the first device, it can send a data processing instruction to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical equipment, and obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical equipment, and merge at least two two-dimensional table data to obtain a merged table, and then when the main device assigns the task of splitting the table to the first device, it can send a first data restoration instruction to the first device so that the first device splits the merged table to obtain at least two first table data in the corresponding format of the distributed computing system, thereby completing the format conversion of multiple two-dimensional table data at the same time, that is, realizing the simultaneous processing of multiple two-dimensional table data input data, greatly improving the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical equipment under the distributed processing framework.
[0076] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0077] An embodiment of the present application provides a method for processing battery charge and discharge data, which is applied to a first device; Figure 1 As shown, the method for processing battery charge and discharge data of the first device may include the following steps:
[0078] Step 101, in response to a data processing instruction of a master device in a distributed computing system, charge and discharge analysis and processing are performed on the data to be analyzed of a target power-consuming device powered by a battery to obtain at least two two-dimensional tabular data; wherein the two-dimensional tabular data represents tabular data that supports processing in a single-machine environment.
[0079] In an embodiment of the present application, the first device can respond to the data processing instructions of the main device in the distributed computing system, perform charge and discharge analysis and processing on the data to be analyzed of the target power-consuming device powered by a battery, and obtain at least two two-dimensional tabular data; wherein the two-dimensional tabular data represents tabular data that supports processing in a single-machine environment.
[0080] In an embodiment of the present application, the distributed computing system may be a Spark cluster, which may include a master device and a slave device. The master device may send tasks to the slave device, and the slave device may execute tasks in response to the tasks sent by the master device. Spark can be used to process large-scale data sets, provide powerful distributed computing capabilities, and can process data in parallel across multiple devices.
[0081] In an embodiment of the present application, the first device represents any slave device other than the master device in a distributed computing system; the first device can be any device with communication, storage and computing functions, such as a server, a computer, a laptop computer and other electronic devices.
[0082] In the embodiments of the present application, the present application does not limit the electrical equipment powered by batteries. For example, the electrical equipment may be a new energy vehicle powered by batteries.
[0083] In the embodiments of the present application, the battery may be a battery cell. A battery cell refers to a basic unit that can realize the mutual conversion of chemical energy and electrical energy, and can be used to make a battery module or a battery pack, so as to supply power to electrical equipment. A battery cell may be a secondary battery, which refers to a battery cell that can be continuously used by activating the active material by charging after the battery cell is discharged. The battery cell may be a lithium-ion battery, a sodium-ion battery, a sodium-lithium-ion battery, a lithium metal battery, a sodium metal battery, a lithium-sulfur battery, a magnesium-ion battery, a nickel-hydrogen battery, a nickel-cadmium battery, a lead-acid battery, etc., and the embodiments of the present application do not limit this.
[0084] In the embodiment of the present application, the battery may also be a single physical module including one or more battery cells to provide higher voltage and capacity. When there are multiple battery cells, the multiple battery cells are connected in series, in parallel or in hybrid connection through a busbar component.
[0085] In some embodiments of the present application, the target power-consuming device may include at least one, that is, the number of the target power-consuming devices is not limited in the present application; for example, the target power-consuming devices may be 100 new energy vehicles.
[0086] In an embodiment of the present application, a data processing instruction can be used to instruct the first device to perform a data processing task, which may include analyzing the original data of the target electrical device, and merging the analysis results and converting the data structure to support subsequent processing of the distributed computing system.
[0087] In an embodiment of the present application, the data to be analyzed may be operating condition data of the target electrical equipment. The first device may perform charge and discharge analysis on the operating condition data of the target electrical equipment to obtain charge and discharge analysis results, which may be presented in the form of two-dimensional table data; wherein the charge and discharge analysis results may include charging analysis results and discharging analysis results of the target electrical equipment.
[0088] In the embodiments of the present application, Pandas is an open source data analysis and manipulation tool built on the Python programming language. Pandas is mainly designed as a stand-alone processing tool. For Spark, data exchange between Spark and Pandas can be achieved through user-defined functions, namely Pandas UDFs. For example, the conversion of data structures from Pandas to Spark can be completed through the Python program embedded in the Pandas UDF.
[0089] In some embodiments of the present application, the two-dimensional tabular data represents tabular data that supports processing in a stand-alone environment. The first device can obtain the two-dimensional tabular data based on a processing tool in a stand-alone environment. The present application does not limit the processing tool in a stand-alone environment. For example, Pandas can be used.
[0090] In some embodiments of the present application, the first device can obtain tabular data under a Python data structure, that is, two-dimensional tabular data, based on user-defined functions in data processing packages such as Pandas.
[0091] It should be noted that the current user-defined function can convert the input data from Python data structure to Spark data structure through the embedded Python program, but this conversion only supports single-input and single-output scenarios, and cannot convert multiple input data at the same time; based on this, the present application designs an improved user-defined function, which can simultaneously convert the data structure of at least two two-dimensional tabular data based on the improved user-defined function.
[0092] Exemplarily, the main device in the distributed computing system can assign the task of processing the operating condition data of 100 new energy vehicles to the first device. When responding to the data processing instruction of the main device, the first device can receive the operating condition data (data to be analyzed) of the 100 new energy vehicles (target electrical equipment), and perform charging and discharging behavior analysis on the operating condition data of the 100 new energy vehicles to obtain the charging analysis results and discharging analysis results corresponding to each of the 100 new energy vehicles. The charging analysis results and the discharging analysis results are both two-dimensional table data under the Python data structure.
[0093] Step 102: merge at least two two-dimensional table data to obtain a merged table.
[0094] In an embodiment of the present application, the first device responds to the data processing instructions of the main device in the distributed computing system, performs charge and discharge analysis on the data to be analyzed of the target electrical equipment powered by a battery, and after obtaining at least two two-dimensional table data, the at least two two-dimensional table data can be merged to obtain a merged table.
[0095] In some embodiments of the present application, after obtaining at least two two-dimensional tabular data, the first device can merge the at least two two-dimensional tabular data into a merged table through an improved user-defined function, and can also realize data structure conversion while merging the tables. That is, the first device can convert at least two two-dimensional tabular data originally in Python data structure into a merged table of Spark data structure through an improved user-defined function.
[0096] Exemplarily, the first device can merge the charging analysis results and discharging analysis results corresponding to 100 new energy vehicles, a total of 200 two-dimensional tabular data, through an improved user-defined function to obtain a merged table. This merged table can be a Spark data structure that can support various subsequent calculations and transmission processes in the distributed computing system.
[0097] In some embodiments of the present application, when the first device merges at least two two-dimensional tabular data to obtain a merged table, it can merge the field name information and field type information in each two-dimensional tabular data in the at least two two-dimensional tabular data into one row to obtain a field merged row; merge the data values of the fields in each two-dimensional tabular data in the at least two two-dimensional tabular data into one row to obtain a data value merged row; thereby determining the merged table based on the field merged row and the data value merged row.
[0098] In some embodiments of the present application, each field name information and field type information in a field merge row may be separated by a comma; and the data values of each field in a data value merge row may be separated by a comma.
[0099] For example, a two-dimensional table data table 1 is as follows:
[0100] Table 1
[0101]
[0102] The above two-dimensional table data includes three fields, the data value of field 1 is data 1-1, the data value of field 2 is data 2-1, and the data value of field 3 is data 3-1. At the same time, the field type information of each field is obtained, for example, the field type corresponding to field 1 is a value, and the field types corresponding to field 2 and field 3 are strings; the field name information and field type information in the two-dimensional table data are merged into one row, and the field merged behavior corresponding to the two-dimensional table data can be obtained: field 1, value, field 2, string, field 3, string; the data values of each field are merged into one row, and the data value merged row corresponding to the two-dimensional table data can be obtained as: data 1-1, data 2-1, data 3-1.
[0103] For example, a two-dimensional table data table 2 is as follows:
[0104] Table 2
[0105]
[0106] The above two-dimensional table data includes three fields, the data value of field a is data a-1, the data value of field b is data b-1, and the data value of field c is data c-1. At the same time, the field type information of each field is obtained, for example, the field type information of field a, field b and field c are all strings; the field name information and field type information in the two-dimensional table data are merged into one row, and the field merged behavior corresponding to the two-dimensional table data can be obtained: field a, string, field b, string, field c, string; the data values of each field are merged into one row, and the data value merged row corresponding to the two-dimensional table data can be obtained as: data a-1, data b-1, data c-1.
[0107] In some embodiments of the present application, when the first device determines the merged table based on the field merged row and the data value merged row, it can generate a data merged column according to the field merged row and the data value merged row; generate a table name merged column according to the first table name information corresponding to the field merged row and the second table name information corresponding to the data value merged row; wherein the first table name information represents the table name of the two-dimensional table type data corresponding to the field merged row; the second table name information represents the table name of the two-dimensional table type data corresponding to the data value merged row; and determine the merged table based on the data merged column and the table name merged column.
[0108] In an embodiment of the present application, when generating a data merge column based on field merge rows and data value merge rows, the field merge rows and data value merge rows corresponding to at least two two-dimensional table data can be merged into one column to obtain a data merge column.
[0109] Exemplarily, the field merged rows and data value merged rows corresponding to Table 1 and Table 2 are merged into one column, and the obtained data merged column can be shown in the following table:
[0110] Table 3
[0111]
[0112] Exemplarily, since the first table name information corresponding to the above field merge row "#field 1, value, field 2, string, field 3, string" is table 1, the second table name information corresponding to the data value merge row "data 1-1, data 2-1, data 3-1" is table 1, the first table name information corresponding to the field merge row "#field a, string, field b, string, field c, string" is table 2, and the second table name information corresponding to the data value merge row "data a-1, data b-1, data c-1" is table 2, the table name merge column generated according to the above first table name information and the second table name information can be shown in the following table:
[0113] Table 4
[0114]
[0115] Exemplarily, the merged table determined according to the data merge column shown in Table 3 and the table name merge column shown in Table 4 may be as shown in the following table:
[0116] Table 5
[0117]
[0118] Step 103 , in response to a first data restoration instruction of the master device, split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports processing by a distributed computing system and has the same content as the two-dimensional table data.
[0119] In an embodiment of the present application, after merging at least two two-dimensional table data to obtain a merged table, the first device can respond to a first data restoration instruction of the main device to split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data.
[0120] In an embodiment of the present application, a data restoration instruction can be used to instruct a slave device in a distributed computing system to perform a table splitting task; the data restoration instruction may include a first data restoration instruction and a second data restoration instruction, the first data restoration instruction represents an instruction instructing the first device to perform the table splitting task, and the second data restoration instruction represents an instruction instructing the second device to perform the table splitting task.
[0121] In some embodiments of the present application, if the first device receives the first data restoration instruction, it means that the master device assigns the task of table splitting to the first device, and the first device can perform the task of table splitting.
[0122] In an embodiment of the present application, the first table data represents table data that supports processing by a distributed computing system and has the same content as the two-dimensional table data. In other words, the first table data is restored table data of a Spark data structure corresponding to the original two-dimensional table data.
[0123] In some embodiments of the present application, when the first device splits the merged table to obtain at least two first table data, it can obtain the target field merged row and the target data value merged row corresponding to the same table name information in the table name merged column in the merged table; then determine the table to be restored based on the target field merged row and the target data value merged row; thereby determining the first table data based on the table to be restored.
[0124] It can be understood that in the embodiments of the present application, the target field merge rows and the target data value merge rows refer to the field merge rows and data value merge rows with the same table name information; the target field merge rows and the target data value merge rows are the field merge rows and data value merge rows belonging to the same two-dimensional table type data.
[0125] Exemplarily, the merged table shown in the above Table 5 is split, and the field merged rows and data value merged rows whose table name information is Table 1 in the merged table can be obtained first, then it can be determined that the table to be restored corresponding to Table 1 includes the field merged rows "#Field 1: numerical value, field 2: string, field 3: string" and the data value merged rows "Data 1-1, Data 2-1, Data 3-1"; the field merged rows and data value merged rows whose table name information is Table 2 can also be obtained, then it can be determined that the table to be restored corresponding to Table 2 includes the field merged rows "#Field a: string, field b: string, field c: string" and the data value merged rows "Data a-1, Data b-1, Data c-1".
[0126] In some embodiments of the present application, when the first device determines the first table data based on the table to be restored, it can obtain the field type information corresponding to the field name information in the target field merge row; then, according to the field type information, data recovery processing is performed on the data values of each field in the target data value merge row to obtain a data value merge row in the target format; finally, the first table data is determined based on the mapping relationship between the field name information in the target field merge row and the data values in the data value merge row in the target format.
[0127] In an embodiment of the present application, the target format represents a format corresponding to the field type information in a distributed computing system; for example, if a data value whose field type information is a string has a format difference between a Python environment and a Spark environment, data recovery processing needs to be performed on the field to adjust it to the string format in the Spark environment.
[0128] Exemplarily, when determining the first table data corresponding to Table 1 based on the table to be restored corresponding to Table 1, the field type information corresponding to each field name information can be first obtained from the target field merge row of the table to be restored, and the data value of the field can be recovered according to the field type information to obtain the target format data value merge row corresponding to Table 1, and then the corresponding first table data can be determined according to the mapping relationship between different field name information and the corresponding target format data value. The form of the first table data corresponding to Table 1 is the same as the original two-dimensional table data in the aforementioned example, except that the field type of each field is the data structure corresponding to Spark.
[0129] Exemplarily, the first table data corresponding to Table 1 may be shown in the following table:
[0130] Table 6
[0131]
[0132] Among them, data 1-1′ represents the data value of field 1 under the Spark data structure, data 2-1′ represents the data value of field 2 under the Spark data structure, and data 3-1′ represents the data value of field 3 under the Spark data structure.
[0133] Exemplarily, the first table data corresponding to Table 2 may be shown in the following table:
[0134] Table 7
[0135]
[0136] Among them, data a-1′ represents the data value of field a under the Spark data structure, data b-1′ represents the data value of field b under the Spark data structure, and data c-1′ represents the data value of field c under the Spark data structure.
[0137] In some embodiments of the present application, after obtaining at least two first table data, the first device can send at least two first table data to the receiving device in response to the first indication information of the main device; for example, the first table data may include the charging and discharging analysis results of a new energy vehicle, and the receiving device may be the vehicle computer of the new energy vehicle or the mobile device corresponding to the new energy vehicle, such as the owner's mobile phone and other devices.
[0138] In some embodiments of the present application, Figure 2 As shown, after step 102, the method for processing battery charge and discharge data may further include the following steps:
[0139] Step 104 : In response to the first transmission instruction of the master device, send the merged table so that the second device splits the merged table to obtain at least two first table data.
[0140] In an embodiment of the present application, the first device can also merge at least two two-dimensional table data to obtain a merged table, and then, in response to a first transmission instruction from the main device, send the merged table to the second device, so that the second device splits the merged table to obtain at least two first table data.
[0141] In an embodiment of the present application, the second device represents a slave device other than the first device and the master device in the distributed computing system.
[0142] In an embodiment of the present application, the master device can determine how to allocate the current task of splitting the merged table by analyzing the computing power usage of each slave device in the current distributed computing system, including allocating all split tasks to one slave device, or allocating the split tasks to at least two slave devices, so that at least two slave devices can jointly complete the split tasks, which can improve the processing efficiency when facing massive table data.
[0143] In an embodiment of the present application, a first transmission instruction is used to instruct the first device to send the merged table to the second device for splitting; when the master device determines that the current computing power usage of the first device is too high and is not suitable for executing the table splitting task by analyzing the computing power usage of each slave device in the current distributed computing system, a first transmission instruction can be sent to the first device, so that the first device sends the merged table to the second device for splitting through the network in the distributed computing system.
[0144] In an embodiment of the present application, the second device represents a slave device different from the first device. The number of second devices is not limited in this application and can be one or more; that is, the first device can send the merged table to one or more slave devices other than itself in the distributed computing system, and the other one or more slave devices in the distributed computing system complete the splitting of the table.
[0145] In an embodiment of the present application, the merged table representation supports a table for transmission and reading by devices in a distributed computing system. For example, the merged table may be a table of a Spark data structure, so that the first device can send the merged table to another slave device in the distributed computing system, namely, the second device.
[0146] In some embodiments of the present application, Figure 3 As shown, after step 102, the method for processing battery charge and discharge data may further include the following steps:
[0147] Step 105 : In response to the first splitting instruction of the master device, split a portion of the merged table to obtain a first amount of table data.
[0148] In an embodiment of the present application, the first device may also merge at least two two-dimensional table data to obtain a merged table, and then, in response to a first split instruction from the main device, split part of the merged table to obtain a first amount of table data.
[0149] In an embodiment of the present application, if the main device assigns the table splitting task to the first device and the second device, that is, the first device and the second device jointly complete the table splitting task, a first splitting instruction and a second transmission instruction can be sent to the first device, and the first splitting instruction is used to instruct the first device to split and restore part of the merged table, and the second transmission instruction can be used to instruct the first device to send the merged table to the second device to split part of the table.
[0150] In some embodiments of the present application, after obtaining the first amount of table data, the first device can send the first amount of table data to a slave device in the distributed computing system in response to the second indication information of the master device, so that the slave device sends the first amount of table data to the receiving device after collecting all the table data.
[0151] Step 106 : In response to the second transmission instruction of the master device, send the merged table so that the second device splits part of the merged table to obtain a second amount of table data.
[0152] In an embodiment of the present application, the first device can also merge at least two two-dimensional table data to obtain a merged table, and then, in response to a second transmission instruction from the main device, send the merged table to the second device, so that the second device splits part of the merged table to obtain a second amount of table data.
[0153] Exemplarily, the master device determines to assign the splitting task of the merged table obtained by merging 200 two-dimensional table-type data to the first device and the other two slave devices, including slave device A and slave device B, and the three slave devices jointly perform the splitting task, wherein the first device splits 50 of the tables, including tables 1 to 50, slave device A splits 100 of the tables, including tables 51 to 150, and slave device B splits the remaining 50 tables, including tables 151 to 200; then the master device can send a first splitting instruction to the first device, and the first splitting instruction can include It carries table name indication information indicating the splitting of tables 1 to 50, so that the first device can split tables 1 to 50 in the merged table in response to the first splitting instruction; the master device can also send a second transmission instruction to the first device, so that the first device can send the merged table to slave device A and slave device B, and at the same time the master device will send an instruction indicating the splitting of tables 51 to 150 to device A, and send an instruction indicating the splitting of tables 151 to 200 to slave device B, so that slave device A and slave device B can complete the splitting and restoration of part of the table according to their respective instructions.
[0154] In some embodiments of the present application, the first device sends the merged table to the second device in response to the second transmission instruction of the main device, so that the second device splits part of the merged table to obtain a second amount of table data. The first device can also respond to the third indication information of the main device, and after receiving the second amount of table data from the second device, summarize the first amount of table data and the second amount of table data and send them to the receiving device.
[0155] An embodiment of the present application provides a method for processing battery charging and discharging data, wherein a first device can respond to a data processing instruction of a master device in a distributed computing system, perform charging and discharging analysis on the data to be analyzed of a target electrical device using a battery as power, and obtain at least two two-dimensional tabular data; wherein the two-dimensional tabular data represents tabular data that supports processing in a single-machine environment; the first device represents any slave device other than the master device in the distributed computing system; wherein the two-dimensional tabular data represents tabular data that supports processing in a single-machine environment; at least two two-dimensional tabular data are merged to obtain a merged table; in response to a first data restoration instruction of the master device, the merged table is split to obtain at least two first tabular data; wherein the first tabular data represents tabular data that supports processing by a distributed computing system and has the same content as the two-dimensional tabular data. It can be seen that when the first device receives the data processing instruction from the main device, it indicates that the main device assigns the task of charging and discharging data analysis to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical equipment, and obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical equipment. Then the first device can merge at least two two-dimensional table data to obtain a merged table. Then, when the main device assigns the task of splitting the table to the first device, that is, when the first device receives the first data restoration instruction from the main device, the first device can split the merged table to obtain at least two first table data in the corresponding format of the distributed computing system, thereby completing the format conversion of multiple two-dimensional table data at the same time, that is, realizing the simultaneous processing of multiple table data, which greatly improves the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical equipment under the distributed processing framework.
[0156] Based on the above embodiment, in another embodiment of the present application, a method for processing battery charging and discharging data is provided, which is applied to a master device in a distributed computing system, such as Figure 4 As shown, the method for processing battery charge and discharge data of the master device may include the following steps:
[0157] Step 201, sending a data processing instruction so that the first device responds to the data processing instruction, performs charge and discharge analysis on the data to be analyzed of the target electrical device powered by a battery, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table.
[0158] In an embodiment of the present application, the master device can send a data processing instruction to the first device, so that the first device responds to the data processing instruction, performs charging and discharging analysis on the data to be analyzed of the target electrical equipment powered by a battery, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table; wherein the first device represents any slave device in the distributed computing system.
[0159] In an embodiment of the present application, the master device, as a core node in a distributed computing system, can perform task allocation according to the current resource occupancy of each slave device, and allocate tasks to each slave device for execution to improve the execution efficiency of the tasks.
[0160] In an embodiment of the present application, a data processing instruction can be used to instruct the first device to perform a data processing task, which may include analyzing the original data of the target electrical device, and merging the analysis results and converting the data structure to support subsequent processing of the distributed computing system.
[0161] Step 202: Send a first data restoration instruction so that the first device splits the merged table in response to the first data restoration instruction to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data.
[0162] In an embodiment of the present application, a main device sends a data processing instruction so that a first device responds to the data processing instruction, performs charge and discharge analysis on the data to be analyzed of a target electrical device powered by a battery, obtains at least two two-dimensional table data, and merges at least two two-dimensional table data. After obtaining the merged table, a first data restoration instruction can be sent to the first device so that the first device responds to the first data restoration instruction to split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data.
[0163] In an embodiment of the present application, a data restoration instruction can be used to instruct a slave device in a distributed computing system to perform a table splitting task; the data restoration instruction may include a first data restoration instruction and a second data restoration instruction, the first data restoration instruction represents an instruction instructing the first device to perform the table splitting task, and the second data restoration instruction represents an instruction instructing the second device to perform the table splitting task.
[0164] Among them, the second device represents a slave device other than the first device and the master device in the distributed computing system; the number of second devices is not limited in this application and can be one or more.
[0165] In some embodiments of the present application, the merged table representation supports a table for transmission and reading by devices in the distributed computing system; the master device may also send a first transmission instruction to the first device so that the first device sends the merged table to the second device in response to the first transmission instruction; and send a second data restoration instruction to the second device so that the second device splits the merged table in response to the second data restoration instruction to obtain at least two first table data.
[0166] In some embodiments of the present application, the first transmission instruction is used to instruct the first device to send the merged table to the second device for splitting; when the master device analyzes the computing power usage of each slave device in the current distributed computing system and determines that the current computing power usage of the first device is too high and is not suitable for executing the table splitting task, it can send the first transmission instruction to the first device.
[0167] In some embodiments of the present application, at least two first table data may include a first quantity of table data and a second quantity of table data; if the main device assigns the table splitting task to the first device and the second device, that is, the table splitting task is completed by the first device and the second device together, a first splitting instruction can be sent to the first device, so that the first device responds to the first splitting instruction to perform partial table splitting processing on the merged table to obtain a first quantity of table data; a second transmission instruction is sent to the first device, so that the first device sends the merged table to the second device in response to the second transmission instruction; a second splitting instruction is sent to the second device, so that the second device responds to the second splitting instruction to perform partial table splitting processing on the merged table to obtain a second quantity of table data.
[0168] In an embodiment of the present application, the first split instruction is used to instruct the first device to split and restore part of the merged table, and the second transmission instruction can be used to instruct the first device to send the merged table to the second device to split the part of the table.
[0169] Exemplarily, the master device determines to assign the splitting task of the merged table obtained by merging 200 two-dimensional table-type data to the first device and the other two slave devices, including slave device A and slave device B, and the three slave devices jointly perform the splitting task, wherein the first device splits 50 of the tables, including tables 1 to 50, slave device A splits 100 of the tables, including tables 51 to 150, and slave device B splits the remaining 50 tables, including tables 151 to 200; then the master device can send a first splitting instruction to the first device, and the first splitting instruction can include It carries table name indication information indicating the splitting of tables 1 to 50, so that the first device can split tables 1 to 50 in the merged table in response to the first splitting instruction; the master device can also send a second transmission instruction to the first device, so that the first device can send the merged table to slave device A and slave device B, and at the same time the master device will send an instruction indicating the splitting of tables 51 to 150 to device A, and send an instruction indicating the splitting of tables 151 to 200 to slave device B, so that slave device A and slave device B can complete the splitting and restoration of part of the table according to their respective instructions.
[0170] In some embodiments of the present application, the main device may send a first indication message to the first device so that the first device sends at least two first table data to the receiving device; for example, the first table data may include the charging and discharging analysis results of a new energy vehicle, and the receiving device may be the vehicle computer of the new energy vehicle or the mobile device corresponding to the new energy vehicle, such as the owner's mobile phone and other devices.
[0171] In some embodiments of the present application, the master device may send a second indication message to the first device after the first device obtains the first amount of table data, so that the first device sends the first amount of table data to a slave device in the distributed computing system, so that the slave device sends the table data to the receiving device after collecting all the table data.
[0172] In some embodiments of the present application, the main device may send a third indication message to the first device so that the first device splits part of the merged table on the second device to obtain a second amount of table data. After receiving the second amount of table data sent by the second device, the first device summarizes the first amount of table data and the second amount of table data and sends them to the receiving device.
[0173] An embodiment of the present application provides a method for processing battery charging and discharging data, wherein a main device sends a data processing instruction to a first device, so that the first device responds to the data processing instruction, performs charging and discharging analysis on the data to be analyzed of a target electrical device powered by a battery, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table; a first data restoration instruction is sent to the first device, so that the first device responds to the first data restoration instruction to split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data. It can be seen that when the main device assigns the task of charging and discharging data analysis to the first device, it can send a data processing instruction to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical equipment, and obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical equipment, and merge at least two two-dimensional table data to obtain a merged table; and then when the main device assigns the task of splitting the table to the first device, it can send a first data restoration instruction to the first device, so that the first device splits the merged table to obtain at least two first table data in the corresponding format of the distributed computing system, thereby completing the format conversion of multiple two-dimensional table data at the same time, that is, realizing the simultaneous processing of multiple table data, which greatly improves the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical equipment under the distributed processing framework.
[0174] Based on the above embodiment, in another embodiment of the present application, Figure 5 As shown, the method for processing battery charging and discharging data applied to a distributed computing system may include the following steps:
[0175] Step 301: The master device sends a data processing instruction to the first device.
[0176] Step 302: In response to the data processing instruction, the first device performs charge and discharge analysis on the data to be analyzed of the target power-consuming device powered by a battery to obtain at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table.
[0177] Step 303: The master device sends a first data restoration instruction to the first device.
[0178] Step 304: The first device splits the merged table in response to the first data restoration instruction to obtain at least two first table data.
[0179] In an embodiment of the present application, the master device can determine how to allocate the task of splitting the merged table by analyzing the computing power usage of each slave device in the current distributed computing system, including allocating all split tasks to one slave device, or allocating the split tasks to at least two slave devices, so that at least two slave devices can jointly complete the split tasks, which can improve the processing efficiency when facing massive table data.
[0180] In some embodiments of the present application, the master device may also assign the table splitting task to a second device other than the first device after the first device completes the table merging; Figure 6 As shown, after step 302, the method for processing battery charging and discharging data of the distributed computing system may further include the following steps:
[0181] Step 305: The master device sends a first transmission instruction to the first device.
[0182] Step 306: The first device sends the merged table to the second device in response to the first transmission instruction.
[0183] Step 307: The master device sends a second data restoration instruction to the second device.
[0184] Step 308: The second device splits the merged table in response to the second data restoration instruction to obtain at least two first table data.
[0185] In an embodiment of the present application, when the master device determines, by analyzing the computing power usage of each slave device in the current distributed computing system, that the current computing power usage of the first device is too high and is not suitable for executing the table splitting task, a first transmission instruction can be sent to the first device, so that the first device sends the merged table to the second device for splitting via the network in the distributed computing system.
[0186] In an embodiment of the present application, the number of second devices is not limited in this application and can be one or more; in other words, the first device can send the merged table to one or more slave devices other than itself in the distributed computing system, and the other one or more slave devices in the distributed computing system will complete the splitting of the table.
[0187] In some embodiments of the present application, the master device may also assign the table splitting task to the first device and the second device, and the first device and the second device jointly complete the table splitting task; Figure 7 As shown, after step 302, the method for processing battery charging and discharging data of the distributed computing system may further include the following steps:
[0188] Step 309: The master device sends a first split instruction to the first device.
[0189] Step 310: In response to the first splitting instruction, the first device splits part of the merged table to obtain a first amount of table data.
[0190] Step 311: The master device sends a second transmission instruction to the first device.
[0191] Step 312: The first device sends the merged table to the second device in response to the second transmission instruction.
[0192] In this embodiment, the execution order of step 309 and step 311 is not limited in this application. For example, step 311 may be executed after step 309, or step 309 may be executed after step 311, or step 309 and step 311 may be executed simultaneously.
[0193] Step 313: The master device sends a second split instruction to the second device.
[0194] Step 314: The second device splits part of the merged table in response to the second split instruction to obtain a second amount of table data.
[0195] An embodiment of the present application provides a method for processing battery charge and discharge data applied to a distributed computing system. In the distributed computing system, a master device can send instructions to each slave device, and each slave device can complete the relevant processing of the battery charge and discharge data accordingly according to the instructions of the master device, thereby realizing simultaneous processing of multiple charge and discharge data and conversion of data structures based on the distributed computing system, thereby improving the processing efficiency of the battery charge and discharge data.
[0196] Based on the above embodiments, in another embodiment of the present application, illustratively, the present application optimizes user-defined functions so that it can perform data structure conversion and output multiple tables after conversion for multi-input two-dimensional tabular data (DataFrame) on the basis of a single input; the present application mainly merges multiple two-dimensional tabular data to generate a merged table, and then uses a distributed computing system to split and restore the merged table, that is, it can automatically identify and restore multiple two-dimensional tabular data under the Spark data structure, thereby effectively reducing the complexity of relying on external databases for processing in the current multi-input and multi-output scenarios, while retaining the integrity and consistency of the data, greatly simplifying the data processing process, and making it possible to process complex computing tasks with multi-dimensional and multi-table combinations in the Spark environment more efficient and reliable, reducing the complexity of data operations and potential error risks.
[0197] For example, the user-defined functions in the current related technologies can only handle the situation of single input and single output, and have very great limitations when facing the processing of multiple data. Since only one table after data structure conversion can be returned each time, other means are needed, such as processing through an external database, or by calling multiple user-defined functions to process them separately. When the amount of data is large, the complexity of data processing and the redundancy of code will be greatly increased; this embodiment avoids dependence on external database servers, is completely based on distributed computing systems, and makes full use of existing computing resources. By adding a data merging layer and a data restoration layer to the software framework of the first device, it is possible to directly complete data calculation, merging and restoration within the distributed computing system, better utilize distributed computing capabilities, and avoid performance bottlenecks caused by transferring data to an external database, so that large-scale data tasks can be processed more efficiently, significantly improving computing performance and throughput.
[0198] Exemplarily, the user-defined function extracts and stores the field names and field types in at least two two-dimensional tabular data through an embedded Python program. By extracting the field names and field types, it can be ensured that each field can be accurately identified and restored during the process of migrating data from data processing packages such as Pandas to Spark.
[0199] Exemplarily, the field names and their field types are merged into one row, with the field names and field types separated by commas, and the data values of each field in each two-dimensional table data are merged into one row, with the data values separated by commas; then all the field merged rows and data value merged rows are merged into one column; in addition, a table name merge column is generated based on the table names corresponding to the field merged rows and data value merged rows to record and distinguish the names of the original tables, thereby obtaining a merged table; in the subsequent data restoration process, the table names in the table name merge column can be used to split the field merged rows and data value merged rows.
[0200] In some embodiments of the present application, the improved user-defined function can not only perform merge processing, but also perform data structure conversion of table data, and subsequent splitting and restoration of the merged table; by extracting the table name in the merged table, the merged table is split into individual tables to be restored, and then using the field type information, the data value of each field is processed into the data value corresponding to the field type in the Spark environment, and according to the mapping relationship between each field name and the corresponding data value, the table to be restored is restored to the final first table data.
[0201] Exemplarily, a slave device in a Spark cluster can merge two Pandas DataFrames, that is, two two-dimensional tabular data, when all necessary databases and environmental devices are ready; including extracting the field name information and field type information of each table, and combining this information into a row, for example, merging the field name information and field type information of one of the tables into a row to obtain a field merge row, and the merge format can be: #field 1: type 1, field 2: type 2, and this row can be used as the first row of the data merge column in the merged table; the data values of each field in the table can also be merged into a row to obtain a data value merge row, and the data value merge row of each table is placed below the field merge row, and then the field merge rows and data value merge rows of the two tables are merged into one column to obtain a data merge column; then the corresponding table name is added to each row in the data merge column to form a table name merge column, thereby obtaining a merged table.
[0202] Exemplarily, any slave device in the distributed computing system may use the improved user-defined function to perform table merging processing to obtain a merged table, and then perform subsequent splitting processing on the merged table based on the distributed computing system.
[0203] Exemplarily, when splitting the merged table based on a distributed computing system, the merged table can be first split into two tables to be restored using the table name merge column, and then the data type of the data value of each field can be processed using the field type information in the merged row of each field to achieve the conversion of the data type of the Pandas table to the data type of the Spark table; at the same time, according to the mapping relationship between each field and the corresponding data value, the table to be restored is further split to obtain the final two Spark DataFrames, thereby achieving the conversion of the data structure of multi-table data from the Pandas framework to the Spark framework.
[0204] In summary, the present application can break through the limitations of the distributed computing system framework, provide good support for scenarios with multiple table data outputs, avoid the complex operations caused by the need to build an additional relational database in current related methods, reduce the demand for additional hardware resources, database software licenses and other resources, and completely rely on the existing distributed computing system, making full use of existing computing resources for different usage scenarios, effectively improving the applicability and versatility of the method.
[0205] An embodiment of the present application provides a method for processing battery charging and discharging data, wherein a first device can respond to a data processing instruction of a master device in a distributed computing system, perform charging and discharging analysis on the data to be analyzed of a target electrical device using a battery as power, and obtain at least two two-dimensional tabular data; wherein the two-dimensional tabular data represents tabular data that supports processing in a single-machine environment; the first device represents any slave device other than the master device in the distributed computing system; wherein the two-dimensional tabular data represents tabular data that supports processing in a single-machine environment; at least two two-dimensional tabular data are merged to obtain a merged table; in response to a first data restoration instruction of the master device, the merged table is split to obtain at least two first tabular data; wherein the first tabular data represents tabular data that supports processing by a distributed computing system and has the same content as the two-dimensional tabular data. It can be seen that when the first device receives the data processing instruction from the main device, it indicates that the main device assigns the task of charging and discharging data analysis to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical equipment, and obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical equipment. Then the first device can merge at least two two-dimensional table data to obtain a merged table. Then, when the main device assigns the task of splitting the table to the first device, that is, when the first device receives the first data restoration instruction from the main device, the first device can split the merged table to obtain at least two first table data in the corresponding format of the distributed computing system, thereby completing the format conversion of multiple two-dimensional table data at the same time, that is, realizing the simultaneous processing of multiple table data, which greatly improves the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical equipment under the distributed processing framework.
[0206] Based on the above embodiment, in another embodiment of the present application, a first device is provided, such as Figure 8 As shown, the first device 1 may include an analyzing unit 11 , a merging unit 12 , a splitting unit 13 and a second sending unit 14 .
[0207] The analysis unit 11 can be used to respond to the data processing instructions of the master device in the distributed computing system, perform charge and discharge analysis and processing on the data to be analyzed of the target electrical equipment powered by the battery, and obtain at least two two-dimensional table data; wherein the two-dimensional table data represents the table data that supports single-machine environment processing; the first device represents any slave device other than the master device in the distributed computing system.
[0208] The merging unit 12 may be used to merge at least two two-dimensional table data to obtain a merged table.
[0209] The splitting unit 13 can be used to respond to the first data restoration instruction of the main device to split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data.
[0210] In some embodiments, the merging unit 12 can also be used to merge the field name information and field type information in each two-dimensional table data in at least two two-dimensional table data into one row to obtain a field merged row; and merge the data values of the fields in each two-dimensional table data in at least two two-dimensional table data into one row to obtain a data value merged row; and determine the merged table based on the field merged row and the data value merged row.
[0211] In some embodiments, the merging unit 12 can also be used to generate a data merged column based on the field merged row and the data value merged row; and to generate a table name merged column based on the first table name information corresponding to the field merged row and the second table name information corresponding to the data value merged row; wherein the first table name information represents the table name of the two-dimensional table type data corresponding to the field merged row; the second table name information represents the table name of the two-dimensional table type data corresponding to the data value merged row; and determine the merged table based on the data merged column and the table name merged column.
[0212] In some embodiments, the splitting unit 13 can also be used to obtain the target field merged rows and target data value merged rows corresponding to the same table name information in the table name merged column in the merged table; and determine the table to be restored based on the target field merged rows and the target data value merged rows; and determine the first table data based on the table to be restored.
[0213] In some embodiments, the splitting unit 13 can also be used to obtain field type information corresponding to each field name information in the target field merge row; and perform data recovery processing on the data values of each field in the target data value merge row according to the field type information to obtain a data value merge row in the target format; and determine the first table data based on the mapping relationship between each field name information in the target field merge row and each data value in the data value merge row in the target format.
[0214] In some embodiments, the merging unit 12 can also be used to respond to data processing instructions, receive data to be analyzed from a user device, and analyze and process the data to be analyzed to obtain at least two two-dimensional table data; and merge and process at least two two-dimensional table data to obtain a merged table.
[0215] In some embodiments, the merged table represents a table that supports transmission and reading by devices in a distributed computing system; the second sending unit 14 can be used to respond to the first transmission instruction of the master device to send the merged table so that the second device splits the merged table to obtain at least two first table data; wherein the second device represents a device other than the first device and the master device in the distributed computing system.
[0216] In some embodiments, at least two first table data include a first quantity of table data and a second quantity of table data; the splitting unit 13 can also be used to respond to a first splitting instruction of the main device, split a portion of the merged table to obtain a first quantity of table data; the second sending unit 14 can also be used to respond to a second transmission instruction of the main device, send the merged table, so that the second device splits a portion of the merged table to obtain a second quantity of table data.
[0217] In the embodiments of the present application, further, Fig. 9 Schematic diagram of the composition structure of the first device proposed in the embodiment of the present application Figure 2 ,like Fig. 9 As shown, the first device 1 proposed in the embodiment of the present application may also include a first processor 15 and a first memory 16 storing executable instructions of the first processor 15; further, the first device 1 may also include a first communication interface 17, and a first bus 18 for connecting the first processor 15, the first memory 16 and the first communication interface 17.
[0218] In the embodiment of the present application, the first processor 15 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiment of the present application is not specifically limited. The first device 1 may also include a first memory 16, which may be connected to the first processor 15, wherein the first memory 16 is used to store executable program code, the program code includes computer operation instructions, and the first memory 16 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.
[0219] In the embodiment of the present application, the first bus 18 is used to connect the first communication interface 17, the first processor 15 and the first memory 16, and the mutual communication between these devices.
[0220] In the embodiment of the present application, the first memory 16 is used to store instructions and data.
[0221] Furthermore, in an embodiment of the present application, the above-mentioned first processor 15 is used to respond to a data processing instruction of a main device in a distributed computing system, perform charge and discharge analysis on the data to be analyzed of a target electrical equipment powered by a battery, and obtain at least two two-dimensional table data; wherein the two-dimensional table data represents table data that supports processing in a single-machine environment; merge at least two two-dimensional table data to obtain a merged table; respond to a first data restoration instruction of the main device, split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports processing by a distributed computing system and has the same content as the two-dimensional table data.
[0222] In practical applications, the first memory 16 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the first processor 15.
[0223] The embodiment of the present application provides a first device, which is used to respond to the data processing instruction of the master device in the distributed computing system, merge at least two two-dimensional table data to obtain a merged table; wherein the two-dimensional table data represents the table data that supports the processing in a single machine environment; and respond to the first data restoration instruction of the master device, split the merged table to obtain at least two first table data; wherein the first table data represents the table data that supports the processing of the distributed computing system and has the same content as the two-dimensional table data. It can be seen that any slave device in the distributed computing system can merge at least two two-dimensional table data to obtain a merged table when processing at least two two-dimensional table data that only supports the single machine environment, and then when the master device assigns the task of splitting the table to the first device, that is, when the first device receives the first data restoration instruction of the master device, the first device can split the merged table to obtain at least two first table data in the corresponding format of the distributed computing system, thereby completing the format conversion of multiple two-dimensional table data at the same time, that is, realizing the simultaneous processing of multiple input data, which greatly improves the processing efficiency of data structure conversion of multiple input data under the distributed processing framework.
[0224] Based on the above embodiment, in another embodiment of the present application, a main device is provided, such as Fig.10 As shown, the master device 2 may include a first sending unit 21 .
[0225] The first sending unit 21 can send a data processing instruction so that the first device responds to the data processing instruction, performs charging and discharging analysis on the data to be analyzed of the target electrical equipment powered by a battery, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table; and sends a first data restoration instruction so that the first device responds to the first data restoration instruction to split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports processing by a distributed computing system and has the same content as the two-dimensional table data; the first device represents any slave device in the distributed computing system.
[0226] In some embodiments, the merged table represents a table that supports transmission and reading by devices in a distributed computing system; the first sending unit 21 can also be used to send a first transmission instruction so that the first device sends the merged table to the second device in response to the first transmission instruction; wherein the second device represents a slave device different from the first device in the distributed computing system; and send a second data restoration instruction so that the second device splits the merged table in response to the second data restoration instruction to obtain at least two first table data.
[0227] In some embodiments, at least two first table data include a first quantity of table data and a second quantity of table data. The first sending unit 21 can also be used to send a first splitting instruction so that the first device splits part of the merged table in response to the first splitting instruction to obtain a first quantity of table data; and send a second transmission instruction so that the first device sends the merged table to the second device in response to the second transmission instruction; and send a second splitting instruction so that the second device splits part of the merged table in response to the second splitting instruction to obtain a second quantity of table data.
[0228] Fig.11 Schematic diagram of the composition structure of the main device proposed in the embodiment of the present application Figure 2 ,like Fig.11 As shown, the main device 2 proposed in the embodiment of the present application may also include a second processor 22 and a second memory 23 storing executable instructions of the second processor 22; further, the main device 2 may also include a second communication interface 24, and a second bus 25 for connecting the second processor 22, the second memory 23 and the second communication interface 24.
[0229] In an embodiment of the present application, the second processor 22 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the function of the first processor may also be other, and the embodiment of the present application is not specifically limited. The main device 2 may also include a second memory 23, which may be connected to the second processor 22, wherein the second memory 23 is used to store executable program code, the program code includes computer operation instructions, and the second memory 23 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.
[0230] In the embodiment of the present application, the second bus 25 is used to connect the second communication interface 24, the second processor 22 and the second memory 23, and the mutual communication between these devices.
[0231] In the embodiment of the present application, the second memory 23 is used to store instructions and data.
[0232] Furthermore, in an embodiment of the present application, the above-mentioned second processor 22 is used to send a data processing instruction so that the first device responds to the data processing instruction, performs charging and discharging analysis on the data to be analyzed of the target electrical equipment powered by a battery, obtains at least two two-dimensional table data, and merges at least two two-dimensional table data to obtain a merged table; wherein the first device represents any slave device in the distributed computing system; sends a first data restoration instruction so that the first device responds to the first data restoration instruction to split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data.
[0233] In practical applications, the second memory 23 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the second processor 22.
[0234] An embodiment of the present application provides a main device, including a first sending unit; the first sending unit can be used to send a data processing instruction to the first device, so that the first device responds to the data processing instruction, performs charging and discharging analysis on the data to be analyzed of the target electrical equipment powered by a battery, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table; and sends a first data restoration instruction to the first device, so that the first device responds to the first data restoration instruction to split the merged table to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data. It can be seen that when the main device assigns the task of charging and discharging data analysis to the first device, it can send a data processing instruction to the first device, and then the first device can perform charging and discharging analysis on the data to be analyzed of the target electrical equipment, and obtain at least two two-dimensional table data that only support a single-machine environment and can characterize the charging and discharging conditions of the target electrical equipment, and merge at least two two-dimensional table data to obtain a merged table; and then when the main device assigns the task of splitting the table to the first device, it can send a first data restoration instruction to the first device, so that the first device splits the merged table to obtain at least two first table data in the corresponding format of the distributed computing system, thereby completing the format conversion of multiple two-dimensional table data at the same time, that is, realizing the simultaneous processing of multiple table data, which greatly improves the processing efficiency of data structure conversion of multiple data characterizing the charging and discharging conditions of target electrical equipment under the distributed processing framework.
[0235] Specifically, the program instructions corresponding to the method for processing battery charge and discharge data in this embodiment may be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the program instructions corresponding to the method for processing battery charge and discharge data in the storage medium are read or executed by the first processor, the following steps are included:
[0236] In response to a data processing instruction of a master device in a distributed computing system, charge and discharge analysis processing is performed on the to-be-analyzed data of a target power-consuming device using a battery as a power source, thereby obtaining at least two two-dimensional table-type data; wherein the two-dimensional table-type data represents table-type data that supports processing in a single-machine environment;
[0237] Merging at least two two-dimensional table data to obtain a merged table;
[0238] In response to a first data restoration instruction of the master device, the merged table is split to obtain at least two first table data; wherein the first table data represents table data that supports processing by a distributed computing system and has the same content as the two-dimensional table data.
[0239] When the program instructions corresponding to a method for processing battery charge and discharge data in the storage medium are read or executed by the second processor, the method includes the following steps:
[0240] Sending a data processing instruction so that the first device responds to the data processing instruction, performs charge and discharge analysis processing on the to-be-analyzed data of the target electrical device using the battery as power, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data to obtain a merged table; wherein the first device represents any slave device in the distributed computing system;
[0241] A first data restoration instruction is sent, so that the first device splits the merged table in response to the first data restoration instruction to obtain at least two first table data; wherein the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data.
[0242] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.
[0243] If the integrated unit is implemented in the form of a software function module and is not 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 embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0244] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.
[0245] The present application is described with reference to the implementation flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0246] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0247] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0248] The above embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present invention is within the protection scope of the present invention.
Claims
1. A method for processing battery charge and discharge data, characterized in that: The method comprises: In response to a data processing instruction of a master device in a distributed computing system, charge and discharge analysis processing is performed on the data to be analyzed of a target power-consuming device using a battery as a power source, thereby obtaining at least two two-dimensional table data; wherein the two-dimensional table data represents table data that supports processing in a single-machine environment; The at least two two-dimensional table data are merged based on the field merge row and the data value merge row to obtain a merged table; the field merge row is obtained by merging the field name information and the field type information in each two-dimensional table data into one row; the data value merge row is obtained by merging the data values of the fields in each two-dimensional table data into one row; In response to the first data restoration instruction of the master device, the merged table is split based on the target field merge row and the target data value merge row to obtain at least two first table data; wherein, the first table data represents table data that supports processing by the distributed computing system and has the same content as the two-dimensional table data; the target field merge row and the target data value merge row are merged rows and data value merged rows corresponding to the same table name information in the table name merge column in the merged table.
2. The method for processing battery charge and discharge data according to claim 1, characterized in that: The merged table representation supports a table for transmission and reading by a device in the distributed computing system; the method further comprises: In response to the first transmission instruction of the master device, the merged table is sent, so that the second device splits the merged table to obtain the at least two first table data.
3. The method for processing battery charge and discharge data according to claim 2, characterized in that: The at least two first tabular data include a first amount of tabular data and a second amount of tabular data; the method further includes: In response to a first split instruction of the master device, splitting a part of the merged table to obtain the first amount of table data; In response to the second transmission instruction of the master device, the merged table is sent, so that the second device splits part of the merged table to obtain the second amount of table data.
4. The method for processing battery charge and discharge data according to any one of claims 1 to 3, characterized in that: The merging process of the at least two two-dimensional table data based on the field merging row and the data value merging row to obtain a merged table includes: Merging the field name information and the field type information in each of the at least two two-dimensional table data into one row to obtain a field merged row; Merging data values of fields in each of the at least two two-dimensional table data into one row to obtain a data value merged row; The merged table is determined based on the field merged row and the data value merged row.
5. The method for processing battery charge and discharge data according to claim 4, characterized in that: The determining the merged table based on the field merged row and the data value merged row includes: Generate a data merge column according to the field merge row and the data value merge row; Generate a table name merge column according to the first table name information corresponding to the field merge row and the second table name information corresponding to the data value merge row; wherein the first table name information represents the table name of the two-dimensional table data corresponding to the field merge row; and the second table name information represents the table name of the two-dimensional table data corresponding to the data value merge row; The merged table is determined according to the data merge column and the table name merge column.
6. The method for processing battery charge and discharge data according to claim 5, characterized in that: The step of splitting the merged table based on the target field merged row and the target data value merged row to obtain at least two first table data includes: Obtain target field merged rows and target data value merged rows corresponding to the same table name information in the table name merged column in the merged table; Determine the table to be restored according to the target field merged row and the target data value merged row; The first table data is determined based on the table to be restored.
7. The method for processing battery charge and discharge data according to claim 6, characterized in that: The determining the first table data based on the table to be restored includes: Obtain the field type information corresponding to each field name information in the target field merge row; Performing data recovery processing on the data values of each field in the target data value merge row according to the field type information to obtain a data value merge row in a target format; The first table data is determined based on the mapping relationship between each field name information in the target field merge row and each data value in the data value merge row of the target format.
8. A method for processing battery charge and discharge data, characterized in that: The method comprises: Sending a data processing instruction so that the first device responds to the data processing instruction, performs charge and discharge analysis processing on the to-be-analyzed data of the target electric-consuming device using the battery as the power source, obtains at least two two-dimensional table-type data, and merges the at least two two-dimensional table-type data based on the field merged row and the data value merged row to obtain a merged table; wherein the first device represents any slave device in the distributed computing system; the field merged row is obtained by merging the field name information and the field type information in each two-dimensional table-type data into one row; the data value merged row is obtained by merging the data values of the fields in each two-dimensional table-type data into one row; A first data restoration instruction is sent so that the first device splits the merged table based on the target field merge row and the target data value merge row in response to the first data restoration instruction to obtain at least two first table data; wherein the first table data represents table data that supports processing by the distributed computing system and has the same content as the two-dimensional table data; the target field merge row and the target data value merge row are merge rows and data value merge rows corresponding to the same table name information in the table name merge column in the merged table.
9. The method for processing battery charge and discharge data according to claim 8, characterized in that: The merged table representation supports a table for transmission and reading by a device in the distributed computing system; the method further comprises: Sending a first transmission instruction so that the first device sends the merged table to a second device in response to the first transmission instruction; wherein the second device represents a slave device different from the first device in the distributed computing system; A second data restoration instruction is sent, so that the second device splits the merged table in response to the second data restoration instruction to obtain at least two first table data.
10. The method for processing battery charge and discharge data according to claim 8 or 9, characterized in that: The at least two first tabular data include a first amount of tabular data and a second amount of tabular data, and the method further includes: Sending a first splitting instruction, so that the first device splits a part of the merged table in response to the first splitting instruction to obtain the first amount of table data; sending a second transmission instruction, so that the first device sends the merged table to the second device in response to the second transmission instruction; A second splitting instruction is sent, so that the second device splits a part of the merged table in response to the second splitting instruction to obtain the second amount of table data.
11. A first device, characterized in that: The first device includes an analyzing unit, a merging unit and a splitting unit; The analysis unit is used to respond to the data processing instruction of the master device in the distributed computing system, perform charge and discharge analysis and processing on the to-be-analyzed data of the target power-consuming device using the battery as the power source, and obtain at least two two-dimensional table data; wherein the two-dimensional table data represents the table data supporting the processing in a single-machine environment; the first device represents any slave device other than the master device in the distributed computing system; The merging unit is used to merge the at least two two-dimensional table data based on the field merge row and the data value merge row to obtain a merged table; the field merge row is obtained by merging the field name information and the field type information in each two-dimensional table data into one row; the data value merge row is obtained by merging the data values of the fields in each two-dimensional table data into one row; The splitting unit is used to respond to the first data restoration instruction of the main device, split the merged table based on the target field merge row and the target data value merge row to obtain at least two first table data; wherein the first table data represents table data that supports processing by the distributed computing system and has the same content as the two-dimensional table data; the target field merge row and the target data value merge row are the merged rows and data value merged rows corresponding to the same table name information in the table name merge column in the merged table.
12. A master device, characterized in that: The master device comprises a first sending unit; The first sending unit is used to send a data processing instruction, so that the first device responds to the data processing instruction, performs charge and discharge analysis processing on the to-be-analyzed data of the target electric device using the battery as power, obtains at least two two-dimensional table data, and merges the at least two two-dimensional table data based on the field merge row and the data value merge row to obtain a merged table; And sending a first data restoration instruction, so that the first device responds to the first data restoration instruction to split the merged table based on the target field merge row and the target data value merge row to obtain at least two first table data; wherein, the first table data represents table data that supports distributed computing system processing and has the same content as the two-dimensional table data; the first device represents any slave device in the distributed computing system, the field merge row is obtained by merging the field name information and field type information in each two-dimensional table data into one row; the data value merge row is obtained by merging the data values of the fields in each two-dimensional table data into one row; the target field merge row and the target data value merge row are the merged rows and data value merged rows corresponding to the same table name information in the table name merge column in the merged table.
13. A first device, characterized in that: The first device includes a first processor and a first memory storing instructions executable by the first processor; when the instructions are executed by the first processor, the method according to any one of claims 1 to 7 is implemented.
14. A master device, characterized in that: The main device includes a second processor and a second memory storing instructions executable by the second processor; when the instructions are executed by the second processor, the method according to any one of claims 8 to 10 is implemented.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a first processor, the method according to any one of claims 1 to 7 is implemented; when the computer program is executed by a second processor, the method according to any one of claims 8 to 10 is implemented.
Citation Information
Patent Citations
Table conversion method and device, computer equipment and storage medium
CN112036124A
Transaction execution method and device, computing device and storage medium
CN113704361A