Communication address configuration method, electronic device and storage medium

By using constant current source and voltage sampling unit in low-voltage electrical systems, the communication address of slave equipment is automatically set, which solves the problems of complex settings and high error rates in the prior art, and improves configuration efficiency and flexibility.

CN115567488BActive Publication Date: 2025-02-14SHANGHAI KINGSI POWER CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211215870.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2025-02-14
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

In the prior art, setting the communication address of the slave device is complicated, resulting in low setup efficiency and high error rate.

Method used

By providing a constant current source in the host device and a voltage sampling unit in the slave device, using the current feedback mechanism of the constant current source, the voltage value of the slave device is obtained based on the voltage sampling unit, and the target is determined based on the preset mapping relationship. The mailing address and automatically set the mailing address of the slave device.

Benefits of technology

It realizes the automatic setting of slave device communication addresses, improves address configuration efficiency, reduces error rate, and enhances the flexibility of configuration methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115567488B_ABST
    Figure CN115567488B_ABST
Patent Text Reader

Abstract

The present application provides a communication address configuration method, an electronic device and a storage medium, and relates to the field of low-voltage electrical appliance technology. The method is applied to a slave device in a communication configuration system, the communication configuration system includes a host device and at least one slave device, the host device is provided with a constant current source, and each slave device is provided with a voltage sampling unit, the method includes: when the constant current source is powered on, obtaining the voltage value corresponding to the slave device based on the voltage sampling unit; obtaining the target communication address of the slave device according to the voltage value corresponding to the slave device and the preset mapping relationship; setting the communication address of the slave device as the target communication address can realize the automatic setting of the communication address of the slave device, improve the address configuration efficiency, and avoid communication address setting errors; in addition, it can also make the setting of the communication address of each slave device independent of the program logic in the host device, which can improve the flexibility of the communication address configuration method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of low-voltage electrical appliances, and in particular to a communication address configuration method, an electronic device and a storage medium. Background Art

[0002] In the field of low-voltage electrical appliances, a host and slave devices such as circuit breakers and leakage protectors are generally installed in a low-voltage distribution box. The host and slave devices communicate based on a bus communication protocol.

[0003] In the prior art, when setting the communication address of each slave device, it is often necessary to install preset software on each host device and each slave device. Specifically, when setting, it is necessary to trigger the slave device to enter the sorting mode through the function key broadcast in the software installed by the host device. Then, the user clicks the function keys in the software installed by the slave device in turn to reply, and sets the communication address in the order of invitation and confirmation.

[0004] It can be seen that the setting of the communication address of each existing slave device is relatively complicated. Therefore, there are problems of low setting efficiency and high error rate in the setting process. Summary of the invention

[0005] The purpose of this application is to provide a communication address configuration method, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, which can improve the efficiency of communication address setting and avoid setting errors. To achieve the above-mentioned purpose, the technical solution adopted in the embodiment of this application is as follows:

[0006] In a first aspect, the present invention provides a communication address configuration method, which is applied to a slave device in a communication configuration system, wherein the communication configuration system includes a host device and at least one slave device, wherein the host device is provided with a constant current source, and each of the slave devices is provided with a voltage sampling unit, wherein the positive electrode of the constant current source in the host device is sequentially connected in series with the input end of the voltage sampling unit in each of the slave devices, and the negative electrode of the constant current source is sequentially connected in series with the output end of the voltage sampling unit in each of the slave devices, and the method includes:

[0007] When the constant current source is powered on, acquiring a voltage value corresponding to the slave device based on the voltage sampling unit;

[0008] Acquire a target communication address of the slave device according to a voltage value corresponding to the slave device and a preset mapping relationship, wherein the preset mapping relationship includes a mapping relationship between a voltage value and a communication address;

[0009] The communication address of the slave device is set as the target communication address.

[0010] In an optional implementation manner, the preset mapping relationship is pre-stored in the host device, and the method further includes:

[0011] Receiving a query instruction sent by the host device according to the preset mapping relationship;

[0012] According to the inquiry instruction, an inquiry response is sent to the host device, so that the host device determines the number of slave devices in the communication configuration system according to the inquiry response, and generates a slave address table for storage, wherein the slave address table includes: the target communication address of each slave device corresponding to the inquiry response.

[0013] In an optional implementation, the communication configuration system further comprises at least one slave power system, and the power supply output terminal of each slave power system is electrically connected to the power supply input terminal of each slave device;

[0014] The slave devices include multiple ones, and the preset mapping relationship is pre-stored in the host device. The preset mapping relationship also includes a mapping relationship between the communication address of each slave device and the arrangement order. The arrangement order is used to indicate the arrangement order of each slave device among the multiple slave devices.

[0015] In an optional implementation, the host device performs serial communication with each of the slave devices based on a serial communication protocol;

[0016] The receiving the inquiry instruction sent by the host device according to the preset mapping relationship includes: receiving the inquiry instruction sent by the host device through the second serial sending end through the first serial receiving end;

[0017] The sending of the inquiry response to the host device according to the inquiry instruction includes: sending the inquiry response to the host device through a first serial sending end according to the inquiry instruction.

[0018] In an optional embodiment, the method further comprises:

[0019] Receiving an operation instruction sent by a host device according to the slave address table, the operation instruction including: a control instruction and / or a status query instruction;

