Master-slave communication method, reactive power compensation system and storage medium

In the reactive power compensation system, the slave capacitor receives the broadcast information from the host capacitor and then determines the transmission permission time and information transmission moment, and responds in sequence, which solves the problem of low communication efficiency in the existing technology and improves the communication efficiency and determination of the system. sex.

CN118381043BActive Publication Date: 2024-09-06DELIXI ELECTRIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410804797.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-06
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

In the reactive power compensation system based on the ModBus communication protocol of the RS485 physical bus, when the host capacitor reads the operating information of the slave capacitor and controls the switching operation through polling, the communication efficiency is low, resulting in low system efficiency.

Method used

After the slave capacitor receives the first information broadcast by the host capacitor, it determines the transmission permission time and the information sending moment, and sends response information to the host capacitor in sequence to avoid information conflicts. The host capacitor does not need to repeatedly ask through polling, and the slave capacitor can accurately determine the reception state.

Benefits of technology

The communication efficiency of the reactive power compensation system is improved, the time required for the host capacitor to obtain the current status of the slave capacitor is shortened, the time for repeated inquiries of the host capacitor is saved, and the certainty of the system is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118381043B
    Figure CN118381043B
Patent Text Reader

Abstract

The present application provides a master-slave communication method, a reactive power compensation system and a storage medium. The method includes: a slave capacitor receives a first message broadcasted by a host capacitor, and the first message is used by the slave capacitor to perform a corresponding operation. The slave capacitor determines a sending permission time based on the first information, and the sending permission time is used to indicate the length of time required for the slave capacitor to send information to the host capacitor. The slave capacitor determines the information sending time based on the sending permission time and the order in which the slave capacitor sends information among multiple slave capacitors. From the information sending time, the slave capacitor sends a second message to the host capacitor, and the second message is used to indicate that the slave capacitor has performed a corresponding operation. Thereby improving the communication efficiency of the reactive power compensation system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a master-slave communication method, a reactive power compensation system and a storage medium. Background Art

[0002] The ModBus communication protocol based on the RS485 physical bus is a commonly used communication method in industry. This protocol is simple to implement and has high reliability, and is widely used in a variety of industrial control sites. In the reactive power compensation system using the above communication protocol, a host capacitor and multiple slave capacitors are included.

[0003] In the related art, when it is necessary to read the operation information from the slave capacitor, the host capacitor usually reads it through a polling read operation. When it is necessary to control the slave capacitor to be put into the grid or removed from the grid, the host capacitor usually controls the slave capacitor to perform the switching operation by sending broadcast information.

[0004] However, the polling read operation requires the host capacitor to traverse multiple slave capacitors in turn, and multiple slave capacitors respond in turn. It takes a lot of time for the host capacitor to learn the operating information of all slave capacitors. Moreover, the slave capacitor will not respond to the broadcast information. After the host capacitor controls the slave capacitor to perform the switching operation, if it wants to know the current switching status of the slave capacitor, it needs to perform the polling read operation on multiple slave capacitors again, resulting in low communication efficiency of the system. Summary of the invention

[0005] The present application provides a master-slave communication method, a reactive power compensation system and a storage medium to solve the problem of low communication efficiency of the reactive power compensation system and improve the communication efficiency of the reactive power compensation system.

[0006] In a first aspect, the present application provides a master-slave communication method, which is applied to a reactive power compensation system, wherein the reactive power compensation system includes a master capacitor and a plurality of slave capacitors, and the method includes:

[0007] The slave capacitor receives first information broadcasted by the host capacitor, and the first information is used by the slave capacitor to perform corresponding operations.

[0008] The slave capacitor determines a sending permission time according to the first information, where the sending permission time is used to indicate a time length required for the slave capacitor to send information to the host capacitor.

[0009] The slave capacitor determines the information transmission time according to the transmission allowed time and the order in which the slave capacitor transmits information among a plurality of slave capacitors.

[0010] The slave capacitor sends second information to the host capacitor at the time of sending the information, where the second information is used to indicate that the slave capacitor has performed a corresponding operation.

[0011] Through the master-slave communication method provided in the first aspect, the slave capacitor receives the first information broadcasted by the host capacitor, and the first information is used for the slave capacitor to perform a corresponding operation, so that each of the multiple slave capacitors can obtain the first information, and perform a corresponding operation according to the first information and then respond. The slave capacitor determines the transmission permission time according to the first information, and the transmission permission time is used to indicate the length of time required for the slave capacitor to send information to the host capacitor, so that each slave capacitor can know the length of time required to send information to the host capacitor. The slave capacitor determines the information sending time according to the transmission permission time and the order in which the slave capacitor sends information among the multiple slave capacitors, so that each slave capacitor can know their own information sending time, and each slave capacitor can respond in turn according to their own information sending time. The slave capacitor sends the second information to the host capacitor from the information sending time, and the second information is used to indicate that the slave capacitor has performed a corresponding operation. Based on this, the multiple slave capacitors send the second information to the host capacitor in turn, so that the slave capacitor can respond to the first information broadcasted by the host capacitor in turn to avoid information conflicts. The host capacitor can accurately determine whether the slave capacitor has received the first information through the second information. The host capacitor does not need to repeatedly inquire each slave capacitor by polling, which saves the time of repeated inquiries of the host capacitor and improves the communication efficiency of the reactive power compensation system.

[0012] In a possible design, the slave capacitor determines the transmission allowed time according to the first information, including:

