Slave ID distribution method of multi-machine system and multi-machine system

By using the evaluation parameters of the charging and discharging circuit in the slave machine of a multi-machine system to allocate ID, the problem of slave ID is solved, the system cost is reduced, and the goals of unique allocation and cost-effectiveness are achieved.

CN119814734APending Publication Date: 2025-04-11GUANGDONG WANHE THERMAL ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411771994.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In multi-machine systems, a unique ID is needed to be assigned to the slave, but existing methods require different hardware features for the slave or use additional central servers or complex communication mechanisms, increasing system costs.

Method used

By setting up a charge and discharge circuit with unfixed charge and discharge power in the slave, the slave performs the same power management logic and assigns the slave to the slave according to the evaluation parameters that perform the power management logic, no additional hardware features or server is required.

Benefits of technology

The unique allocation of slave IDs is realized, the cost of multi-machine systems is reduced, and additional demands for hardware and communication mechanisms are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814734A_ABST
    Figure CN119814734A_ABST
Patent Text Reader

Abstract

The invention discloses a slave ID distribution method of a multi-machine system and the multi-machine system. The multi-machine system comprises a host machine and a plurality of slave machines, the slave machines are provided with charging and discharging circuits, the slave machines obtain charging duration or discharging duration of the charging and discharging circuits, the slave machines calculate interval time for sending ID distribution requests to the host machine according to the charging duration or the discharging duration, and the slave machines send the ID distribution requests to the host machine after the interval time. The host determines the receiving sequence of the received ID allocation requests when receiving the ID allocation requests, the host determines the IDs of the slaves based on the receiving sequence of the received ID allocation requests, the host sends ID allocation response information to the slaves and allocates the IDs to the slaves, and the ID allocation response information comprises the IDs of the slaves. According to the method, the ID of each slave is determined by using the natural time difference of the charging duration or the discharging duration of the charging and discharging circuit of each slave, different hardware characteristics do not need to be set for each slave, an additional central server or a complex communication mechanism is not needed, and the cost of a multi-machine system is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to communication technology, and in particular to a slave ID allocation method for a multi-machine system and the multi-machine system. Background Art

[0002] A multi-machine system is a system composed of two or more electronic devices. A common multi-machine system is a host connected to multiple slaves, and the host exchanges information with multiple slaves.

[0003] In a multi-machine system, the allocation of unique identifiers (IDs) for devices is a key issue, especially when large-scale deployment is required. For electronic devices with physical addresses or serial numbers, IDs can be generated based on the physical addresses or serial numbers of the electronic devices. However, adding physical addresses or serial numbers to electronic devices increases the cost of manufacturers, so some electronic devices do not have physical addresses or serial numbers. For electronic devices without physical addresses or serial numbers, an existing method is to generate IDs based on the hardware characteristics of components in the electronic device (for example, the resistance value of a resistor, the capacitance value of a capacitor, etc.).

[0004] However, the hardware features of components in multiple slaves may be the same, which means that the slave ID is no longer unique. In order to obtain a different ID, the hardware features of each slave must be different, which increases the cost of the multi-machine system. Summary of the invention

[0005] One of the technical problems solved by the present invention is to provide a method for allocating slave IDs in a multi-machine system, which does not require different hardware features for each slave, does not require an additional central server or a complex communication mechanism, and reduces the cost of the multi-machine system.

[0006] The second technical problem solved by the present invention is to provide a multi-machine system for executing the slave ID allocation method of the multi-machine system of the present invention, which does not require different hardware features for each slave, does not require an additional central server or complex communication mechanism, and reduces the cost of the multi-machine system.

[0007] The first technical problem mentioned above is solved by the following technical solution:

[0008] A method for allocating slave IDs of a multi-machine system, the multi-machine system comprising a host and a plurality of slaves, the plurality of slaves being all provided with the same charge-discharge circuit, the charge-discharge circuit having a characteristic of non-fixed charge-discharge power, the method comprising:

[0009] The multiple slaves execute the same power management logic;

[0010] After the slave executes the power management logic, obtaining evaluation parameters of the execution of the power management logic;

[0011] Based on the evaluation parameters, the master assigns an ID to the slave.