[0020] According to the operation instruction, control the slave device to perform the target operation and obtain the operation result, wherein the operation result corresponding to the control instruction includes: control result, and the operation result corresponding to the status query instruction includes: target status;

[0021] The operation result is sent to the host device.

[0022] In an optional implementation, when the host device receives a constant current source power-on instruction, it controls the constant current source to power on, wherein the constant current source power-on instruction may be generated in any of the following ways:

[0023] Receiving the constant current source power-on instruction sent by the first external device through a wired communication module in the host device, wherein the wired communication module includes at least one of the following: a serial communication module and an Ethernet module;

[0024] Receiving the constant current source power-on instruction sent by the second external device through a wireless communication module in the host device, wherein the wireless communication module includes at least one of the following: a cellular mobile communication module port, a WiFi module, and a Bluetooth module;

[0025] The constant current source power-on instruction is generated by a preset function key module in the host device.

[0026] In an optional implementation, the host device includes a gateway, and the slave device includes at least one of the following: a circuit breaker, a contactor, and a relay.

[0027] In a second aspect, the present invention provides a communication address configuration method, which is applied to a host device in a communication configuration system, wherein the communication configuration system comprises the host device and at least one slave device, wherein the host device is provided with a constant current source, and each of the slave devices is provided with a voltage sampling unit, wherein the positive electrode of the constant current source in the host device is connected in series with the input end of the voltage sampling unit in each of the slave devices, and the negative electrode of the constant current source is connected in series with the output end of the voltage sampling unit in each of the slave devices, wherein the method comprises:

[0028] Get the constant current source power-on instruction;

[0029] According to the constant current source power-on instruction, the constant current source is controlled to be powered on, so that when the constant current source is powered on, each of the slave devices obtains the voltage value corresponding to each of the slave devices based on the voltage sampling unit; each of the slave devices determines the target communication address of each of the slave devices according to its corresponding voltage value and a preset mapping relationship, and sets the communication address of each of the slave devices to each of the target communication addresses, and the preset mapping relationship includes a mapping relationship between voltage values ​​and communication addresses.

[0030] In a third aspect, the present invention provides a communication address configuration, which is applied to a slave device in a communication configuration system, wherein the communication configuration system includes a host device and at least one slave device, wherein the host device is provided with a constant current source, and each of the slave devices is provided with a voltage sampling unit, wherein the positive electrode of the constant current source in the host device is sequentially connected in series with the input end of the voltage sampling unit in each of the slave devices, and the negative electrode of the constant current source is sequentially connected in series with the output end of the voltage sampling unit in each of the slave devices, wherein the communication address configuration includes:

[0031] an acquisition module, configured to acquire a voltage value corresponding to the slave device based on the voltage sampling unit when the constant current source is powered on;

[0032] A determination module, used for determining and acquiring a target communication address of the slave device according to a voltage value corresponding to a slave device of the slave device and a preset mapping relationship, wherein the preset mapping relationship includes a mapping relationship between a voltage value and a communication address;

[0033] The setting module is used to set the communication address of the slave device to the target communication address.

[0034] In an optional implementation manner, the preset mapping relationship is pre-stored in the host device, and the communication address configuration further includes: a processing module, configured to receive an inquiry instruction sent by the host device according to the preset mapping relationship;

[0035] According to the inquiry instruction, an inquiry response is sent to the host device, so that the host device determines the number of slave devices in the communication configuration system according to the inquiry response, and generates a slave address table for storage, wherein the slave address table includes: the target communication address of each slave device corresponding to the inquiry response.

[0036] In an optional implementation, the communication configuration system further comprises at least one slave power system, and the power supply output terminal of each slave power system is electrically connected to the power supply input terminal of each slave device;

[0037] The slave devices include multiple ones, and the preset mapping relationship is pre-stored in the host device. The preset mapping relationship also includes a mapping relationship between the communication address of each slave device and the arrangement order. The arrangement order is used to indicate the arrangement order of each slave device among the multiple slave devices.

[0038] In an optional implementation, the host device performs serial communication with each of the slave devices based on a serial communication protocol;

[0039] The processing module is specifically configured to receive, through the first serial receiving end, an inquiry instruction sent by the host device through the second serial sending end; and send an inquiry response to the host device through the first serial sending end according to the inquiry instruction.

[0040] In an optional implementation, the processing module is further specifically used to receive an operation instruction sent by the host device according to the slave address table, and the operation instruction includes: a control instruction and / or a status query instruction;

[0041] According to the operation instruction, control the slave device to perform the target operation and obtain the operation result, wherein the operation result corresponding to the control instruction includes: control result, and the operation result corresponding to the status query instruction includes: target status;

[0042] The operation result is sent to the host device.

[0043] In an optional implementation, when the host device receives a constant current source power-on instruction, it controls the constant current source to power on, wherein the constant current source power-on instruction may be generated in any of the following ways:

[0044] Receiving the constant current source power-on instruction sent by the first external device through a wired communication module in the host device, wherein the wired communication module includes at least one of the following: a serial communication module and an Ethernet module;

[0045] Receiving the constant current source power-on instruction sent by the second external device through a wireless communication module in the host device, wherein the wireless communication module includes at least one of the following: a cellular mobile communication module port, a WiFi module, and a Bluetooth module;