[0013] The slave capacitor determines the number of information characters according to the first information.

[0014] The slave capacitor determines the allowed sending time through formula one according to the number of information characters, the sending time of a single character and the fault tolerance time, or the slave capacitor determines the allowed sending time through formula two according to the number of information characters and the sending time of a single character.

[0015] Among them, formula 1 is: .

[0016] in, Allow time for sending, is the number of information characters, The duration for sending a single character. The fault tolerance time.

[0017] Among them, formula 2 is: .

[0018] in, Allow time for sending, is the number of information characters, The duration for sending a single character.

[0019] In a possible design, the type of the first information is a write type, and the slave capacitor determines the number of information characters according to the first information, including:

[0020] The slave capacitor determines the number of characters of the first information as the number of characters of the information.

[0021] In a possible design, the first information carries a write function code, and the write function code is used to indicate that the type of the first information is a write type. The slave capacitor determines the number of information characters according to the first information, including:

[0022] The slave capacitor determines the number of information characters according to the write function code and the character number table, and the character number table is used to indicate the relationship between the type of information and the number of information characters.

[0023] In a possible design, the first information carries a read function code and a data frame length, the read function code is used to indicate that the type of the first information is a read type, and the data frame length is used to indicate the number of characters in the data frame of the information, and the slave capacitor determines the number of information characters according to the first information, including:

[0024] The slave capacitor determines the number of information characters according to the read function code, the data frame length and the character number table, where the character number table is used to indicate the relationship between the type of information and the number of information characters.

[0025] In a possible design, the first information is specifically used for the host capacitor to control the switching state of the slave capacitor, or the first information is specifically used for the host capacitor to request the operating information of the slave capacitor.

[0026] In one possible design, the method further includes:

[0027] The slave capacitor determines the order in which the slave capacitor sends information among the plurality of slave capacitors according to the address of the slave capacitor.

[0028] In one possible design, the method further includes:

[0029] The slave capacitor determines second information according to the first information, and the second information carries operation information of the slave capacitor.

[0030] In a second aspect, the present application provides a reactive power compensation system, comprising: a power grid, a host capacitor, and a plurality of slave capacitors for executing the master-slave communication method of the first aspect and any possible design of the first aspect.

[0031] The host capacitor is electrically connected to the power grid, and the host capacitor is communicatively connected to each of the plurality of slave capacitors.

[0032] In a third aspect, the present application provides a master-slave communication device, a module for executing the master-slave communication method in the first aspect and any possible design of the first aspect.

[0033] In a fourth aspect, the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer executable program or instructions, and when the processor executes the computer executable program or instructions, it can implement a master-slave communication method as in the first aspect and any possible design of the first aspect.

[0034] In a fifth aspect, the present application provides an electronic device, comprising a processor, which, when executing a computer executable program or instruction in a memory, implements a master-slave communication method as in the first aspect and any possible design of the first aspect.

[0035] In a sixth aspect, the present application provides a computer-readable storage medium having a computer-executable program or instruction stored thereon. When the computer-executable program or instruction is executed by a processor, a master-slave communication method as in the first aspect and any possible design of the first aspect is implemented.

[0036] In the seventh aspect, the present application provides a computer program product, including: execution instructions, the execution instructions are stored in a readable storage medium, at least one processor of an electronic device can read the execution instructions from the readable storage medium, and at least one processor executes the execution instructions to enable the electronic device to implement a master-slave communication method as in the first aspect and any possible design of the first aspect.

[0037] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 A schematic structural diagram of a reactive power compensation system provided in one embodiment of the present application.

[0040] Figure 2 A flowchart of a master-slave communication method provided in one embodiment of the present application.

[0041] Figure 3 A schematic diagram of the structure of first information provided in one embodiment of the present application.

[0042] Figure 4 A schematic diagram of the structure of another type of first information provided in an embodiment of the present application.

[0043] Figure 5 A schematic diagram of the sequence in which multiple slave capacitors send information according to an embodiment of the present application.

[0044] Figure 6 A schematic diagram of the structure of second information provided in one embodiment of the present application.

[0045] Figure 7 A schematic diagram of the structure of another type of second information provided in an embodiment of the present application.

[0046] Figure 8 A flow chart of a method for determining a sending allowed time provided in an embodiment of the present application.

[0047] Fig. 9 A flowchart of another method for determining the allowed time for sending provided in an embodiment of the present application.

[0048] Fig.10 A schematic diagram of the structure of a master-slave communication device provided in one embodiment of the present application.

[0049] Fig.11 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.

[0050] Fig.12 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0051] In this application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c alone can mean: a alone, b alone, c alone, a and b in combination, a and c in combination, b and c in combination, or a, b, and c in combination, where a, b, and c can be single or multiple. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0052] The directions or positional relationships indicated by terms such as "center", "longitudinal", "lateral", "up", "down", "left", "right", "front", and "back" are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present application and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present application.

[0053] The terms "connected" and "connected" should be understood in a broad sense. For example, the "connected" or "connected" of a circuit structure can refer to not only physical connection, but also electrical connection or signal connection. For example, it can be directly connected, that is, physically connected, or indirectly connected through at least one intermediate element, as long as the circuit is connected, or it can be the internal connection of two elements; signal connection can refer to signal connection through a circuit or through a media medium, such as radio waves. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0054] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase "embodiments" in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0055] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0056] In the reactive power compensation system, there are usually the following two communication modes between the master capacitor and the slave capacitor.