[0012] The present invention provides a slave ID allocation method for a multi-machine system, wherein the multi-machine system includes a host and multiple slaves, wherein the slaves are provided with a charge-discharge circuit, and the charge-discharge circuit has the characteristic that the charge-discharge power is not fixed. When multiple slaves execute the same power management logic, since the charge-discharge circuit has the characteristic that the charge-discharge power is not fixed, the evaluation parameters for executing the power management logic will be different, and thus the IDs generated based on different evaluation parameters will also be different. The present invention utilizes the characteristic that the charge-discharge power of the original charge-discharge circuit of each slave is not fixed, and determines the ID of the slave through the difference in the evaluation parameters for executing the power management logic of each slave, without setting different hardware features for each slave, without requiring an additional central server or a complex communication mechanism, thereby reducing the cost of the multi-machine system.

[0013] In some embodiments of the present invention, the power management logic is charging to a first preset value or discharging to a second preset value or a preset number of charge and discharge cycles, and the evaluation parameter is execution time.

[0014] In some embodiments of the present invention, the power management logic is a first preset time for charging, a second preset time for discharging, or a third preset time for a charge-discharge cycle, and the evaluation parameter is a current power.

[0015] In some embodiments of the present invention, based on the evaluation parameter, the host assigns an ID to the slave, including:

[0016] The slave calculates the interval time for sending ID allocation request to the host according to the evaluation parameter;

[0017] The slave sends an ID allocation request to the host after the interval time;

[0018] When receiving the ID allocation request, the host determines a receiving order of the received ID allocation request;

[0019] The host determines the ID of the slave based on the order in which the received ID allocation requests are received;

[0020] The host sends ID allocation response information to the slave to allocate an ID to the slave, and the ID allocation response information includes the ID of the slave.

[0021] In some embodiments of the present invention, calculating the interval time of sending the ID allocation request to the host according to the evaluation parameter includes:

[0022] Calculate the order number of sending ID allocation requests to the master based on the evaluation parameter and the total number of the slaves;

[0023] The product of the sequence number and the preset time length is calculated to obtain the interval time for the slave to send the ID allocation request to the host, wherein the interval time is based on the broadcast signal received by the slave from the host.

[0024] In some embodiments of the present invention, calculating the order number of sending the ID allocation request to the master based on the evaluation parameter and the total number of the slaves includes:

[0025] Converting the evaluation parameter into a dimensionless value having one digit greater than the total number of the slaves;

[0026] Calculating the remainder of the dimensionless value and the total number of the slaves;

[0027] The remainder is added by 1 to obtain the sequence number of the ID allocation request sent by the slave to the master.

[0028] In some embodiments of the present invention, the slave ID allocation method of the multi-machine system further includes:

[0029] When the host simultaneously receives the ID allocation requests sent by at least two target slaves, it determines that there is a conflict between the IDs of the at least two target slaves, and does not send the ID allocation response information to the at least two target slaves.

[0030] In some embodiments of the present invention, the slave ID allocation method of the multi-machine system further includes:

[0031] After the host sends the ID allocation response information to the slaves other than the target slave, it determines that the slaves other than the target slave have been allocated IDs, the current round of ID allocation ends, and the next round of ID allocation begins;

[0032] The target slave, based on not receiving the ID allocation response information within the set time, controls the charge and discharge circuit to discharge or charge back to meet the initial conditions for executing the power management logic, and then returns to execute the same power management logic. After executing the power management logic, an evaluation parameter for executing the power management logic is obtained, and the interval time for sending an ID allocation request to the host is calculated according to the evaluation parameter, until all slaves have been assigned an ID, wherein the slave that has been assigned an ID no longer participates in the next round of ID allocation.

[0033] In some embodiments of the present invention, when the host does not receive an ID allocation request from the slave in consecutive preset rounds of ID allocation, it is determined that all the slaves have been allocated IDs.

[0034] In some embodiments of the present invention, the multiple slaves execute the same power management logic, including:

[0035] After the multi-machine system is powered on, the host sends a broadcast signal to the multiple slaves;

[0036] The multiple slave devices execute the same power management logic based on the first reception of the broadcast signal.

[0037] In some embodiments of the present invention, based on the evaluation parameter, the host assigns an ID to the slave, including:

[0038] The slave sends an ID allocation request characterized by evaluation parameters to the host;

[0039] The host determines the ID of the slave based on the evaluation parameter in the received ID allocation request;