[0046] The constant current source power-on instruction is generated by a preset function key module in the host device.

[0047] In an optional implementation, the host device includes a gateway, and the slave device includes at least one of the following: a circuit breaker, a contactor, and a relay.

[0048] In a fourth aspect, the present invention provides a communication address configuration device, which is applied to a host device in a communication configuration system, wherein the communication configuration system comprises the host device and at least one slave device, wherein the host device is provided with a constant current source, and each of the slave devices is provided with a voltage sampling unit, wherein the positive electrode of the constant current source in the host device is connected in series with the input end of the voltage sampling unit in each of the slave devices, and the negative electrode of the constant current source is connected in series with the output end of the voltage sampling unit in each of the slave devices, wherein the communication address configuration device comprises:

[0049] An acquisition module is used to obtain a constant current source power-on instruction;

[0050] A control module is used to control the constant current source to power on according to the constant current source power-on instruction, so that when the constant current source is powered on, each of the slave devices obtains the voltage value corresponding to each of the slave devices based on the voltage sampling unit; each of the slave devices determines the target communication address of each of the slave devices according to its corresponding voltage value and a preset mapping relationship, and sets the communication address of each of the slave devices to each of the target communication addresses, and the preset mapping relationship includes a mapping relationship between voltage values ​​and communication addresses.

[0051] In a fifth aspect, the present invention provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the communication address configuration method as described in any of the aforementioned implementations.

[0052] In a sixth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the communication address configuration method as described in any of the aforementioned implementation modes are executed.

[0053] The beneficial effects of this application are:

[0054] The communication address configuration method, electronic device and storage medium provided in the embodiments of the present application are applied to a slave device in a communication configuration system, the communication configuration system includes a host device and at least one slave device, the host device is provided with a constant current source, each slave device is provided with a voltage sampling unit, the positive electrode of the constant current source in the host device is sequentially connected in series with the input end of the voltage sampling unit in each slave device, and the negative electrode of the constant current source is sequentially connected in series with the output end of the voltage sampling unit in each slave device, the method includes: when the constant current source is powered on, obtaining a voltage value corresponding to the slave device based on the voltage sampling unit; obtaining a target communication address of the slave device according to the voltage value corresponding to the slave device and a preset mapping relationship, the preset mapping relationship includes a mapping relationship between the voltage value and the communication address; setting the communication address of the slave device as the target communication address can realize automatic setting of the communication address of the slave device, improve address configuration efficiency, and avoid communication address setting errors; in addition, the setting of the communication address of each slave device can also be made independent of the program logic in the host device, which can improve the flexibility of the communication address configuration method. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0056] Figure 1 A schematic diagram of the structure of a communication configuration system provided in an embodiment of the present application;

[0057] Figure 2 A flow chart of a communication address configuration method provided in an embodiment of the present application;

[0058] Figure 3 A flowchart of another communication address configuration method provided in an embodiment of the present application;

[0059] Figure 4 A flowchart of another communication address configuration method provided in an embodiment of the present application;

[0060] Figure 5 A flowchart of another communication address configuration method provided in an embodiment of the present application;

[0061] Figure 6 A flowchart of another communication address configuration method provided in an embodiment of the present application;

[0062] Figure 7 A schematic diagram of the functional modules of a communication address configuration device provided in an embodiment of the present application;

[0063] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0065] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0066] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0067] Figure 1 A schematic diagram of a communication configuration system provided in an embodiment of the present application, wherein Figure 1 As shown, the communication configuration system may include a host device and at least one slave device, the host device is provided with a constant current source, each slave device is provided with a voltage sampling unit, the positive electrode of the constant current source in the host device is connected in series with the input end of the voltage sampling unit in each slave device, and the negative electrode of the constant current source is connected in series with the output end of the voltage sampling unit in each slave device, and optionally, the voltage sampling unit includes at least one of the following: a resistor, a voltage regulator, and a semiconductor triode. Based on the communication configuration system, a corresponding communication address can be set for each slave device, and the specific setting process can be referred to the following embodiment.

[0068] Figure 2 A flow chart of a communication address configuration method provided in an embodiment of the present application, the execution subject of the method may be a slave device in the above communication configuration system, such as Figure 2 As shown, the method may include:

[0069] S101 . When a constant current source is powered on, a voltage value corresponding to a slave device is acquired based on a voltage sampling unit.

[0070] The essence of the constant current source is to use a constant current device to feedback the current and dynamically adjust the power supply state of the device so that the current tends to be constant. As long as the current can be obtained, feedback can be effectively formed to establish a constant current source. Optionally, the constant current source device can include electronic components such as diodes and triodes, which are not limited here.

[0071] In some embodiments, the voltage sampling unit may include electronic components such as resistors and voltage regulators. Based on the connection relationship between the slave device and the host device in the above communication system, it can be seen that the constant current source can output a constant current to each slave device when powered on. By utilizing the principle of constant current source current, according to Ohm's law, through the voltage drop, the voltage value corresponding to each slave device will be different, that is, each slave device can obtain its corresponding voltage value. It can be understood that for each slave device, the voltage value obtained will be unique.

[0072] Optionally, the constant current source may be powered by a power supply system of the host device, or may be powered by a power supply system dedicated to the constant current source, which is not limited here.