[0057] In the first, the master capacitor inquires and the slave capacitor responds.

[0058] For example, the master capacitor reads data in registers of all slave capacitors, the master capacitor performs a polling read operation on each slave capacitor in turn, and the slave capacitor responds based on the polling read operation of the master capacitor.

[0059] In the second case, the host capacitor sends a broadcast command, the slave capacitor receives the broadcast command, and performs corresponding operations according to the broadcast command, and the slave capacitor does not respond.

[0060] For example, the master capacitor controls the slave capacitor to be connected to the grid or removed from the grid. The master capacitor sends a broadcast command, the slave capacitor receives the broadcast command, and is connected to the grid or removed from the grid according to the instruction of the broadcast command.

[0061] However, in the first method mentioned above, the host capacitor needs to query each slave capacitor in turn according to the address of the slave capacitor, and the slave capacitor responds according to the address of the slave capacitor. The host capacitor needs to spend a lot of time to read the data in the registers of all slave capacitors, resulting in low communication efficiency.

[0062] In the second method mentioned above, after the slave capacitor is put into the power grid or removed from the power grid according to the instructions of the broadcast command, it will not respond to the broadcast command. Therefore, the host capacitor cannot know whether the slave capacitor has correctly received the broadcast command, and cannot know the current state of the slave capacitor. The host capacitor needs to obtain the current state of the slave capacitor again through the first method mentioned above, which increases the uncertainty of the reactive power compensation system and leads to low communication efficiency.

[0063] Based on the above problems, exemplarily, the present application provides a master-slave communication method, a reactive power compensation system and a storage medium. After each slave capacitor receives a broadcast command sent by a host capacitor, the slave capacitor determines the time required for the slave capacitor to send a response message to the host capacitor according to the broadcast command. Each slave capacitor determines the time to send the response message to the host capacitor according to the time and its own address. Each slave capacitor sends the response message to the host capacitor in sequence according to its corresponding time of sending the response message, so that the slave capacitor can respond to the broadcast command sent by the host capacitor in sequence, shortening the time required for the host capacitor to obtain the current state of the slave capacitor, improving communication efficiency, and enabling the host capacitor to determine whether the slave capacitor has correctly received the broadcast command without having to obtain the current state of the slave capacitor again through polling reading, which helps to improve communication efficiency.

[0064] The master-slave communication method provided in the present application is applied to a reactive power compensation system, the reactive power compensation system includes a master capacitor and a plurality of slave capacitors, the master-slave communication method is executed by the slave capacitor, or, is executed by a master-slave communication device in the slave capacitor. The master-slave communication device can be implemented by a combination of software and / or hardware.

[0065] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of a reactive power compensation system provided in one embodiment of the present application. Figure 1 As shown, the reactive power compensation system of the present application may include: a host capacitor 11 , a plurality of slave capacitors 12 and a power grid 13 .

[0066] in, Figure 1 Taking the number of slave capacitors as 3 as an example, the present application does not limit the number of slave capacitors.

[0067] The slave capacitor 12 may be an intelligent capacitor or a non-intelligent capacitor. The host capacitor 11 may be an intelligent capacitor, or a combination of a reactive power compensation controller and a non-intelligent capacitor. Of course, when the slave capacitor 12 is an intelligent capacitor, the slave capacitor may also be used as a host capacitor, and this application does not limit this.

[0068] When the host capacitor 11 is a combination of a reactive compensation controller and a non-intelligent capacitor, the user can intuitively observe the switching state of the host capacitor or the slave capacitor and the specific state of various parameters through the display screen in the reactive compensation controller.

[0069] The host capacitor 11 is electrically connected to the power grid 13 .

[0070] The plurality of slave capacitors 12 are electrically connected to the power grid 13 respectively.

[0071] The host capacitor 11 is communicatively connected to a plurality of slave capacitors 12 .

[0072] Among them, multiple slave capacitors 12 can be connected to each other in communication. Figure 1 Not shown in FIG.

[0073] For example, the host capacitor 11 and the slave capacitor 12 may be directly or indirectly connected via a wired or wireless communication method. The slave capacitors 12 may be directly or indirectly connected via a wired or wireless communication method.

[0074] Among them, wired communication methods may be coaxial cables, optical fibers, digital subscriber lines (DSL), etc. Wireless communication methods may be Bluetooth, infrared, wireless (Wi-Fi), microwaves, etc.

[0075] In some specific examples, the host capacitor 11 and the plurality of slave capacitors 12 may communicate with each other via a ModBus communication protocol based on an RS485 physical bus.

[0076] In some specific examples, RJ45 (Registered Jack 45) interfaces are provided on the host capacitor 11 and the plurality of slave capacitors 12. The host capacitor 11 and the slave capacitors 12 can communicate with each other through the RJ45 interfaces according to the RS-485 protocol.

[0077] Below, the following embodiments of the present application will be based on Figure 1 As an example, the reactive power compensation system with the structure shown in the figure is combined with Figures 2 to 9 , the master-slave communication method provided by this application is elaborated in detail.

[0078] See also Figure 2 , Figure 2 A flow chart of a master-slave communication method provided in one embodiment of the present application. Figure 2 As shown, the method includes:

[0079] S101. A slave capacitor receives first information broadcasted by a host capacitor.

[0080] The first information is used to execute a corresponding operation from the machine capacitor.

[0081] Among them, the first information has multiple forms.

[0082] In some examples, the first information is used for the master capacitor to control a switching state of the slave capacitor.

