Data distribution method and device of intelligent electric energy meter, medium and equipment

By obtaining and building accurate communication channels and memory parameters in smart power meters, combined with CRC32 verification, the problem of inaccurate and efficient data distribution in the existing technology is solved, and efficient and reliable data transmission is achieved.

CN120256164APending Publication Date: 2025-07-04GUANGDONG ELECTRIC POWER SCI RES INST ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510333765.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

There are problems such as high coupling, poor scalability, difficulty in monitoring and low communication efficiency among existing smart power meters application APPs, resulting in inaccurate and efficient data distribution.

Method used

By obtaining the communication channel parameters and shared memory areas of the source application APP, as well as the communication channel parameters and shared memory parameters of each target application APP, the data transmission channel is built using the preset channel function interface and the power table chip, and combining the CRC32 verification mechanism to ensure the accuracy and efficiency of data transmission.

Benefits of technology

It improves the accuracy and efficiency of data transmission of smart power meter systems, reduces the risk of data transmission failure caused by parameter mismatch or format errors, and enhances the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256164A_ABST
    Figure CN120256164A_ABST
Patent Text Reader

Abstract

The invention discloses a data distribution method and device of an intelligent electric energy meter, a medium and equipment. According to the application, the communication and memory parameters of the source APP and the parameters corresponding to the target APPs are obtained, and then the parameters of the target APPs are transmitted to the source APP by utilizing the preset channel function interface, so that the source APP can write the parameters into the shared memory area according to the communication channel parameters of the source APP. And then, depending on a preset function of the electric energy meter chip, constructing a data sending channel between the source application APP and each target application APP, so that the target application APP can complete data receiving according to the channels and the shared memory region. The coherent process improves the accuracy and efficiency of data transmission, and solves the problem that the data distribution of the intelligent electric energy meter cannot be accurately and efficiently completed in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data distribution of smart electricity meters, and particularly to a data distribution method, device, medium and equipment for smart electricity meters. Background Art

[0002] With the rapid development of Internet of Things technology, smart electricity meters have become an important part of the intelligentization of the power system. Smart electricity meters can not only perform basic electricity metering, but also integrate multiple functions, such as remote meter reading, load control, user interaction, etc. The realization of these functions depends on multiple application programs running inside the smart electricity meter, namely application APPs. These application APPs need to exchange data and communicate with each other to achieve complex functions and operations.

[0003] In the existing technology, the data interaction between smart electricity meter application APPs mainly adopts direct message queue or pipeline method. This communication method has the following main disadvantages:

[0004] High coupling degree: The applications communicate directly with each other using message queue or pipeline method, resulting in a high coupling degree between applications. When one application modifies the message format or length, other applications that need to receive this message must also make corresponding adjustments.

[0005] Poor scalability: When adding new applications or new functional modules, large-scale modifications need to be made to the original applications in order to communicate with the new applications or functional modules, which limits the scalability of the system.

[0006] Difficult to monitor: All applications use direct connection methods for data interaction, which makes connection management and data interaction monitoring difficult. Once data interaction anomalies occur, it is difficult to discover and solve them in a timely manner.

[0007] Low communication efficiency: The direct communication between applications requires a large amount of CPU resources, which not only reduces the communication efficiency, but also increases the possibility of errors.

[0008] These problems cause the existing technology to be unable to accurately and efficiently complete the data distribution of smart electricity meters. Summary of the Invention

[0009] The present invention provides a data distribution method, device, medium and equipment for smart electricity meters to solve the problem that the existing technology cannot accurately and efficiently complete the data distribution of smart electricity meters.

[0010] In a first aspect, the present application provides a data distribution method for smart electricity meters, including:

[0011] Obtain the first communication channel parameters and the first shared memory area of the source application APP, as well as the second communication channel parameters and the second shared memory parameters of each target application APP;

[0012] According to the preset channel function interface, send the second communication channel parameters and the second shared memory parameters to the source application APP, so that the source application APP inputs the second communication channel parameters and the second shared memory parameters into the first shared memory area according to the first communication channel parameters;

[0013] Construct data sending channels between the source application APP and each target application APP according to the preset electricity meter chip, so that each target application APP receives data according to the data sending channels and the first shared memory area.

