Statistical method and system for each rate table code based on stream processing and computer equipment

Through a stream-based method, data processing is performed on a single-rate electricity meter to realize the rate measurement, which solves the problem that the existing technology cannot realize rate measurement, helps enterprises to effectively utilize the peak and valley electricity price policy and reduce electricity costs.

CN120013705APending Publication Date: 2025-05-16HANGZHOU SUNRISE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411979715.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The prior art cannot perform secondary data processing on single-rate electricity meters that do not support metering of rate measurement to realize metering of rate measurement, and cannot effectively classify electricity usage in fine-grained manner to formulate targeted electricity usage strategies.

Method used

Using a stream-based processing method, the meter collector periodically reports the meter code data, obtain the latest and last reported meter codes, calculate the energy consumption and add it to the meter code corresponding to the target rate, or split the average of the meter code into the meter code corresponding to different rates.

Benefits of technology

The rate metering function of single-rate electricity meter has been realized, helping large commercial electricity users to effectively utilize the peak and valley electricity price policy and reduce electricity costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013705A_ABST
    Figure CN120013705A_ABST
Patent Text Reader

Abstract

The invention relates to a stream processing-based rate table code statistical method and system, computer equipment, a storage medium and a computer program product. The method comprises the steps of periodically uploading table code data through an electric meter collector, splitting the table code data according to periods, and adding the table code increment, namely the energy consumption, of each period to a table code of a rate corresponding to a reporting time point so as to update the table codes corresponding to different rates. Therefore, aiming at a single-rate electricity meter, a different-rate metering function is realized, and the cost of realizing different-rate energy consumption statistics and electricity charging by a user is reduced. Therefore, large-scale commercial power utilization enterprises are helped to effectively utilize the peak-valley electricity price policy, and the purposes of saving electricity and reducing cost are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power systems, and in particular to a method, system, computer device, storage medium and computer program product for counting rate table codes based on stream processing. Background Art

[0002] At present, many large commercial electricity users, such as apartment hotels and shopping malls, usually do not support rate-based metering with their original electricity meters, which directly leads to the inability to fully utilize the cost-saving advantages brought by the peak and valley electricity price policy. These companies hope to achieve rate-based statistics and billing functions for electricity consumption without increasing the huge cost of replacing electricity meters, so as to reasonably optimize the electricity consumption time and structure and reduce electricity costs.

[0003] However, the existing smart meter platforms and data processing systems cannot meet the needs of these enterprises. They cannot perform secondary data processing on meters that do not support sub-rate metering to achieve sub-rate metering, nor can they effectively classify the power consumption of different areas or devices in fine granularity to formulate targeted power consumption strategies.

[0004] Therefore, there is an urgent need for a new technical solution that can realize the sub-rate metering function for single-rate electricity meters, help large commercial electricity users effectively utilize peak and valley electricity price policies, and achieve the goal of saving electricity and reducing costs. Summary of the invention

[0005] Based on this, it is necessary to provide a method, system, computer equipment, computer readable storage medium and computer program product based on stream processing for counting each rate table code to address the above technical problems, which can solve the problem that single-rate electricity meters cannot measure different rates.

[0006] In a first aspect, the present application provides a method for counting rate table codes based on stream processing. The method comprises:

[0007] Obtaining the first meter code reported most recently by the meter collector; wherein the meter collector collects meter code data of the user's meter in real time and reports it periodically;

[0008] According to the time point when the meter collector reports the first meter code, determining the target rate corresponding to the time point from the rate period plan;

[0009] Determine whether there is a real-time table code; wherein the real-time table code is the second table code reported by the electric meter collector last time;

[0010] If the real-time table code exists, the energy consumption is added to the table code corresponding to the target rate; wherein the energy consumption is the difference between the first table code and the second table code.

[0011] In one of the embodiments, the method also includes: if the real-time table code does not exist, then the first table code is evenly split into four first table code means, corresponding to the table code corresponding to the rate during the peak period, the table code corresponding to the rate during the peak period, the table code corresponding to the rate during the flat period, and the table code corresponding to the rate during the off-peak period.

[0012] In one embodiment, after the table code corresponding to any rate is updated, the method further includes: updating the value of the real-time table code stored in the cache and the database to the first table code; and updating the table code corresponding to each rate stored in the database.

[0013] In one of the embodiments, according to the time point when the meter collector reports the first meter code, determining the target rate corresponding to the time point from the rate period plan includes: determining the target time zone and target period to which the time point when the meter collector reports the first meter code belongs; and determining the target rate at the time point from the rate period plan according to the target time zone and the target period.