[0083] The first information can be used by the master capacitor to control the slave capacitor to be removed from the power grid, or the first information can be used by the master capacitor to control the slave capacitor to be put into the power grid. Thus, the slave capacitor can be removed from the power grid according to the instruction of the first information, or the slave capacitor can be put into the power grid according to the instruction of the first information.

[0084] like Figure 3 As shown, the first information may include a broadcast address, a function code, a register code, a data area, and a cyclic redundancy check (CRC) code.

[0085] The broadcast address may be, for example, 0x00.

[0086] The function code is used to identify the operation that the host capacitor needs to perform.

[0087] For example, the function code may be 0x06, indicating that the operation performed by the host capacitor is a write operation, the type of the first information is a write type, and the first information may be used by the host capacitor to control the switching state of the slave capacitor.

[0088] The register code is used to identify the register of the slave capacitor, that is, to which register of the slave capacitor the host capacitor needs to write data.

[0089] The data in the data area is the data that the host capacitor needs to write to the slave capacitor.

[0090] The CRC code is used for error detection to ensure that the slave capacitor receives the correct first information.

[0091] In other examples, the first information is used for the master capacitor to request the operating information of the slave capacitor.

[0092] The operation information of the slave capacitor may include operation parameters, operation status, fault information, etc.

[0093] The operating parameters may include voltage, current, temperature, and capacitance.

[0094] The operating state may include an on-state and a off-state. The on-state means that the slave capacitor is electrically connected to the power grid. The off-state means that the slave capacitor is disconnected from the power grid.

[0095] The fault information includes the tripping times of the slave capacitor, the fault type, etc.

[0096] like Figure 4 As shown, the first information may include a broadcast address, a function code, a register code, a data frame length, and a CRC code.

[0097] The function code is used to identify the operation that the host capacitor needs to perform.

[0098] For example, the function code may be 0x03, indicating that the operation performed by the host capacitor is a read operation, and the type of the first information is a read type. The first information may be used by the host capacitor to request the operation information of the slave capacitor.

[0099] The register code is used to identify the register of the slave capacitor, that is, from which register of the slave capacitor the master capacitor needs to read data.

[0100] The data frame length is used to indicate the length of data that the host capacitor needs to read from the register of the slave capacitor. For example, the data frame length may be 0x02, indicating that the host capacitor needs to read two bytes of data from the register of the slave capacitor.

[0101] Based on this, after receiving the first information broadcasted by the master capacitor, each slave capacitor in the reactive power compensation system needs to respond to the first information, and each slave capacitor can determine the time required to respond to the first information based on the first information.

[0102] S102: The slave capacitor determines a sending allowed time according to the first information.

[0103] The transmission allowed time is used to indicate the time required for the slave capacitor to send information to the host capacitor.

[0104] Since a plurality of slave capacitors need to respond to the first information, the slave capacitors need to know the time required for sending the response information to the host capacitor, thereby reserving a response time for each slave capacitor.

[0105] Thus, each slave capacitor can first determine the time required to send information to the master capacitor, ensuring that each slave capacitor has enough time to respond.

[0106] Specifically, the slave capacitor determines the number of information characters of the response information, and determines the transmission allowed time according to the number of information characters and the transmission time of a single character. The slave capacitor can send the response information to the host capacitor within the transmission allowed time.

[0107] The number of information characters of each of the plurality of slave capacitors is the same, and the transmission allowed time is the same.

[0108] The transmission allowed time is used to indicate the time required for the slave capacitor to send information to the host capacitor.

[0109] Based on this, the slave capacitor determines the transmission allowed time, and each slave capacitor can know how long it takes to send information to the master capacitor.

[0110] S103: The slave capacitor determines the information sending time according to the sending allowed time and the sequence in which the slave capacitor sends information among multiple slave capacitors.

[0111] Considering that if all slave capacitors respond at the same time, it may cause conflicting information from different slave capacitor responses, and the host capacitor cannot receive correct response information.

[0112] Based on this, the slave capacitors can be sorted to determine the order of response information of multiple slave capacitors. Multiple slave capacitors respond based on the order of response information, thereby avoiding conflicts in response information between multiple slave capacitors.

[0113] The slave capacitor may determine the order in which the slave capacitor sends information among multiple slave capacitors in a plurality of ways.

[0114] In some examples, the order in which the slave capacitors send information among the multiple slave capacitors may be the order in which the slave capacitors are located among the addresses of the multiple slave capacitors.

[0115] In other examples, the order in which the slave capacitor sends information among the multiple slave capacitors may be a preset order. When designing a reactive power compensation system, the order in which the multiple slave capacitors send information may be preset.

[0116] The slave capacitor may determine the information transmission time according to the transmission allowed time and the sequence in which the slave capacitor transmits information among a plurality of slave capacitors.

[0117] For example, the order in which multiple slave capacitors send information is slave capacitor 1, slave capacitor 2, and slave capacitor 3. Figure 5 As shown, the host capacitor broadcasts the first information, the slave capacitor 1 responds from time T0, after a transmission allowed time, the slave capacitor 2 responds from time T1, and after another transmission allowed time, the slave capacitor 3 responds from time T2.

[0118] Based on this, the slave capacitor determines the information sending time, each slave capacitor can know its own information sending time, and each slave capacitor can respond in turn according to its own information sending time.

[0119] S104. At the time when the slave capacitor sends the second information, the slave capacitor sends the second information to the master capacitor.