[0014] This application can ensure the accurate matching of communication parameters between the source application APP and the target application APP by obtaining the first communication channel parameters and the first shared memory area of the source application APP, as well as the second communication channel parameters and the second shared memory parameters of each target application APP, thereby improving the accuracy of data transmission. Further, by sending the communication parameters of the target application APP to the source application APP through the preset channel function interface, and enabling the source application APP to write data into the shared memory according to these parameters, this step optimizes the data organization and storage process, laying a foundation for efficient transmission. Finally, using the electricity meter chip to construct data sending channels between the source application APP and each target application APP enables the target application APP to accurately receive data according to these channels and shared memory parameters. This application improves communication efficiency and solves the problem in the prior art that the data distribution of intelligent electricity meters cannot be accurately and efficiently completed.

[0015] As a preferred embodiment of the first aspect, it further includes:

[0016] Perform integrity verification on the data when each target application APP sends or receives messages.

[0017] In this preferred embodiment, the present application integrates the CRC32 check function into each target application APP, performs data integrity verification when sending messages, and performs the CRC32 comparison function when receiving messages. The method of the present application enhances the reliability and accuracy of data transmission. Specifically, the CRC32 check during sending ensures that each message has undergone an integrity check before leaving the source application APP, which can detect any possible errors during data transmission. When the message reaches the target application APP, the CRC32 comparison function at the receiving end further verifies the integrity of the message, ensuring that only the unaltered and complete data will be received and processed. This dual-check mechanism effectively reduces problems caused by data transmission errors and improves the fault tolerance of the system.

[0018] As a preferred embodiment of the first aspect, the source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameters, specifically:

[0019] The source application APP formats the respective second communication channel parameters and the respective second shared memory parameters according to a preset message interaction definition rule, and encapsulates the formatted respective second communication channel parameters and respective second shared memory parameters into a standardized message format according to the format requirements of the preset interaction structure and the first communication channel parameters, obtaining the standardized respective second communication channel parameters and respective second shared memory parameters;

[0020] Input the standardized respective second communication channel parameters and respective second shared memory parameters into the first shared memory area;

[0021] Among them, the preset message interaction definition rule is used to define the format, content, transmission order, and verification method of messages during communication between the source application APP and the target application APP; the preset interaction structure is a standardized data structure for organizing and storing communication data.

[0022] In this preferred embodiment, the present application ensures the standardization and structuring of data transmission by enabling the source application APP to input each second communication channel parameter and each second shared memory parameter into the first shared memory area according to the preset message interaction definition rules and the preset interaction structure, in combination with the first communication channel parameter. This standardization process allows the source application APP to organize and store communication data in a unified and predictable manner, thereby improving the efficiency and accuracy of data transmission. Since each parameter and memory address follows the preset rules, the source application APP can unambiguously identify and access the communication parameters of the target application APP, reducing the risk of data transmission failure caused by parameter mismatch or format error. Therefore, this method enhances the interoperability and reliability of the system by implementing a strict structured communication protocol during data transmission, thereby improving the communication efficiency of the entire smart meter system and the accuracy of data.

[0023] As a preferred embodiment of the first aspect, constructing each data sending channel between the source application APP and each target application APP according to the preset electricity meter chip specifically includes:

[0024] Constructing each data sending channel between the source application APP and each target application APP according to the direct access memory of the preset electricity meter chip;

[0025] Monitoring the sending status of each data sending channel according to the preset monitoring channel.

[0026] In this preferred embodiment, the present application constructs a data sending channel between the source application APP and each target application APP by utilizing the DMA (Direct Memory Access) function of the preset electricity meter chip, and the method of the present application realizes the efficiency and real-time performance of data transmission. The DMA function allows data to be directly transmitted between memories without occupying CPU resources, thereby reducing the burden on the CPU and increasing the data processing speed. In addition, by monitoring the sending status of these data sending channels through the preset monitoring channel, the integrity and accuracy of data transmission can be detected and ensured in real time. This monitoring mechanism provides the system with the ability to promptly discover and solve problems that may occur during the transmission process, thereby enhancing the stability and reliability of the system.

[0027] As an embodiment of the first aspect, each second communication channel parameter of each target application APP includes the name of each target application APP, the channel number of each target application APP, the channel depth, the channel timeout time, the number of retransmissions, and the channel verification method;

[0028] Each second shared memory parameter of each target application APP includes the shared memory pointer of each target application APP and the shared memory depth of each target application APP.

[0029] In this preferred embodiment, the present application defines in detail the second communication channel parameters of each target application APP, including the target application APP name, channel number, channel depth, channel timeout time, number of retransmissions, and channel verification method, as well as the second shared memory parameters, including the shared memory pointer and shared memory depth. The method of the present application can achieve precise communication management and data transmission control. This detailed parameterization ensures that during the data transmission process, the source application APP can accurately send data to the correct target location according to the specific requirements and characteristics of the target application APP, and the integrity and correctness of the data are ensured through the verification method. At the same time, the clear definition of the shared memory parameters enables data to be stored and accessed efficiently, reducing memory conflicts and access latency.