[0014] In one of the embodiments, the rate period scheme, the real-time table code and table codes corresponding to different rates are obtained from a cache or a database.

[0015] In a second aspect, the present application also provides a system for counting rate table codes based on stream processing. The system comprises:

[0016] The meter collector is used to collect meter code data of user meters in real time and periodically report it to the rate meter code stream processing and splitting module;

[0017] The rate period plan configuration module is used to configure the corresponding rates for different time zones according to the local peak and valley electricity prices and generate rate period plans;

[0018] The rate table code stream processing and splitting module is used to obtain the first table code reported most recently by the meter collector; determine the target rate corresponding to the time point from the rate period plan according to the time point when the meter collector reports the first table code; judge whether there is a real-time table code; wherein the real-time table code is the second table code reported by the meter collector last time; if the real-time table code exists, the energy consumption is added to the table code corresponding to the target rate; wherein the energy consumption is the difference between the first table code and the second table code.

[0019] In one of the embodiments, the rate table code stream processing and splitting module is also used to, if the real-time table code does not exist, evenly split the first table code into four first table code averages, corresponding to the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the flat period, and the table code of the rate corresponding to the off-peak period.

[0020] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0021] Obtain the first meter code most recently reported by the meter collector; wherein the meter collector collects meter code data of the user's meter in real time and reports it periodically; according to the time point when the meter collector reports the first meter code, determine the target rate corresponding to the time point from the rate period plan; determine whether there is a real-time meter code; wherein the real-time meter code is the second meter code reported by the meter collector last time; if the real-time meter code exists, add the energy consumption to the meter code corresponding to the target rate; wherein the energy consumption is the difference between the first meter code and the second meter code.

[0022] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0023] Obtain the first meter code most recently reported by the meter collector; wherein the meter collector collects meter code data of the user's meter in real time and reports it periodically; according to the time point when the meter collector reports the first meter code, determine the target rate corresponding to the time point from the rate period plan; determine whether there is a real-time meter code; wherein the real-time meter code is the second meter code reported by the meter collector last time; if the real-time meter code exists, add the energy consumption to the meter code corresponding to the target rate; wherein the energy consumption is the difference between the first meter code and the second meter code.

[0024] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0025] Obtain the first meter code most recently reported by the meter collector; wherein the meter collector collects meter code data of the user's meter in real time and reports it periodically; according to the time point when the meter collector reports the first meter code, determine the target rate corresponding to the time point from the rate period plan; determine whether there is a real-time meter code; wherein the real-time meter code is the second meter code reported by the meter collector last time; if the real-time meter code exists, add the energy consumption to the meter code corresponding to the target rate; wherein the energy consumption is the difference between the first meter code and the second meter code.

[0026] The above-mentioned method, system, computer device, storage medium and computer program product for calculating the rate table codes based on flow processing periodically report the table code data through the meter collector, so that the table code data is split according to the period, and the table code increment of each period, that is, the energy consumption, is added to the table code of the rate corresponding to the reporting time point to update the table code corresponding to different rates. In this way, the rate metering function can be realized for single-rate meters, helping large commercial power users to effectively use the peak and valley electricity price policy and achieve the purpose of saving electricity and reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a diagram of an application environment of a method for counting rate table codes based on stream processing in one embodiment;

[0028] Figure 2 A schematic diagram of a flow chart of a method for calculating statistics of rate table codes based on stream processing in one embodiment;

[0029] Figure 3 A flow chart of another method for calculating statistics of rate table codes based on stream processing in one embodiment;

[0030] Figure 4 It is a structural block diagram of a system for counting rate table codes based on stream processing in one embodiment;

[0031] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0033] The method for counting the rate table codes based on stream processing provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The collector 110 communicates with the server 120 through the network. The data storage system can store data that the server 120 needs to process, such as meter code data reported by the collector 110; the data storage system can also be used to store data required by the server 120, such as rate period plans and meter codes corresponding to different rates. The data storage system can be integrated on the server 120, or it can be placed on the cloud or other network servers. The collector 110 is used to collect meter code data of user meters in real time and report it to the server 120 periodically.

[0034] The server 120 is used to measure the user's electricity consumption by rate according to the meter code data reported by the collector 110. For example, the first meter code reported by the meter collector is obtained; wherein the meter collector collects the meter code data of the user's meter in real time and reports it periodically; according to the time point when the meter collector reports the first meter code, the target rate corresponding to the time point is determined from the rate period plan; it is determined whether there is a real-time meter code; wherein the real-time meter code is the second meter code reported by the meter collector last time; if the real-time meter code exists, the energy consumption is added to the meter code corresponding to the target rate; wherein the energy consumption is the difference between the first meter code and the second meter code.