[0120] After the slave capacitor performs a corresponding operation based on the first information, when the information sending time arrives, the slave capacitor can send the second information to the host capacitor from the information sending time.

[0121] Based on this, multiple slave capacitors respond in sequence and send the second information to the host capacitor, so as to avoid multiple slave capacitors replying at the same time and avoid conflicts between the second information responded by different slave capacitors.

[0122] The second information is used to indicate that the slave capacitor has performed a corresponding operation.

[0123] For example, when the first information is used for the host capacitor to control the switching state of the slave capacitor, the second information is used to indicate that the slave capacitor has performed the switching operation. When the first information is used for the host capacitor to request the operation information of the slave capacitor, the second information is used to indicate the operation information of the slave capacitor.

[0124] Based on this, the plurality of slave capacitors sequentially send the second information to the master capacitor.

[0125] In an embodiment of the present application, a slave capacitor receives a first message broadcasted by a host capacitor, and the first message is used for the slave capacitor to perform a corresponding operation, so that each of the multiple slave capacitors can obtain the first message, and perform a corresponding operation according to the first message and then respond. The slave capacitor determines the transmission permission time according to the first message, and the transmission permission time is used to indicate the time required for the slave capacitor to send information to the host capacitor, so that each slave capacitor can know the time required to send information to the host capacitor. The slave capacitor determines the information transmission time according to the transmission permission time and the order in which the slave capacitor sends information among multiple slave capacitors, so that each slave capacitor can know their own information transmission time, and each slave capacitor can respond in turn according to their own information transmission time. The slave capacitor sends the second information to the host capacitor from the information transmission time, and the second information is used to indicate that the slave capacitor has performed the corresponding operation. Based on this, multiple slave capacitors send the second information to the host capacitor in turn, so that the slave capacitor can respond to the first information broadcasted by the host capacitor in turn to avoid information conflicts. The host capacitor can accurately determine whether the slave capacitor has received the first information through the second information. The host capacitor does not need to repeatedly inquire each slave capacitor by polling, which saves the time of repeated inquiries of the host capacitor and improves the communication efficiency of the reactive power compensation system.

[0126] Based on the above exemplary description, the slave capacitor may determine the second information by the following method.

[0127] The slave capacitor determines second information according to the first information, and the second information carries operation information of the slave capacitor.

[0128] Among them, the slave capacitor only needs to determine the second information before S104. The slave capacitor can first determine the time when the information is sent, that is, execute S101 to S103 first, and then determine the second information. The slave capacitor can also first determine the second information and then determine the time when the information is sent, that is, execute S101 to S103 again. This application does not limit the time when the slave capacitor determines the second information.

[0129] Among them, the second information has multiple forms.

[0130] In some examples, when the first information is used by the host capacitor to control the switching state of the slave capacitor, the slave capacitor writes the data in the data area indicated in the first information into the register indicated in the first information, thereby completing the switching operation. After completing the switching operation, the slave capacitor can determine the second information based on the first information.

[0131] The operation information of the slave capacitor carried by the second information is the switching state of the slave capacitor, and the second information is used to feedback that the slave capacitor has completed the switching operation according to the instruction of the first information.

[0132] like Figure 6 As shown, the first information includes a broadcast address, a function code, a register code, a data area, and a CRC code, and the second information may include a slave capacitor address, a function code, a register code, a data area, and a CRC code.

[0133] The address code in the second information is the address of the slave capacitor, and the register code is the same as the first information. The data area includes the data stored in the register after the switching operation is completed.

[0134] Thus, the slave capacitor sends the second information to the master capacitor, and when the master capacitor receives the second information, it can be determined that the slave capacitor has completed the switching operation according to the instruction of the first information.

[0135] In some other examples, when the first information is used by the host capacitor to request the operation information of the slave capacitor, the first information indicates which register of the slave capacitor the host capacitor needs to read several bytes of data from. After receiving the first information, the slave capacitor can determine the second information according to the first information.

[0136] The second information carries the data in the register indicated by the first information.

[0137] like Figure 7 As shown, the first information includes a broadcast address, a function code, a register code, a data frame length, and a CRC code, and the second information may include a slave capacitor address, a function code, a register code, a data area, and a CRC code.

[0138] The length of the data area is the length indicated by the data frame length. Figure 7 Taking the data frame length of 0x02 as an example, the length of the data area of ​​the second information is 4 bytes.

[0139] Based on the above exemplary description, the slave capacitor may determine the order in which the slave capacitor sends information among multiple slave capacitors by the following method.

[0140] The slave capacitor determines the order in which the slave capacitor sends information among the multiple capacitors according to the address of the slave capacitor.

[0141] Among them, the slave capacitor can determine the order in which the slave capacitor sends information among multiple slave capacitors before executing S104 each time, or the slave capacitor can determine the order in which the multiple slave capacitors send information before executing S101 to S104, and all the slave capacitors store the order in which the multiple slave capacitors send information in their respective corresponding memories, so that the slave capacitor can obtain the order in which the slave capacitor sends information among multiple slave capacitors from the memory before executing S104 each time.

[0142] The slave capacitor may determine the order in which the slave capacitor sends information among multiple slave capacitors in a plurality of ways.

[0143] In some examples, the order in which the slave capacitors send information among the multiple slave capacitors may be the order in which the slave capacitors are located among the addresses of the multiple slave capacitors.