[0073] S102 . Obtain a target communication address of the slave device according to a voltage value corresponding to the slave device and a preset mapping relationship, where the preset mapping relationship includes a mapping relationship between a voltage value and a communication address.

[0074] Among them, the preset mapping relationship can be pre-stored in each slave device. Then, for each slave device, after determining its corresponding voltage value, it can query and determine the communication address corresponding to each voltage value from the preset mapping relationship as the target communication address of each slave device.

[0075] S103, setting the communication address of the slave device as the target communication address.

[0076] For the slave device, based on the determined target communication address, its communication address can be set as the target communication address. It can be seen that in this setting process, the slave device can realize the automatic setting of its target communication address, which can improve the address configuration efficiency and avoid communication address setting errors; in addition, the setting of the communication address of each slave device can be made independent of the program logic in the host device, which can improve the flexibility of the communication address configuration method.

[0077] In summary, an embodiment of the present application provides a communication address configuration method, which can be applied to a slave device in a communication configuration system. The communication configuration system includes a host device and at least one slave device, a constant current source is provided in the host device, and a voltage sampling unit is provided in each slave device. The positive electrode of the constant current source in the host device is connected in series with the input end of the voltage sampling unit in each slave device, and the negative electrode of the constant current source is connected in series with the output end of the voltage sampling unit in each slave device. The method includes: when the constant current source is powered on, obtaining a voltage value corresponding to the slave device based on the voltage sampling unit; obtaining a target communication address of the slave device according to the voltage value corresponding to the slave device and a preset mapping relationship, and the preset mapping relationship includes a mapping relationship between the voltage value and the communication address; setting the communication address of the slave device as the target communication address can realize automatic setting of the communication address of the slave device, improve the address configuration efficiency, and avoid communication address setting errors; in addition, the setting of the communication address of each slave device can also be made independent of the program logic in the host device, which can improve the flexibility of the communication address configuration method.

[0078] It should be noted that, during implementation, the program logic corresponding to the above steps S101 to S103 can be deployed separately as a script program, that is, the program logic corresponding to the above steps S101 to S103 and the normal working logic corresponding to the slave device can be deployed separately to avoid affecting the implementation of other normal operations in the slave device.

[0079] Figure 3A flowchart of another communication address configuration method provided in an embodiment of the present application.

[0080] Alternatively, if Figure 3 As shown, the above method also includes:

[0081] S201, receiving a query instruction sent by a host device according to a preset mapping relationship.

[0082] Optionally, the host device can pre-store the above-mentioned preset mapping relationship, that is, the mapping relationship between the voltage value and the communication address. That is, for the host device, it can pre-determine the communication address of each slave device according to the preset mapping relationship, and send a query instruction to each slave device to determine whether each slave device is online.

[0083] S202, according to the inquiry instruction, send an inquiry response to the host device, so that the host device determines the number of slave devices in the communication configuration system according to the inquiry response, and generates a slave address table for storage, the slave address table includes: the target communication address of each slave device corresponding to the inquiry response.

[0084] For each slave device, if it receives an inquiry instruction sent by the host device according to a preset mapping relationship, it can send a corresponding inquiry response to the host device. It can be understood that if the host device receives an inquiry response sent by a slave device pointed to by a certain communication address, it means that the slave device is online, otherwise, it means that the slave device is offline. It can be understood that based on this concept, the host device can receive an inquiry response sent by a communicative slave device, and determine the number of slave devices in the communication configuration system based on this, and generate a slave address table.

[0085] Among them, the generated slave address table can include the target communication address of each slave device. It can be understood that when the host device subsequently communicates with a specific slave device, the target communication address of each slave device can be determined according to the slave address table to achieve accurate communication.

[0086] Optionally, in some embodiments, after generating the above-mentioned slave address table, the host device may also power off the constant current source to avoid ineffective waste of electric energy, thereby reducing the address configuration cost.

[0087] Optionally, the communication configuration system also includes at least one slave power system, and each slave power system power supply output terminal is electrically connected to the power supply input terminal of each slave device, so that for each slave device, it can also have its exclusive slave power system to power the controller therein, ensuring the reliability of the working power supply of the slave device. In some embodiments, the slave power system of each slave device can be arranged inside the slave device. Applying the embodiments of the present application, it is possible to be compatible with slave devices with a slave power system arranged inside, and the applicability of the method of the present application can be improved.

[0088] Of course, it should be noted that each slave device may also share a power supply system, and the power supply system may be arranged inside the host device, thus reducing the manufacturing cost of each slave device.

[0089] In some embodiments, the slave devices include multiple slave devices, and a preset mapping relationship is pre-stored in the host device. The preset mapping relationship also includes a mapping relationship between the communication address of each slave device and the arrangement order. The arrangement order is used to indicate the arrangement order of each slave device among the multiple slave devices.

[0090] In combination with the above description, the preset mapping relationship stored in the host device may include a mapping relationship between a voltage value, a communication address, and an arrangement order, wherein the arrangement order may indicate the arrangement order of each slave device among multiple slave devices, that is, it may indicate the installation position of each slave device among multiple slave devices.