[0030] In a second aspect, the present application provides a data distribution device for an intelligent electricity meter. The data distribution device for the intelligent electricity meter includes an acquisition module, a sending module, and a receiving module;

[0031] The acquisition module is used to acquire the first communication channel parameters and the first shared memory area of the source application APP, as well as the second communication channel parameters and the second shared memory parameters of each target application APP;

[0032] The sending module is used to send the second communication channel parameters and the second shared memory parameters to the source application APP according to a preset channel function interface, so that the source application APP inputs the second communication channel parameters and the second shared memory parameters into the first shared memory area according to the first communication channel parameters;

[0033] The receiving module is used to construct the data sending channels between the source application APP and each target application APP according to a preset electricity meter chip, so that each target application APP receives data according to the data sending channels and the first shared memory area.

[0034] The device uses three modules to divide the work and coordinate with each other to better complete the data distribution. By obtaining the first communication channel parameters and the first shared memory area of the source application APP, as well as the second communication channel parameters and the second shared memory parameters of each target application APP, this application can ensure the accurate matching of the communication parameters between the source application APP and the target application APP, thereby improving the accuracy of data transmission. Further, by means of a preset channel function interface, the communication parameters of the target application APP are sent to the source application APP, and the source application APP writes the data into the shared memory according to these parameters. This step optimizes the data organization and storage process and lays a foundation for efficient transmission. Finally, a data sending channel between the source application APP and each target application APP is constructed by using a watt-hour meter chip, so that the target application APP can accurately receive data according to these channels and the shared memory parameters. This application improves the communication efficiency and solves the problem that the data distribution of the intelligent watt-hour meter cannot be accurately and efficiently completed in the prior art.

[0035] As a preferred embodiment of the second aspect, it further includes:

[0036] When each target application APP sends or receives a message, data integrity verification is performed.

[0037] In this preferred embodiment, this application integrates the CRC32 verification function in each target application APP, performs data integrity verification when sending a message, and performs CRC32 comparison function when receiving a message. The method of this application enhances the reliability and accuracy of data transmission. Specifically, the CRC32 verification during sending ensures that each message has passed the integrity check before leaving the source application APP, so that any possible errors can be detected during the data transmission process. When the message reaches the target application APP, the CRC32 comparison function at the receiving end further verifies the integrity of the message, ensuring that only the unmodified and complete data will be received and processed. This dual verification mechanism effectively reduces the problems caused by data transmission errors and improves the fault tolerance of the system.

[0038] As a preferred embodiment of the second aspect, the source application APP inputs the second communication channel parameters and the second shared memory parameters into the first shared memory area according to the first communication channel parameters, specifically:

[0039] The source application APP formats each of the second communication channel parameters and each of the second shared memory parameters according to a preset message interaction definition rule, and encapsulates the formatted second communication channel parameters and second shared memory parameters into a standardized message format according to the format requirements of a preset interaction structure and the first communication channel parameters, obtaining the standardized second communication channel parameters and second shared memory parameters;

[0040] Input the standardized second communication channel parameters and second shared memory parameters into a first shared memory area;

[0041] Wherein, the preset message interaction definition rule is used to define the format, content, transmission order and verification method of messages during communication between the source application APP and the target application APP; the preset interaction structure is a standardized data structure for organizing and storing communication data.

[0042] In this preferred embodiment, the present application ensures the standardization and structuring of data transmission by enabling the source application APP to input each of the second communication channel parameters and each of the second shared memory parameters into the first shared memory area according to the preset message interaction definition rule and the preset interaction structure, in combination with the first communication channel parameters. This standardization process allows the source application APP to organize and store communication data in a unified and predictable manner, thereby improving the efficiency and accuracy of data transmission. Since each parameter and memory address follows a preset rule, the source application APP can unambiguously identify and access the communication parameters of the target application APP, reducing the risk of data transmission failure due to parameter mismatch or format error. Therefore, this method enhances the interoperability and reliability of the system by implementing a strict structured communication protocol during data transmission, thereby improving the communication efficiency of the entire smart meter system and the accuracy of data.

[0043] In a third aspect, the present application provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the data distribution method of a smart electricity meter as described above. Its beneficial effects are the same as those of the data distribution method of a smart electricity meter provided in the first aspect of the present application.

