Electric energy meter service scheduling method based on synchronization and asynchronous message collaboration and electric energy meter
By adopting a service scheduling method of synchronous and asynchronous message collaboration in smart power meters, and using the system data bus and message queue mechanism, the problems of high resource occupation and difficulty in cost control are solved, and the business scheduling efficiency and development efficiency of power meters are improved.
Patent Information
- Application Number
- CN202411545200.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2024-12-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The software system architecture of smart power meters has the problem of excessive resource utilization, which leads to low development efficiency and difficult design quality control, and the RTOS-based architecture is difficult to meet cost control requirements.
Adopt the power meter service scheduling method based on synchronous and asynchronous message collaboration, send synchronous or asynchronous message messages through the system data bus, and use message scheduling functions and message queues to process data interactions at idle time to realize efficient data transmission between service modules and deal with.
It significantly improves the business scheduling efficiency of the electricity meter, solves the problems of low development efficiency and cost control under the conditions of system resource constraints, and realizes timely synchronization and asynchronous processing of business data.
Smart Images

Figure CN119071348A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an electric energy meter service dispatching method based on synchronous and asynchronous message coordination and an electric energy meter, belonging to the field of electric energy meter service dispatching. Background Art
[0002] Smart energy meters are important terminals for automatic collection of electricity consumption information, online interaction of metering information, and distributed energy settlement. With the development of digitalization, intelligence, and networking and the diversification of user-side electricity demand, their functions and application scenarios are also constantly expanding. Smart energy meters have evolved from a single metering and billing device to a smart electricity terminal that integrates multiple functions, including remote rate setting, remote refresh program, photovoltaic control, etc. However, with the advancement of technology and the growth of market demand, problems such as the manufacturing cost, technical threshold, and market barriers of smart energy meters have gradually emerged.
[0003] At present, there are two main architectures for the software system of smart energy meters: one is the front-end and back-end system that combines interrupt drive and polling. Those business requests that need to be responded to in time are processed in real time by interrupt drive, and business functions that do not require strict response time are responded by polling. However, with the continuous increase in the business of smart energy meters, the business scheduling requirements are also increasing. The front-end and back-end system architecture based on the combination of interrupt drive and polling gradually reveals its own shortcomings such as low development efficiency and difficult design quality control.
[0004] The other is a software system architecture based on a real-time operating system (RTOS). RTOS divides the processor time into multiple time slices and assigns the time slices to different tasks. Designers divide the product functions into several small tasks with different priorities. Through the task scheduling function of RTOS, tasks are executed by rotating time slices or selecting priorities. Due to strict control of product costs, the MCU processor used in smart energy meters has relatively low performance and relatively few hardware system resources. When using a software system architecture based on RTOS, the operating system itself will occupy a considerable part of the MCU's system resources, and the MCU processor performance requirements are relatively high, which makes it difficult to meet the cost control requirements of smart energy meters. Summary of the invention
[0005] The purpose of the present invention is to provide an electric energy meter service scheduling method and an electric energy meter based on synchronous and asynchronous message collaboration, so as to solve the problem that the software system architecture of the electric energy meter occupies too many system resources.
[0006] To achieve the above object, the solution of the present invention includes: The electric energy meter service scheduling method based on synchronous and asynchronous message collaboration of the present invention, when the service modules of the electric energy meter need to synchronize services: and data interaction needs to be carried out in a timely manner, the service module providing data sends a synchronous message message to the system data bus used to forward messages, and the system data bus finds the service module to perform data interaction through the message scheduling function and processes the synchronous message message, and the service module to perform data synchronization performs corresponding service processing after receiving the synchronous message message sent by the system data bus; if the data interaction does not need to be carried out in a timely manner, the service module providing data sends an asynchronous message message to the message queue in the system data bus, and the system data bus finds the service module to perform data interaction during the idle time of the current time period and processes the asynchronous message message, and the service module to perform data interaction performs corresponding service processing after receiving the asynchronous message message sent by the system data bus.
[0007] Furthermore, the business processing includes: the business module that wants to interact with data sends a data request message to the system data bus, the system data bus finds the business module that provides data and sends the data request message to the business module that provides data, and after receiving the data request message, the business module that provides data sends a data response message including corresponding data to the system data bus, and the system data bus finds the business module that wants to interact with data and sends the data response message to the business module that wants to interact with data.
[0008] Furthermore, each business module includes a read data interface, a write data interface and a message response interface; the read data interface is used to send a data request message to the system data bus, the write data interface is used to send a data response message including corresponding data to the system data bus, and the message response interface is used to send a synchronous message message or an asynchronous message message to the system data bus.
[0009] Furthermore, the system data bus contains a table including business module IDs and message IDs corresponding to the business modules. When sending a message, the business module providing data fills in the ID of the business module to which data interaction is to be performed into the message. The system data bus transmits the message to the business module to which data interaction is to be performed by looking up the table.
[0010] Furthermore, when the system data bus has no idle time in the current time period, the service module to be used for data interaction is found in the next time period and the asynchronous message is processed.
[0011] An electric energy meter of the present invention uses the following method when realizing coordinated dispatch of services: When the business modules of the electric energy meter need to synchronize their services, and data interaction needs to be carried out in a timely manner, the business module providing data sends a synchronous message to the system data bus used to forward messages, and the system data bus finds the business module for data interaction through the message scheduling function and processes the synchronous message. The business module for data synchronization performs corresponding business processing after receiving the synchronous message sent by the system data bus; if data interaction does not need to be carried out in a timely manner, the business module providing data sends an asynchronous message to the message queue in the system data bus, and the system data bus finds the business module for data interaction during the idle time of the current time period and processes the asynchronous message. The business module for data interaction performs corresponding business processing after receiving the asynchronous message sent by the system data bus.
[0012] Furthermore, the business processing includes: the business module that wants to interact with data sends a data request message to the system data bus, the system data bus finds the business module that provides data and sends the data request message to the business module that provides data, and after receiving the data request message, the business module that provides data sends a data response message including corresponding data to the system data bus, and the system data bus finds the business module that wants to interact with data and sends the data response message to the business module that wants to interact with data.
[0013] Furthermore, each business module includes a read data interface, a write data interface and a message response interface; the read data interface is used to send a data request message to the system data bus, the write data interface is used to send a data response message including corresponding data to the system data bus, and the message response interface is used to send a synchronous message message or an asynchronous message message to the system data bus.
[0014] Furthermore, the system data bus contains a table including business module IDs and message IDs corresponding to the business modules. When sending a message, the business module providing data fills in the ID of the business module to which data interaction is to be performed into the message. The system data bus transmits the message to the business module to which data interaction is to be performed by looking up the table.
[0015] Furthermore, when the system data bus has no idle time in the current time period, the service module to be used for data interaction is found in the next time period and the asynchronous message is processed.
[0016] The beneficial effects of the present invention are as follows: the present invention provides a new business collaborative scheduling method for an electric energy meter. When the business modules of the electric energy meter need to synchronize business data in time, the business module providing data sends a synchronous message to the system data bus, the system data bus finds the business module to be interacted with data and processes the synchronous message, and the business module to be synchronized with data performs corresponding business processing after receiving the synchronous message sent by the system data bus; when the business modules of the electric energy meter do not need to synchronize business data in time, the business module providing data sends an asynchronous message to the system data bus, the business module providing data sends an asynchronous message to the message queue in the system data bus, the system data bus finds the business module to be interacted with data in the idle time of the current time period and processes the asynchronous message, and the business module to be interacted with data performs corresponding business processing after receiving the asynchronous message sent by the system data bus. The present invention solves the problem of limited system resources and significantly improves the business scheduling efficiency of the electric energy meter through the mechanism of message scheduling and the modularization of business functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a business model diagram of the software system architecture of the present invention; Figure 2 It is a schematic diagram of a business module of the present invention performing a message response; Figure 3 It is a schematic diagram of the business module of the present invention when performing synchronous message or asynchronous message transmission; Figure 4 It is a schematic diagram of message transmission when the business module of the present invention performs data interaction. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0019] The idea of the present invention is to use the message scheduling mechanism of micro resources to complete the business collaborative scheduling of the electric energy meter. Considering that some business data of the electric energy meter needs to be synchronized in time, the business module that provides data sends a synchronous message message to the system data bus, and the system data bus finds the business module to interact with data and processes the synchronous message message. The business module to synchronize data performs corresponding business processing after receiving the synchronous message message sent by the system data bus; considering that some business data of the electric energy meter does not need to be synchronized in time, the business module that provides data sends an asynchronous message message to the system data bus, and the business module that provides data sends an asynchronous message message to the message queue in the system data bus, and the system data bus finds the business module to interact with data in the idle time of the current time period and processes the asynchronous message message. The business module to interact with data performs corresponding business processing after receiving the asynchronous message message sent by the system data bus.
[0020] Method Example: This embodiment provides a method for dispatching electric energy meter services based on synchronous and asynchronous message coordination, which implements service dispatching of various service modules of the electric energy meter through the message dispatching mechanism of micro resources, an independent data interaction bus and a unified module design interface. Figure 1 As shown, each business module has the same read data interface, write data interface, and message response interface. In addition to the read data interface, write data interface, and message response interface, each business module also has a functional interface that can realize its own business, such as an initialization interface and a message receiving interface. Each business module interacts with data through an independent system data bus, wherein the read data interface is used to read data from other business modules, the write data interface is used to write its own data to other business modules, and the message response interface is used to send messages to other business modules and receive messages from other business modules. The functional characteristics of the energy meter are abstracted and classified, and the energy meter business is divided into several independent business modules, such as an electricity business module for collecting user electricity consumption, an electricity fee management business module for electricity fee management, a freezing business module that allows electricity data to be automatically saved in a storage chip under specific conditions, a remote communication module that allows users or power companies to communicate remotely, and a control business module that allows users or power companies to remotely control.
[0021] When data is exchanged between business modules, they are exchanged through the system data bus, achieving complete decoupling between business modules. Figure 2As shown, when each business module has processed its own business function, if other business modules are needed to respond to the data processed by its own business module, it will also send messages to the system data bus, where the messages include synchronous messages and asynchronous messages. Synchronous messages refer to the system data bus directly processing the message after the message is sent, while asynchronous messages refer to the system data bus continuing to perform other tasks after the message is sent. This message will only be executed when the system data bus is idle. Among them, each business module has a synchronous message function and an asynchronous message function. The business module sends synchronous messages through the synchronous message function, and the business module sends asynchronous messages through the asynchronous message function. The system data bus is driven by timing or triggering messages, and calls the message response interface of the business module to send the message to the business module that needs to respond to this message to correctly execute business scheduling.
[0022] like Figure 3 As shown, when the business modules need to synchronize their services, that is, this business needs to be communicated in time, such as the collection of user power consumption, remote zeroing of electric energy meters by power companies, and remote opening and closing of electric energy meters by power companies, the business module directly sends a synchronous message message to the system data bus, and the system data bus calls the message scheduling function to immediately forward this synchronous message message to the business module that needs to respond to this message; when the business modules do not need to synchronize their services, that is, this business does not need to be communicated in time, such as the power company remotely changing the electricity fee and the communication rate parameters in the remote communication module, the business module sends an asynchronous message message to the message queue in the system data bus, and the system will first process other services, and process the asynchronous message message in the idle time period of the current time period, and send this asynchronous message message to the business module that needs to respond to this message. As another embodiment, if there is no idle time in the current time period, the asynchronous message message will be processed in the next time period.
[0023] Each business module implements data access between business modules through the system data bus. Each business module registers its own module ID and the message ID corresponding to the module ID in the system data bus when the module is initialized, so a table is created in the system data bus. This table has the module ID of each business module and the message ID corresponding to the module ID. When data interaction is required between business modules, the system data bus is first accessed, and the system data bus finds the business module to be accessed based on the module ID and message ID in the table. Figure 4 As shown, when each business module needs other business modules to provide business data, it sends a data request message to the system data bus, and the system data bus finds the business module to be accessed according to the module ID when the business module is registered. The data response message of each business module is also sent by the system data bus according to the module ID when the business module is registered.
[0024] The following is a further explanation of the asynchronous message coordinated electric energy meter service dispatching method of the present invention by taking an example of an asynchronous message: When the power company remotely changes the electricity fee parameters in the electricity fee management business module, since the electricity fee changes at this time, the electricity fee management business module needs to send a message containing the electricity fee adjustment and the message ID corresponding to the freezing business module to the freezing business module. Since the message does not need to be processed by the system data bus in time at this time, the electricity fee management business module sends an asynchronous message to the message queue in the system data bus through its own message response interface. The system data bus dispatches the asynchronous message to the freezing business module by looking up the table in the next time period, and then the freezing business module processes the asynchronous message; since the freezing business module needs to read the electricity fee parameters in the electricity fee management business module at this time, a data request message containing the module ID of the electricity fee management business module is sent to the system data bus through the read data interface of the freezing business module. The system data bus sends the data request message to the electricity fee management business module by looking up the table. The electricity fee management business module fills the adjusted electricity fee into the data response message containing the module ID of the freezing business module through the write data interface, and then sends it to the system data bus. The system data bus sends the data response message to the freezing business module by looking up the table. After receiving the data response message, the freezing business module processes and finds out that the electricity fee has changed at this time, so the freezing business module saves the electricity data at this time in the storage chip.
[0025] The following further illustrates the method for dispatching electric energy meter services using synchronous messages in coordination with the present invention by taking an example of a synchronous message: When the power company sends an electric energy meter reset instruction to the remote communication module, the remote communication module also needs to send the electric energy meter reset instruction to all other business modules of the electric energy meter. Since the message needs to be processed by the system data bus in time at this time, the remote communication module sends a synchronization message containing the message ID corresponding to all other business modules to the system through its own message response interface. The system data bus immediately sends this synchronization message to all other business modules by looking up the table, and then all other business modules receive the synchronization message and wait for the communication module to send a data reset instruction; since the remote communication module needs to write the reset instruction to all other business modules, a data request message containing the reset instruction and the module ID of all other business modules is sent to the system data bus through the write data interface of the remote communication module. The system data bus sends this data request message to all other business modules by looking up the table. After all other business modules receive the data response message containing the reset instruction, they process and know that their own business module data needs to be reset at this time, so they execute the corresponding data reset function. After clearing the data, each business module will send a synchronization message to the system containing the clearing success and the module ID of the remote communication module. The system data bus sends the synchronization message to the remote communication module through a table lookup. After receiving the message, the remote communication module sends the clearing success data to the power company.
[0026] Electric energy meter embodiment: This embodiment provides an electric energy meter. When the electric energy meter performs collaborative scheduling of services, the method described in the method embodiment is adopted. Since the introduction of the method is clear enough, it will not be repeated here.
[0027] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for dispatching electric energy meter services based on synchronous and asynchronous message coordination, characterized in that: When the business modules of the electric energy meter need to synchronize their services: and data interaction needs to be carried out in a timely manner, the business module providing data sends a synchronization message to the system data bus used to forward messages, and the system data bus finds the business module to interact with data through the message scheduling function and processes the synchronization message. The business module to synchronize data performs corresponding business processing after receiving the synchronization message sent by the system data bus; If data interaction does not need to be carried out in a timely manner, the business module providing data sends an asynchronous message message to the message queue in the system data bus. The system data bus finds the business module for data interaction during the idle time of the current time period and processes the asynchronous message message. The business module for data interaction performs corresponding business processing after receiving the asynchronous message message sent by the system data bus.
2. The method for dispatching electric energy meter services based on synchronous and asynchronous message coordination according to claim 1, characterized in that: The business processing includes: the business module that wants to perform data interaction sends a data request message to the system data bus, the system data bus finds the business module that provides data and sends the data request message to the business module that provides data, after receiving the data request message, the business module that provides data sends a data response message including corresponding data to the system data bus, the system data bus finds the business module that wants to perform data interaction and sends the data response message to the business module that wants to perform data interaction.
3. The method for dispatching electric energy meter services based on synchronous and asynchronous message coordination according to claim 2, characterized in that: Each business module includes a read data interface, a write data interface and a message response interface; the read data interface is used to send a data request message to the system data bus, the write data interface is used to send a data response message including corresponding data to the system data bus, and the message response interface is used to send a synchronous message message or an asynchronous message message to the system data bus.
4. The method for dispatching electric energy meter services based on synchronous and asynchronous message coordination according to claim 2, characterized in that: The system data bus contains a table including business module IDs and message IDs corresponding to the business modules. When sending a message, the business module that provides data fills the ID of the business module to be interacted with into the message. The system data bus transmits the message to the business module to be interacted with by looking up the table.
5. The method for dispatching electric energy meter services based on synchronous and asynchronous message coordination according to claim 1, characterized in that: When the system data bus has no idle time in the current time period, the service module to be used for data interaction is found in the next time period and the asynchronous message is processed.
6. An electric energy meter, characterized in that: The electric energy meter uses the following method when implementing the coordinated dispatch of services: When the business modules of the electric energy meter need to synchronize their services: and data interaction needs to be carried out in a timely manner, the business module providing data sends a synchronization message to the system data bus used to forward messages, and the system data bus finds the business module to interact with data through the message scheduling function and processes the synchronization message. The business module to synchronize data performs corresponding business processing after receiving the synchronization message sent by the system data bus; If data interaction does not need to be carried out in a timely manner, the business module providing data sends an asynchronous message message to the message queue in the system data bus. The system data bus finds the business module for data interaction during the idle time of the current time period and processes the asynchronous message message. The business module for data interaction performs corresponding business processing after receiving the asynchronous message message sent by the system data bus.
7. The electric energy meter according to claim 6, characterized in that: The business processing includes: the business module that wants to perform data interaction sends a data request message to the system data bus, the system data bus finds the business module that provides data and sends the data request message to the business module that provides data, after receiving the data request message, the business module that provides data sends a data response message including corresponding data to the system data bus, the system data bus finds the business module that wants to perform data interaction and sends the data response message to the business module that wants to perform data interaction.
8. The electric energy meter according to claim 7, characterized in that: Each business module includes a read data interface, a write data interface and a message response interface; the read data interface is used to send a data request message to the system data bus, the write data interface is used to send a data response message including corresponding data to the system data bus, and the message response interface is used to send a synchronous message message or an asynchronous message message to the system data bus.
9. The electric energy meter according to claim 7, characterized in that: The system data bus contains a table including business module IDs and message IDs corresponding to the business modules. When sending a message, the business module that provides data fills the ID of the business module to be interacted with into the message. The system data bus transmits the message to the business module to be interacted with by looking up the table.
10. The electric energy meter according to claim 6, characterized in that: When the system data bus has no idle time in the current time period, the service module to be used for data interaction is found in the next time period and the asynchronous message is processed.
Citation Information
Patent Citations
Method and device for sending data
CN101764746A
Communication method between real-time operating system and non-real-time operating system on multi-core processor
CN103942178A
Metering information interaction platform and method based on asynchronous queue
CN115022382A
Novel multifunctional ammeter data acquisition system and method
CN117388547A
Data transfer method and data storage device
EP3477961A1