[0091] By applying the embodiments of the present application, if the operation and maintenance personnel of the slave device determine that a certain slave device has a fault at the working site of the slave device, then at this time, the arrangement order of the slave device among multiple slave devices can be obtained and input into the host device, and the host device determines the communication address of the slave device according to the arrangement order corresponding to the slave device, and sends a corresponding fault query instruction to the communication address of the slave device; for the slave device, optionally, after receiving the fault query instruction sent by the host device, it can return relevant status parameters to the host device, so that the slave device can quickly determine the cause of the failure of the slave device according to the relevant status parameters, thereby improving the applicability and intelligence of the method of the present application.

[0092] Figure 4 A flowchart of another communication address configuration method provided in an embodiment of the present application. Optionally, the host device performs serial communication with each slave device based on a serial communication protocol, wherein the serial communication protocol may be an RS485 protocol, a serial peripheral interface (Serial Peripheral Interface) protocol, an integrated circuit bus (Inter-Integrated Circuit, IIC), etc., which is not limited here and can be flexibly selected according to the actual application scenario.

[0093] In which, the RS485 protocol is used for explanation, the second serial transmitting end of the host device can be electrically connected to the first serial receiving end of a slave device, and the second serial receiving end of the host device can be electrically connected to the first serial transmitting end of the slave device. It should be noted that the serial communication connection mode between the slave devices can refer to the connection mode between the host device and the slave device mentioned above, which will not be repeated here.

[0094] Based on the above description, if Figure 4 As shown, the above-mentioned receiving the query instruction sent by the host device according to the preset mapping relationship includes:

[0095] S301, receiving, through a first serial receiving end, a query instruction sent by a host device through a second serial sending end.

[0096] Accordingly, the above-mentioned sending of the inquiry response to the host device according to the inquiry instruction includes:

[0097] S302: According to the inquiry instruction, send an inquiry response to the host device through the first serial sending end.

[0098] Among them, according to the communication connection relationship between the above-mentioned host device and the slave device, the host device can send an inquiry instruction to the slave device connected to it through the second serial transmitting end, and the slave device can receive the inquiry instruction sent by the host device according to the preset mapping relationship through the first serial receiving end, and send an inquiry response to the host device through the first serial transmitting end; the host device can receive the inquiry response through the second serial receiving end, so that normal communication between the host device and the slave device can be achieved.

[0099] It should be noted that, if the communication configuration system includes multiple slave devices, each slave device may communicate with the host device with reference to the above steps S301 and S302.

[0100] Figure 5 A flowchart of another communication address configuration method provided in an embodiment of the present application.

[0101] Alternatively, if Figure 5 As shown, the above method also includes:

[0102] S401, receiving an operation instruction sent by a host device according to a slave address table, where the operation instruction includes: a control instruction and / or a status query instruction.

[0103] Optionally, the control instruction may include but is not limited to: a slave device start instruction, a slave device shutdown instruction, a slave device parameter setting instruction, a slave device state switching instruction (wherein the slave device state may include: sleep state, normal working state, fault state, etc.).

[0104] Optionally, the status query instructions may include but are not limited to: query instructions for various working parameters in the alarm state, query instructions for various working parameters in the fault state, and query instructions for various working parameters in the normal operating state; wherein the working parameters may include at least one of the following: working voltage value, working current value, and working power value.

[0105] It can be understood that since the host device can know the target communication address of each slave device in advance based on the slave address table, the host device can send control instructions and / or status query instructions to any slave device according to the actual application scenario, so that remote management of the slave device can be achieved.

[0106] S402. According to the operation instruction, control the slave device to execute the target operation and obtain the operation result, wherein the operation result corresponding to the control instruction includes: control result, and the operation result corresponding to the status query instruction includes: target status.

[0107] S403: Send the operation result to the host device.

[0108] For the slave device, if a control instruction is received, the corresponding control can be performed according to the control instruction, and the operation result, that is, the control result, can be fed back to the host device, where the control result can be used to indicate whether the control is successful; if a status query instruction is received, the target status can be obtained according to the status query instruction, and the host device feeds back the target status, thereby realizing the remote management of the slave device by the host device and improving the intelligence of the interaction between the host device and the slave device.

[0109] Optionally, when receiving the constant current source power-on instruction, the host device controls the constant current source to power on, that is, the host device can control the power-on operation of the constant current source. Of course, the host device can also control the power-off operation of the constant current source.

[0110] Among them, the constant current source power-on instruction can be generated by any of the following methods:

[0111] Method 1: receiving the constant current source power-on instruction sent by the first external device through a wired communication module in the host device, where the wired communication module includes at least one of the following: a serial communication module and an Ethernet module.

[0112] Optionally, the host device may include a wired communication module such as a serial communication module and / or an Ethernet module, through which the host device can communicate with the first external device. In this case, the first external device can send a constant current source power-on instruction to the host device through the wired communication module, and the host device can trigger the address configuration program of each slave device in the communication configuration system according to the constant current source power-on instruction, thereby realizing the automatic configuration of the target communication address of each slave device. Optionally, the first external device can be an industrial computer, a portable computer, etc., which is not limited here.

[0113] Method 2: receiving the constant current source power-on instruction sent by the second external device through the wireless communication module in the host device, the wireless communication module includes at least one of the following: a cellular mobile communication module port, a WiFi module, and a Bluetooth module.

[0114] Optionally, the host device may include a cellular mobile communication module port, a WiFi module, a Bluetooth module, and at least one wireless communication module, through which the host device can communicate with the second external device. In this case, the second external device can send a constant current source power-on instruction to the host device through the wired communication module. In some embodiments, the second external device can be a mobile terminal, a wearable device, etc., which is not limited here.