[0144] Since the addresses of the slave capacitors are preset, each slave capacitor knows its position in the addresses of all slave capacitors, and the slave capacitor can determine the order in which the slave capacitor sends information among the multiple slave capacitors according to the order of the addresses of the multiple slave capacitors.

[0145] For example, the number of slave capacitors is 3, the address of slave capacitor 1 is 0x01, the address of slave capacitor 2 is 0x02, the address of slave capacitor 3 is 0x03, and the order of the addresses of multiple slave capacitors is 0x01, 0x02, and 0x03. Slave capacitor 1 can determine that the position of slave capacitor 1 among the addresses of all slave capacitors is the first, slave capacitor 2 can determine that the position of slave capacitor 2 among the addresses of all slave capacitors is the second, and slave capacitor 3 can determine that the position of slave capacitor 3 among the addresses of all slave capacitors is the third.

[0146] Based on this, the order in which multiple slave capacitors send information can be slave capacitor 1, slave capacitor 2, and slave capacitor 3, that is, slave capacitor 1 sends information first, slave capacitor 2 sends information second, and slave capacitor 3 sends information third.

[0147] The above example is based on the order in which the numerical values ​​of the addresses of the multiple slave capacitors are arranged from small to large. Of course, the order of the addresses of the multiple slave capacitors can also be that the numerical values ​​of the addresses of the multiple slave capacitors are arranged from large to small, and this application does not impose any limitation on this.

[0148] Based on the above example, when the order of the addresses of the multiple slave capacitors is that the numerical values ​​of the addresses of the multiple slave capacitors are arranged from large to small, the order of the addresses of the multiple slave capacitors is 0x03, 0x02, 0x01, and the order in which the multiple slave capacitors send information can be slave capacitor 3, slave capacitor 2, slave capacitor 1, that is, slave capacitor 3 sends information first, slave capacitor 2 sends information second, and slave capacitor 1 sends information third.

[0149] In other examples, the order in which the slave capacitor sends information among the multiple slave capacitors may be a preset order. When designing a reactive power compensation system, the order in which the multiple slave capacitors send information may be preset.

[0150] Based on the above exemplary description, in S102 , the slave capacitor may determine the transmission allowed time in a variety of ways.

[0151] Next, combine Figure 8 and Fig. 9 , a process of determining the sending allowed time according to the first information by the slave capacitor is elaborated in detail.

[0152] See also Figure 8 , Figure 8 A flow chart of a method for determining a sending allowed time provided in an embodiment of the present application. Figure 8 As shown, the method includes:

[0153] S201. The slave capacitor determines the number of information characters according to first information.

[0154] Among them, the slave capacitor can determine the number of information characters in a variety of ways.

[0155] The number of information characters is the number of characters of the information that the slave capacitor responds to the first information, that is, the number of characters of the second information. The number of information characters corresponding to each of the plurality of slave capacitors may be the same or different.

[0156] The slave capacitor may parse the first information to determine the type and specific content of the first information.

[0157] For example, when the function code in the first information is 0x06, the slave capacitor can determine that the first information is a write type, and the first information can be used by the host capacitor to control the switching state of the slave capacitor.

[0158] For another example, when the function code in the first information is 0x03, the slave capacitor may determine that the first information is used by the host capacitor to control the switching state of the slave capacitor.

[0159] Based on this, the slave capacitor can determine the number of information characters according to the type and specific content of the first information.

[0160] There are various situations for the number of information characters in the response information of the slave capacitor for different types of the first information.

[0161] In some examples, when the first information is of a write type, the number of information characters of the response information of the slave capacitor is a fixed number.

[0162] The number of information characters of the response information of the slave capacitor may be consistent with the first information, or the slave capacitor may determine the number of information characters of the response information of the slave capacitor according to a character number table and the type of the first information.

[0163] The character quantity table is used to indicate the relationship between the type of information and the number of information characters.

[0164] In other examples, when the first information is of a read type, the number of information characters of the response information of the slave capacitor needs to be determined according to the function code, data frame length and character quantity table of the first information.

[0165] The function code is used to indicate the type of information.

[0166] S202: The slave capacitor determines the transmission allowable time according to the number of information characters, the transmission time of a single character and the fault tolerance time by using Formula 1.

[0167] Formula 1;

[0168] in, Allow time for sending, is the number of information characters, The duration for sending a single character. The fault tolerance time.

[0169] The single character sending duration is a duration preset according to the baud rate and the structure of the information, and the single character sending duration may be pre-stored in the memory of each slave capacitor.

[0170] For example, the baud rate of the reactive power compensation system is 9600, and the information structure includes 1 start bit, 8 data bits, 1 stop bit, and 1 even parity bit. The sending time of one byte is (1+8+1+1) / 9600=0.00114583s=1.14583ms.

[0171] Among them, the fault tolerance time is used to increase the fault tolerance rate of the slave capacitor sending the second information. Adding the fault tolerance time can increase the allowed sending time, thereby reserving sufficient time for each slave capacitor to send the second information, avoiding the situation where the second information of one slave capacitor has not been sent yet, and the next slave capacitor has started sending the second information, which helps to ensure that the host capacitor receives the correct second information.

[0172] The fault tolerance time may be, for example, 50 ms.

[0173] In addition to the above Figure 8 In addition to the methods shown, see Fig. 9 , Fig. 9 A flowchart of another method for determining the allowed time for sending provided in an embodiment of the present application. Fig. 9 As shown, the method includes:

[0174] S301. The slave capacitor determines the number of information characters according to first information.

