Load management statistical analysis method based on data cloud platform, computer equipment and storage medium
Through Python, the power system data is automatically obtained and filtered, and the load management sequence table is formed and visually displayed. This solves the problems of low efficiency in compiling the load management sequence table and untimely update of user information, and realizes the real-time accuracy and matching of user information. Flexible response to special situations provides more effective decision-making support for load management.
Patent Information
- Application Number
- CN202411461087.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, load management sequence table compilation efficiency is low, there are omissions and statistical errors in data summary and analysis, user information is not updated in time, and it is impossible to accurately reflect the power consumption of the power system, especially during peak power consumption periods, it is difficult to deal with local power grids. The situation of restriction in sections.
Python is used to automatically obtain data from marketing systems and metrology systems, form a load management order table, filter data whose business type does not match the business status, save and visualize display using the pandas library, and predict the potential of staggered peak electricity consumption based on user behavior. Provide personalized suggestions.
It improves the efficiency of compiling the load management sequence table, ensures the real-time and accuracy of user information, enhances the ability to respond to special situations, and provides more effective decision-making support for load management.
Smart Images

Figure CN119293118A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and in particular to a load management statistical analysis method, computer equipment and storage medium based on a data cloud platform. Background Art
[0002] With the development of social economy and the improvement of people's living standards, the demand for electricity is increasing, and the pressure on the stable operation and power supply guarantee of the power system is increasing. Especially during the peak period of electricity consumption, the contradiction between electricity supply and demand is more prominent, and the power system is facing severe challenges. In order to prevent load tension and shortage, a load management priority table must be formulated in advance to ensure residents' electricity use. The load management priority table usually refers to a table or database used to manage power loads in the power system. In the operation of the power system, the load management priority table is a tool used by the power dispatching center to record and arrange the priority, operating status, and dispatching strategy of different power loads. It is essential to ensure the stable operation of the power grid, optimize power distribution, and control loads in emergency situations.
[0003] However, there are several problems in the compilation process:
[0004] 1. Heavy workload. The load management ranking table includes the peak shift rotation ranking table, the daily peak avoidance ranking table and other tables. The amount of information during work is huge. Taking the load management ranking table of this city as an example, there are nearly 40,000 special transformers in total. One user data contains 27 elements such as user capacity, station, line, transformer, and household relationship. Grassroots personnel need to query multiple systems such as the marketing system and the metering system to obtain effective information. This working mode has low efficiency, and the process of summarizing and analyzing data information may result in omissions and statistical errors, and cannot guarantee high accuracy.
[0005] 2. The user information in the load management ranking table is incorrect because the user has changed their name or cancelled their account, so it needs to be manually updated regularly. The annual load management ranking table is revised in December of each year, but the official start is usually a few months away from the peak load period (June-September). During this period, users will change their names, transfer, suspend, cancel their accounts, and other services, and the user contact information will change. As a result, the user status of the load management ranking table is not accurate enough, and there is a situation where the user cannot be contacted. This problem was found to be common in various municipal bureaus across the province during the inspection of the completion of the power supply guarantee work in the province, and there is currently no effective tool to solve the problem.
[0006] When a local power grid section is restricted (not a citywide power shortage), the priority list is re-established based on the restricted equipment released by the dispatcher. The load management priority list usually established belongs to the priority list for power shortage, including substations and lines in the city. However, once a local power grid is restricted, only a few sections of the substation bus have load gaps, and not all users in the city need to participate in load management. It is necessary to manually prepare a load management plan for a specific power-restricted area again.
[0007] The above information is presented as background information only to assist with understanding the present disclosure and no determination or admission is made as to whether any of the above may be used as prior art with respect to the present disclosure. Summary of the invention
[0008] The present invention provides a load management statistical analysis method, computer equipment and storage medium based on a data cloud platform to solve the problems existing in the prior art.
[0009] To achieve the above object, the present invention provides the following technical solutions:
[0010] In a first aspect, the present invention provides a load management statistical analysis method based on a data cloud platform, the method comprising:
[0011] Use Python to automatically obtain data from the marketing system and metering system to form a load management ranking table;
[0012] Using Python to set the query field information of the load management ranking table and execute SQL query statements to filter data that does not match the business type and business status;
[0013] Use Python's pandas library to save the filtered data to excel;
[0014] Use Python to visualize the filtered data;
[0015] The user's electricity consumption in different time periods is predicted based on user behavior. By comparing the predicted electricity consumption with the actual electricity consumption, the user's potential for off-peak electricity consumption in the next 7 days is evaluated and the users are classified.
[0016] Furthermore, in the load management statistical analysis method based on the data cloud platform, the step of automatically acquiring data from the marketing system and the metering system using Python to form a load management ranking table includes:
[0017] Use Python's pymysql database to access the marketing system and metering system, and set parameters to establish connections with the marketing system and metering system;
[0018] After the connection is established, data is automatically obtained from the marketing system and metering system to form a load management ranking table.
[0019] Furthermore, in the load management statistical analysis method based on the data cloud platform, the parameters are set as follows:
[0020] db_config = {
[0021] 'host': 'localhost', # Marketing system, metering system information server address
[0022] 'user': 'your_username', # database username
[0023] 'password': 'your_password', # database password
[0024] 'database': 'your_database_name' # Database name.
[0025] Furthermore, in the load management statistical analysis method based on the data cloud platform, the step of using Python to set the query field information of the load management ranking table and execute SQL query statements to filter data that does not match the business type and business status includes:
[0026] The following query field information of the load management ranking table is set using Python:
[0027] user_id: user ID;
[0028] user_name: user name;
[0029] city: city;
[0030] contact_info: contact information;
[0031] business_id: business ID;
[0032] business_type: business type;
[0033] status_id: status ID;
[0034] status: business status;
[0035] status_date: status update date;
[0036] Use Python to execute SQL query statements to filter out data that does not match the business type and business status.
[0037] Furthermore, in the load management statistical analysis method based on the data cloud platform, the business status includes completed, in progress and not started.
[0038] Furthermore, in the load management statistical analysis method based on the data cloud platform, the step of using Python to execute SQL query statements to filter data that does not match the business type and business status includes:
[0039] Use Python's execute() method to execute SQL query statements, filter data that does not match the business type and business status, and form a result set.
[0040] Furthermore, in the load management statistical analysis method based on the data cloud platform, the SQL query statement is:
[0041] SELECT l.user_id, l.user_name, l.contact_info, b.business_id,b.business_type, s.status_id, s.status, s.status_date FROM load_management lJOIN load_management_business b ON l.user_id = b.user_id JOIN load_management_status s ON b.business_id = s.business_id WHERE l.business_type ! = status.
[0042] Furthermore, in the load management statistical analysis method based on the data cloud platform, the step of using Python's pandas library to save the filtered data to Excel includes:
[0043] The steps of using Python's pandas library to save the filtered data to excel include:
[0044] Use Python to declare the result set data storage variable date[] and set the excel format:
[0045] results_list = []
[0046] for row in results:
[0047] results_list.append({
[0048] 'user_id': row[0],
[0049] 'user_name': row[1],
[0050] 'contact_info': row[2],
[0051] 'business_id': row[3],
[0052] 'business_type': row[4],
[0053] 'status_id': row[5],
[0054] 'status': row[6],
[0055] 'status_date': row[7]
[0056] });
[0057] Create a DataFrame using the DataFrame() method of the pandas library:
[0058] DataFrame(data[1:], columns=data[0]);
[0059] Save the filtered data to excel through the to_excel(file_name, index=False) method:
[0060] DataFrame(data[1:], columns=data[0]).to_excel(file_name, index=False).
[0061] Furthermore, in the load management statistical analysis method based on the data cloud platform, the step of visually displaying the screened data using Python includes:
[0062] Use Python to create the following interactive bar chart:
[0063] fig = px.bar(df, x='User name', y='Power saving', color='Business status',
[0064] title = 'Each user saves power',
[0065] labels={'Power saved': 'Power saved (kWh)'})
[0066] fig.show();
[0067] Use Python to save the chart as an HTML file:
[0068] fig.write_html("report.html").
[0069] In a second aspect, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the load management statistical analysis method based on the data cloud platform provided in the first aspect above.
[0070] In a third aspect, the present invention provides a storage medium comprising computer executable instructions, wherein the computer executable instructions are executed by a computer processor to implement the load management statistical analysis method based on a data cloud platform as provided in the first aspect above.
[0071] Compared with the prior art, the present invention has the following beneficial effects:
[0072] The present invention provides a load management statistical analysis method, computer equipment and storage medium based on a data cloud platform. By using Python technology to automatically obtain statistical data and perform analysis, it can realize the screening, preservation and visual display of data that does not match the business type and business status, thereby improving the efficiency of compiling the load management ranking table, ensuring the real-time and accuracy of user information, and enhancing the ability to flexibly respond to special situations. In addition, it predicts the potential for off-peak power consumption based on user behavior, can provide users with personalized off-peak power consumption suggestions, and provide more effective decision-making support for load management.
[0073] The present invention has other features and advantages, which will be apparent from or will be described in detail in the accompanying drawings and the following detailed description incorporated herein, which together serve to explain the specific principles of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0075] Figure 1 It is a flow chart of a load management statistical analysis method based on a data cloud platform provided in the first embodiment of the present invention;
[0076] Figure 2 It is a structural diagram of a computer device provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0077] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0078] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0079] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0080] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0081] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0082] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in the sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0083] In this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0084] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0085] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms such as "install", "connect", "connect", "fix", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For technicians in the technical field to which the present application belongs, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0086] Embodiment 1
[0087] Please refer to Figure 1 , is a flow chart of a load management statistical analysis method based on a data cloud platform provided in Embodiment 1 of the present invention. The method specifically comprises the following steps:
[0088] S101. Use Python to automatically obtain data from the marketing system and metering system to form a load management ranking table.
[0089] It should be noted that, at this stage, this embodiment makes full use of the powerful functions of the Python programming language to design and implement an efficient data capture mechanism. By writing a customized Python script, the method can automatically extract key data from the marketing system and metering system of the power company, including but not limited to user power consumption, load curve, user attributes, etc. Subsequently, based on the acquired data, the system automatically constructs a load management ranking table, which not only contains the user's power consumption information, but also integrates a variety of business rules and strategies, laying a solid foundation for subsequent analysis and management.
[0090] In this embodiment, the step S101 may be further refined to include the following contents:
[0091] Use Python's pymysql database to access the marketing system and metering system, and set parameters to establish connections with the marketing system and metering system;
[0092] After the connection is established, data is automatically obtained from the marketing system and metering system to form a load management ranking table.
[0093] In this embodiment, the parameters are set as follows:
[0094] db_config = {
[0095] 'host': 'localhost', # Marketing system, metering system information server address
[0096] 'user': 'your_username', # database username
[0097] 'password': 'your_password', # database password
[0098] 'database': 'your_database_name' # Database name.
[0099] S102: Using Python to set query field information of the load management ranking table and execute SQL query statements to filter data that does not match the business type and business status.
[0100] It should be noted that in order to ensure the accuracy and effectiveness of the data, this method introduces a strict data cleaning and screening process. Using the powerful processing power of Python, detailed query field information is set, and SQL query statements are written to achieve accurate retrieval of data in the load management ordinal table. In particular, for data that does not match the business type and business status, the system can automatically identify and filter them out, effectively avoiding the interference of erroneous data on subsequent analysis results. This process not only improves the overall quality of the data, but also provides reliable data support for subsequent analysis work.
[0101] In this embodiment, the step S102 may be further refined to include the following contents:
[0102] The following query field information of the load management ranking table is set using Python:
[0103] user_id: user ID;
[0104] user_name: user name;
[0105] city: city;
[0106] contact_info: contact information;
[0107] business_id: business ID;
[0108] business_type: business type;
[0109] status_id: status ID;
[0110] status: business status;
[0111] status_date: status update date;
[0112] Use Python to execute SQL query statements to filter out data that does not match the business type and business status.
[0113] In this embodiment, the service status includes completed, in progress, and not started.
[0114] In this embodiment, the step of using Python to execute SQL query statements to filter data that does not match the business type and business status specifically includes:
[0115] Use Python's execute() method to execute SQL query statements, filter data that does not match the business type and business status, and form a result set.
[0116] In this embodiment, the SQL query statement is:
[0117] SELECT l.user_id, l.user_name, l.contact_info, b.business_id,b.business_type, s.status_id, s.status, s.status_date FROM load_management lJOIN load_management_business b ON l.user_id = b.user_id JOIN load_management_status s ON b.business_id = s.business_id WHERE l.business_type ! = status.
[0118] S103. Use Python's pandas library to save the filtered data to excel.
[0119] It should be noted that after completing data cleaning and screening, this method uses Python's pandas library to further organize and analyze the screened data. The pandas library is known for its powerful data processing capabilities, and can easily implement operations such as data grouping, aggregation, and sorting. On this basis, the sorted data is saved in an Excel file to form reports that are easy to read and analyze. These reports not only contain detailed user electricity consumption information, but also provide rich statistical analysis results, such as electricity consumption trends, load distribution, etc., which provide strong data support for the decision-making of power companies.
[0120] In this embodiment, step S103 may be further refined to include the following contents:
[0121] The steps of using Python's pandas library to save the filtered data to excel include:
[0122] Use Python to declare the result set data storage variable date[] and set the excel format:
[0123] results_list = []
[0124] for row in results:
[0125] results_list.append({
[0126] 'user_id': row[0],
[0127] 'user_name': row[1],
[0128] 'contact_info': row[2],
[0129] 'business_id': row[3],
[0130] 'business_type': row[4],
[0131] 'status_id': row[5],
[0132] 'status': row[6],
[0133] 'status_date': row[7]
[0134] });
[0135] Create a DataFrame using the DataFrame() method of the pandas library:
[0136] DataFrame(data[1:], columns=data[0]);
[0137] Save the filtered data to excel through the to_excel(file_name, index=False) method:
[0138] DataFrame(data[1:], columns=data[0]).to_excel(file_name, index=False).
[0139] S104. Use Python to visualize the filtered data.
[0140] It should be noted that by displaying the statistical analysis conclusions of off-peak electricity consumption in intuitive visual charts, the readability and comprehensibility of the statistical analysis results are improved.
[0141] In this embodiment, the step S104 may be further refined to include the following contents:
[0142] Use Python to create the following interactive bar chart:
[0143] fig = px.bar(df, x='User name', y='Power saving', color='Business status',
[0144] title = 'Each user saves power',
[0145] labels={'Power saved': 'Power saved (kWh)'})
[0146] fig.show();
[0147] Use Python to save the chart as an HTML file (convenient for embedding into reports or sharing directly):
[0148] fig.write_html("report.html").
[0149] S105. Predict the user's electricity consumption in different time periods based on the user's behavior, and compare the predicted electricity consumption with the actual electricity consumption to evaluate the user's potential for off-peak electricity consumption in the next 7 days, and classify the users.
[0150] It should be noted that the method specifically uses the user's historical electricity consumption data (time, power, etc.), as well as the user's business type, participation in the peak-shifting electricity consumption plan and other information. The user's electricity consumption in different time periods is predicted based on the time series prediction model. By comparing the predicted electricity consumption with the actual electricity consumption, the user's potential for peak-shifting electricity consumption in the next 7 days is evaluated, and the users are classified (for example, high potential, medium potential, low potential).
[0151] Although the terms such as query, acquisition, Python, etc. are used more frequently in this application, the possibility of using other terms is not excluded. These terms are used only to more conveniently describe and explain the essence of the present invention; interpreting them as any additional restrictions is contrary to the spirit of the present invention.
[0152] The present invention provides a load management statistical analysis method based on a data cloud platform. By utilizing Python technology to automatically obtain statistical data and perform analysis, it can implement the screening, preservation, and visualization of data that do not match business type and business status, thereby improving the efficiency of compiling load management ranking tables, ensuring the real-time and accuracy of user information, and enhancing the ability to flexibly respond to special situations. In addition, it predicts the potential for off-peak power consumption based on user behavior, can provide users with personalized off-peak power consumption suggestions, and provide more effective decision-making support for load management.
[0153] Embodiment 2
[0154] Figure 2 A schematic diagram of the structure of a computer device provided in Embodiment 2 of the present invention. Figure 2 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 2 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0155] like Figure 2 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0156] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0157] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0158] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 2 not shown, usually called a "hard drive"). Although Figure 2 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0159] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0160] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via a bus 18. It should be understood that although Figure 2 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0161] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the load management statistical analysis method based on the data cloud platform provided in an embodiment of the present invention.
[0162] Embodiment 3
[0163] Embodiment 3 of the present invention provides a computer-readable storage medium having computer-executable instructions stored thereon. When the instructions are executed by a processor, the load management statistical analysis method based on a data cloud platform as provided in all the embodiments of the invention of this application is implemented.
[0164] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0165] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0166] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0167] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0168] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of this application, this does not limit the scope of patent protection of this application. All technical solutions generated by replacing or modifying equivalent structures or equivalent processes based on the essential concept of this application using the contents recorded in the specification and drawings of this application, as well as directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, are included in the scope of patent protection of this application.
Claims
1. A load management statistical analysis method based on a data cloud platform, characterized in that: The method comprises: Use Python to automatically obtain data from the marketing system and metering system to form a load management ranking table; Using Python to set the query field information of the load management ranking table and execute SQL query statements to filter data that does not match the business type and business status; Use Python's pandas library to save the filtered data to excel; Use Python to visualize the filtered data; The user's electricity consumption in different time periods is predicted based on user behavior. By comparing the predicted electricity consumption with the actual electricity consumption, the user's potential for off-peak electricity consumption in the next 7 days is evaluated and the users are classified.
2. The load management statistical analysis method based on the data cloud platform according to claim 1 is characterized in that: The steps of automatically acquiring data from the marketing system and the metering system using Python to form a load management ranking table include: Use Python's pymysql database to access the marketing system and metering system, and set parameters to establish connections with the marketing system and metering system; After the connection is established, data is automatically obtained from the marketing system and metering system to form a load management ranking table.
3. The load management statistical analysis method based on the data cloud platform according to claim 2 is characterized in that: The parameter settings are as follows: db_config = { 'host': 'localhost', # Marketing system, metering system information server address 'user': 'your_username', # database username 'password': 'your_password', # database password 'database': 'your_database_name' # Database name.
4. The load management statistical analysis method based on the data cloud platform according to claim 1 is characterized in that: The step of using Python to set the query field information of the load management ranking table and executing SQL query statements to filter data that does not match the business type and business status includes: The following query field information of the load management ranking table is set using Python: user_id: user ID; user_name: user name; city: city; contact_info: contact information; business_id: business ID; business_type: business type; status_id: status ID; status: business status; status_date: status update date; Use Python to execute SQL query statements to filter out data that does not match the business type and business status.
5. The load management statistical analysis method based on the data cloud platform according to claim 4 is characterized in that: The step of using Python to execute SQL query statements to filter data that does not match the business type and business status includes: Use Python's execute() method to execute SQL query statements, filter data that does not match the business type and business status, and form a result set.
6. The load management statistical analysis method based on the data cloud platform according to claim 5 is characterized in that: The SQL query statement is: SELECT l.user_id, l.user_name, l.contact_info, b.business_id, b.business_type, s.status_id, s.status, s.status_date FROM load_management l JOIN load_management_business b ON l.user_id = b.user_id JOIN load_management_status sON b.business_id = s.business_id WHERE l.business_type ! = status.
7. The load management statistical analysis method based on the data cloud platform according to claim 1 is characterized in that: The steps of using Python's pandas library to save the filtered data to excel include: The steps of using Python's pandas library to save the filtered data to excel include: Use Python to declare the result set data storage variable date[] and set the excel format: results_list = [] for row in results: results_list.append({ 'user_id': row[0], 'user_name': row[1], 'contact_info': row[2], 'business_id': row[3], 'business_type': row[4], 'status_id': row[5], 'status': row[6], 'status_date': row[7] }); Create a DataFrame using the DataFrame() method of the pandas library: DataFrame(data[1:], columns=data[0]); Save the filtered data to excel through the to_excel(file_name, index=False) method: DataFrame(data[1:], columns=data[0]).to_excel(file_name, index=False).
8. The load management statistical analysis method based on the data cloud platform according to claim 1 is characterized in that: The steps of visually displaying the filtered data using Python include: Use Python to create the following interactive bar chart: fig = px.bar(df, x='User name', y='Power saving', color='Business status', title = 'Each user saves power', labels={'Power saved': 'Power saved (kWh)'}) fig.show(); Use Python to save the chart as an HTML file: fig.write_html("report.html").
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the load management statistical analysis method based on the data cloud platform as described in any one of claims 1 to 8 is implemented.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are executed by a computer processor to implement the load management statistical analysis method based on a data cloud platform as described in any one of claims 1 to 8.