[0115] Method 3: Generate a constant current source power-on instruction through a preset function key module in the host device;

[0116] Optionally, the preset function key module can be embedded on the surface of the host device, and the preset function key module can include a physical key. In actual application, the physical key can be pressed to generate a constant current source power-on instruction. By using the embodiment of the present application, a manual triggering mode of manual access can be realized.

[0117] Based on the above description, it can be seen that the present application can generate constant current source power-on instructions in a variety of ways, so that different generation methods can be selected according to actual application scenarios, which can improve the applicability of the method of the present application.

[0118] Based on the above embodiment, it should be noted that if a new addition operation is performed on a slave device in the communication configuration system, in this case, in order to ensure that the newly added slave device can be assigned to the correct target communication address, the above steps S101 to S103 can be re-executed, that is, the constant current source can be controlled to be powered on again, so as to ensure that each slave device can be assigned to the correct target communication address. It is worth noting that if a deletion operation is performed on a slave device in the communication configuration system, it is also necessary to re-execute the above steps S101 to S103 so that the slave address stored in the host device can be updated in time.

[0119] Optionally, the host device includes a gateway, and the slave device includes at least one of the following: a circuit breaker, a contactor, and a relay.

[0120] It should be noted that if the communication configuration system includes multiple slave devices, the multiple slave devices may optionally include at least two types of devices. For example, among the multiple slave devices, some of the slave devices are circuit breakers, and some of the slave devices are relays.

[0121] Of course, it should be noted that the types of slave devices are not limited to the types shown above, and may also include fuses, leakage protectors, air switches, etc. according to actual application scenarios. The host device is also not limited to the gateway, and may also be an industrial computer, a portable computer, etc. according to actual application scenarios.

[0122] Optionally, an embodiment of the present application further provides a distribution box, which may include the above-mentioned communication configuration system. For the description of the communication configuration system, please refer to the relevant part mentioned above and will not be repeated here.

[0123] In some embodiments, each slave device may be provided with a default address. Optionally, the default address may be set at the factory. During the communication address configuration process, the host device may communicate with each slave device in sequence according to the default address and the communication order of each slave device, and send a target communication address to each slave device. After receiving the target communication address, each slave device may reset its own communication address accordingly, wherein the target communication address may be determined according to the communication address setting rules, and the target communication addresses corresponding to each slave device are different. For example, the default address of each host device may be M. Using the embodiments of the present application, for example, the target communication address of the first slave device communicating with the host device may be set to A, and the target communication address of the Nth slave device communicating with the host device may be set to A+N. Of course, the communication address setting rules are not limited to this.

[0124] In some embodiments, the host device may also determine the target communication address of each slave device according to the communication signal strength between the host device and some slave devices and a preset algorithm.

[0125] Alternatively, a power IO signal line can be added to establish hand-in-hand communication between a slave device and the remaining slave devices through high and low levels. Optionally, during the specific setting, the host device can set one slave device to correspond to a high-level signal each time and the other slave devices to correspond to low-level signals. For the slave device marked as a high-level signal, the host device determines the target communication address of the slave device according to the communication address setting rule, and sets the communication address of the slave device accordingly.

[0126] Figure 6 A flow chart of another communication address configuration method provided in an embodiment of the present application, the execution subject of the method may be a host device in the above communication configuration system, such as Figure 6 As shown, the above method includes:

[0127] S501, obtaining a constant current source power-on instruction.

[0128] Optionally, the constant current source power-on instruction can be generated by a wired communication module, a wireless communication module, a preset function key module, etc. in the host device, which is not limited here. For this part, please refer to the above-mentioned related content.

[0129] S502. According to the constant current source power-on instruction, control the constant current source to power on, so that when the constant current source is powered on, each slave device obtains the voltage value corresponding to each slave device based on the voltage sampling unit, and determines the target communication address of each slave device according to its corresponding voltage value and a preset mapping relationship; each slave device sets the communication address of each slave device to each target communication address.

[0130] The preset mapping relationship includes a mapping relationship between a voltage value and a communication address.

[0131] In combination with the foregoing description, after the host device obtains the constant current source power-on instruction, it can power on the constant current source accordingly, so that the communication address setting function of each slave device can be triggered through the constant current source power-on operation, thereby realizing the automatic setting of the communication address, improving the address configuration efficiency of the slave device, and avoiding communication address setting errors; in addition, the setting of the communication address of each slave device can be made independent of the program logic in the host device, thereby improving the flexibility of the communication address configuration method.

[0132] In summary, the embodiment of the present application provides a communication address configuration method, which can be applied to a host device in a communication configuration system. By applying the embodiment of the present application, the slave device can realize the automatic setting of its target communication address, improve the address configuration efficiency, and avoid communication address setting errors; in addition, the setting of the communication address of each slave device can be independent of the program logic in the host device, which can improve the flexibility of the communication address configuration method.