[0044] In a fourth aspect, the present application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements any one of the data distribution methods of a smart electricity meter as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 Schematic flow chart of an embodiment of the data distribution method for the smart electricity meter provided in this application;

[0046] Figure 2 Schematic structural diagram of an embodiment of the data transmission provided in this application;

[0047] Figure 3 Schematic structural diagram of an embodiment of the data distribution device for the smart electricity meter provided in this application. Detailed implementation manners

[0048] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0049] Embodiment 1

[0050] Please refer to Figure 1 , a data distribution method for a smart electricity meter provided in an embodiment of the present invention.

[0051] In this embodiment, the process of the data distribution method for the smart electricity meter in this application is described in detail through steps S01 - S03.

[0052] The entire data distribution process of this application is as Figure 2 shown, including a source application App, each target application APP, a communication App module, and an independent DMA channel.

[0053] Furthermore, (1) the electricity meter of this application has the M2M function of hardware DMA.

[0054] (2) The communication APP of this application has a dedicated DMA interface, can manage the DMA controller of the electricity meter chip, and can establish direct data transfer between two pieces of memory by using the M2M characteristics of DMA.

[0055] (3) Other application APPs of this application need to define parameters such as the application APP name, channel number, channel depth, channel timeout time, number of retransmissions, channel verification method, shared memory size, and shared memory address in a dedicated area.

[0056] (4) Other application APPs of this application have the function of appending CRC32 verification to the sent messages and the function of comparing CRC32 for the received messages.

[0057] (5) Other applications APP of this application have the function of appending CRC32 checksum to the content written into the shared memory and the function of comparing CRC32 for the data read from the shared memory.

[0058] S01: Obtain the first communication channel parameter and the first shared memory area of the source application APP, as well as the second communication channel parameters and the second shared memory parameters of each target application APP.

[0059] As a preferred embodiment of Embodiment 1, the obtaining of the first communication channel parameter and the first shared memory area of the source application APP, as well as the second communication channel parameters and the second shared memory parameters of each target application APP, specifically includes:

[0060] The communication App module obtains the communication channel parameters and shared memory parameters defined by all applications APP in the system, and establishes a monitoring and printing channel;

[0061] More specifically, after the system starts, a communication APP application is created. The communication APP takes over the DMA controller of the electric energy meter chip and creates a public receiving channel;

[0062] The system creates other application APPs. The other application APPs allocate shared memory areas through the dynamic memory allocation function according to the defined shared memory parameters, and record the addresses of the shared memory areas;

[0063] The other application APPs can call the communication APP interface function to communicate with the communication APP;

[0064] The other application APPs send their own channel parameters to the communication APP through the communication APP public transceiver communication channel. For example:

[0065] typedef struct

[0066] {

[0067] INT32U Name; / / APP name

[0068] INT32U Chn_Num; / / Channel number

[0069] INT32U Chn_Size; / / Channel depth

[0070] INT32U Chn_TimeOut; / / Channel reply timeout

[0071] INT32U Chn_ReSend; / / Number of retransmissions

[0072] INT32U Check_Type; / / Check method

[0073] INT32U Share_Men_Size; Shared memory size

[0074] INT32U* Share_Men_pointer; Shared memory pointer

[0075] }APP_Msg_Para;

[0076] After the communication APP receives it, it first stores the communication channel parameters sent by the application APP, parses and records the parameters, and based on the parsed channel number and memory pointer address, completes the corresponding relationship for sending and receiving between different applications;

[0077] The communication APP monitors the common sending and receiving channels and waits for messages from other application APPs.

[0078] S02: According to the preset channel function interface, send the respective second communication channel parameters and the respective second shared memory parameters to the source application APP, so that the source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameters.

[0079] As a preferred embodiment of Embodiment 1, the step of sending the respective second communication channel parameters and the respective second shared memory parameters to the source application APP according to the preset channel function interface, so that the source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameters, specifically is:

[0080] The source application APP organizes a retrieval target APP parameter message, and the message content includes a retrieval command, the name of the source application APP, the name of the target APP or the channel number, or obtains the channel information of all installed application APPs by retrieving all commands;

[0081] The source application APP sends the above retrieval message to the public receiving channel of the communication APP;

[0082] After the communication APP receives the message sent by the source application APP, according to the retrieval command in the message, it retrieves the channel parameters of all application APPs stored in the previous step through the name of the target APP or the channel number;

[0083] The communication APP sends the retrieved target application APP communication parameters or empty information back to the source application APP through the established communication sending channel with the source application APP;