[0175] For the method of determining the number of information characters from the machine capacitor, please refer to S201.

[0176] S302: The slave capacitor determines the transmission allowed time according to the number of information characters and the transmission time of a single character by using Formula 2.

[0177] Formula 2:

[0178] in, Allow time for sending, is the number of information characters, The duration for sending a single character.

[0179] Based on this, the slave capacitor can send the second information to the host capacitor within the allowed sending time, and each slave capacitor can send the second information to the host capacitor in turn based on the allowed sending time, saving the time for all slave capacitors to respond.

[0180] Based on the above exemplary description, in S201 or S301 , the slave capacitor may determine the number of information characters in a variety of ways.

[0181] In some examples, the slave capacitor determines the number of characters of the first information as the number of characters of the information.

[0182] The type of the first information is a write type.

[0183] When the first information is write-type information, for example, the first information is used by the host capacitor to control the switching state of the slave capacitor, the number of information characters in the second information is consistent with the first information. After receiving the first information, the slave capacitor can determine the number of characters in the first information as the number of information characters.

[0184] For example, the number of characters of the first information is 8 bytes, and the number of characters of the information is 8 bytes.

[0185] In other examples, the slave capacitor determines the number of information characters based on a write function code and a character number table.

[0186] The character quantity table is used to indicate the relationship between the type of information and the number of information characters.

[0187] The first information carries a write function code.

[0188] The write function code is used to indicate that the type of the first information is a write type.

[0189] When the first information is write-type information, for example, the first information is used by the host capacitor to control the switching state of the slave capacitor, the slave capacitor can determine the number of characters corresponding to the write function code indicated in the character quantity table as the number of information characters when receiving the write function code in the first information.

[0190] For example, the number of characters corresponding to the write function code indicated in the character number table is 8 bytes, and the number of information characters is 8 bytes.

[0191] Based on this, the slave capacitor can determine the number of information characters after receiving the write function code in the first information, without having to wait until the first information is completely received to determine the number of information characters, thus saving the time required to determine the number of information characters and helping to improve communication efficiency.

[0192] In yet other examples, the slave capacitor determines the number of information characters based on a read function code, a data frame length, and a character number table.

[0193] The character quantity table is used to indicate the relationship between the type of information and the number of information characters.

[0194] The first information carries a read function code and a data frame length.

[0195] The read function code is used to indicate that the type of the first information is a read type.

[0196] The data frame length is used to indicate the number of characters in the data frame of the information.

[0197] When the first information is read type information, for example, when the first information is used by the host capacitor to request the operating information of the slave capacitor, the slave capacitor can determine the number of information characters based on the number of characters corresponding to the read function code indicated in the character quantity table and the data frame length when receiving the read function code and the data frame length in the first information.

[0198] For example, the number of characters corresponding to the read function code indicated in the character quantity table is 6 bytes + data frame length, the data frame length is 0x02, that is, the length of the data area of ​​the second information is 4 bytes, and the number of information characters is 10 bytes.

[0199] Based on this, the slave capacitor can determine the number of information characters after receiving the read function code in the first information, without having to wait until the first information is completely received to determine the number of information characters, thus saving the time required to determine the number of information characters and helping to improve communication efficiency.

[0200] Based on the above exemplary description, the host capacitor can parse the second information. If an error occurs in the parsing result or the second information is not received, the host capacitor can perform data connection processing on the slave capacitor corresponding to the second information alone.

[0201] Fig.10 This is a schematic diagram of the structure of a master-slave communication device provided in one embodiment of the present application. Fig.10 As shown, the device includes: a receiving module 101, a first determining module 102, a second determining module 103 and a sending module 104.

[0202] The receiving module 101 is used to receive first information broadcasted by the host capacitor, where the first information is used by the slave capacitor to perform corresponding operations.

[0203] The first determination module 102 is used to determine a sending allowed time according to the first information, where the sending allowed time is used to indicate the time required for the slave capacitor to send information to the host capacitor.

[0204] The second determining module 103 is used to determine the information sending time according to the sending allowed time and the sequence in which the slave capacitor sends information among the multiple slave capacitors.

[0205] The sending module 104 is used to send second information to the master capacitor at the information sending time, where the second information is used to indicate that the slave capacitor has performed a corresponding operation.

[0206] In some examples, the first determination module 102 is specifically configured to determine the number of information characters according to the first information. According to the number of information characters, the transmission time of a single character and the fault tolerance time, the transmission allowable time is determined by formula 1, or the slave capacitor determines the transmission allowable time according to the number of information characters and the transmission time of a single character by formula 2.

[0207] Among them, formula 1 is: .

[0208] in, Allow time for sending, is the number of information characters, The duration for sending a single character. The fault tolerance time.

[0209] Among them, formula 2 is: .

[0210] in, Allow time for sending, is the number of information characters, The duration for sending a single character.

[0211] In some examples, the type of the first information is a write type, and the first determination module 102 is specifically configured to determine the number of characters of the first information as the number of information characters.

[0212] In some examples, the first information carries a write function code, which is used to indicate that the type of the first information is a write type. The first determination module 102 is specifically used to determine the number of information characters based on the write function code and the character quantity table. The character quantity table is used to indicate the relationship between the type of information and the number of information characters.

[0213] In some examples, the first information carries a read function code and a data frame length, the read function code is used to indicate that the type of the first information is a read type, and the data frame length is used to indicate the number of characters in the data frame of the information. The first determination module 102 is specifically used to determine the number of information characters based on the read function code, the data frame length and the character quantity table, and the character quantity table is used to indicate the relationship between the type of information and the number of information characters.