[0035] The server 120 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0036] In one embodiment, Figure 2 As shown, a method for counting the code of each rate table based on stream processing is provided, and the method is applied to Figure 1 The server 120 in the example is used as an example to illustrate, and the following steps are included:

[0037] S202, obtaining the first meter code most recently reported by the electric meter collector.

[0038] Among them, the meter collector collects the meter code data of the user's meter in real time and reports it periodically. Periodic reporting, for example, the meter collector reports the meter code displayed by the user's meter once every set period. The set period can be any time period, for example, 15 minutes, 1 hour or a day, etc. The meter code here is the meter display code number, or the amount of electricity displayed by the user's meter. The meter code and electricity in this application can be interchangeable.

[0039] S204: According to the time point when the electric meter collector reports the first meter code, determine the target rate corresponding to the time point from the rate period plan.

[0040] Among them, the rate period plan includes rates corresponding to different time zones, such as rates corresponding to peak periods, rates corresponding to peak periods, rates corresponding to flat periods, and rates corresponding to off-peak periods.

[0041] In one example, based on the time point when the meter collector reports the first meter code, the target rate corresponding to the time point is determined from the rate period plan, including: determining the target time zone and target period to which the time point when the meter collector reports the first meter code belongs; based on the target time zone and target period, determining the target rate at the time point from the rate period plan.

[0042] Exemplarily, when the meter code reported by the meter collector is received, the current time point is obtained. The time point is expressed in the form of X year Y month Z day K hour J minute, where X, Y, Z, K and J are all integers, such as 5:03 on July 10, 2002. The target time zone and target time period to which the reported time point belongs can be determined first. The time zone here refers to a certain period of a whole day in a year, such as July 1 to September 1 (summer). The union of the time zones of a rate period scheme is equal to one year. The time period here refers to all "daily time periods" in a day. "Daily time period" refers to the time period of a certain day. Different time periods correspond to different rates. For example, the peak time period is 10:00 to 12:00, the flat period is 7:00-10:00, the valley period is 23:00-7:00 the next day, and the peak period is a specific period in January, July and August each year (such as January 18:00-19:00). In this way, there is a correspondence between peak and valley electricity prices and rate periods. For a given time point or period, the rate corresponding to this time point or period can be determined.

[0043] S206, determining whether there is a real-time table code.

[0044] The real-time meter code is the second meter code reported by the meter collector last time. When the meter collector reports the meter code of a certain user's meter for the first time, it is determined that there is no real-time meter code; when the meter collector does not report the meter code of a certain user's meter for the first time, it is determined that there is a real-time meter code.

[0045] S208: If there is a real-time meter code, the energy consumption is added to the meter code corresponding to the target rate.

[0046] The energy consumption is the difference between the first table code and the second table code. Exemplarily, the table codes corresponding to different rates are stored in the database, that is, the power consumption of a certain user under different rates. When a real-time table code exists, it means that the user's power consumption has increased within a reporting cycle of the meter collector, and the power used by the user, that is, the energy consumption, is added to the table code corresponding to the target rate to update the table codes corresponding to different rates stored in the database.

[0047] In one example, if Figure 2 As shown, the method also includes:

[0048] S210, if there is no real-time table code, the first table code is evenly split into four first table code averages, corresponding to the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the flat period, and the table code of the rate corresponding to the off-peak period.

[0049] It should be noted that for a user's electricity meter, when the meter collector reports the meter code of the user's electricity meter for the first time, since it is impossible to analyze the time period of the user's electricity usage before reporting, the first meter code can be evenly divided into four first meter code averages, corresponding to the meter code of the rate corresponding to the peak period, the meter code of the rate corresponding to the peak period, the meter code of the rate corresponding to the flat period, and the meter code of the rate corresponding to the off-peak period. This can reduce the error of the divided rate measurement.

[0050] In one example, after the table code corresponding to any rate is updated, the method further includes: updating the value of the real-time table code stored in the cache and the database to the first table code; updating the table code corresponding to each rate stored in the database, so as to accurately record the table code (or power consumption) corresponding to different rates after the meter collector reports the table code.

[0051] In one example, the rate period scheme, the real-time table code, and the table codes corresponding to different rates are obtained from a cache or a database.

[0052] The above-mentioned method for calculating the table codes of each rate based on stream processing, through the meter collector periodically reporting the table code data, makes the table code data split according to the period, and adds the table code increment of each period, that is, the energy consumption, to the table code of the rate corresponding to the reporting time point, so as to update the table code corresponding to the different rates. In this way, the sub-rate metering function can be realized for single-rate meters, reducing the cost of users to realize sub-rate energy consumption statistics and electricity billing. And then help large commercial electricity users to effectively utilize the peak and valley electricity price policy to achieve the purpose of saving electricity and reducing costs. It conveniently solves the problem of splitting the rate of single-rate meters, and can achieve the effect of using peak and valley usage statistics and peak and valley billing without upgrading the meter, greatly reducing the cost required for customers to conduct energy statistics and energy billing.