[0084] The source application APP parses the received message to obtain the channel parameters of the target application APP;

[0085] Based on the target APP communication parameter information obtained in step S2, the source application APP wraps the interaction message in an interaction structure according to the unified message interaction definition rules. For example:

[0086] typedef struct

[0087] {

[0088] INT32U Target_Name; / / Name of the target application APP

[0089] INT32U Source_Name; / / Name of the source application APP

[0090] INT32U Data[]; / / Specific communication data

[0091] INT32U Data_Len; / / Length of the communication data

[0092] INT32U CRC_32; / / Checksum

[0093] }APP_Msg;

[0094] The source application APP writes the above structure into its own shared memory area.

[0095] Among them, the interaction structure is a standardized data structure for organizing and storing communication data. It is a data type in programming, usually composed of multiple fields, each field having a fixed type and meaning, and is used to store specific information. The role of the interaction structure is to ensure that both the sending and receiving parties can process data in a unified format, thereby achieving efficient and accurate communication.

[0096] In this preferred embodiment, the present application sends the second communication channel parameters and the second shared memory parameters of each target application APP to the source application APP by using a preset channel function interface, ensuring that the source application APP can accurately receive and identify the communication requirements and memory layout of the target application APP. This process allows the source application APP to accurately map the received second communication channel parameters and the second shared memory parameters to the first shared memory area according to the first communication channel parameters. This precise parameter transfer and mapping mechanism, first, the preset channel function interface provides a standardized communication method to ensure the correct transfer of parameters between the source application APP and the target application APP; second, the source application APP correctly writes the data into the predetermined shared memory area according to these parameters, which not only improves the accuracy of data transmission but also avoids data misalignment or loss caused by incorrect or inconsistent parameters.

[0097] S03: Based on a preset electricity meter chip, construct each data sending channel between the source application APP and each target application APP, so that each target application APP receives data according to each data sending channel and the first shared memory area.

[0098] As a preferred embodiment of Embodiment 1, the step of constructing each data sending channel between the source application APP and each target application APP based on a preset electricity meter chip, so that each target application APP receives data according to each data sending channel and the first shared memory area, specifically includes:

[0099] The dedicated channel established between the source application APP and the communication APP calls the inos_app_msg_send interface to send a message to notify the communication APP to prepare to establish a communication channel between the DMA of the source application APP and the target application APP. The specific content to be sent is, for example:

[0100] typedef struct

[0101] {

[0102] INT32U Target_Name; / / Name of the target application APP

[0103] INT32U Source_Name; / / Name of the source application APP

[0104] INT32U Data_Len; / / Data length

[0105] }APP_Send_Ifo;

[0106] After receiving the message sent by the source application APP, the communication APP extracts the shared memory pointer of the source application APP, the shared memory pointer of the target application APP, and the data transmission length according to the received message, and calls the inos_app_DMA_chn_set interface to establish a DMA communication channel between the source application APP and the target application APP;

[0107] The communication APP calls the inos_app_DMA_chn_start interface to start the DMA data transmission between the source application APP and the target application APP;

[0108] After the DMA channel transmission is completed, it notifies both the communication APP and the target APP for processing.

[0109] In this preferred embodiment, the present application ensures the standardization and structuring of data transmission by enabling the source application APP to input each second communication channel parameter and each second shared memory parameter into the first shared memory area in accordance with the preset message interaction definition rules and the preset interaction structure, in combination with the first communication channel parameters. This standardized processing allows the source application APP to organize and store communication data in a unified and predictable manner, thereby improving the efficiency and accuracy of data transmission. Since each parameter and memory address follows the preset rules, the source application APP can unambiguously identify and access the communication parameters of the target application APP, reducing the risk of data transmission failure caused by parameter mismatch or format error. Therefore, this method enhances the interoperability and reliability of the system by implementing a strict structured communication protocol during data transmission, thereby improving the communication efficiency of the entire smart meter system and the accuracy of data.

[0110] The present application can ensure the precise matching of communication parameters between the source application APP and the target application APP by obtaining the first communication channel parameters and the first shared memory area of the source application APP, as well as each second communication channel parameter and each second shared memory parameter of each target application APP, thereby improving the accuracy of data transmission. Further, the communication parameters of the target application APP are sent to the source application APP through the preset channel function interface, and the source application APP writes the data into the shared memory according to these parameters. This step optimizes the data organization and storage process and lays a foundation for efficient transmission. Finally, a data sending channel between the source application APP and each target application APP is constructed using the electric energy meter chip, enabling the target application APP to accurately receive data based on these channels and shared memory parameters. The present application improves the communication efficiency and solves the problem in the prior art that the data distribution of smart electric energy meters cannot be accurately and efficiently completed.