[0214] In some examples, the first information is specifically used for the host capacitor to control the switching state of the slave capacitor, or the first information is specifically used for the host capacitor to request the operating information of the slave capacitor.

[0215] In some examples, the master-slave communication device further includes a third determination module, and the third determination module is used to determine the order in which the slave capacitor sends information among the multiple slave capacitors according to the address of the slave capacitor.

[0216] In some examples, the master-slave communication device further includes a fourth determination module, the fourth determination module being configured to determine second information according to the first information, the second information carrying operation information of the slave capacitor.

[0217] Fig.11 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig.11 As shown, the electronic device may include: a processor 201 and a memory 202, wherein the memory 202 stores a computer program, and when the processor 201 executes the computer program, the embodiment of the present application is implemented. Figures 2 to 9 The master-slave communication method shown.

[0218] The electronic device can be used to execute each step and / or process corresponding to the corresponding electronic device in the above method embodiment.

[0219] Fig.12 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig.12 As shown, the electronic device may include: when the processor 301 executes the computer executable program or instruction in the memory, the embodiment of the present application is implemented Figures 2 to 9 The master-slave communication method shown.

[0220] The electronic device can be used to execute each step and / or process corresponding to the corresponding electronic device in the above method embodiment.

[0221] The electronic device of the present application can be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar. The operations implemented by each module can be further referred to the relevant description of the method embodiment, which will not be repeated here. The modules here can also be replaced by components or circuits.

[0222] The present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in each embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0223] Another embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the present application can be implemented. Figures 2 to 9 The master-slave communication method shown.

[0224] The present application also provides a program product, which includes an execution instruction, which is stored in a computer-readable storage medium. At least one processor of an electronic device can read the execution instruction from the computer-readable storage medium, and at least one processor executes the execution instruction so that the electronic device implements the master-slave communication method in the above method embodiment.

[0225] The present application also provides a chip, which is connected to a memory, or a memory is integrated on the chip. When the software program stored in the memory is executed, the master-slave communication method in the above method embodiment is implemented.

[0226] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and 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 modules, which can be electrical, mechanical or other forms.

[0227] Those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.

[0228] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A master-slave communication method, characterized in that: Applied to a reactive power compensation system, the reactive power compensation system includes a host capacitor and a plurality of slave capacitors, and the method includes: The slave capacitor receives first information broadcasted by the host capacitor, where the first information is used for the slave capacitor to perform a corresponding operation; The slave capacitor determines a sending permission time according to the first information, where the sending permission time is used to indicate a time required for the slave capacitor to send information to the host capacitor; The slave capacitor determines the information sending time according to the sending allowed time and the order in which the slave capacitor sends information among the plurality of slave capacitors; The slave capacitor sends second information to the host capacitor from the moment the information is sent, wherein the second information is used to indicate that the slave capacitor has performed a corresponding operation; The slave capacitor determines the sending allowed time according to the first information, including: The slave capacitor determines the number of information characters according to the first information; The slave capacitor determines the transmission allowable time by formula 1 according to the number of information characters, the transmission time of a single character and the fault tolerance time, or the slave capacitor determines the transmission allowable time by formula 2 according to the number of information characters and the transmission time of a single character; Among them, formula 1 is: ; in, allowing time for said sending, is the number of characters of the information, The duration for sending the single character, is the fault tolerance time; Among them, formula 2 is: ; in, allowing time for said sending, is the number of characters of the information, The duration for sending the single character.

2. The method according to claim 1, characterized in that The type of the first information is a write type, and the slave capacitor determines the number of information characters according to the first information, including: The slave capacitor determines the number of characters of the first information as the number of information characters.

3. The method according to claim 1, characterized in that The first information carries a write function code, and the write function code is used to indicate that the type of the first information is a write type. The slave capacitor determines the number of information characters according to the first information, including: The slave capacitor determines the number of information characters according to the write function code and a character number table, wherein the character number table is used to indicate the relationship between the type of information and the number of information characters.

4. The method according to claim 1, characterized in that: The first information carries a read function code and a data frame length, the read function code is used to indicate that the type of the first information is a read type, and the data frame length is used to indicate the number of characters in the data frame of the information. The slave capacitor determines the number of information characters according to the first information, including: The slave capacitor determines the number of information characters according to the read function code, the data frame length and a character quantity table, wherein the character quantity table is used to indicate the relationship between the type of information and the number of information characters.

5. The method according to any one of claims 1 to 4, characterized in that: The first information is specifically used by the host capacitor to control the switching state of the slave capacitor, or the first information is specifically used by the host capacitor to request the operating information of the slave capacitor.

6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The slave capacitor determines a sequence in which the slave capacitor sends information among the plurality of slave capacitors according to an address of the slave capacitor.

7. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The slave capacitor determines the second information according to the first information, where the second information carries the operation information of the slave capacitor.

8. A reactive power compensation system, characterized in that: The reactive power compensation system comprises: a power grid, a master capacitor, and a plurality of slave capacitors for executing the method according to any one of claims 1 to 7; The host capacitor is electrically connected to the power grid, and the host capacitor is communicatively connected to each of the plurality of slave capacitors.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer-executable program or instructions, and the computer-executable program or instructions are configured to execute the method according to any one of claims 1 to 7.