Disclosure of Invention
Therefore, the invention provides an automatic identification method of an intelligent electric energy meter expansion module and an intelligent electric energy meter.
The invention provides an automatic identification method for an intelligent electric energy meter expansion module, which comprises the following steps: receiving an in-place signal of the expansion module to acquire information of the expansion module; acquiring registration information corresponding to the expansion module information in an expansion module information base, wherein the registration information is acquired and stored in the expansion module information base before receiving the expansion module in-place signal; determining the module type of the expansion module according to the registration information corresponding to the expansion module information in the expansion module information base; and establishing a communication channel according to the module type of the expansion module.
Optionally, in the automatic identification method for an intelligent electric energy meter expansion module provided by the present invention, the registration information further includes an encryption manner of the expansion module, and the automatic identification method for an intelligent electric energy meter expansion module further includes: determining an encryption mode of the expansion module according to registration information corresponding to the expansion module information in the expansion module information base; and authenticating the expansion module by adopting a safety authentication mode corresponding to the encryption mode.
Optionally, in the method for automatically identifying an expansion module of an intelligent electric energy meter provided by the present invention, establishing a communication channel according to a module type of the expansion module includes: judging whether the type of the expansion module is a B-type expansion module or not; if the type of the expansion module is the B-type expansion module, judging whether the type of the expansion module is a metering type expansion module or not; if the type of the expansion module is a metering type expansion module, a communication channel between the expansion module and the metering module is established.
Optionally, in the method for automatically identifying an expansion module of an intelligent electric energy meter provided by the present invention, establishing a communication channel between the expansion module and a metering module includes: determining the logic address of the expansion module according to the registration information corresponding to the expansion module information in the expansion module information base; if the logic address of the expansion module is the same as the logic address of the expansion module of the established communication channel, allocating a new logic address for the expansion module; and establishing a communication channel between the metering module and the network according to the new logical address.
Optionally, in the method for automatically identifying an expansion module of an intelligent electric energy meter provided by the present invention, the registration information is generated by the following steps: receiving basic information of the expansion module, wherein the basic information comprises the module type of the expansion module; determining the category identification number of the expansion module according to a predefined identification rule and the module type of the expansion module, wherein the predefined identification rule comprises the category identification number corresponding to each module type; and generating registration information according to the basic information and the category identification number of the expansion module.
The second aspect of the present invention provides an intelligent electric energy meter, which includes a management module, a metering module and an expansion module connecting device, wherein the management module includes: the module in-place signal detection module is used for receiving the expansion module in-place signal and acquiring the information of the expansion module; the system comprises an expansion module information base, a registration information acquisition module and an expansion module information acquisition module, wherein the expansion module information base is used for receiving an in-place signal of an expansion module and storing the in-place signal of the expansion module in the expansion module information base; the expansion module identification module is used for determining the module type of the expansion module according to the registration information corresponding to the expansion module information in the expansion module information base; and the communication channel connecting module is used for establishing a communication channel according to the module type of the expansion module.
Optionally, in the intelligent electric energy meter provided by the present invention, the registration information further includes an encryption manner of the expansion module, and the management module further includes: the encryption mode confirming module is used for confirming the encryption mode of the expansion module according to the registration information corresponding to the information of the expansion module in the information base of the expansion module; and the safety authentication module is used for authenticating the expansion module by adopting a safety authentication mode corresponding to the encryption mode.
Optionally, in the intelligent electric energy meter provided by the present invention, the communication channel connection module includes: the first judgment sub-module is used for judging whether the type of the expansion module is a B-type expansion module; the second judgment sub-module is used for judging whether the type of the expansion module is the metering type expansion module or not if the type of the expansion module is the B type expansion module; and if the type of the expansion module is a metering type expansion module, the communication channel establishing sub-module is used for establishing a communication channel between the expansion module and the metering module.
Optionally, in the intelligent electric energy meter provided by the present invention, the communication channel establishing sub-module includes: the logic address acquisition unit is used for determining the logic address of the expansion module according to the registration information corresponding to the expansion module information in the expansion module information base; the logic address allocation unit is used for allocating a new logic address to the expansion module group if the logic address of the expansion module group is the same as the logic address of the expansion module group of the established communication channel; and the communication channel establishing unit is used for establishing a communication channel between the metering module and the network equipment according to the new logical address.
Optionally, the intelligent electric energy meter provided by the present invention further includes: the information receiving module is used for receiving basic information of the expansion module, and the basic information comprises the module type of the expansion module; the class identification number generation module is used for determining the class identification number of the expansion module according to a predefined identification rule and the module type of the expansion module, wherein the predefined identification rule comprises the class identification number corresponding to each module type; and the registration information generating module is used for generating registration information according to the basic information and the category identification number of the expansion module.
The technical scheme of the invention has the following advantages:
1. the automatic identification method of the expansion module of the intelligent electric energy meter comprises the steps of acquiring registration information of the expansion module before receiving an in-place signal of the expansion module, storing the registration information into a module information base, determining the module type of the expansion module through the registration information corresponding to the information of the expansion module after receiving the in-place signal of the expansion module and acquiring the module expansion information of the expansion module, and establishing a communication channel according to the module type of the expansion module, so that the identification and the use of the expansion module are completed. According to the automatic identification method for the expansion module of the intelligent electric energy meter, the registration mechanism that the registration information is obtained and stored is adopted, when the in-place signal of the expansion module generated by the unknown expansion module is received, the expansion module can be identified according to the registration information in the module information base, and even if the expansion module generating the in-place signal is the unknown expansion module, plug and play of the expansion module can be realized.
2. According to the automatic identification method of the intelligent electric energy meter expansion module, the encryption mode of the expansion module is contained in the pre-acquired and stored registration information, because the encryption modes of different expansion modules are different, if the expansion module is authenticated by adopting a security authentication mode which does not correspond to the encryption mode, the obtained authentication result is unreliable.
3. According to the intelligent electric energy meter, before the extension module in-place signal is received, the registration information of the extension module is obtained, and is stored in the module information base, wherein the registration information comprises the module type of the extension module, so that the identification of the extension module is completed. According to the intelligent electric energy meter provided by the invention, through the registration mechanism of acquiring and storing the registration information, when the in-place signal of the expansion module generated by the unknown expansion module is received, the expansion module can be identified according to the registration information in the module information base, and even if the expansion module generating the in-place signal is the unknown expansion module, the plug and play of the expansion module can be realized.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "first", "second", and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The embodiment of the invention provides an automatic identification method for an expansion module of an intelligent electric energy meter, which can be applied to a management module in the intelligent electric energy meter, and as shown in fig. 1, the method comprises the following steps:
step S10: and receiving the in-place signal of the expansion module to acquire the information of the expansion module.
In an optional embodiment, the extension module in-place signal refers to a signal generated when the extension module is inserted into the intelligent electric energy meter, the management module in the intelligent electric energy meter can monitor the extension module in-place signal in real time, and the in-place signal is changed from a high level to a low level after the extension module is connected.
Step S20: and acquiring registration information corresponding to the expansion module information in the expansion module information base, wherein the registration information is acquired before receiving the expansion module in-place signal and is stored in the expansion module information base, and the registration information comprises the module type of the expansion module.
In an optional embodiment, for an unknown expansion module, first, the information of the expansion module is registered, and the registered information is stored in the information base of the expansion module. Through obtaining the registration information that extension module information and extension module information base were saved and carry out the comparison, even unknown extension module inserts intelligent ammeter, the basic information of unknown extension module can also be confirmed through the registration information of prestoring to the management module to discernment unknown extension module.
In an optional embodiment, in the registration stage, after the management module acquires the registration information, it is first determined whether the same information as the registration information exists in the expansion module information base, if the same information does not exist, the received registration information is stored in the expansion module information base, and if the same information exists, the storage operation is not executed.
Step S30: and determining the module type of the expansion module according to the registration information corresponding to the expansion module information in the expansion module information base. A series of subsequent operations on the expansion module are basically realized based on the module type of the expansion module, so that the determination of the module type of the expansion module is equivalent to the realization of the identification of the expansion module.
Step S40: and establishing a communication channel according to the module type of the expansion module. Since different types of expansion modules need to establish communication channels with different devices, and communication modes between different types of expansion modules and other devices are different, it is necessary to establish a communication channel corresponding to a module type according to the module type of the expansion module.
According to the automatic identification method for the expansion module of the intelligent electric energy meter, before the in-place signal of the expansion module is received, the registration information of the expansion module is obtained and stored in the module information base, the registration information comprises the module type of the expansion module, after the in-place signal of the expansion module is received and the module expansion information of the expansion module is obtained, the module type of the expansion module can be determined through the registration information corresponding to the information of the expansion module, and a communication channel is established according to the module type of the expansion module, so that the identification and the use of the expansion module are completed. According to the automatic identification method for the intelligent electric energy meter expansion module, the registration mechanism that the registration information is acquired and stored is adopted, when an expansion module in-place signal generated by an unknown expansion module is received, the expansion module can be identified according to the registration information in the module information base, and even if the expansion module generating the in-place signal is the unknown expansion module, plug and play of the expansion module can be realized.
In an optional embodiment, the registration information further includes an encryption manner of the expansion module, as shown in fig. 2, the method for automatically identifying the expansion module of the intelligent electric energy meter further includes:
step S50: and determining the encryption mode of the expansion module according to the registration information corresponding to the expansion module information in the expansion module information base.
In an optional embodiment, the encryption mode of the expansion module generally includes hardware ESAM encryption and software encryption, and the encryption mode included in the registration information of the expansion module is hardware ESAM encryption or software encryption.
Step S60: and authenticating the expansion module by adopting a safety authentication mode corresponding to the encryption mode.
As described in step S50, the encryption method of the expansion module generally includes two types, namely, hardware ESAM encryption and software encryption, and the security authentication method used in the authentication is different for different encryption methods, and when the encryption method of the expansion module is hardware ESAM encryption, the authentication method corresponding to the hardware ESAM encryption is used to authenticate the expansion module, and when the encryption method of the expansion module is software encryption, the authentication method corresponding to the software encryption is used to authenticate the expansion module. The method can give consideration to the expansion module which adopts different encryption measures for encryption, and the expansion module is authenticated through a proper safety authentication mode, thereby ensuring the successful authentication.
According to the automatic identification method of the intelligent electric energy meter expansion module, the encryption mode of the expansion module is firstly obtained and stored in the registration information, and due to the fact that the encryption modes of different expansion modules are different, if the expansion module is authenticated in the security authentication mode which does not correspond to the encryption mode, the obtained authentication result is unreliable.
In an optional embodiment, the registration information may include different types of identification numbers generated according to predefined identification rules, and the identification numbers are used to identify the extension modules, so as to facilitate subsequent identification of the extension modules according to the identification numbers.
In an optional embodiment, the module types in the registration information may be identified by category identification numbers, different category identification numbers are used for representing different module types, for the same module type, a uniform identification number is used for identifying, and when the module type of the extension module is identified subsequently, the module type of the extension module may be determined by the identification number.
In an optional embodiment, a 16-bit binary string can be used to form a class identification number for identifying the module type of the extension module, and illustratively, bit0 can be used to indicate that the communication class extension module is used, bit1 indicates the computation class extension module, bit2 indicates the control class extension module, bit3 indicates the storage class extension module, \8230 \ 8230;, and the other bits are reserved as 0.
In an optional embodiment, when inputting the basic information of the expansion module, the user may manually input a category identification number corresponding to the module type of the expansion module and satisfying the predefined identification rule, and after receiving the basic information and the category identification number of the expansion module, the management module combines the basic information and the category identification number of the expansion module to form the registration information.
In an alternative embodiment, as shown in fig. 3, if the user does not input the category identification number when inputting the basic information of the extension module, the registration information may be generated by the following steps:
step S71: and receiving basic information of the expansion module, wherein the basic information comprises the module type of the expansion module, and the module type comprises a communication expansion module, a calculation expansion module, a control expansion module, a storage expansion module and the like.
Step S72: and determining the category identification number of the expansion module according to the predefined identification rule and the module type of the expansion module, wherein the predefined identification rule comprises the category identification number corresponding to each module type.
And S73, generating registration information according to the basic information and the category identification number of the expansion module.
When the management module establishes communication with the expansion module and establishes communication for the expansion module and the terminal device, basic information of the expansion module needs to be determined through registration information in an expansion module information base, for example, the management module needs to determine the type of the expansion module first and then can transmit corresponding information to the expansion module, but for an unknown expansion module newly inserted into the intelligent electric energy meter, the management module cannot know information such as the type of the expansion module. When the information of the expansion module is stored in the expansion module information base, the category identification number used for representing the function type of the expansion module is determined according to the predefined identification rule of the expansion module information base, the expansion module can be classified according to the unified standard according to the category identification number determined by the predefined identification rule, the compatible processing of the known expansion module and the unknown expansion module is realized, and after the in-place signal of the expansion module is received, even if the expansion module sending the in-place signal of the expansion module is the unknown expansion module, the function type of the unknown expansion module can be determined according to the category identification number of the expansion module, so that the plug-and-play of the unknown expansion module is realized.
In an optional embodiment, the received basic information may further include a logical address of the expansion module, a generation method of a logical address identification number may be defined in the predefined identification rule, when generating the registration information, the logical address identification number may be generated according to the predefined identification rule, and the registration information is generated according to the basic information, the category identification number, and the logical address identification number.
In an alternative embodiment, the predefined identification rule may define a decimal character to form a logical address identification number for identifying a logical address of the expansion module, 2 denotes a load switch, 3 denotes a non-intrusive load sensing module, 4 denotes an ordered charging module, 5 denotes a power quality module, 6 denotes an expansion communication module 1,7 denotes an expansion communication module, 8 denotes an intelligent lock, 9 denotes a random metering module, 10 denotes a washing machine, 11 denotes a refrigerator, 12 denotes a water heater, and 13 denotes an air conditioner.
In an optional embodiment, the received basic information may further include a module serial number of the expansion module, the expansion module may be used for key distribution in an authentication process, a generation method of the module serial identification number may be defined in the predefined identification rule, the module serial identification number may be generated according to the predefined identification rule when the registration information is generated, and the registration information may be generated according to the basic information, the category identification number, and the module serial identification number.
In an optional embodiment, the predefined identification rule may define that an ESAM serial number is used as a module sequence identification number; the equipment serial number can also be defined and adopted as the module sequence identification number; it can also be defined as: if the ESAM serial number exists in the module, the ESAM serial number is used as the module serial number, if the ESAM serial number does not exist, the equipment serial number is used as the module serial number, and if the ESAM serial number does not exist, the equipment serial number does not exist, and the 8-byte character with 0 is used as the module serial number of the expansion module.
In an alternative embodiment, the step S40 includes: if the type of the expansion module is a B-type expansion module and is a metering type expansion module, a communication channel between the expansion module and the metering module is established.
In an alternative embodiment, as shown in FIG. 4, the expansion modules may be divided into two broad categories: the system comprises an A-type expansion module and a B-type expansion module, wherein the A-type expansion module is mainly responsible for communication between the electric energy meter and a master station/terminal, and when the type of the expansion module belongs to the A-type expansion module, a communication channel between the expansion module and the master station/terminal can be established.
Generally, the B-type expansion module can be divided into a metering module and a non-metering module, if the B-type expansion module is the metering module, the management module is required to automatically start a sampling data output function of the metering module, and sampling data is transmitted to the expansion module through an SPI (serial peripheral interface) between the expansion module and the metering module, such as a load identification module; the non-metering module does not need to start the sampling data output function of the metering module, such as an order electricity module; the electric energy meter is internally provided with at most 1A-type expansion module, a single-phase meter simultaneously supports access to 2B-type expansion modules, and a three-phase meter can simultaneously support access to 3B-type expansion modules;
in the embodiment shown in fig. 4, when the management module communicates with the class a expansion module and the class B expansion module, data transmission needs to be performed through a Universal Asynchronous Receiver/Transmitter (UART), so that the management module needs to establish a communication channel with the class a expansion module and the class B expansion module based on the UART, and when the management module communicates with the metering module, data transmission needs to be performed through a Serial Peripheral Interface (SPI), so that the management module needs to establish a communication channel with the metering module based on the SPI. Therefore, when the management module establishes an interaction channel with the expansion module, a communication channel corresponding to the type of the expansion module needs to be established according to the type of the module.
In an optional embodiment, the step of establishing a communication channel between the expansion module and the metering module specifically includes:
firstly, the logic address of the expansion module is determined according to the registration information corresponding to the expansion module information in the expansion module information base.
Then, if the logic address of the expansion module is the same as the logic address of the expansion module with the established communication channel, a new logic address is allocated to the expansion module group;
and finally, establishing a communication channel between the metering module and the network according to the new logical address.
In an alternative embodiment, the extension module itself has a logical address, but when the interaction channel is established, if a channel is already established for an extension module of the same type as the extension module, a new logical address needs to be allocated to the extension module in order to avoid collision between the extension module and extension modules of the same type as other modules.
In an optional embodiment, if the registration information includes the category identification number, after the step S40 is executed, the method for automatically identifying an expansion module of an intelligent electric energy meter according to an embodiment of the present invention further includes:
opening the function authority corresponding to the module type for the expansion module.
For different types of expansion modules, the functions are different, and in order to enable the expansion modules to realize the functions, after the types of the expansion modules are determined according to the category identification numbers, corresponding function permissions are opened for the expansion modules according to the functions corresponding to the expansion modules of the types. For example, if the measurement module is a measurement type module, the measurement module is turned on to sample data output function.
The embodiment of the present invention further provides an intelligent electric energy meter, which includes a management module, a metering module, and an expansion module connecting device, wherein, as shown in fig. 5, the management module includes:
the module in-place signal detection module 10 is configured to receive the extension module in-place signal and acquire extension module information, for details, refer to the description of step S10 in the foregoing embodiment, and details are not described here again.
The registration information obtaining module 20 is configured to obtain registration information corresponding to the extension module information in the extension module information base, where the registration information is obtained before receiving the extension module in-place signal and is stored in the extension module information base, and the detailed content refers to the description of step S20 in the foregoing embodiment, and is not described herein again.
The extended module identification module 30 is configured to determine a module type of the extended module according to the registration information corresponding to the extended module information in the extended module information base, for details, refer to the description of step S30 in the foregoing embodiment, and details are not described here again.
The communication channel connection module 40 is configured to establish a communication channel according to the module type of the expansion module, for details, refer to the description of step S40 in the foregoing embodiment, and details are not described here again.
According to the intelligent electric energy meter provided by the embodiment of the invention, before the extension module in-place signal is received, the registration information of the extension module is obtained, and the registration information is stored in the module information base, wherein the registration information comprises the module type of the extension module, so that the identification of the extension module is completed. According to the intelligent electric energy meter provided by the embodiment of the invention, through the registration mechanism of acquiring and storing the registration information, when the in-place signal of the expansion module generated by the unknown expansion module is received, the expansion module can be identified according to the registration information in the module information base, and even if the expansion module generating the in-place signal is the unknown expansion module, the plug and play of the expansion module can be realized.
In an optional embodiment, the registration information further includes an encryption manner of the expansion module, and the intelligent electric energy meter provided in the embodiment of the present invention further includes:
the encryption mode determining module is configured to determine an encryption mode of the expansion module according to the registration information corresponding to the expansion module information in the expansion module information base, for details, refer to the description of step S50 in the foregoing embodiment, and details are not repeated here.
The security authentication module is configured to authenticate the expansion module by using a security authentication method corresponding to the encryption method, for details, refer to the description of step S60 in the foregoing embodiment, and no further description is given here.
In an optional embodiment, in the intelligent electric energy meter provided in the embodiment of the present invention, the communication channel connection module 40 includes:
the first determining sub-module is configured to determine whether the type of the expansion module is a type B expansion module, for details, refer to the description of the method for establishing communication between the expansion module and the metering module in the foregoing embodiment, and details are not described herein again.
If the type of the expansion module is the type B expansion module, the second determining module is configured to determine whether the type of the expansion module is the metering expansion module, for details, refer to the description of the method for establishing communication between the expansion module and the metering module in the foregoing embodiment, and no further description is given here.
If the type of the expansion module is a metering type expansion module, the communication channel establishing sub-module is used for establishing a communication channel between the expansion module and the metering module, for details, refer to the description of the method for establishing the communication between the expansion module and the metering module in the above embodiment, and are not described herein again.
In an optional embodiment, in the intelligent electric energy meter provided in the embodiment of the present invention, the communication channel establishing sub-module includes:
the logic address obtaining unit is configured to determine a logic address of the expansion module according to the registration information corresponding to the expansion module information in the expansion module information base, for details, refer to the description of the step of establishing the communication channel between the expansion module and the metering module in the foregoing embodiment, and details are not described here again.
If the logical address of the expansion module is the same as the logical address of the expansion module that has already established the communication channel, the logical address allocating unit is configured to allocate a new logical address to the expansion module.
A communication channel establishing unit, configured to establish a communication channel between the expansion module and the metering module according to the new logical address, for details, refer to the description of the step of establishing the communication channel between the expansion module and the metering module in the foregoing embodiment, which is not described herein again.
In an optional embodiment, the intelligent electric energy meter provided in the embodiment of the present invention further includes:
the information receiving module is configured to receive basic information of the expansion module, where the basic information includes a module type of the expansion module, and for details, reference is made to the description of step S71 in the foregoing embodiment, and details are not described here again.
The category identification number generation module is configured to determine a category identification number of the expansion module according to a predefined identification rule and a module type of the expansion module, where the predefined identification rule includes a category identification number corresponding to each module type, and details of the step S72 in the foregoing embodiment are referred to and are not described herein again.
The registration information generating module is configured to generate registration information according to the basic information and the category identification number of the extension module, for details, refer to the description of step S73 in the foregoing embodiment, and details are not described here again.
An embodiment of the present invention further provides a computer device, as shown in fig. 6, the computer device mainly includes one or more processors 51 and a memory 52, and one processor 51 is taken as an example in fig. 6.
The computer device may further include: an input device 53 and an output device 54.
The processor 51, the memory 52, the input device 53 and the output device 54 may be connected by a bus or other means, and the bus connection is exemplified in fig. 6.
The processor 51 may be a Central Processing Unit (CPU). The Processor 51 may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory 52 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the smart electricity meter, and the like. Further, the memory 52 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 52 may optionally include a memory located remotely from the processor 51, which may be connected to the smart power meter via a network. The input device 53 may receive a calculation request (or other numerical or character information) input by a user and generate a key signal input related to the intelligent power meter. The output device 54 may include a display device such as a display screen for outputting the calculation result.
The embodiment of the invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions can execute the automatic identification method of the intelligent electric energy meter expansion module in any method embodiment. The storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. This need not be, nor should it be exhaustive of all embodiments. And obvious variations or modifications therefrom are within the scope of the invention.