[0040] The host sends ID allocation response information to the slave to allocate an ID to the slave, and the ID allocation response information includes the ID of the slave.

[0041] The above second technical problem is solved by the following technical solution:

[0042] A multi-machine system, used to execute the slave ID allocation method of the multi-machine system provided by the aforementioned embodiment of the present invention, the multi-machine system comprises a host and multiple slaves, the slave is a water heater, the multiple slaves each comprises a controller and a charge-discharge circuit, the charge-discharge circuit has a characteristic of unfixed charge-discharge power, the controller is connected to the host, and the charge-discharge circuit is connected to the controller;

[0043] The charge and discharge circuit includes a capacitor, a first resistor and a second resistor. The first end of the first resistor is connected to the first pin of the controller, and the second end of the first resistor is respectively connected to the second pin of the controller, the first end of the capacitor and the second end of the second resistor. The second end of the capacitor is grounded, and the second end of the second resistor is grounded.

[0044] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0046] Figure 1A flowchart of a method for allocating slave IDs in a multi-machine system provided by the present invention;

[0047] Figure 2 A flowchart of another method for allocating slave IDs in a multi-machine system provided by the present invention;

[0048] Figure 3 A schematic diagram of the structure of a multi-machine system provided by the present invention;

[0049] Figure 4 A schematic diagram of the structure of a slave provided by the present invention;

[0050] Figure 5 The present invention provides a schematic structural diagram of an electronic device.

[0051] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0052] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0054] Figure 1 The present invention provides a flowchart of a slave ID allocation method for a multi-machine system, wherein the multi-machine system includes a host and multiple slaves, wherein the multiple slaves are connected to the host, and each of the slaves is provided with a charge-discharge circuit, wherein the charge-discharge circuit has a characteristic of non-fixed charge-discharge power, such as Figure 1As shown, the method specifically comprises the following steps:

[0055] S101. Multiple slave devices execute the same power management logic.

[0056] In the embodiment of the present invention, when it is necessary to assign an ID to a slave, the host can control multiple slaves to execute the same power management logic, ensuring that the evaluation parameters of the power management logic executed by each slave are obtained when other variables are the same.

[0057] S102: After the slave executes the power management logic, it obtains evaluation parameters of executing the power management logic.

[0058] In the embodiment of the present invention, after executing the power management logic, the slave device obtains the evaluation parameter of executing the power management logic.

[0059] Exemplarily, in some embodiments of the present invention, the power management logic is that the charge and discharge circuit of the slave machine charges from the same power to a first preset value or discharges to a second preset value or a preset number of charge and discharge cycles, and the evaluation parameter is the execution time. Exemplarily, the first preset value can be any value between 80% power and 100% power, and the second preset value can be any value between 10% power and 20% power. The evaluation parameter is the charging time taken by the charge and discharge circuit of each slave machine to charge from the same power to the first preset value, or the discharge time taken by the charge and discharge circuit of each slave machine to discharge from the same power to the second preset value, or the cycle time taken by the charge and discharge circuit of each slave machine to go through a preset number of charge and discharge cycles from the same power.

[0060] Exemplarily, in some other embodiments of the present invention, the power management logic is that the charge and discharge circuit of the slave machine charges the same amount of power for a first preset time or discharges for a second preset time or charges and discharges for a third preset time, and the evaluation parameter is the current power, which is the power after the power management logic is executed.

[0061] S103. Based on the evaluation parameters, the host allocates an ID to the slave.

[0062] In some embodiments of the present invention, the slave calculates characteristic information characterizing the slave ID based on evaluation parameters, and then sends the characteristic information to the host in the form of an ID allocation request. After receiving the ID allocation request, the host determines the slave ID based on the characteristic information, and the slave sends ID allocation response information to allocate an ID to the slave, and the ID allocation response information includes the slave ID.

[0063] In other embodiments of the present invention, the slave sends an ID allocation request characterized by evaluation parameters to the host, the host determines the ID of the slave based on the evaluation parameters in the received ID allocation request, the host sends ID allocation response information to the slave to allocate an ID to the slave, and the ID allocation response information includes the ID of the slave.