[0111] Embodiment 2

[0112] Please refer to Figure 3 , a data distribution device for a smart electric energy meter provided by an embodiment of the present application.

[0113] In this embodiment, the data distribution device of the smart electric energy meter includes an acquisition module 10, a sending module 20, and a receiving module 30.

[0114] The entire data distribution process of the present application is as Figure 2 shown, including the source application App, each target application APP, the communication App module, and an independent DMA channel.

[0115] Furthermore, (1) the electric energy meter of the present application has the M2M function of hardware DMA.

[0116] (2) The communication APP of this application has a dedicated DMA interface, which can manage the DMA controller of the electric energy meter chip and can establish direct data transfer between two pieces of memory by using the M2M feature of DMA.

[0117] (3) Other application APPs of this application need to define parameters such as the application APP name, channel number, channel depth, channel timeout time, number of retransmissions, channel verification method, shared memory size, and shared memory address in a dedicated area.

[0118] (4) Other application APPs of this application have the function of appending CRC32 verification to the sent messages and the function of comparing CRC32 for the received messages.

[0119] (5) Other application APPs of this application have the function of appending CRC32 verification to the content written into the shared memory and the function of comparing CRC32 for the data read from the shared memory.

[0120] The acquisition module 10 is used to acquire the first communication channel parameters and the first shared memory area of the source application APP, as well as the second communication channel parameters and the second shared memory parameters of each target application APP.

[0121] As a preferred embodiment of the second embodiment, the acquisition of the first communication channel parameters and the first shared memory area of the source application APP, as well as the second communication channel parameters and the second shared memory parameters of each target application APP, specifically includes:

[0122] The communication App module acquires the communication channel parameters and shared memory parameters defined by all application APPs in the system and establishes a monitoring and printing channel;

[0123] More specifically, after the system starts, a communication APP application is created. The communication APP takes over the DMA controller of the electric energy meter chip and creates a public receiving channel;

[0124] The system creates other application APPs. The other application APPs allocate shared memory areas through the dynamic memory allocation function according to the defined shared memory parameters and record the addresses of the shared memory areas;

[0125] Other application APPs can call the communication APP interface function to communicate with the communication APP;

[0126] Other application APPs send their own channel parameters to the communication APP through the communication APP public transceiver communication channel. For example:

[0127] typedef struct

[0128] {

[0129] INT32U Name; / / APP name

[0130] INT32U Chn_Num; / / Channel number

[0131] INT32U Chn_Size; / / Channel depth

[0132] INT32U Chn_TimeOut; / / Channel reply timeout

[0133] INT32U Chn_ReSend; / / Number of retransmissions

[0134] INT32U Check_Type; / / Verification method

[0135] INT32U Share_Men_Size; Shared memory size

[0136] INT32U*Share_Men_pointer; Shared memory pointer

[0137] }APP_Msg_Para;

[0138] After the communication APP receives it, it first stores the communication channel parameters sent by the application APP and parses and records the parameters. Based on the parsed channel number and the memory pointer address, it completes the corresponding relationship for sending and receiving between different applications;

[0139] The communication APP monitors the common sending and receiving channels and waits for messages from other application APPs.

[0140] The sending module 20 is used to send the respective second communication channel parameters and the respective second shared memory parameters to the source application APP according to a preset channel function interface, so that the source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameters.

[0141] As a preferred embodiment of Embodiment 2, the step of sending the respective second communication channel parameters and the respective second shared memory parameters to the source application APP according to a preset channel function interface, so that the source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameters is specifically as follows:

[0142] The source application APP organizes a search for the target APP parameter message. The message content includes a search command, the name of the source application APP, the name of the target APP or the channel number, or obtains the channel information of all installed application APPs by searching for all commands;

[0143] The source application APP sends the above retrieval message to the public receiving channel of the communication APP;

[0144] After receiving the message sent by the source application APP, the communication APP retrieves the channel parameters of all the stored application APPs in the steps according to the retrieval command in the message through the target APP name or channel number;

[0145] The communication APP sends the retrieved communication parameters or empty information of the target application APP back to the source application APP through the communication sending channel established with the source application APP;

[0146] The source application APP parses the received message to obtain the channel parameters of the target application APP;