[0053] For example, this embodiment provides an optional implementation process based on the above embodiment, see Figure 3 Another flow chart of a method for counting rate table codes based on stream processing is shown, and the process specifically includes the following steps:

[0054] S301, obtaining the meter code reported by the electric meter collector.

[0055] S302, reading the rate period plan corresponding to the time point of reporting the report code from the cache or database.

[0056] S303, determine whether there is an enabled rate period plan, if so, execute S304, if not, execute S312.

[0057] S304, searching the rate period plan for the time zone to which the time point of the reporting code belongs.

[0058] S305, searching the time period to which the time point of reporting the code belongs in the corresponding time zone, and determining the target rate according to the corresponding time period.

[0059] S306, reading the real-time table code from the cache or database.

[0060] S307, determine whether there is a real-time table code, if so, execute S308, if not, execute S311.

[0061] S308, determine whether the time point of the current reporting code is later than the time point of the real-time reporting code, if yes, execute S309, if not, execute S312.

[0062] S309, adding the energy consumption to the meter code corresponding to the target rate to form a new meter code.

[0063] S310, updating the cache, updating the database and storing the table code.

[0064] S311, split the first table code into four first table code means, which respectively correspond to the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the flat period, and the table code of the rate corresponding to the off-peak period.

[0065] S312, end.

[0066] The specific process of S301-S312 can refer to the description of the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0067] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0068] Based on the same inventive concept, the embodiment of the present application also provides a system for calculating the statistics of rate tables based on flow processing for implementing the above-mentioned method for calculating the statistics of rate tables based on flow processing. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more embodiments of the system for calculating the statistics of rate tables based on flow processing provided below can be referred to the limitations of the method for calculating the statistics of rate tables based on flow processing above, and will not be repeated here.

[0069] In one embodiment, Figure 4 As shown, a rate table code statistics system 400 based on stream processing is provided, including: an electricity meter collector 410, a rate period scheme configuration module 420 and a rate table code stream processing and splitting module 430.

[0070] The meter collector 410 is used to collect meter code data of user meters in real time and report it to the rate table code stream processing and splitting module periodically.

[0071] The rate period scheme configuration module 420 is used to configure the corresponding rates for different time zones according to the local peak and valley electricity prices, and generate a rate period scheme.

[0072] The rate table code stream processing and splitting module 430 is used to obtain the first table code reported most recently by the meter collector; determine the target rate corresponding to the time point from the rate period plan according to the time point when the meter collector reports the first table code; determine whether there is a real-time table code; wherein the real-time table code is the second table code reported by the meter collector last time; if the real-time table code exists, the energy consumption is added to the table code corresponding to the target rate; wherein the energy consumption is the difference between the first table code and the second table code.

[0073] In one example, the rate table code stream processing and splitting module 430 is also used to, if there is no real-time table code, evenly split the first table code into four first table code averages, corresponding to the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the flat period, and the table code of the rate corresponding to the off-peak period.

[0074] In one example, the rate table code stream processing and splitting module 430 is also used to determine the target time zone and target time period to which the time point when the meter collector reports the first table code belongs; according to the target time zone and target time period, determine the target rate at the time point from the rate period plan.

[0075] In one example, the rate table code statistics system 400 based on stream processing further includes a database, which is used to store the real-time table code and the table code corresponding to each rate.

[0076] In one example, the rate table code stream processing and splitting module 430 is further used to obtain the rate period scheme, the real-time table code and the table codes corresponding to different rates from the cache or database.

[0077] In one example, after the table code corresponding to any rate is updated, the rate table code stream processing and splitting module 430 is also used to update the value of the real-time table code stored in the cache and the database to the first table code; and update the table code corresponding to each rate stored in the database.

[0078] The above-mentioned rate table code statistics system based on stream processing periodically reports table code data through the meter collector, so that the table code data is split according to the period, and the table code increment of each period, that is, the energy consumption, is added to the table code of the rate corresponding to the reporting time point to update the table code corresponding to different rates. In this way, the rate-based metering function can be realized for single-rate meters, reducing the cost of users to realize rate-based energy consumption statistics and electricity billing. It can then help large commercial electricity users effectively utilize the peak and valley electricity price policy to achieve the goal of saving electricity and reducing costs.