[0064] The present invention provides a slave ID allocation method for a multi-machine system, wherein the multi-machine system includes a host and multiple slaves, wherein the slaves are provided with a charge-discharge circuit, and the charge-discharge circuit has the characteristic that the charge-discharge power is not fixed. When multiple slaves execute the same power management logic, since the charge-discharge circuit has the characteristic that the charge-discharge power is not fixed, the evaluation parameters for executing the power management logic will be different, and thus the IDs generated based on different evaluation parameters will also be different. The present invention utilizes the characteristic that the charge-discharge power of the original charge-discharge circuit of each slave is not fixed, and determines the ID of the slave through the difference in the evaluation parameters for executing the power management logic of each slave, without setting different hardware features for each slave, without requiring an additional central server or a complex communication mechanism, thereby reducing the cost of the multi-machine system.

[0065] It is understandable that there are many reasons why the charging and discharging circuit has the characteristic of non-fixed charging and discharging power. First, the charging and discharging circuit may be in different environmental conditions (temperature, humidity, etc.) when charging and discharging. The environmental conditions will cause fluctuations in the charging and discharging power. At the same time, the working efficiency of the components will not always remain constant. In addition, the marking parameters of the charging and discharging circuits of each slave may be the same, but due to production process reasons, the marking parameters are not completely equal to the actual parameters, that is, the actual parameters of the charging and discharging circuits of each slave are not exactly the same, which makes the charging power of the charging and discharging circuits of each slave different.

[0066] In order to enable those skilled in the art to more clearly understand the technical solution of the present invention, the solution of the present invention will be described below through specific embodiments. Exemplarily, in this embodiment, the power management logic is that the charging and discharging circuits of the slaves are charged from the same power to the first preset value, and the evaluation parameter is the charging time taken for the charging and discharging circuits of each slave to charge from the same power to the first preset value as an example. Other power management logic and evaluation parameter solutions can refer to the solution of this embodiment, and the embodiments of the present invention will not be repeated here.

[0067] Figure 2 A flowchart of another method for allocating slave IDs in a multi-machine system provided by the present invention is shown in FIG. Figure 2 As shown, the slave ID allocation method of the multi-machine system includes:

[0068] S201. Multiple slave devices execute the same power management logic.

[0069] In an embodiment of the present invention, when the multi-machine system is powered on, the master sends a broadcast signal to all slaves at a preset interval, and the slave starts to execute the power management logic when it receives the broadcast signal for the first time. Exemplarily, the charge and discharge circuits of each slave start charging from the same power. Exemplarily, the charge and discharge circuit can be a circuit including an electrolytic capacitor, and charging the charge and discharge circuit of the slave is charging the electrolytic capacitor.

[0070] S202: The slave device obtains the charging time of the charging and discharging circuit.

[0071] In an embodiment of the present invention, the slave obtains the charging time of the charge-discharge circuit to charge to a first preset value. Exemplarily, a detection circuit is provided inside the slave for detecting the voltage of the charge-discharge circuit. When the voltage of the charge-discharge circuit reaches the first preset value, it is determined that the charging of the charge-discharge circuit is completed. The slave will start timing from the first receipt of the broadcast signal to the time when it is determined that the charging of the charge-discharge circuit is completed as the charging time of the charge-discharge circuit. It should be noted that the marking parameters of the charge-discharge circuits of each slave may be the same. When the marking parameters are not completely equal to the actual parameters due to production process reasons, that is, the charge-discharge circuits of each slave have the characteristic of non-fixed charge-discharge power, the actual parameters of the charge-discharge circuits of each slave are not exactly the same, which makes the charging time of the charge-discharge circuits of each slave different.

[0072] S203: The slave calculates the interval time for sending ID allocation requests to the host according to the charging time.

[0073] As mentioned above, the charging time of the charging and discharging circuits of each slave is different. Therefore, in an embodiment of the present invention, the slave can calculate the interval time for sending an ID allocation request to the host according to the charging time, and send the ID allocation request to the host after the interval time. When the host receives the ID allocation request, it determines the ID of the slave according to the receiving order of the received ID allocation requests.

[0074] Exemplarily, in some embodiments of the present invention, the slave calculates the interval time for sending an ID allocation request to the host according to the charging time, including the following sub-steps:

[0075] S2031. Calculate the sequence number of sending ID allocation requests to the host based on the charging duration and the total number of slaves.