[0147] Based on the communication parameter information of the target APP obtained in step S2, the source application APP wraps the interaction message in an interaction structure according to the unified message interaction definition rule, for example:

[0148] typedef struct

[0149] {

[0150] INT32U Target_Name; / / Name of the target application APP

[0151] INT32U Source_Name; / / Name of the source application APP

[0152] INT32U Data[]; / / Specific communication data

[0153] INT32U Data_Len; / / Length of the communication data

[0154] INT32U CRC_32; / / Checksum

[0155] }APP_Msg;

[0156] The source application APP writes the above structure into its own shared memory area.

[0157] Among them, the interaction structure is a standardized data structure for organizing and storing communication data. It is a data type in programming, usually composed of multiple fields, each field having a fixed type and meaning, and is used to store specific information. The role of the interaction structure is to ensure that both the sending and receiving parties can process data according to a unified format, so as to achieve efficient and accurate communication.

[0158] In this preferred embodiment, the present application sends the second communication channel parameters and the second shared memory parameters of each target application APP to the source application APP by using a preset channel function interface, ensuring that the source application APP can accurately receive and identify the communication requirements and memory layout of the target application APP. This process allows the source application APP to accurately map the received second communication channel parameters and second shared memory parameters to the first shared memory area according to the first communication channel parameters. This precise parameter transfer and mapping mechanism, first of all, the preset channel function interface provides a standardized communication method to ensure the correct transfer of parameters between the source application APP and the target application APP; secondly, the source application APP correctly writes data to the predetermined shared memory area according to these parameters, which not only improves the accuracy of data transmission but also avoids data misalignment or loss caused by incorrect or inconsistent parameters.

[0159] The receiving module 30 is used to construct each data sending channel between the source application APP and each target application APP according to a preset electric energy meter chip, so that each target application APP receives data according to each data sending channel and the first shared memory area.

[0160] As a preferred embodiment of the second embodiment, the constructing each data sending channel between the source application APP and each target application APP according to a preset electric energy meter chip, so that each target application APP receives data according to each data sending channel and the first shared memory area, specifically is:

[0161] The dedicated channel established between the source application APP and the communication APP calls the inos_app_msg_send interface to send a message to notify the communication APP to prepare to establish a communication channel between the DMA of the source application APP and the target application APP. The specific sending content, for example:

[0162] typedef struct

[0163] {

[0164] INT32U Target_Name; / / Name of the target application APP

[0165] INT32U Source_Name; / / Name of the source application APP

[0166] INT32U Data_Len; / / Data length

[0167] }APP_Send_Ifo;

[0168] After the communication APP receives the message sent by the source application APP, it extracts the shared memory pointer of the source application APP, the shared memory pointer of the target application APP, and the transmission data length according to the received message, and calls the inos_app_DMA_chn_set interface to establish a DMA communication channel between the source application APP and the target application APP;

[0169] The communication APP calls the inos_app_DMA_chn_start interface to start the DMA data transmission between the source application APP and the target application APP;

[0170] After the DMA channel transmission is completed, both the communication APP and the target APP are notified to process.

[0171] In this preferred embodiment, the present application ensures the standardization and structuring of data transmission by enabling the source application APP to input each second communication channel parameter and each second shared memory parameter into the first shared memory area according to the preset message interaction definition rules and the preset interaction structure, in combination with the first communication channel parameters. This standardized processing allows the source application APP to organize and store communication data in a unified and predictable manner, thereby improving the efficiency and accuracy of data transmission. Since each parameter and memory address follows the preset rules, the source application APP can unambiguously identify and access the communication parameters of the target application APP, reducing the risk of data transmission failure caused by parameter mismatch or format error. Therefore, this method enhances the interoperability and reliability of the system by implementing a strict structured communication protocol during data transmission, thereby improving the communication efficiency of the entire smart meter system and the accuracy of data.

[0172] This device uses three modules to divide the work and coordinate to better complete the data distribution. The present application can ensure the precise matching of communication parameters between the source application APP and the target application APP by obtaining the first communication channel parameters and the first shared memory area of the source application APP, as well as each second communication channel parameter and each second shared memory parameter of each target application APP, thereby improving the accuracy of data transmission. Further, by sending the communication parameters of the target application APP to the source application APP through the preset channel function interface and enabling the source application APP to write data into the shared memory according to these parameters, this step optimizes the data organization and storage process, laying a foundation for efficient transmission. Finally, using the electric energy meter chip to construct a data sending channel between the source application APP and each target application APP enables the target application APP to accurately receive data according to these channels and shared memory parameters. The present application improves the communication efficiency and solves the problem in the prior art that the data distribution of smart electric energy meters cannot be accurately and efficiently completed.

