Method and device for detecting polarity of interface of electric energy meter
By realizing polarity detection and switching in the 485 communication interface circuit of the power meter, the communication problem caused by human error is solved, and the accuracy and compatibility of 485 bus detection is ensured.
Patent Information
- Application Number
- CN202411979716.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-16
AI Technical Summary
In the 485 communication of the power meter, human error causes the line to be connected in reverse or the wrong chip is used, resulting in poor communication.
A method for detecting the polarity of the electric energy meter interface is provided, which initializes the 485 communication interface circuit through the control circuit, and switches the circuit according to the preset logic to change the polarity of the 485 bus, and then determines whether the data communication is normal to determine the polarity type.
This method can accurately identify polarity types, solve the communication problems caused by human errors, and ensure that the 485 bus detection is compatible with various single and three-phase power meters.
Smart Images

Figure CN120009809A_ABST
Abstract
Description
Background Art
[0002] In the 485 communication of the electric energy meter, A and B represent two signal lines in the 485 communication interface circuit, which are used to transmit differential signals. Specifically: Line A: Usually defined as the positive terminal (A+), it transmits positive differential signals during the communication process. Line B: Defined as the negative terminal (B-), it transmits negative differential signals. 485 communication uses differential signal transmission, that is, the voltage difference between lines A and B is used to represent data. When the voltage of line A is higher than that of line B, it indicates a logical state (such as logical "1"); and when the voltage of line B is higher than that of line A, it indicates another logical state (such as logical "0"). This differential transmission method can effectively resist electromagnetic interference and improve the reliability and stability of communication.
[0003] In the related art, two types of chips, non-polarized and polarized, are used in the 485 communication of the electric energy meter. When connecting the 485 bus during production or on-site construction, it is easy for the line to be connected in reverse or the wrong chip to be used, resulting in poor communication.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The present disclosure provides a method that, at least to a certain extent, overcomes the problem of communication failure caused by reverse connection of lines or use of wrong chips in the related art.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a method for detecting the polarity of an electric energy meter interface is provided, characterized by comprising:
[0008] After the electric energy meter is powered on, the control circuit initializes the 485 communication interface circuit and prepares for communication;
[0009] Perform data communication between the 485 communication interface circuit and external equipment to determine whether the data communication is normal;
[0010] If the data communication is normal, the polarity is correct, and the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus;
[0011] After changing the polarity of the 485 bus, the 485 communication interface circuit will communicate data with the external device again. If the data communication is abnormal, it means that the chip has polarity problems.
[0012] In some embodiments, after the 485 communication interface circuit after changing the polarity of the 485 bus performs data communication with the external device again, the method further includes:
[0013] If the data communication is normal, it is a non-polarity chip.
[0014] In some embodiments, after the 485 communication interface circuit performs data communication with an external device and determines whether the data communication is normal, the method further includes:
[0015] If the data communication is abnormal, the polarity is wrong, and the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus;
[0016] After changing the polarity of the 485 bus, the 485 communication interface circuit performs data communication with the external device again. If the data communication is normal, it is a non-polarity chip.
[0017] In some embodiments, after the control circuit changes the polarity of the 485 bus according to the preset logic switching circuit if the data communication is abnormal, the polarity is wrong, the method further includes:
[0018] After changing the polarity of the 485 bus, the 485 communication interface circuit will communicate data with the external device again. If the data communication is abnormal, it is a hardware function failure.
[0019] In some embodiments, the determination of whether data communication is normal is based on preset rules, wherein the preset rules include integrity and correctness verification of data packets and communication timeout determination.
[0020] According to another aspect of the present disclosure, there is also provided an electric energy meter interface polarity detection device, comprising:
[0021] 485 communication interface circuit, used to connect to external 485 bus to realize data reception and transmission;
[0022] The control circuit is used to initialize the 485 communication interface circuit and control the action of the switching circuit according to the polarity judgment result to adjust the polarity of the 485 bus;
[0023] The storage circuit is used to store communication configuration parameters and historical polarity judgment records.
[0024] In some embodiments, the switching circuit includes a relay or a transistor switch, which is used to switch the A and B line connections of the 485 bus under the instruction of the control circuit to achieve a change in polarity.
[0025] In some embodiments, the control circuit further includes a polarity detection module for automatically detecting the polarity of the 485 bus after initialization, and providing a polarity determination signal to the control circuit according to the detection result.
[0026] In some embodiments, the polarity detection module determines the polarity by monitoring the idle state voltage on the 485 bus or sending a specific test signal and receiving a reflected signal.
[0027] In some embodiments, the storage circuit is a non-volatile memory, which is used to keep the stored data from being lost when the electric energy meter is powered off.
[0028] The electric energy meter interface polarity detection method provided in the embodiment of the present disclosure is that after the electric energy meter is powered on, the control circuit initializes the 485 communication interface circuit and prepares for communication; the 485 communication interface circuit communicates data with the external device to determine whether the data communication is normal; if the data communication is normal, the polarity is correct, and the control circuit changes the polarity of the 485 bus according to the preset logic switching circuit; the 485 communication interface circuit after changing the polarity of the 485 bus communicates data with the external device again, and if the data communication is abnormal, it is a polar chip. The present application tests the electric energy meter by changing the polarity of the 485 bus according to the preset logic switching circuit, which can be fully compatible with the 485 bus detection of various single-phase and three-phase electric energy meters, and solves the problem of poor communication caused by artificially connecting the line in reverse or using the wrong chip.
[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0031] Figure 1 A flow chart of a method for detecting polarity of an electric energy meter interface in an embodiment of the present disclosure is shown;
[0032] Figure 2 A flowchart showing a specific example of a method for detecting polarity of an electric energy meter interface in an embodiment of the present disclosure is shown;
[0033] Figure 3 A flowchart showing another specific example of a method for detecting polarity of an electric energy meter interface in an embodiment of the present disclosure is shown;
[0034] Figure 4 A flowchart showing another specific example of a method for detecting polarity of an electric energy meter interface in an embodiment of the present disclosure;
[0035] Figure 5A flowchart showing another specific example of a method for detecting polarity of an electric energy meter interface in an embodiment of the present disclosure is shown;
[0036] Figure 6 A schematic diagram of a device for detecting polarity of an electric energy meter interface in an embodiment of the present disclosure is shown;
[0037] Figure 7 An electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0038] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0039] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0040] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0041] Figure 1 A flow chart of a method for detecting the polarity of an electric energy meter interface in an embodiment of the present disclosure is shown. Figure 1 As shown, the electric energy meter interface polarity detection method provided in the embodiment of the present disclosure includes the following steps:
[0042] S102, after the electric energy meter is powered on, the control circuit initializes the 485 communication interface circuit and prepares for communication.
[0043] It should be noted that the above 485 may be RS-485, which is a commonly used communication protocol in industrial control environments, using differential signal transmission, and usually only two signal lines (A+ and B-) are needed for normal communication. The above control circuit initialization of the 485 communication interface circuit may be to connect the A and B ends of the 485 communication interface circuit to the external 485 bus with normal polarity (i.e., AB positive connection).
[0044] S104, performing data communication between the 485 communication interface circuit and the external device, and determining whether the data communication is normal.
[0045] It should be noted that the above-mentioned determination of whether data communication is normal is based on preset rules, wherein the preset rules include integrity and correctness verification of data packets and communication timeout judgment.
[0046] S106 If the data communication is normal, the polarity is correct, and the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus.
[0047] It should be noted that the correct polarity may indicate that the current polarity setting is correct. The preset logic switching circuit may connect the A and B terminals of the 485 communication interface circuit to the external 485 bus with abnormal polarity (ie, AB reverse connection).
[0048] S108, after changing the polarity of the 485 bus, the 485 communication interface circuit performs data communication with the external device again. If the data communication is abnormal, it means that the chip has polarity.
[0049] For example, the A and B ends of the 485 communication interface circuit are connected to the external 485 bus with abnormal polarity (i.e., AB reverse connection) to perform data communication again. At this time, the communication is abnormal, and the electric energy meter is judged to be a polarized chip.
[0050] The present application tests the electric energy meter by changing the polarity of the 485 bus according to a preset logic switching circuit, and is fully compatible with the 485 bus detection of various single-phase and three-phase electric energy meters, solving the problem of poor communication caused by artificially connecting the line in reverse or using the wrong chip.
[0051] In one embodiment of the present disclosure, Figure 2 As shown, the electric energy meter interface polarity detection method provided in the embodiment of the present disclosure can determine the non-polarity chip through the following steps after the 485 communication interface circuit after changing the polarity of the 485 bus communicates data with the external device again:
[0052] S202, if the data communication is normal, it is a non-polarity chip.
[0053] The present application can ensure correct connection and use in practical applications by quickly and accurately identifying whether the chip has a non-polarity characteristic, thereby avoiding communication failures caused by reverse polarity.
[0054] In one embodiment of the present disclosure, Figure 3 As shown, the electric energy meter interface polarity detection method provided in the embodiment of the present disclosure further includes the following steps after the 485 communication interface circuit communicates data with the external device and determines whether the data communication is normal:
[0055] S302, if the data communication is abnormal, the polarity is wrong, and the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus;
[0056] S304, the 485 communication interface circuit after changing the polarity of the 485 bus performs data communication with the external device again. If the data communication is normal, it is a non-polarity chip.
[0057] This application can comprehensively detect the working conditions of the chip under different polarities by changing the polarity of the 485 bus when data communication is abnormal and performing communication test again, and can accurately determine whether the chip has non-polarity characteristics.
[0058] In one embodiment of the present disclosure, Figure 4 As shown, the electric energy meter interface polarity detection method provided in the embodiment of the present disclosure further includes the following steps after the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus if the data communication is abnormal, the polarity is wrong:
[0059] S402, the 485 communication interface circuit after changing the polarity of the 485 bus performs data communication with the external device again. If the data communication is abnormal, it is a hardware function failure.
[0060] The present application can accurately diagnose the root cause of the problem by locating the problem as a hardware functional failure when normal communication is still not possible after changing the polarity of the 485 bus, thereby avoiding ineffective repairs and replacements due to misjudgment and improving repair efficiency and accuracy.
[0061] In one example of the present disclosure, the above-mentioned determination of whether data communication is normal is based on preset rules, wherein the preset rules include integrity and correctness verification of data packets and communication timeout judgment.
[0062] It should be noted that the integrity check of the data packet can ensure that the data is not truncated or damaged during the communication process, and can ensure the accuracy and reliability of the data, avoiding wrong decisions or operations caused by incomplete data. The correctness check of the data packet can ensure that the received data is consistent with the sent data. By verifying the correctness of the data, errors in the communication process can be discovered and corrected in a timely manner, improving the accuracy of communication. Communication timeout judgment can ensure that data is received within a reasonable time. If the communication times out, it can be considered that the communication has failed, and corresponding measures can be taken. Based on the preset rules, whether the data communication is normal, including the integrity and correctness check of the data packet and the communication timeout judgment, the combined effect of these three jointly promotes the accuracy of data communication judgment in the electric energy meter test.
[0063] Figure 5 A flowchart of a specific example of a method for detecting polarity of an electric energy meter interface in an embodiment of the present disclosure is shown. Figure 5 As shown, the following steps are included:
[0064] S501: AB is connected, and communication test starts;
[0065] S502: Determine whether the communication test is passed, if yes, execute S503, if no, execute S506;
[0066] S503: AB is reversed and communication test is performed again;
[0067] S504: Determine whether the communication test is passed, if yes, execute S505, if no, execute S508;
[0068] S505: polarity;
[0069] S506: AB reverse connection for communication test;
[0070] S507: Determine whether the communication test is passed, if yes, execute S508, if no, execute S509;
[0071] S508: non-polar;
[0072] S509: Hardware function failure.
[0073] This application can quickly determine the 485 polarity and automatically determine whether the polarity of the 485 bus is correct. If it is incorrect, it will automatically adjust to ensure normal communication.
[0074] Based on the same inventive concept, the present disclosure also provides an electric energy meter interface polarity detection device in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0075] Figure 6 A schematic diagram of a device for detecting polarity of an electric energy meter interface in an embodiment of the present disclosure is shown. Figure 6 As shown, the device includes: a 485 communication interface circuit 61, a control circuit 62 and a storage circuit 63.
[0076] The 485 communication interface circuit 61 is used to connect to the external 485 bus to realize data reception and transmission.
[0077] The control circuit 62 is used to initialize the 485 communication interface circuit and control the action of the switching circuit according to the polarity determination result to adjust the polarity of the 485 bus.
[0078] The storage circuit 63 is used to store communication configuration parameters and historical polarity judgment records.
[0079] In one example of the present disclosure, the switching circuit includes a relay or a transistor switch, which is used to switch the A and B line connections of the 485 bus under the instruction of the control circuit, thereby achieving a change in polarity.
[0080] In one example of the present disclosure, the control circuit further includes a polarity detection module for automatically detecting the polarity of the 485 bus after initialization, and providing a polarity determination signal to the control circuit according to the detection result.
[0081] In one example of the present disclosure, the polarity detection module determines the polarity by monitoring the idle state voltage on the 485 bus or sending a specific test signal and receiving a reflected signal.
[0082] In one example of the present disclosure, the storage circuit is a non-volatile memory, which is used to keep the stored data from being lost when the electric energy meter is powered off.
[0083] It should be noted that the above modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0084] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0085] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present disclosure is described. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0086] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).
[0087] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps described in the above “exemplary method” section of this specification according to various exemplary embodiments of the present disclosure.
[0088] For example, the processing unit 710 may perform the following steps of the above method embodiment: after the electric energy meter is powered on, the control circuit initializes 485 the communication interface circuit to prepare for communication;
[0089] Perform data communication between the 485 communication interface circuit and external equipment to determine whether the data communication is normal;
[0090] If the data communication is normal, the polarity is correct, and the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus;
[0091] After changing the polarity of the 485 bus, the 485 communication interface circuit will communicate data with the external device again. If the data communication is abnormal, it means that the chip has polarity problems.
[0092] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .
[0093] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0094] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0095] The electronic device 700 may also communicate with one or more external devices 740 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 770. As shown, the network adapter 770 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0096] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0097] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the above-mentioned electric energy meter interface polarity detection method when executed by a processor.
[0098] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0099] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0100] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0101] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0102] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0103] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0104] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0105] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0106] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A method for detecting the polarity of an electric energy meter interface, characterized in that: include: After the electric energy meter is powered on, the control circuit initializes the 485 communication interface circuit and prepares for communication; Perform data communication between the 485 communication interface circuit and external equipment to determine whether the data communication is normal; If the data communication is normal, the polarity is correct, and the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus; After changing the polarity of the 485 bus, the 485 communication interface circuit will communicate data with the external device again. If the data communication is abnormal, it means that the chip has polarity problems.
2. The method for detecting the polarity of an electric energy meter interface according to claim 1, characterized in that: After the 485 communication interface circuit after changing the polarity of the 485 bus performs data communication with the external device again, the method further includes: If the data communication is normal, it is a non-polarity chip.
3. The method for detecting the polarity of an electric energy meter interface according to claim 1, characterized in that: After the 485 communication interface circuit performs data communication with the external device and determines whether the data communication is normal, the method further includes: If the data communication is abnormal, the polarity is wrong, and the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus; After changing the polarity of the 485 bus, the 485 communication interface circuit performs data communication with the external device again. If the data communication is normal, it is a non-polarity chip.
4. The method for detecting the polarity of the electric energy meter interface according to claim 3, characterized in that: After the control circuit switches the circuit according to the preset logic to change the polarity of the 485 bus if the data communication is abnormal, the polarity is wrong, the method further includes: After changing the polarity of the 485 bus, the 485 communication interface circuit will communicate data with the external device again. If the data communication is abnormal, it is a hardware function failure.
5. The method for detecting the polarity of an electric energy meter interface according to any one of claims 1 to 4, characterized in that: The determination of whether data communication is normal is based on preset rules, wherein the preset rules include integrity and correctness verification of data packets and communication timeout determination.
6. A device for detecting the polarity of an electric energy meter interface, characterized in that: include: 485 communication interface circuit, used to connect to external 485 bus to realize data reception and transmission; The control circuit is used to initialize the 485 communication interface circuit and control the action of the switching circuit according to the polarity judgment result to adjust the polarity of the 485 bus; The storage circuit is used to store communication configuration parameters and historical polarity judgment records.
7. The electric energy meter interface polarity detection device according to claim 6, characterized in that: The switching circuit includes a relay or a transistor switch, which is used to switch the A and B line connections of the 485 bus under the instruction of the control circuit, thereby achieving a change in polarity.
8. The electric energy meter interface polarity detection device according to claim 6, characterized in that: The control circuit also includes a polarity detection module, which is used to automatically detect the polarity of the 485 bus after initialization and provide a polarity judgment signal to the control circuit according to the detection result.
9. The electric energy meter interface polarity detection device according to claim 6, characterized in that: The polarity detection module determines the polarity by monitoring the idle state voltage on the 485 bus or sending a specific test signal and receiving a reflected signal.
10. The electric energy meter interface polarity detection device according to claim 6, characterized in that: The storage circuit is a non-volatile memory, which is used to keep the stored data from being lost when the electric energy meter is powered off.