[0133] Figure 7A functional module diagram of a communication address configuration device provided in an embodiment of the present application, the communication address configuration device can be applied to a slave device in a communication configuration system, the communication configuration system includes a host device and at least one slave device, the host device is provided with a constant current source, each of the slave devices is provided with a voltage sampling unit, the positive electrode of the constant current source in the host device is sequentially connected in series with the input end of the voltage sampling unit in each of the slave devices, and the negative electrode of the constant current source is sequentially connected in series with the output end of the voltage sampling unit in each of the slave devices. The basic principle of the device and the technical effects produced are the same as those of the corresponding method embodiments described above. For the sake of brief description, the parts not mentioned in this embodiment may refer to the corresponding contents in the method embodiments. Figure 7 As shown, the communication address configuration device 200 includes:

[0134] An acquisition module 210, configured to acquire a voltage value corresponding to the slave device based on the voltage sampling unit when the constant current source is powered on;

[0135] A determination module 220, configured to determine and obtain a target communication address of the slave device according to a voltage value corresponding to a slave device of the slave device and a preset mapping relationship, wherein the preset mapping relationship includes a mapping relationship between a voltage value and a communication address;

[0136] The setting module 230 is used to set the communication address of the slave device as the target communication address.

[0137] In an optional implementation manner, the preset mapping relationship is pre-stored in the host device, and the communication address configuration further includes: a processing module, configured to receive an inquiry instruction sent by the host device according to the preset mapping relationship;

[0138] According to the inquiry instruction, an inquiry response is sent to the host device, so that the host device determines the number of slave devices in the communication configuration system according to the inquiry response, and generates a slave address table for storage, wherein the slave address table includes: the target communication address of each slave device corresponding to the inquiry response.

[0139] In an optional implementation, the communication configuration system further comprises at least one slave power system, and the power supply output terminal of each slave power system is electrically connected to the power supply input terminal of each slave device;

[0140] The slave devices include multiple ones, and the preset mapping relationship is pre-stored in the host device. The preset mapping relationship also includes a mapping relationship between the communication address of each slave device and the arrangement order. The arrangement order is used to indicate the arrangement order of each slave device among the multiple slave devices.

[0141] In an optional implementation, the host device performs serial communication with each of the slave devices based on a serial communication protocol;

[0142] The processing module is specifically configured to receive, through the first serial receiving end, an inquiry instruction sent by the host device through the second serial sending end; and send an inquiry response to the host device through the first serial sending end according to the inquiry instruction.

[0143] In an optional implementation, the processing module is further specifically used to receive an operation instruction sent by the host device according to the slave address table, and the operation instruction includes: a control instruction and / or a status query instruction;

[0144] According to the operation instruction, control the slave device to perform the target operation and obtain the operation result, wherein the operation result corresponding to the control instruction includes: control result, and the operation result corresponding to the status query instruction includes: target status;

[0145] The operation result is sent to the host device.

[0146] In an optional implementation, when the host device receives a constant current source power-on instruction, it controls the constant current source to power on, wherein the constant current source power-on instruction may be generated in any of the following ways:

[0147] Receiving the constant current source power-on instruction sent by the first external device through a wired communication module in the host device, wherein the wired communication module includes at least one of the following: a serial communication module and an Ethernet module;

[0148] Receiving the constant current source power-on instruction sent by the second external device through a wireless communication module in the host device, wherein the wireless communication module includes at least one of the following: a cellular mobile communication module port, a WiFi module, and a Bluetooth module;

[0149] The constant current source power-on instruction is generated by a preset function key module in the host device.

[0150] In an optional implementation, the host device includes a gateway, and the slave device includes at least one of the following: a circuit breaker, a contactor, and a relay.

[0151] Optionally, an embodiment of the present application further provides a communication address configuration device, which is applied to a host device in a communication configuration system, wherein the communication configuration system includes the host device and at least one slave device, the host device is provided with a constant current source, each of the slave devices is provided with a voltage sampling unit, the positive electrode of the constant current source in the host device is connected in series with the input end of the voltage sampling unit in each of the slave devices, and the negative electrode of the constant current source is connected in series with the output end of the voltage sampling unit in each of the slave devices, and the communication address configuration device includes:

[0152] An acquisition module is used to obtain a constant current source power-on instruction;

[0153] A control module is used to control the constant current source to power on according to the constant current source power-on instruction, so that when the constant current source is powered on, each of the slave devices obtains the voltage value corresponding to each of the slave devices based on the voltage sampling unit; each of the slave devices determines the target communication address of each of the slave devices according to its corresponding voltage value and a preset mapping relationship, and sets the communication address of each of the slave devices to each of the target communication addresses, and the preset mapping relationship includes a mapping relationship between voltage values ​​and communication addresses.

[0154] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0155] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0156] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device can be integrated into the above-mentioned communication address configuration device. Figure 8 As shown, the electronic device may include: a processor 310, a storage medium 320 and a bus 330, the storage medium 320 stores machine-readable instructions executable by the processor 310, when the electronic device is running, the processor 310 and the storage medium 320 communicate through the bus 330, and the processor 310 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.

[0157] Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method embodiment are executed. The specific implementation method and technical effect are similar and will not be repeated here.