[0173] Embodiment 3:

[0174] An embodiment of the present application provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the data distribution method of the intelligent electricity meter described above.

[0175] Among them, for the data distribution method of the intelligent electricity meter, if it is implemented in the form of a software functional unit and used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0176] Embodiment Four

[0177] The present application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the data distribution method of any one of the intelligent electricity meters described in Embodiment One.

[0178] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. In particular, it is pointed out that for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A data distribution method for an intelligent electricity meter, characterized in that Including: Obtain the first communication channel parameter and the first shared memory area of the source application APP, as well as the respective second communication channel parameters and the respective second shared memory parameters of each target application APP; According to a preset channel function interface, send the respective second communication channel parameters and the respective second shared memory parameters to the source application APP, so that the source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameter; Construct respective data sending channels between the source application APP and each target application APP according to a preset electric energy meter chip, so that each target application APP receives data according to each data sending channel and the first shared memory area.

2. The data distribution method of the intelligent electric energy meter according to claim 1, wherein It also includes: When each target application APP sends or receives a message, perform integrity verification on the data.

3. The data distribution method of the intelligent electric energy meter according to claim 1, characterized in that The source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameter, specifically: The source application APP performs formatting processing on the respective second communication channel parameters and the respective second shared memory parameters according to a preset message interaction definition rule, and encapsulates the formatted respective second communication channel parameters and the respective second shared memory parameters into a standardized message format according to the format requirements of a preset interaction structure and the first communication channel parameter, to obtain the standardized respective second communication channel parameters and the respective second shared memory parameters; Input the standardized respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area; Wherein, the preset message interaction definition rule is used to define the format, content, transmission sequence, and verification method of messages during communication between the source application APP and the target application APP; the preset interaction structure is a standardized data structure for organizing and storing communication data.

4. The data distribution method of the intelligent electricity meter according to claim 1, wherein The construction of respective data sending channels between the source application APP and each target application APP according to the preset electric energy meter chip, specifically: Construct respective data sending channels between the source application APP and each target application APP according to the direct access memory of the preset electric energy meter chip; Monitor the sending situation of each data sending channel according to a preset monitoring channel.

5. The data distribution method of the intelligent electricity meter according to any one of claims 1-4, characterized in that The respective second communication channel parameters of each target application APP include the names of each target application APP, the channel numbers of each target application APP, the channel depth, the channel timeout time, the number of retransmissions, and the channel verification method; The respective second shared memory parameters of each target application APP include the shared memory pointers of each target application APP and the shared memory depths of each target application APP.

6. A data distribution device for an intelligent electricity meter, characterized in that, Including an acquisition module, a sending module, and a receiving module; The acquisition module is used to obtain the first communication channel parameter and the first shared memory area of the source application APP, as well as the respective second communication channel parameters and the respective second shared memory parameters of each target application APP; The sending module is used to send the respective second communication channel parameters and the respective second shared memory parameters to the source application APP according to a preset channel function interface, so that the source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameters; The receiving module is used to construct respective data sending channels between the source application APP and the respective target application APPs according to a preset electricity meter chip, so that the respective target application APPs receive data according to the respective data sending channels and the first shared memory area.

7. The data distribution device of the intelligent electricity meter according to claim 6, characterized in that, It further includes: When the respective target application APPs send or receive messages, integrity verification is performed on the data.

8. The data distribution device of the intelligent electricity meter according to claim 6, characterized in that, The source application APP inputs the respective second communication channel parameters and the respective second shared memory parameters into the first shared memory area according to the first communication channel parameters, specifically: The source application APP performs formatting processing on the respective second communication channel parameters and the respective second shared memory parameters according to a preset message interaction definition rule, and encapsulates the formatted respective second communication channel parameters and respective second shared memory parameters into a standardized message format according to the format requirements of a preset interaction structure and the first communication channel parameters, to obtain the standardized respective second communication channel parameters and respective second shared memory parameters; Input the standardized respective second communication channel parameters and respective second shared memory parameters into the first shared memory area; Wherein, the preset message interaction definition rule is used to define the format, content, transmission sequence and verification method of messages during communication between the source application APP and the target application APP; the preset interaction structure is a standardized data structure for organizing and storing communication data.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the data distribution method of the smart electricity meter according to any one of claims 1 to 5.

10. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the data distribution method of the smart electricity meter according to any one of claims 1 to 5.