Interaction method and device between master station device and slave station device, centralized controller, building management system and storage medium
By using a relay list in the centralized controller and multi-threaded parallel processing technology, the problem of slow access speed for the master station device to access a large amount of Modbus point data was solved, achieving fast access and efficient interaction.
Patent Information
- Application Number
- CN202511297474.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-11
AI Technical Summary
In the existing technology, when the master station device accesses a large amount of Modbus point data, the Modbus point data access speed is low, resulting in low interaction efficiency between the master station device and the slave station device.
The point data is stored in a relay list in the centralized controller. Multi-threaded parallel processing technology is used to realize fast access and control operations on the point data, including parallel writing and reading of point data. When the main station device needs to access a large amount of point data, it can perform fast access based on the relay list.
It improved the access speed of Modbus location data, enhanced the interaction efficiency between master and slave devices, and ensured the accuracy and consistency of location data.
Smart Images

Figure CN120785680B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to an interaction method, apparatus, centralized controller, building management system and storage medium between master station equipment and slave station equipment. Background Technology
[0002] Due to its ease of use and high reliability, the Modbus protocol is widely used in communication scenarios between master and slave devices, such as in building management systems. However, in existing technologies, when a master device needs to access a large amount of Modbus point data, it must retrieve it from the corresponding slave device at each Modbus point. This results in low Modbus point data access speed and consequently, low interaction efficiency between the master and slave devices. Therefore, improving the access speed of Modbus point data has become an urgent technical problem to be solved. Summary of the Invention
[0003] This application provides a method, apparatus, centralized controller, building management system, and storage medium for interaction between master station equipment and slave station equipment, in order to solve the problem of low Modbus point data access speed when the master station equipment needs to access a large amount of Modbus point data in the prior art.
[0004] In a first aspect, embodiments of this application provide an interaction method between a master station device and a slave station device, applied to a centralized controller, the method comprising:
[0005] Receive at least one control instruction and / or at least one query instruction sent by the master station device, wherein each of the at least one control instruction carries a point address and point data corresponding to the point address, and each of the at least one query instruction carries a point address;
[0006] In response to the at least one control command, the point data corresponding to the first point address in the relay list is written, and the slave device corresponding to the first point address is controlled to perform the corresponding control operation, wherein the first point address is the point address carried by the at least one control command; and / or,
[0007] In response to the at least one query instruction, the point data corresponding to the second point address in the relay list is read, and the read point data is sent to the main station device, wherein the second point address is the point address carried by the at least one query instruction.
[0008] Optionally, writing the point data corresponding to the first point address in the relay list and controlling the slave device corresponding to the first point address to perform the corresponding control operation includes:
[0009] Multiple threads are used to write the point data corresponding to the first point address in the relay list in parallel, and the slave device corresponding to the first point address is controlled to perform the corresponding control operation.
[0010] Optionally, after writing the point data corresponding to the first point address in the relay list and controlling the slave device corresponding to the first point address to perform the corresponding control operation, the method further includes:
[0011] Obtain the status data of the slave device corresponding to the first point address;
[0012] Based on the status data of the slave device corresponding to the first location address, the location data corresponding to the first location address in the relay list is updated.
[0013] Optionally, reading the point data corresponding to the second point address in the relay list and sending the read point data to the master station device includes:
[0014] Multiple threads are used to read the point data corresponding to the second point address in the relay list in parallel, and the read point data is sent to the master station device.
[0015] Optionally, before receiving at least one control command and / or at least one query command sent by the master station device, the method further includes:
[0016] After the central controller is started, it acquires the status data of each slave device;
[0017] The relay list is generated based on the status data of each slave device.
[0018] Optionally, the relay list includes point address field information, point data field information, and read / write flag field information. The point address field information is used to store the point address corresponding to each parameter of each slave device. The point data field information is used to store the point data corresponding to each parameter of each slave device. The read / write flag field information is used to indicate whether the current operation is a write operation or a read operation on the point data of the relay list.
[0019] Secondly, embodiments of this application also provide an interaction device between a master station device and a slave station device, applied to a centralized controller, the device comprising:
[0020] The receiving module is used to receive at least one control instruction and / or at least one query instruction sent by the master station device, wherein each of the at least one control instruction carries a point address and point data corresponding to the point address, and each of the at least one query instruction carries a point address;
[0021] The writing module is configured to, in response to the at least one control instruction, write the point data corresponding to the first point address in the relay list, and control the slave device corresponding to the first point address to perform the corresponding control operation, wherein the first point address is the point address carried by the at least one control instruction; and / or,
[0022] The reading module is used to respond to the at least one query instruction, read the point data corresponding to the second point address in the relay list, and send the read point data to the main station device, wherein the second point address is the point address carried by the at least one query instruction.
[0023] Thirdly, embodiments of this application also provide a centralized controller, which includes the interaction device between the master station device and the slave station device described in the second aspect.
[0024] Fourthly, embodiments of this application also provide a building management system, which includes a centralized controller, a master station device, and at least one slave station device;
[0025] The centralized controller is communicatively connected to the master station device and the at least one slave station device.
[0026] The centralized controller is used to execute the interaction method between the master station equipment and the slave station equipment described in the first aspect.
[0027] Fifthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the interaction method between the master station device and the slave station device described in the first aspect.
[0028] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application receives at least one control instruction and / or at least one query instruction sent by the master station device, wherein each of the at least one control instruction carries a point address and point data corresponding to the point address, and each of the at least one query instruction carries a point address; in response to the at least one control instruction, the point data corresponding to the first point address in the relay list is written, and the slave device corresponding to the first point address is controlled to perform the corresponding control operation, wherein the first point address is the point address carried by the at least one control instruction; and / or, in response to the at least one query instruction, the point data corresponding to the second point address in the relay list is read, and the read point data is sent to the master station device, wherein the second point address is the point address carried by the at least one query instruction. Using the above method, the location data of each slave device can be stored in the relay list in the centralized controller. When the master device needs to access a large amount of location data, it can quickly access it based on the relay list, thereby improving the access speed of location data and improving the interaction efficiency between the master device and the slave device. Attached Figure Description
[0029] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0030] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0032] Figure 1 A flowchart illustrating an interaction method between a master station device and a slave station device provided in an embodiment of this application;
[0033] Figure 2 A schematic diagram of the structure of an interaction device between a master station device and a slave station device provided in an embodiment of this application;
[0034] Figure 3A schematic diagram of the structure of a centralized controller provided in an embodiment of this application;
[0035] Figure 4 This is a schematic diagram of the structure of another centralized controller provided in an embodiment of this application;
[0036] Figure 5 This is a schematic diagram of a building management system provided in an embodiment of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0039] To address the issue of low Modbus point data access speed in existing technologies when master station devices need to access large amounts of Modbus point data, this application provides an interaction method, apparatus, centralized controller, building management system, and storage medium between master station devices and slave devices, which can improve the access speed of Modbus point data.
[0040] See Figure 1 , Figure 1 This is a flowchart illustrating an interaction method between a master station device and a slave station device provided in an embodiment of this application. Figure 1 As shown, the interaction method between the master station device and the slave station device is applied to the centralized controller. The interaction method between the master station device and the slave station device may include the following steps:
[0041] Step S101: Receive at least one control instruction and / or at least one query instruction sent by the master station device, wherein each control instruction carries a point address and point data corresponding to the point address, and each query instruction carries a point address.
[0042] Specifically, the aforementioned master station equipment can be understood as a host computer, primarily used to control and manage the various slave station devices. The aforementioned control commands refer to instructions that control the slave station devices to perform corresponding operations, such as controlling the slave station devices to perform operations like powering on, powering off, adjusting temperature, adjusting fan speed, and adjusting operating mode. The aforementioned query commands refer to instructions that query the device status of the slave station devices, such as querying the operating power, fan speed, etc. The number of the aforementioned control commands and query commands can be one or more, depending on the actual scenario requirements. The aforementioned point address refers to the address of a data register or holding register used to store the status data of a specific function of a slave station device. As an optional implementation, this point address can be defined by combining a unit identifier, function code, starting address, and quantity. The unit identifier refers to the address of the slave station device, typically used to distinguish different slave station devices on the network. The function code refers to the code of the operation to be performed, i.e., used to tell the slave station device the specific operation to be performed, such as reading (0x03) or writing (0x06) data. The starting address refers to the starting address of the data register or holding register. In the Modbus protocol, registers are typically addressed in 16-bit units, so the starting address refers to a 16-bit address. The quantity refers to the number of registers to be read or written, also in 16-bit units, representing the number of registers to be operated on. This point address is globally unique. The aforementioned point data refers to the status data of a specific function of a slave device, and this point data corresponds one-to-one with the point address.
[0043] Step S102: In response to at least one control instruction, write the point data corresponding to the first point address in the relay list, and control the slave device corresponding to the first point address to perform the corresponding control operation, wherein the first point address is the point address carried by at least one control instruction.
[0044] Specifically, the aforementioned relay list is a linked list in the centralized controller used to store the addresses of each point and the point data corresponding to each point address.
[0045] In this step, when the centralized controller receives at least one control command sent by the master station device, it can respond to the at least one control command by parsing the point address and the corresponding point data carried by each control command (the point address and point data are set by the user or the master station device based on the device control requirements). Then, based on the parsed point address and point data, it writes the point data corresponding to the point address into the relay list and controls the slave device corresponding to the point address to perform the corresponding control operation. In this way, the control of each slave device can be quickly realized, and the point data of each slave device can be kept consistent with the point data in the relay list.
[0046] Step S103: In response to at least one query instruction, read the point data corresponding to the second point address in the relay list and send the read point data to the main station device, wherein the second point address is the point address carried by at least one query instruction.
[0047] In this step, when the centralized controller receives at least one query command sent by the master station device, it can respond to the query command by parsing the point address carried by each control command (the point address is set by the user or the master station device based on the device query requirements). Then, based on the parsed point address, it reads the point data corresponding to the point address in the relay list (the point data can be collected by the centralized controller from the slave device or written by the master station device, with the latest point data being the most accurate). The read point data is then sent to the master station device. In this way, the status query of each slave device can be quickly realized, so that the master station device can understand the latest status of each slave device in a timely manner.
[0048] Using the above method, the location data of each slave device can be stored in the relay list in the centralized controller. When the master device needs to access a large amount of location data, it can quickly access it based on the relay list, thereby improving the access speed of location data and improving the interaction efficiency between the master device and the slave device.
[0049] In an optional embodiment, step S102, which involves writing the point data corresponding to the first point address in the relay list and controlling the slave device corresponding to the first point address to perform the corresponding control operation, includes:
[0050] Multiple threads are used to write the data of the point corresponding to the first point address in the relay list in parallel, and the slave device corresponding to the first point address is controlled to perform the corresponding control operation.
[0051] Specifically, the centralized controller may include multiple threads. When the master station device sends multiple control commands simultaneously, the centralized controller can use these multiple threads to write the point data corresponding to the point address in each control command in the relay list in parallel, and control the slave station device corresponding to the point address in each control command to perform the corresponding control operation in parallel.
[0052] In this way, the centralized controller can process multiple control commands sent by the master station equipment at the same time, thereby improving the overall control efficiency of the equipment.
[0053] In an optional embodiment, after step S102, which involves writing the data corresponding to the first address in the relay list and controlling the slave device corresponding to the first address to perform the corresponding control operation, the method further includes:
[0054] Obtain the status data of the slave device corresponding to the first point address;
[0055] Based on the status data of the slave device corresponding to the first address, the data of the point corresponding to the first address in the relay list is updated.
[0056] Specifically, after the centralized controller writes the point data corresponding to the first point address in the relay list and controls the slave device corresponding to the first point address to perform the corresponding control operation, it can also obtain the status data of the slave device corresponding to the first point address after performing the corresponding control operation. Then, based on the status data of the slave device corresponding to the first point address after performing the corresponding control operation, it updates the point data corresponding to the first point address in the relay list. In this way, it can ensure that the point data in the relay list is consistent with the actual status of the slave devices, thereby ensuring the accuracy of the point data accessed by the master device.
[0057] In an optional embodiment, step S103, reading the point data corresponding to the second point address in the relay list and sending the read point data to the main station device, includes:
[0058] Multiple threads are used to read the point data corresponding to the second point address in the relay list in parallel, and the read point data is sent to the main station device.
[0059] Specifically, the centralized controller may include multiple threads. When the master station device sends multiple query commands simultaneously, the centralized controller can use these multiple threads to read the point data corresponding to the point address in each query command in the relay list in parallel, and send the read point data to the master station device in parallel.
[0060] In this way, the centralized controller can process multiple query commands sent by the master station device at the same time, thereby improving the overall query efficiency of the device.
[0061] In an optional embodiment, before step S103 above, receiving at least one control command and / or at least one query command sent by the master station device, the method further includes:
[0062] After the central controller starts up, it acquires the status data of each slave device;
[0063] A relay list is generated based on the status data of each slave device.
[0064] Specifically, after startup, the central controller can acquire the status data of each slave device, generate an initial relay list based on the status data of each slave device, and update the initial relay list when it receives control commands from the master device, so that the point data in the relay list is always up-to-date.
[0065] This allows for the preloading of the relay list, reducing latency when the main station device accesses point data, thereby improving the speed at which the main station device accesses point data.
[0066] In one optional embodiment, the relay list includes point address field information, point data field information, and read / write flag field information. The point address field information is used to store the point address corresponding to each parameter of each slave device, the point data field information is used to store the point data corresponding to each parameter of each slave device, and the read / write flag field information is used to indicate whether the current operation is a write operation or a read operation on the point data of the relay list.
[0067] Specifically, the aforementioned relay list may include point address field information, point data field information, and read / write flag field information. The point address field information stores the point address corresponding to each parameter of each slave device, which can be obtained by combining the unit identifier, function code, starting address, and quantity. The point data field information stores the point data corresponding to each parameter of each slave device, such as the temperature value of slave device 1, the operating mode of slave device 2, and the wind speed of slave device 3. The read / write flag field information indicates whether the current operation is a write or read operation on the point data of the relay list. For example, if the central controller is currently performing a write operation on the point data of the relay list, the read / write flag field information can be set to 1; if the central controller is currently performing a read operation on the point data of the relay list, the read / write flag field information can be set to 0, and so on.
[0068] The structure of the relay list can be configured according to the access habits of the master station device. There are two methods, which are illustrated here using an air conditioner indoor unit as a slave station device. The first method uses the same location of different indoor units as the location data (such as indoor unit 1 temperature, indoor unit 2 temperature, indoor unit 3 temperature, etc.); the second method uses different locations of the same indoor unit as the location data (such as indoor unit 1 temperature, indoor unit 1 mode, indoor unit 1 fan speed, etc.).
[0069] In this way, when accessing point data, the point address can be quickly matched in the relay list. When the amount of accessed point data is large, it can effectively avoid repeatedly obtaining the corresponding status from the slave device every time the corresponding point is accessed, thereby saving a lot of access time.
[0070] See Figure 2 , Figure 2 This is a schematic diagram of the structure of an interaction device between a master station device and a slave station device provided in an embodiment of this application. Figure 2 As shown, the interaction device 200 between the master station device and the slave station device is applied to the centralized controller. The interaction device 200 between the master station device and the slave station device includes:
[0071] The receiving module 201 is used to receive at least one control instruction and / or at least one query instruction sent by the master station device, wherein each control instruction carries a point address and point data corresponding to the point address, and each query instruction carries a point address.
[0072] The writing module 202 is configured to, in response to at least one control instruction, write the point data corresponding to the first point address in the relay list, and control the slave device corresponding to the first point address to perform the corresponding control operation, wherein the first point address is the point address carried by at least one control instruction; and / or,
[0073] The reading module 203 is used to read the point data corresponding to the second point address in the relay list in response to at least one query instruction, and send the read point data to the main station device, wherein the second point address is the point address carried by at least one query instruction.
[0074] Furthermore, the writing module 202 includes:
[0075] The write submodule is used to use multiple threads to write the data of the point corresponding to the first point address in the relay list in parallel, and to control the slave device corresponding to the first point address to perform the corresponding control operation.
[0076] Furthermore, the interaction device 200 between the master station equipment and the slave station equipment also includes:
[0077] The first acquisition module is used to acquire the status data of the slave device corresponding to the first point address;
[0078] The update module is used to update the point data corresponding to the first point address in the relay list based on the status data of the slave device corresponding to the first point address.
[0079] Furthermore, the reading module 203 includes:
[0080] The read submodule is used to read the point data corresponding to the second point address in the relay list in parallel using multiple threads, and then send the read point data to the main station device.
[0081] Furthermore, the interaction device 200 between the master station equipment and the slave station equipment also includes:
[0082] The second acquisition module is used to acquire the status data of each slave device after the central controller is started.
[0083] The generation module is used to generate a relay list based on the status data of each slave device.
[0084] Furthermore, the relay list includes point address field information, point data field information, and read / write flag field information. The point address field information is used to store the point address corresponding to each parameter of each slave device, the point data field information is used to store the point data corresponding to each parameter of each slave device, and the read / write flag field information is used to indicate whether the current operation is a write operation or a read operation on the point data of the relay list.
[0085] It should be noted that the interaction device 200 between the master station device and the slave station device can realize the interaction method between the master station device and the slave station device provided in the aforementioned method embodiment, and can achieve the same technical effect, which will not be described in detail here.
[0086] See Figure 3 , Figure 3 This is a schematic diagram of the structure of a centralized controller provided in an embodiment of this application, such as... Figure 3 As shown, the centralized controller includes the interaction device between the master station device and the slave station device provided in the aforementioned embodiments.
[0087] As an optional implementation, the structure of the centralized controller can also be as follows: Figure 4 As shown, the centralized controller 400 may include a relay list module 401, a data acquisition module 402, a communication module 403, and a multi-threaded processing module 404. The relay list module 401 includes a relay list for storing location data. The data acquisition module 402 collects location data from slave devices and stores it in the relay list. The communication module 403 enables communication between the centralized controller 400 and both the master and slave devices. The multi-threaded processing module 404 performs multi-threaded processing on control commands and query commands sent by the master device to improve system throughput.
[0088] See Figure 5 , Figure 5 This is a schematic diagram of a building management system provided in an embodiment of this application. Figure 5 As shown, the building management system includes a central controller 501, a master station device 502, and at least one slave station device 503;
[0089] The centralized controller 501 is communicatively connected to the master station device 502 and at least one slave station device 503.
[0090] The centralized controller 501 is used to execute the steps of the interaction method between the master station device 502 and the slave station device 503 provided in the foregoing method embodiments.
[0091] Specifically, when the central controller 501 starts up, it can initialize a preloaded relay list based on the status of each slave device 503 (i.e., the unit). Preloading can reduce the latency of the master device 502 (i.e., the host computer) during its first access and improve the speed of the master device 502 when it first accesses the point data.
[0092] When the master station device 502 controls the slave station device 503, the centralized controller 501 can receive control commands issued by the master station device 502. After receiving the control command, the centralized controller 501 writes the point data in the control command to the relay list and sets the read / write flag corresponding to that point to 1. Then, the centralized controller 501 issues corresponding control commands to the slave station device 503. After the slave station device 503 completes the corresponding action (such as powering on / off, adjusting temperature, adjusting fan speed, etc.), it clears the read / write status bit to 0, achieving synchronization between the commands of the master station device 502 and the status of the slave station device 503. After the status data of the slave station device 503 changes, the centralized controller 501 will synchronously update the corresponding point value in the relay list. The master station device 502 can access the relay list to achieve status synchronization with the slave station device 503.
[0093] The centralized controller 501 has multi-threaded processing capabilities and supports concurrent processing mechanisms. The master station device 502 can send multiple commands simultaneously, and the centralized controller 501 responds to multiple commands to perform read or write operations on the relay list, thereby controlling the slave station device 503.
[0094] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the interaction method between the master station device and the slave station device as provided in any of the foregoing method embodiments.
[0095] Therefore, the building management system can store Modbus location data in advance through a relay list, and reduce data transmission time and processing latency through relay list preloading, master-slave station device status data synchronization, and the concurrent processing mechanism of the centralized controller, thereby significantly improving the access speed of Modbus location data.
[0096] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0097] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0098] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0099] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for interaction between a master station device and a slave station device, characterized in that, Applied to a centralized controller, the method includes: The system receives at least one control instruction and at least one query instruction sent by the master station device. Each control instruction carries a point address and point data corresponding to the point address. Each query instruction carries a point address, which includes a unit identifier, a function code, a starting address, and a quantity. The unit identifier refers to the address of the slave device, the function code refers to the operation code of the slave device, the starting address refers to the starting address of the data register or holding register, and the quantity refers to the number of registers to be read or written. In response to the at least one control instruction, the point data corresponding to the first point address in the relay list is written, and the slave device corresponding to the first point address is controlled to perform the corresponding control operation, wherein the first point address is the point address carried by the at least one control instruction. In response to the at least one query instruction, the point data corresponding to the second point address in the relay list is read, and the read point data is sent to the main station device, wherein the second point address is the point address carried by the at least one query instruction.
2. The method according to claim 1, characterized in that, The step of writing the data corresponding to the first address in the relay list and controlling the slave device corresponding to the first address to perform the corresponding control operation includes: Multiple threads are used to write the point data corresponding to the first point address in the relay list in parallel, and the slave device corresponding to the first point address is controlled to perform the corresponding control operation.
3. The method according to claim 2, characterized in that, After writing the data corresponding to the first address in the relay list and controlling the slave device corresponding to the first address to perform the corresponding control operation, the method further includes: Obtain the status data of the slave device corresponding to the first point address; Based on the status data of the slave device corresponding to the first location address, the location data corresponding to the first location address in the relay list is updated.
4. The method according to claim 1, characterized in that, The step of reading the point data corresponding to the second point address in the relay list and sending the read point data to the main station device includes: Multiple threads are used to read the point data corresponding to the second point address in the relay list in parallel, and the read point data is sent to the master station device.
5. The method according to claim 1, characterized in that, Before receiving at least one control command and / or at least one query command sent by the master station device, the method further includes: After the central controller is started, it acquires the status data of each slave device; The relay list is generated based on the status data of each slave device.
6. The method according to any one of claims 1-5, characterized in that, The relay list includes point address field information, point data field information, and read / write flag field information. The point address field information is used to store the point address corresponding to each parameter of each slave device. The point data field information is used to store the point data corresponding to each parameter of each slave device. The read / write flag field information is used to indicate whether the current operation is a write operation or a read operation on the point data of the relay list.
7. An interaction device between a master station device and a slave station device, characterized in that, Applied to a centralized controller, the device includes: The receiving module is used to receive at least one control instruction and at least one query instruction sent by the master station device. Each control instruction carries a point address and point data corresponding to the point address. Each query instruction carries a point address. The point address includes a unit identifier, a function code, a starting address, and a quantity. The unit identifier refers to the address of the slave device. The function code refers to the operation code of the slave device. The starting address refers to the starting address of the data register or holding register. The quantity refers to the number of registers to be read or written. The writing module is used to respond to the at least one control instruction to write the point data corresponding to the first point address in the relay list, and control the slave device corresponding to the first point address to perform the corresponding control operation, wherein the first point address is the point address carried by the at least one control instruction. The reading module is used to respond to the at least one query instruction, read the point data corresponding to the second point address in the relay list, and send the read point data to the main station device, wherein the second point address is the point address carried by the at least one query instruction.
8. A centralized controller, characterized in that, The centralized controller includes the interaction device between the master station equipment and the slave station equipment as described in claim 7.
9. A building management system, characterized in that, The building management system includes a centralized controller, a master station device, and at least one slave station device; The centralized controller is communicatively connected to the master station device and the at least one slave station device. The centralized controller is used to execute the interaction method between the master station equipment and the slave station equipment as described in any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the interaction method between the master station device and the slave station device as described in any one of claims 1-6.
Citation Information
Patent Citations
Modbus communication method and communication system based on DCS controller
CN119094272A