[0076] In an embodiment of the present invention, the sequential number of ID allocation requests sent by the slave to the host is related to the charging time of the slave and the total number of slaves in the multi-machine system. Therefore, the charging time of the slave can be dimensionless in advance, and the sequential number of ID allocation requests sent to the host can be calculated based on the dimensionless value of the charging time and the total number of slaves.

[0077] In some embodiments of the present invention, the charging time is converted into a dimensionless value that is one digit greater than the total number of slaves, the remainder of the dimensionless value and the total number of slaves is calculated, and the remainder is added by 1 to obtain the sequence number of ID allocation requests sent by the slave to the host.

[0078] Exemplarily, in a specific embodiment of the present invention, the total number of slaves in a multi-machine system is 30, and the charging time of the slaves is usually tens of milliseconds. Assuming that the charging time of one of the slaves is 54.2 ms, the charging time is converted into a dimensionless value 542 which is one digit larger than the total number of slaves. The dimensionless value 542 is divided by the total number 30, and the remainder is 2. Then the sequence number of the ID allocation request sent by the slave to the host is 2+1=3.

[0079] S2032. Calculate the product of the sequence number and the preset time length to obtain the interval time for the slave to send an ID allocation request to the master.

[0080] In an embodiment of the present invention, the product of the sequence number and the preset duration is calculated to obtain the interval time for the slave to send an ID allocation request to the host. The interval time is based on the first time the slave receives a broadcast signal from the host when the multi-machine system is powered on, and the preset time is greater than the charging time of any charge and discharge circuit. In an embodiment of the present invention, when the multi-machine system is powered on, the host sends a broadcast signal to all slaves at the same time, that is, all slaves receive the broadcast signal at the same time. Exemplarily, the preset duration is 100ms, and the sequence number of a slave sending an ID allocation request to the host calculated in the aforementioned steps is 3, then the interval time for the slave to send an ID allocation request to the host is 300ms, that is, the ID allocation request is sent to the host 300ms after receiving the initialization signal or the broadcast signal.

[0081] S204: The slave sends an ID allocation request to the master after an interval.

[0082] In an embodiment of the present invention, the slave sends an ID allocation request to the master after an interval. For example, if the interval for a slave to send an ID allocation request to the master is calculated to be 300ms in the aforementioned steps, the slave sends an ID allocation request to the master after receiving an initialization signal or 300ms after receiving a broadcast signal.

[0083] S205. When receiving the ID allocation request, the host determines the receiving order of the received ID allocation request.

[0084] In an embodiment of the present invention, when receiving the ID allocation request, the host determines the order of receiving the received ID allocation request. Exemplarily, in some embodiments of the present invention, the host can determine the order of receiving according to the time sequence of the received ID allocation request. In other embodiments of the present invention, the ID allocation request includes the sequence number calculated in the above steps, and the sequence number is the order of receiving the ID allocation request received by the host.

[0085] S206: The host determines the ID of the slave based on the order in which the received ID allocation requests are received.

[0086] In an embodiment of the present invention, the host determines the ID of the slave based on the order of receiving the received ID allocation request. For example, if the order of receiving the ID allocation request of a slave received by the host is 3, the host determines the ID of the slave to be 03.

[0087] S207: The host sends an ID allocation response message to the slave to allocate an ID to the slave.

[0088] In the embodiment of the present invention, after the host determines the ID of the slave, it immediately sends ID allocation response information to the slave, and the ID allocation response information includes the ID of the slave.

[0089] In some embodiments of the present invention, there may be a situation where the charging time of two or more slaves is very close, resulting in the same interval time for the two or more slaves to send ID allocation requests to the host, and the two or more slaves send ID allocation requests to the host at the same time. In response to this situation, when the host receives ID allocation requests from at least two target slaves at the same time, it determines that there is a conflict in the IDs of at least two target slaves, and suspends sending ID allocation response information to the target slaves.

[0090] After the host sends an ID allocation response message to other slaves except the target slave, it determines that other slaves except the target slave have been allocated IDs, the current round of ID allocation ends, and the next round of ID allocation begins.

[0091] In the next round of ID allocation, when the charge and discharge circuit is controlled to discharge and recover to the initial condition for executing the power management logic, the step of executing the same power management logic on multiple slaves is returned until all slaves have been assigned IDs, wherein the slaves that have been assigned IDs will no longer participate in the next round of ID allocation.