[0079] Each module in the above-mentioned rate table code statistics system based on stream processing can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0080] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store rate period plans and table codes corresponding to each rate. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a statistical method for table codes of each rate based on stream processing is implemented.

[0081] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0082] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the processing logic in the computer program, the following steps are implemented:

[0083] Obtain the first meter code most recently reported by the meter collector; wherein the meter collector collects meter code data of the user's meter in real time and reports it periodically; according to the time point when the meter collector reports the first meter code, determine the target rate corresponding to the time point from the rate period plan; determine whether there is a real-time meter code; wherein the real-time meter code is the second meter code reported by the meter collector last time; if the real-time meter code exists, add the energy consumption to the meter code corresponding to the target rate; wherein the energy consumption is the difference between the first meter code and the second meter code.

[0084] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the processing logic in the computer program is executed by a processor, the following steps are implemented:

[0085] Obtain the first meter code most recently reported by the meter collector; wherein the meter collector collects meter code data of the user's meter in real time and reports it periodically; according to the time point when the meter collector reports the first meter code, determine the target rate corresponding to the time point from the rate period plan; determine whether there is a real-time meter code; wherein the real-time meter code is the second meter code reported by the meter collector last time; if the real-time meter code exists, add the energy consumption to the meter code corresponding to the target rate; wherein the energy consumption is the difference between the first meter code and the second meter code.

[0086] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0087] Obtain the first meter code most recently reported by the meter collector; wherein the meter collector collects meter code data of the user's meter in real time and reports it periodically; according to the time point when the meter collector reports the first meter code, determine the target rate corresponding to the time point from the rate period plan; determine whether there is a real-time meter code; wherein the real-time meter code is the second meter code reported by the meter collector last time; if the real-time meter code exists, add the energy consumption to the meter code corresponding to the target rate; wherein the energy consumption is the difference between the first meter code and the second meter code.

[0088] It should be noted that the user information (including but not limited to the first meter code, second meter code and real-time meter code of the user's electricity meter, etc.) and data (including but not limited to rate period plans, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0089] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0090] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0091] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for counting rate table codes based on stream processing, characterized in that: The method comprises: Obtaining the first meter code reported most recently by the meter collector; wherein the meter collector collects meter code data of the user's meter in real time and reports it periodically; According to the time point when the meter collector reports the first meter code, determining the target rate corresponding to the time point from the rate period plan; Determine whether there is a real-time table code; wherein the real-time table code is the second table code reported by the electric meter collector last time; If the real-time table code exists, the energy consumption is added to the table code corresponding to the target rate; wherein the energy consumption is the difference between the first table code and the second table code.

2. The method according to claim 1, characterized in that The method further comprises: If the real-time table code does not exist, the first table code will be evenly split into four first table code averages, corresponding to the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the flat period, and the table code of the rate corresponding to the off-peak period.

3. The method according to claim 1 or 2, characterized in that: After the table code corresponding to any rate is updated, the method further includes: The value of the real-time table code stored in the cache and the database is updated to the first table code; Update the table code corresponding to each rate stored in the database.

4. The method according to claim 1, characterized in that: According to the time point at which the electric meter collector reports the first meter code, determining a target rate corresponding to the time point from a rate period plan includes: Determine the target time zone and target time period to which the time point at which the electric meter collector reports the first meter code belongs; The target rate at the time point is determined from a rate period scheme according to the target time zone and the target period.

5. The method according to claim 1, characterized in that The rate period scheme, the real-time table code and table codes corresponding to different rates are obtained from a cache or a database.

6. A system for counting rate table codes based on stream processing, characterized in that: The system comprises: The meter collector is used to collect meter code data of user meters in real time and periodically report it to the rate meter code stream processing and splitting module; The rate period plan configuration module is used to configure the corresponding rates for different time zones according to the local peak and valley electricity prices and generate rate period plans; The rate table code stream processing and splitting module is used to obtain the first table code reported most recently by the meter collector; determine the target rate corresponding to the time point from the rate period plan according to the time point when the meter collector reports the first table code; judge whether there is a real-time table code; wherein the real-time table code is the second table code reported by the meter collector last time; if the real-time table code exists, the energy consumption is added to the table code corresponding to the target rate; wherein the energy consumption is the difference between the first table code and the second table code.

7. The system according to claim 6, characterized in that The rate table code stream processing and splitting module is also used to, if the real-time table code does not exist, evenly split the first table code into four first table code averages, corresponding to the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the peak period, the table code of the rate corresponding to the flat period, and the table code of the rate corresponding to the off-peak period.

8. 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 steps of the method according to any one of claims 1 to 5 are implemented.

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

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.