[0158] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0159] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0160] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0161] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0162] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0163] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A communication address configuration method, characterized in that: A slave device used in a communication configuration system, the communication configuration system comprising a host device and at least one slave device, the host device is provided with a constant current source, each of the slave devices is provided with a voltage sampling unit, the positive electrode of the constant current source in the host device is sequentially connected in series with the input end of the voltage sampling unit in each of the slave devices, and the negative electrode of the constant current source is sequentially connected in series with the output end of the voltage sampling unit in each of the slave devices, the method comprising: When the constant current source is powered on, acquiring a voltage value corresponding to the slave device based on the voltage sampling unit; Acquire a target communication address of the slave device according to a voltage value corresponding to the slave device and a preset mapping relationship; Setting the communication address of the slave device to the target communication address; The preset mapping relationship is pre-stored in the host device, and the method further includes: receiving an inquiry instruction sent by the host device according to the preset mapping relationship; sending an inquiry response to the host device according to the inquiry instruction, so that the host device determines the number of the slave devices in the communication configuration system according to the inquiry response, generates a slave address table for storage, and performs a power-off operation on the constant current source, wherein the slave address table includes: a target communication address of the slave device; The communication configuration system further comprises at least one slave power system, the power supply output end of each slave power system is electrically connected to the power supply input end of each slave device, and the preset mapping relationship is pre-stored in the host device; The preset mapping relationship includes a mapping relationship between a voltage value corresponding to a slave device, a communication address of the slave device, and an arrangement order, wherein the arrangement order is used to indicate an arrangement order of each of the slave devices among the plurality of slave devices; The host device is configured to determine the communication address of the target slave device based on the preset mapping relationship and according to the arrangement order of the target slave devices; send a fault query instruction to the target slave device according to the communication address of the target slave device; receive the status parameters returned by the target slave device, and determine the fault cause of the target slave device according to the status parameters returned by the target slave device.

2. The method according to claim 1, characterized in that The host device performs serial communication with each of the slave devices based on a serial communication protocol; The receiving the inquiry instruction sent by the host device according to the preset mapping relationship includes: receiving the inquiry instruction sent by the host device through the second serial sending end through the first serial receiving end; The sending of the inquiry response to the host device according to the inquiry instruction includes: sending the inquiry response to the host device through a first serial sending end according to the inquiry instruction.

3. The method according to claim 1, characterized in that The method further comprises: Receiving an operation instruction sent by a host device according to the slave address table, the operation instruction including: a control instruction and / or a status query instruction; According to the operation instruction, control the slave device to perform the target operation and obtain the operation result, wherein the operation result corresponding to the control instruction includes: control result, and the operation result corresponding to the status query instruction includes: target status; The operation result is sent to the host device.

4. The method according to claim 1, characterized in that: When the host device receives the constant current source power-on instruction, it controls the constant current source to power on, wherein the constant current source power-on instruction can be generated by any of the following methods: Receiving the constant current source power-on instruction sent by the first external device through a wired communication module in the host device, wherein the wired communication module includes at least one of the following: a serial communication module and an Ethernet module; Receiving the constant current source power-on instruction sent by the second external device through a wireless communication module in the host device, wherein the wireless communication module includes at least one of the following: a cellular mobile communication module port, a WiFi module, and a Bluetooth module; The constant current source power-on instruction is generated by a preset function key module in the host device.

5. The method according to any one of claims 1 to 4, characterized in that: The host device includes a gateway, and the slave device includes at least one of the following: a circuit breaker, a contactor, and a relay.

6. A communication address configuration method, characterized in that: A host device applied to a communication configuration system, the communication configuration system comprising the host device and at least one slave device, the host device being provided with a constant current source, each of the slave devices being provided with a voltage sampling unit, the positive electrode of the constant current source in the host device being connected in series with the input end of the voltage sampling unit in each of the slave devices, the negative electrode of the constant current source being connected in series with the output end of the voltage sampling unit in each of the slave devices, and the method comprising: Get the constant current source power-on instruction; According to the constant current source power-on instruction, the constant current source is controlled to be powered on, so that when the constant current source is powered on, each of the slave devices obtains a voltage value corresponding to each of the slave devices based on the voltage sampling unit; each of the slave devices determines a target communication address of each of the slave devices according to its corresponding voltage value and a preset mapping relationship, and sets the communication address of each of the slave devices to each of the target communication addresses; The host device pre-stores the preset mapping relationship, and the method further includes: Sending a query instruction to the slave device according to the preset mapping relationship; Receiving the inquiry response returned by the slave device according to the inquiry instruction, determining the number of the slave devices in the communication configuration system according to the inquiry response, generating a slave address table for storage, and performing a power-off operation on the constant current source, wherein the slave address table includes: a target communication address of the slave device; The communication configuration system further comprises at least one slave power system, wherein the power supply output terminal of each slave power system is electrically connected to the power supply input terminal of each slave device; The host device pre-stores the preset mapping relationship; the preset mapping relationship includes a mapping relationship between a voltage value corresponding to a slave device, a communication address of the slave device, and an arrangement order, wherein the arrangement order is used to indicate an arrangement order of each of the slave devices among the plurality of slave devices; The host device is configured to determine the communication address of the target slave device based on the preset mapping relationship and according to the arrangement order of the target slave devices; send a fault query instruction to the target slave device according to the communication address of the target slave device; receive the status parameters returned by the target slave device, and determine the fault cause of the target slave device according to the status parameters returned by the target slave device.

7. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the communication address configuration method as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the communication address configuration method according to any one of claims 1 to 6 are executed.

Citation Information

Patent Citations

  • Method and system for sequentially identifying slave addresses from master-slave field bus

    CN102821017A