[0092] Exemplarily, the host allocates IDs to the slaves in a carousel manner, and the host enters the next round of ID allocation after each round of ID allocation, waiting to receive an ID allocation request, and repeats this cycle until all slaves have been allocated IDs. Exemplarily, when the host does not receive an ID allocation request from a slave in consecutive preset rounds (e.g., 5 rounds) of ID allocation, it is determined that all slaves have been allocated IDs.

[0093] After the slave sends an ID allocation request to the host after an interval, it determines whether it has received the ID allocation response information sent by the host. If so, the slave determines that the ID allocation is successful; if not, the slave determines that the ID allocation has failed, and controls the charge and discharge circuit to discharge back to meet the initial conditions for executing the power management logic, and returns to the step of executing the same power management logic on multiple slaves until all slaves have been assigned IDs, wherein the slaves that have been assigned IDs will no longer participate in the next round of ID allocation.

[0094] The present invention further provides a multi-machine system, which is used to execute the slave ID allocation method of the multi-machine system provided by any of the aforementioned embodiments of the present invention. Figure 3 A schematic diagram of the structure of a multi-machine system provided by the present invention, Figure 4 A schematic diagram of the structure of a slave provided by the present invention is shown in FIG. Figure 3 , 4 As shown, the multi-machine system includes a host 100 and multiple slaves 200, the slaves 200 include a controller 210 and a charge-discharge circuit 220, the charge-discharge circuit 220 of each slave 200 has a characteristic of non-fixed charge-discharge power, the controller 210 is connected to the host 100, and the charge-discharge circuit 220 is connected to the controller 210. Exemplarily, multiple slaves 200 are cascaded and connected to the host 100.

[0095] For example, Figure 4 As shown, the charge and discharge circuit 220 includes a capacitor EC1, a first resistor R1 and a second resistor R2, the first end of the first resistor R1 is connected to the first pin PIN1 of the controller 210, the second end of the first resistor R1 is connected to the second pin PIN2 of the controller 210, the first end of the capacitor EC1 and the second end of the second resistor R2 respectively, the second end of the capacitor EC1 is grounded, and the second end of the second resistor R2 is grounded. During the charging process of the charge and discharge circuit 220, the capacitor EC1 is charged through the first resistor R1, and during the discharging process of the charge and discharge circuit 220, the capacitor EC1 is discharged through the second resistor R2.

[0096] In some embodiments of the present invention, the slave 200 is a water heater, the water inlet W1 of the water heater is connected to the water inlet main pipeline through the water inlet pipe, the water outlet W2 of the water heater is connected to the corresponding water end of the water heater through the water outlet pipe, and the air inlet G of the water heater is connected to the air inlet main pipeline through the air inlet pipe. Exemplarily, the water heater can be a gas water heater, an electric water heater or a water heater with multiple heat sources, which is not limited in the embodiments of the present invention.

[0097] Figure 5 A schematic diagram of the structure of an electronic device provided by the present invention, the electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0098] like Figure 5 As shown, the electronic device includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0099] A number of components in the electronic device are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0100] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the method executed by the host or slave in the slave ID allocation method of the multi-machine system.

[0101] In some embodiments, the slave ID allocation method for a multi-machine system may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the slave ID allocation method for the multi-machine system described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method executed by the master or slave in the slave ID allocation method for the multi-machine system by any other appropriate means (e.g., by means of firmware).

[0102] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0103] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0104] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an 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.

[0105] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0106] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0107] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0108] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements a method executed by a host or a slave in a slave ID allocation method for a multi-machine system provided in any embodiment of the present application.

[0109] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0110] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0111] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for allocating slave IDs in a multi-machine system, characterized in that: The multi-machine system includes a host and multiple slaves, the multiple slaves are all provided with the same charging and discharging circuit, the charging and discharging circuit has the characteristic of non-fixed charging and discharging power, and the method includes: The multiple slaves execute the same power management logic; After the slave executes the power management logic, obtaining evaluation parameters of the execution of the power management logic; Based on the evaluation parameters, the master assigns an ID to the slave.

2. The slave ID allocation method of a multi-machine system according to claim 1, characterized in that: The power management logic is charging to a first preset value or discharging to a second preset value or a preset number of charge and discharge cycles, and the evaluation parameter is execution time.

3. The slave ID allocation method of a multi-machine system according to claim 1, characterized in that: The power management logic is the first preset time for charging, the second preset time for discharging, or the third preset time for the charge and discharge cycle, and the evaluation parameter is the current power.

4. The slave ID allocation method of a multi-machine system according to claim 1, characterized in that: Based on the evaluation parameters, the host assigns an ID to the slave, including: The slave calculates the interval time for sending ID allocation request to the host according to the evaluation parameter; The slave sends an ID allocation request to the host after the interval time; When receiving the ID allocation request, the host determines a receiving order of the received ID allocation request; The host determines the ID of the slave based on the order in which the received ID allocation requests are received; The host sends ID allocation response information to the slave to allocate an ID to the slave, and the ID allocation response information includes the ID of the slave.

5. The slave ID allocation method of a multi-machine system according to claim 4, characterized in that: Calculating the interval time of sending the ID allocation request to the host according to the evaluation parameter includes: Calculate the order number of sending ID allocation requests to the master based on the evaluation parameter and the total number of the slaves; The product of the sequence number and the preset time length is calculated to obtain the interval time for the slave to send the ID allocation request to the host, wherein the interval time is based on the broadcast signal received by the slave from the host.

6. The slave ID allocation method of a multi-machine system according to claim 5, characterized in that: Calculating the order number of sending the ID allocation request to the master based on the evaluation parameter and the total number of the slaves includes: Converting the evaluation parameter into a dimensionless value having one digit greater than the total number of the slaves; Calculating the remainder of the dimensionless value and the total number of the slaves; The remainder is added by 1 to obtain the sequence number of the ID allocation request sent by the slave to the master.

7. The method for allocating slave IDs of a multi-machine system according to any one of claims 1 to 6, characterized in that: Also includes: When the host simultaneously receives the ID allocation requests sent by at least two target slaves, it determines that there is a conflict between the IDs of the at least two target slaves, and does not send the ID allocation response information to the at least two target slaves.

8. The slave ID allocation method of a multi-machine system according to claim 7, characterized in that: Also includes: After the host sends the ID allocation response information to the slaves other than the target slave, it determines that the slaves other than the target slave have been allocated IDs, the current round of ID allocation ends, and the next round of ID allocation begins; The target slave, based on not receiving the ID allocation response information within the set time, controls the charge and discharge circuit to discharge or charge back to meet the initial conditions for executing the power management logic, and then returns to execute the same power management logic. After executing the power management logic, an evaluation parameter for executing the power management logic is obtained, and the interval time for sending an ID allocation request to the host is calculated according to the evaluation parameter, until all slaves have been assigned an ID, wherein the slave that has been assigned an ID no longer participates in the next round of ID allocation.

9. The slave ID allocation method of a multi-machine system according to claim 8, characterized in that: When the host does not receive an ID allocation request from the slave in consecutive preset rounds of ID allocation, it is determined that all the slaves have been allocated IDs.

10. The method for allocating slave IDs in a multi-machine system according to any one of claims 1 to 6, characterized in that: The multiple slaves execute the same power management logic, including: After the multi-machine system is powered on, the host sends a broadcast signal to the multiple slaves; The multiple slave devices execute the same power management logic based on the first reception of the broadcast signal.

11. The method for allocating slave IDs in a multi-machine system according to any one of claims 1 to 3, characterized in that: Based on the evaluation parameters, the host assigns an ID to the slave, including: The slave sends an ID allocation request characterized by evaluation parameters to the host; The host determines the ID of the slave based on the evaluation parameter in the received ID allocation request; The host sends ID allocation response information to the slave to allocate an ID to the slave, and the ID allocation response information includes the ID of the slave.

12. A multi-machine system, characterized in that: Used to execute the slave ID allocation method of a multi-machine system according to any one of claims 1 to 11, the multi-machine system comprising a host and a plurality of slaves, the slave being a water heater, the plurality of slaves each comprising a controller and a charge-discharge circuit, the charge-discharge circuit having a characteristic of unfixed charge-discharge power, the controller being connected to the host, and the charge-discharge circuit being connected to the controller; The charge and discharge circuit includes a capacitor, a first resistor and a second resistor. The first end of the first resistor is connected to the first pin of the controller, and the second end of the first resistor is respectively connected to the second pin of the controller, the first end of the capacitor and the second end of the second resistor. The second end of the capacitor is grounded, and the second end of the second resistor is grounded.