RS485 bus communication system and communication method, device, equipment and medium thereof
By utilizing idle detection and master device pre-configured time slot mechanisms in the RS485 bus communication system, the latency problem caused by bus busy is solved, achieving efficient data transmission and reliable communication without additional hardware.
Patent Information
- Application Number
- CN202511293498.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-12-12
AI Technical Summary
In existing RS485 bus communication systems, when slave devices send uplink data, the bus may become busy, leading to increased latency, which affects data response efficiency and communication reliability. Furthermore, it is impossible to determine whether the bus is idle or busy without adding hardware.
The device determines the RS485 bus status by detecting idle time and sends uplink data using different types of time slots pre-configured by the master device when idle, including free uplink time slots and fixed-point uplink time slots. This ensures that the appropriate time slot is selected to send data when the bus is busy, reducing latency and improving response efficiency.
Without adding RS485 bus hardware, it improves the data response efficiency of slave devices, ensures the reliability of RS485 bus communication and dynamic adjustment of time slots, and optimizes the data interaction effect of various devices in the system.
Smart Images

Figure CN121125386A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to an RS485 bus communication system and its communication method, apparatus, equipment and medium. Background Technology
[0002] RS485 (Recommended Standard 485) is a serial communication standard widely used in industrial automation, building control, data acquisition, and other fields. It supports multi-point communication, allowing multiple devices to connect to the same network, typically using a master-slave communication mode, where one master device drives multiple slave devices. Each action is initiated by the master device, and the slave devices execute the corresponding action after being identified by their addresses. Summary of the Invention
[0003] This application provides an RS485 bus communication system and its communication method, apparatus, device, and medium, which enables slave devices to determine whether the RS485 bus is currently idle or busy without adding RS485 bus line hardware, and to report data using different types of time slots pre-configured by the master device based on the determination result. This reduces the latency of sending uplink data to the master device via the RS485 bus, improves the data response efficiency of each slave device in the RS485 bus system, and ensures the communication reliability of the RS485 bus.
[0004] In a first aspect, embodiments of this application provide a communication method applied to an RS485 bus communication system, wherein the RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus, the method being applied to the slave device, and the method comprising:
[0005] Determine whether the local slave device needs to send uplink data to the master device;
[0006] Determine the idle detection duration for the RS485 bus;
[0007] During the idle detection period, the RS485 bus is idle-detected.
[0008] When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the first set of uplink time slots pre-configured by the master device;
[0009] When it is determined that the RS485 bus is busy:
[0010] If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle;
[0011] If there is no available time slot in the first set of uplink time slots, the uplink data is postponed to the time slot corresponding to the local slave device in the second set of uplink time slots pre-configured by the master device and sent to the master device.
[0012] As can be seen, in the communication method applied to an RS485 bus communication system provided in this application embodiment, when the slave device determines that it needs to send uplink data to the master device, it further determines the idle detection duration for the RS485 bus and performs idle detection on the RS485 bus within the idle detection duration. Specifically, when the RS485 bus is determined to be idle, the slave device can send the uplink data to the master device through one or more time slots in the first set of uplink time slots pre-configured by the master device. When the RS485 bus is determined to be busy: if there is an available time slot in the first set of uplink time slots, the slave device can postpone the uplink data to the available time slot and send it to the master device when the RS485 bus is idle; if there is no available time slot in the first set of uplink time slots, the slave device can postpone the uplink data to the time slot corresponding to the local slave device in the second set of uplink time slots pre-configured by the master device and send it to the master device. Therefore, the method provided in this application embodiment, without adding RS485 bus line hardware, allows the slave device to determine whether the current RS485 bus is idle or busy, and based on the determination result, adopts different types of time slots pre-configured by the master device to report data in a time-slice distribution manner. This reduces the latency of sending uplink data to the master device through the RS485 bus, improves the data response efficiency of each slave device in the RS485 bus system, and ensures the communication reliability of the RS485 bus.
[0013] In some embodiments, the method further includes:
[0014] In the downlink time slot pre-configured by the master device, receive the timing parameters sent by the master device;
[0015] Based on the time parameters, time calibration is performed between the local slave device and the master device.
[0016] Therefore, in this embodiment of the application, the slave device can realize the time comparison mechanism with the master device through the time comparison parameters sent by the master device, so as to ensure that the time slices (i.e., time slots) between each slave device and the master device are consistent, and further guarantee the communication reliability of the RS485 bus system.
[0017] In some embodiments, the method further includes:
[0018] In the downlink time slot pre-configured by the master device, receive the following three sets of time slot configuration information latest determined and sent by the master device:
[0019] The first set of uplink time slots used to send data from the device to the master device;
[0020] A set of downlink time slots used by the master device to send data to the slave device;
[0021] The second set of uplink time slots is used to send data from the device to the master device;
[0022] Each time slot group includes at least one time slot.
[0023] Therefore, in this embodiment of the application, the slave device can dynamically adjust the data interaction time between each slave device and the master device in the current system according to the function of the master device to dynamically adjust each time slice, so that the data interaction effect between each slave device and the master device in the whole system can be optimized.
[0024] Secondly, this application provides another communication method applied to an RS485 bus communication system, wherein the RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus, the method being applied to the master device, and the method comprising:
[0025] Based on the information of the slave devices currently connected to the master device, the following three sets of timeslot configuration information are determined:
[0026] The first set of uplink time slots used to send data from the device to the master device;
[0027] A set of downlink time slots used by the master device to send data to the slave device;
[0028] The second set of uplink time slots is used to send data from the device to the master device;
[0029] Each time slot group includes at least one time slot;
[0030] The configuration information of the three sets of time slots is sent to the slave device that has established a connection with the master device.
[0031] In some implementations, before sending the configuration information of the three sets of time slots to the slave device that has established a connection with the master device, the method further includes:
[0032] The master device sends its current time adjustment parameters to the slave device that has established a connection with the master device. The time adjustment parameters are used to instruct the slave device to perform time calibration with the master device.
[0033] In some embodiments, the method further includes:
[0034] When a new slave device is added or a slave device is deleted in the system, the configuration information of the three sets of time slots is re-determined based on the information of the slave device currently connected to the master device, and the re-determined configuration information of the three sets of time slots is sent to the slave device connected to the master device in the most recent downlink time slot.
[0035] In some implementations, the configuration information for the three sets of time slots includes:
[0036] The duration of each time slot;
[0037] The number of slots in each group.
[0038] In some implementations...
[0039] The number of uplink time slots in the first group is N, the number of downlink time slots is N / 2, and the number of uplink time slots in the second group is N;
[0040] Alternatively, the number of uplink time slots in the first group is N / 2, the number of downlink time slots is N, and the number of uplink time slots in the second group is N;
[0041] Alternatively, the number of uplink time slots in the first group is N / 2, the number of downlink time slots is N / 2, and the number of uplink time slots in the second group is N;
[0042] Wherein, N is the total number of slave devices currently connected to the master device.
[0043] Thirdly, this application provides a communication device for an RS485 bus communication system, wherein the RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus, the device being applied to the slave device, and the device comprising:
[0044] An uplink data determination unit is used to determine whether the local slave device needs to send uplink data to the master device.
[0045] The detection duration determination unit is used to determine the idle detection duration for the RS485 bus;
[0046] An RS485 bus idle detection unit is used to perform idle detection on the RS485 bus during the idle detection duration.
[0047] The data reporting unit is used for:
[0048] When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the first set of uplink time slots pre-configured by the master device;
[0049] When it is determined that the RS485 bus is busy:
[0050] If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle;
[0051] If there is no available time slot in the first set of uplink time slots, the uplink data is postponed to the time slot corresponding to the local slave device in the second set of uplink time slots pre-configured by the master device and sent to the master device.
[0052] Fourthly, this application provides another communication device applied to an RS485 bus communication system, wherein the RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus, the device being applied to the master device, and the device comprising:
[0053] The time slot configuration unit is used to determine the configuration information of the following three sets of time slots based on the information of the slave device currently connected to the master device:
[0054] The first set of uplink time slots used to send data from the device to the master device;
[0055] A set of downlink time slots used by the master device to send data to the slave device;
[0056] The second set of uplink time slots is used to send data from the device to the master device;
[0057] Each time slot group includes at least one time slot;
[0058] The configuration information sending unit is used to send the configuration information of the three sets of time slots to the slave device that has established a connection with the master device.
[0059] Fifthly, an RS485 bus communication system provided in this application includes: a master device, and at least one slave device connected to the master device via an RS485 bus, wherein:
[0060] The main device is used for:
[0061] Based on the information of the slave devices currently connected to the master device, the following three sets of timeslot configuration information are determined:
[0062] The first set of uplink time slots used to send data from the device to the master device;
[0063] A set of downlink time slots used by the master device to send data to the slave device;
[0064] The second set of uplink time slots is used to send data from the device to the master device;
[0065] Each time slot group includes at least one time slot;
[0066] The configuration information of the three sets of time slots is sent to the slave device that has established a connection with the master device through the downlink time slot;
[0067] The slave device is used for:
[0068] Determine whether the local slave device needs to send uplink data to the master device;
[0069] Determine the idle detection duration for the RS485 bus;
[0070] During the idle detection period, the RS485 bus is idle-detected.
[0071] When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the uplink time slots in the first group of uplink time slots;
[0072] When it is determined that the RS485 bus is busy:
[0073] If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle;
[0074] If there is no available time slot in the first group of uplink time slots, the uplink data is shifted to the time slot corresponding to the local slave device in the second group of uplink time slots and sent to the master device.
[0075] Sixthly, an electronic device provided in this application includes a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory and execute any of the above methods according to the obtained program.
[0076] Seventhly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions for causing the computer to perform any of the methods described above. Attached Figure Description
[0077] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0078] Figure 1 A schematic diagram of the architecture of an RS485 bus communication system provided in this application embodiment;
[0079] Figure 2 A flowchart illustrating a communication method applied to the slave device side of an RS485 bus communication system, provided as an embodiment of this application;
[0080] Figure 3 This is a schematic diagram of a time slot configuration provided in an embodiment of this application;
[0081] Figure 4 A flowchart illustrating a communication method applied to the slave device side of an RS485 bus communication system, provided as an embodiment of this application;
[0082] Figure 5 A flowchart illustrating a communication method applied to the master device side of an RS485 bus communication system, provided as an embodiment of this application;
[0083] Figure 6 A schematic diagram illustrating the time slot reconfiguration process on the master device side of an RS485 bus communication system, provided as an embodiment of this application;
[0084] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0085] Figure 8 A schematic diagram of the structure of a communication device applied to the slave device side of an RS485 bus communication system, provided for an embodiment of this application;
[0086] Figure 9 This is a schematic diagram of the structure of a communication device applied to the master device side of an RS485 bus communication system, provided in an embodiment of this application. Detailed Implementation
[0087] 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 a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0088] This application provides an RS485 bus communication system and its communication method, apparatus, device, and medium, which enables slave devices to determine whether the RS485 bus is currently idle or busy without adding RS485 bus line hardware, and to report data using different types of time slots pre-configured by the master device based on the determination result. This reduces the latency of sending uplink data to the master device via the RS485 bus, improves the data response efficiency of each slave device in the RS485 bus system, and ensures the communication reliability of the RS485 bus.
[0089] The methods, apparatus, equipment, and media are based on the same concept of the application. Since the methods, apparatus, equipment, and media solve problems in similar principles, the implementation of the apparatus, equipment, media, and methods can refer to each other, and repeated parts will not be described again.
[0090] The terms "first," "second," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0091] The following examples and embodiments are to be understood as illustrative only. While this specification may refer to "a," "an," or "some" examples or embodiments in several places, this does not mean that every such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide other embodiments. Furthermore, terms such as "comprising" and "including" should be understood not to limit the described embodiments to consisting only of those features mentioned; such examples and embodiments may also include features, structures, units, modules, etc., not specifically mentioned.
[0092] The various embodiments of this application will now be described in detail with reference to the accompanying drawings. It should be noted that the order in which the embodiments are presented in this application represents only a chronological order and does not represent the superiority or inferiority of the technical solutions provided by the embodiments.
[0093] RS485 communication typically operates in asynchronous half-duplex mode. Asynchronous communication means that the sender and receiver do not need to share the same clock signal; the receiver identifies the start and end of data through specific bits in the data frame (such as start and stop bits). Half-duplex mode means that information can be transmitted in both directions, but not simultaneously. This mode is very flexible in practical applications and suitable for various communication scenarios.
[0094] See Figure 1 In an RS485 bus communication system, the master device initiates communication requests, and the slave devices execute corresponding operations based on the received commands. Each slave device has a unique address, which the master device uses to distinguish between different slave devices. This master-slave communication method ensures the orderliness and reliability of the network and avoids conflicts caused by multiple devices sending data simultaneously.
[0095] To improve the data response efficiency of each slave device in an RS485 bus system while ensuring the communication reliability of the RS485 bus, this application provides a communication method applied to an RS485 bus communication system, wherein the RS485 bus communication system is as follows: Figure 1 As shown, it includes: a master device, and at least one slave device connected to the master device via the RS485 bus, the method being applied to the slave device, see [link to documentation]. Figure 2 The method includes:
[0096] S101. Determine that the local slave device needs to send uplink data to the master device;
[0097] The uplink data includes, for example, alarm data, heartbeat data, and collected environmental data that the alarm detector determines need to report to the master device.
[0098] S102. Determine the idle detection duration for the RS485 bus;
[0099] S103. Perform idle detection on the RS485 bus during the idle detection duration;
[0100] S104. When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more uplink time slots in the first set of uplink time slots pre-configured by the master device.
[0101] S105. When it is determined that the RS485 bus is busy:
[0102] If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle;
[0103] If there is no available time slot in the first set of uplink time slots, the uplink data is postponed to the time slot corresponding to the local slave device in the second set of uplink time slots pre-configured by the master device and sent to the master device.
[0104] In some embodiments, the method further includes:
[0105] In the downlink time slot pre-configured by the master device, receive the timing parameters sent by the master device;
[0106] Based on the time parameters, time calibration is performed between the local slave device and the master device.
[0107] For example, see Figure 3 The master device periodically sends time slots to the first and second slave devices. A time slot can be understood as a beacon. After each slave device receives this beacon, the transmission time (i.e., the time required for the beacon to be transmitted from the master device to the slave device) is added to achieve time slot alignment between the slave device and the master device, thus realizing time calibration between the local slave device and the master device.
[0108] In some embodiments, the method further includes:
[0109] In the downlink time slot pre-configured by the master device, receive the following three sets of time slot configuration information latest determined and sent by the master device:
[0110] The first set of uplink time slots used to send data from the device to the master device;
[0111] A set of downlink time slots used by the master device to send data to the slave device;
[0112] The second set of uplink time slots is used to send data from the device to the master device;
[0113] Each time slot group includes at least one time slot.
[0114] For example, see Figure 3 The master device can broadcast its current time slot. After the current time slot, the equally spaced time intervals are divided into time slots for different functions according to the chronological order. For example... Figure 3 As shown, the master device divides the time slots into three parts: free uplink time slots (i.e., the first set of uplink time slots used by the slave device to send data to the master device), free downlink time slots (i.e., the set of downlink time slots used by the master device to send data to the slave device), and fixed-point uplink time slots (i.e., the second set of uplink time slots used by the slave device to send data to the master device).
[0115] The specific functions of the three time slots mentioned above are as follows:
[0116] Free uplink time slot: Any slave device can send interactive data of the trigger event of the local slave device in any time slot in this group of time slots. For example, after the alarm detector detects a local alarm event, it reports the alarm data to the master device through the most recent free uplink time slot.
[0117] Free downlink time slot: The master device sends data to the slave device in this type of time slot, for example, the master device sends control data to one or more slave devices;
[0118] Fixed-point uplink time slot: This type of time slot matches the current short address of the slave device. Only the slave node with the corresponding short address can send data within this time slot. In other words, each fixed-point uplink time slot corresponds to one slave device, or one slave device corresponds to multiple fixed-point uplink time slots.
[0119] For example, suppose there are 3 slave devices under the master device, and the short addresses of these 3 slave devices are short address 1, short address 2, and short address 3 respectively; the master device will also reserve 3 timed uplink slots corresponding to each of them. Then, the slave device with short address 1 can only send data in the first timed uplink slot, the slave device with short address 2 can only send data in the second timed uplink slot, and the slave device with short address 3 can only send data in the third timed uplink slot. This avoids the bus conflict caused by these 3 slave devices sending data to the master device at the same time.
[0120] In some implementations, the time length of each of the three time slots is the same.
[0121] In some implementations, the duration of each time slot, i.e. the specific time length of each time slot, is determined by the transmission time required for the longest communication data in the current system. If the longest transmission time of communication data between the master device and the slave device in the current system is t1, then the time of a single time slot can be t1+5ms (of course, it can also be other preset values).
[0122] For example, if the longest communication protocol in the current system is 16 bytes and the current baud rate is 9600, then the longest communication time t1 in the current system is: 1 / 9600*1000*10*16=16.7ms.
[0123] In other words, the master device can calculate the longest communication time t1 of the current system by using the current system's serial port baud rate and the longest number of communication bytes.
[0124] The following is a specific embodiment of a communication method from the device side.
[0125] See Figure 4Assuming that there is a slave device in the current RS485 bus communication system, designated as the first slave device, and the short address of the first slave device is A (a numerical value), then the communication methods of the first slave device include:
[0126] S201, First slave device triggers alarm event;
[0127] For example, when the preset triggering conditions are met, an alarm event is triggered, indicating that there is uplink data that needs to be reported to the master device.
[0128] S202, Delay A*T0;
[0129] This step involves the first slave device waiting for A*T0 time after triggering an alarm event, and then executing the next step S203.
[0130] Wherein, at the current bus speed, the time required for the first slave device to receive 1 byte of data is T0; A is the short address of the first slave device.
[0131] S203, Enable idle detection of the RS485 bus during the 2T0 time period;
[0132] For example, start a timer with a timing duration of 2T0;
[0133] S204. Determine whether data has been received;
[0134] That is, determine whether the RS485 bus receives data within 2T0 time; if yes, determine that the RS485 bus is busy, and execute step S206; otherwise, determine that the RS485 bus is idle, and execute step S205.
[0135] S205. Determine that the RS485 bus is idle, and send uplink data to the master device through one or more of the first set of uplink time slots pre-configured by the master device.
[0136] S206. RS485 bus is busy.
[0137] S207. Determine whether the current time slot is the last uplink free time slot; if so, it means that there is no available time slot in the current uplink free time slot, and then proceed to step S208; otherwise, it means that there is an available time slot in the current uplink free time slot, and then proceed to step S209.
[0138] S208. The uplink data is shifted to the time slot corresponding to the first slave device in the pre-configured fixed-point uplink time slot of the master device and sent to the master device;
[0139] S209. Proceed to the next uplink free time slot and return to continue executing step S203, that is, perform idle detection of the RS485 bus for 2T0 duration in the next uplink free time slot.
[0140] In other words, when it is determined that the RS485 bus is busy:
[0141] If there is an available time slot in the first group of uplink time slots (i.e., uplink free time slots), the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle;
[0142] If there is no available time slot in the first set of uplink time slots, the uplink data is shifted to the time slot corresponding to the local slave device in the second set of uplink time slots (i.e., fixed-point uplink time slots) pre-configured by the master device and sent to the master device.
[0143] Therefore, corresponding to the method on the device side described above, this application also provides a method on the master device side. Specifically:
[0144] This application provides another communication method applied to an RS485 bus communication system, wherein the RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus. The method is applied to the master device. See [link to relevant documentation]. Figure 5 The method includes:
[0145] S301. Based on the information of the slave device currently connected to the master device, determine the configuration information of the following three sets of time slots:
[0146] The first set of uplink time slots used to send data from the device to the master device;
[0147] A set of downlink time slots used by the master device to send data to the slave device;
[0148] The second set of uplink time slots is used to send data from the device to the master device;
[0149] Each time slot group includes at least one time slot;
[0150] S302. Send the configuration information of the three sets of time slots to the slave device that has established a connection with the master device.
[0151] In some implementations, before sending the configuration information of the three sets of time slots to the slave device that has established a connection with the master device, the method further includes:
[0152] The master device sends its current time adjustment parameters to the slave device that has established a connection with the master device. The time adjustment parameters are used to instruct the slave device to perform time calibration with the master device.
[0153] For example Figure 3 As shown, the master device sends a time slot to each slave device before the three types of time slots mentioned above.
[0154] In some implementations, see Figure 6 The method further includes:
[0155] S401. When a new slave device is added or a slave device is deleted in the system, the master device re-determines the configuration information of the three sets of time slots (free uplink time slot, free downlink time slot, and fixed-point uplink time slot) based on the information of the slave device currently connected to the master device.
[0156] S402, The main equipment is waiting for the nearest free downlink time slot to arrive;
[0157] S403. In the most recent free downlink time slot, the master device sends the redefined configuration information of the three sets of time slots to the slave device that has established a connection with the master device.
[0158] The master and slave devices within the system communicate according to the three sets of time slots configured in the latest system.
[0159] For example, if the current system has 8 door magnets, 3 switch relays, and 5 temperature detectors, then the design should include 8 free uplink time slots, 3 free downlink time slots, and 16 timed reporting time slots. Door magnet-triggered alarms should preferably report alarm data in the free uplink time slots, and the main device control relays should report in the free downlink time slots. If new devices are added or deleted later, the main device should broadcast the time slots and configuration information for each type of time slot, adjusting the number of each type of time slot.
[0160] In some implementations, the configuration information for the three sets of time slots includes:
[0161] The duration of each time slot;
[0162] The number of slots in each group.
[0163] In some implementations, assuming the total number of slave devices currently connected to the master device is N, then:
[0164] If there are many occasional events triggering slave devices in the current system, such as door magnetic detectors deployed in the system, the triggering of opening the door is uncertain and may be triggered by someone at any time, then configure the number of the first group of uplink time slots to be N, the number of the downlink time slots to be N / 2, and the number of the second group of uplink time slots to be N;
[0165] If there are many reverse control slave devices in the current system, for example, the proportion of bus-controlled switch relays among the slave devices is high, and the master device sends commands to control the opening / closing of the switch relays, then the number of the first group of uplink time slots is configured as N / 2, the number of the downlink time slots is N, and the number of the second group of uplink time slots is N.
[0166] If there are many periodic reporting slave devices in the current system, such as many temperature acquisition slave devices on the bus, and these are all periodic acquisition environment issues, then configure the number of the first group of uplink time slots to be N / 2, the number of the downlink time slots to be N / 2, and the number of the second group of uplink time slots to be N.
[0167] After receiving the time slot and configuration information of the three types of time slots from the master device, the slave device determines the duration of a single time slot, the number of free uplink time slots, the number of free downlink time slots, and the number of fixed-point uplink time slots, thus maintaining a unified time slot configuration with the master device. When an alarm is triggered, the slave device prioritizes sending data in the free uplink time slots. If the current free uplink time slot is always busy, the data is reported in the fixed-point uplink time slot. For example, if both slave devices with short address 1 and short address 2 need to send alarm data, if the slave device with short address 1 detects that the bus is idle in the current free uplink time slot, the short address 1 device starts sending data. At this time, the slave device with short address 2 will detect that the bus is busy in the current free uplink time slot, and will check whether the bus is busy in the next free uplink time slot. If the slave device with short address 1 has already completed sending in the next free uplink time slot, the bus is idle, and the slave device with short address 2 can send data in the next free uplink time slot.
[0168] The following describes the device or apparatus provided in the embodiments of this application, and the explanations or examples of the same or corresponding technical features as those described in the above methods will not be repeated hereafter.
[0169] An electronic device is provided in an embodiment of this application, see [link to example]. Figure 7 For example, it includes: processor 600 and memory 620;
[0170] If the aforementioned electronic device is used as a slave device in an RS485 bus communication system, then:
[0171] Processor 600 is used to read the program from memory 620 and execute the following procedures:
[0172] Determine whether the local slave device needs to send uplink data to the master device;
[0173] Determine the idle detection duration for the RS485 bus;
[0174] During the idle detection period, the RS485 bus is idle-detected.
[0175] When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the first set of uplink time slots pre-configured by the master device;
[0176] When it is determined that the RS485 bus is busy:
[0177] If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle;
[0178] If there is no available time slot in the first set of uplink time slots, the uplink data is postponed to the time slot corresponding to the local slave device in the second set of uplink time slots pre-configured by the master device and sent to the master device.
[0179] In some embodiments, the processor 600 is further configured to read a program from the memory 620 and execute the following processes:
[0180] In the downlink time slot pre-configured by the master device, receive the timing parameters sent by the master device;
[0181] Based on the time parameters, time calibration is performed between the local slave device and the master device.
[0182] In some embodiments, the processor 600 is further configured to read a program from the memory 620 and execute the following processes:
[0183] In the downlink time slot pre-configured by the master device, receive the following three sets of time slot configuration information latest determined and sent by the master device:
[0184] The first set of uplink time slots used to send data from the device to the master device;
[0185] A set of downlink time slots used by the master device to send data to the slave device;
[0186] The second set of uplink time slots is used to send data from the device to the master device;
[0187] Each time slot group includes at least one time slot.
[0188] If the above electronic device is used as the master device in an RS485 bus communication system, then:
[0189] Processor 600 is used to read the program from memory 620 and execute the following procedures:
[0190] Based on the information of the slave devices currently connected to the master device, the following three sets of timeslot configuration information are determined:
[0191] The first set of uplink time slots used to send data from the device to the master device;
[0192] A set of downlink time slots used by the master device to send data to the slave device;
[0193] The second set of uplink time slots is used to send data from the device to the master device;
[0194] Each time slot group includes at least one time slot;
[0195] The configuration information of the three sets of time slots is sent to the slave device that has established a connection with the master device.
[0196] In some implementations, before sending the configuration information of the three sets of time slots to the slave device that has established a connection with the master device, the processor 600 is further configured to read the program in the memory 620 and execute the following process:
[0197] The master device sends its current time adjustment parameters to the slave device that has established a connection with the master device. The time adjustment parameters are used to instruct the slave device to perform time calibration with the master device.
[0198] In some embodiments, the processor 600 is further configured to read a program from the memory 620 and execute the following processes:
[0199] When a new slave device is added or a slave device is deleted in the system, the configuration information of the three sets of time slots is re-determined based on the information of the slave device currently connected to the master device, and the re-determined configuration information of the three sets of time slots is sent to the slave device connected to the master device in the most recent downlink time slot.
[0200] In some implementations, the configuration information for the three sets of time slots includes:
[0201] The duration of each time slot;
[0202] The number of slots in each group.
[0203] In some implementations...
[0204] The number of uplink time slots in the first group is N, the number of downlink time slots is N / 2, and the number of uplink time slots in the second group is N;
[0205] Alternatively, the number of uplink time slots in the first group is N / 2, the number of downlink time slots is N, and the number of uplink time slots in the second group is N;
[0206] Alternatively, the number of uplink time slots in the first group is N / 2, the number of downlink time slots is N / 2, and the number of uplink time slots in the second group is N;
[0207] Wherein, N is the total number of slave devices currently connected to the master device.
[0208] Transceiver 610 is used to receive and send data under the control of processor 600.
[0209] Among them, Figure 7 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 600 and memory represented by memory 620 together. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 610 can be multiple components, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium, including wireless channels, wired channels, optical fibers, etc. For different user equipment, the user interface 630 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.
[0210] The processor 600 is responsible for managing the bus architecture and general processing, while the memory 620 can store the data used by the processor 600 when performing operations.
[0211] In some implementations, the processor 600 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or a CPLD (Complex Programmable Logic Device), and the processor may also employ a multi-core architecture.
[0212] The processor executes any of the methods described in the embodiments of this application according to the obtained executable instructions by calling a computer program stored in memory. The processor and memory may also be physically separated.
[0213] It should be noted that the apparatus provided in this application embodiment can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0214] See Figure 8 This application provides a communication device for an RS485 bus communication system, wherein the RS485 bus communication system (e.g., Figure 1 (As shown) includes: a master device, and at least one slave device connected to the master device via the RS485 bus, the device being applied to the slave device, the device comprising:
[0215] Uplink data determination unit 11 is used to determine whether the local slave device needs to send uplink data to the master device.
[0216] The detection duration determination unit 12 is used to determine the idle detection duration for the RS485 bus;
[0217] RS485 bus idle detection unit 13 is used to perform idle detection on the RS485 bus during the idle detection duration.
[0218] Data reporting unit 14 is used for:
[0219] When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the first set of uplink time slots pre-configured by the master device;
[0220] When it is determined that the RS485 bus is busy:
[0221] If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle;
[0222] If there is no available time slot in the first set of uplink time slots, the uplink data is postponed to the time slot corresponding to the local slave device in the second set of uplink time slots pre-configured by the master device and sent to the master device.
[0223] In some embodiments, the device further includes a time calibration unit for:
[0224] In the downlink time slot pre-configured by the master device, receive the timing parameters sent by the master device;
[0225] Based on the time parameters, time calibration is performed between the local slave device and the master device.
[0226] In some embodiments, the apparatus further includes a time slot configuration information receiving unit, for:
[0227] In the downlink time slot pre-configured by the master device, receive the following three sets of time slot configuration information latest determined and sent by the master device:
[0228] The first set of uplink time slots used to send data from the device to the master device;
[0229] A set of downlink time slots used by the master device to send data to the slave device;
[0230] The second set of uplink time slots is used to send data from the device to the master device;
[0231] Each time slot group includes at least one time slot.
[0232] See Figure 9 This application provides a communication device for an RS485 bus communication system, wherein the RS485 bus communication system (e.g., Figure 1 (As shown) includes: a master device, and at least one slave device connected to the master device via the RS485 bus, the device being applied to the master device, the device comprising:
[0233] The time slot configuration unit 21 is used to determine the configuration information of the following three sets of time slots based on the information of the slave device currently connected to the master device:
[0234] The first set of uplink time slots used to send data from the device to the master device;
[0235] A set of downlink time slots used by the master device to send data to the slave device;
[0236] The second set of uplink time slots is used to send data from the device to the master device;
[0237] Each time slot group includes at least one time slot;
[0238] The configuration information sending unit 22 is used to send the configuration information of the three sets of time slots to the slave device that has established a connection with the master device.
[0239] In some embodiments, before sending the configuration information of the three sets of time slots to the slave device that has established a connection with the master device, the time slot configuration unit 21 is further configured to:
[0240] The master device sends its current time adjustment parameters to the slave device that has established a connection with the master device. The time adjustment parameters are used to instruct the slave device to perform time calibration with the master device.
[0241] In some embodiments, the time slot configuration unit 21 is further configured to:
[0242] When a new slave device is added or a slave device is deleted in the system, the configuration information of the three sets of time slots is re-determined based on the information of the slave device currently connected to the master device, and the re-determined configuration information of the three sets of time slots is sent to the slave device connected to the master device in the most recent downlink time slot.
[0243] In some implementations, the configuration information for the three sets of time slots includes:
[0244] The duration of each time slot;
[0245] The number of slots in each group.
[0246] In some implementations...
[0247] The number of uplink time slots in the first group is N, the number of downlink time slots is N / 2, and the number of uplink time slots in the second group is N;
[0248] Alternatively, the number of uplink time slots in the first group is N / 2, the number of downlink time slots is N, and the number of uplink time slots in the second group is N;
[0249] Alternatively, the number of uplink time slots in the first group is N / 2, the number of downlink time slots is N / 2, and the number of uplink time slots in the second group is N;
[0250] Wherein, N is the total number of slave devices currently connected to the master device.
[0251] In summary, the RS485 bus communication system provided in this application includes: a master device, and at least one slave device connected to the master device via an RS485 bus, wherein:
[0252] The main device is used for:
[0253] Based on the information of the slave devices currently connected to the master device, the following three sets of timeslot configuration information are determined:
[0254] The first set of uplink time slots used to send data from the device to the master device;
[0255] A set of downlink time slots used by the master device to send data to the slave device;
[0256] The second set of uplink time slots is used to send data from the device to the master device;
[0257] Each time slot group includes at least one time slot;
[0258] The configuration information of the three sets of time slots is sent to the slave device that has established a connection with the master device through the downlink time slot;
[0259] The slave device is used for:
[0260] Determine whether the local slave device needs to send uplink data to the master device;
[0261] Determine the idle detection duration for the RS485 bus;
[0262] During the idle detection period, the RS485 bus is idle-detected.
[0263] When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the uplink time slots in the first group of uplink time slots;
[0264] When it is determined that the RS485 bus is busy:
[0265] If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle;
[0266] If there is no available time slot in the first group of uplink time slots, the uplink data is shifted to the time slot corresponding to the local slave device in the second group of uplink time slots and sent to the master device.
[0267] The further functions of the master and slave devices are as described in the aforementioned methods and apparatus sections, and will not be repeated here.
[0268] It should be noted that the division of units in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.
[0269] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0270] Any of the devices or apparatuses provided in the embodiments of this application may specifically be desktop computers, portable computers, smartphones, tablet computers, personal digital assistants (PDAs), etc. They may include a central processing unit (CPU), memory, input / output devices, etc. Input devices may include keyboards, mice, touchscreens, etc., and output devices may include display devices such as liquid crystal displays (LCDs) and cathode ray tubes (CRTs).
[0271] The memory may include read-only memory (ROM) and random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In the embodiments of this application, the memory may be used to store the program of any of the methods provided in the embodiments of this application.
[0272] The processor executes any of the methods described in the embodiments of this application according to the program instructions stored in the memory.
[0273] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the methods described in the above embodiments. The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0274] This application provides a computer-readable storage medium for storing computer program instructions used in the apparatus provided in the above-described embodiments, including a program for performing any of the methods provided in the above-described embodiments. The computer-readable storage medium may be a non-transitory computer-readable medium.
[0275] The computer-readable storage medium can be any available medium or data storage device that a computer can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0276] It should be understood that:
[0277] The access technology used by entities in a communication network to transmit traffic can be any suitable current or future technology, such as WLAN (Wireless Local Access Network), WiMAX (Microwave Access Global Interoperability), LTE, LTE-A, 5G, Bluetooth, infrared, etc.; in addition, embodiments may also apply wired technologies, such as IP-based access technologies, such as wired networks or fixed lines.
[0278] An embodiment suitable for implementation as software code or as part thereof and for operation using a processor or processing function is independent of the software code and can be specified using any known or future-developed programming language, such as high-level programming languages such as Objective-C, C, C++, C#, Java, Python, Javascript, other scripting languages, etc., or low-level programming languages such as machine language or assembler.
[0279] The implementation of the embodiments is hardware-independent and can be implemented using any known or future-developed hardware technology or any combination thereof, such as microprocessors or CPUs (central processing units), MOS (metal-oxide-semiconductor), CMOS (complementary MOS), BiMOS (bipolar MOS), BiCMOS (bipolar CMOS), ECL (emitter-coupled logic), and / or TTL (transistor-transistor logic).
[0280] The embodiments may be implemented as individual devices, apparatuses, units, components or functions, or in a distributed manner. For example, one or more processors or processing functions may be used or shared in the process, or one or more processing segments or processing portions may be used and shared in the process, wherein one or more physical processors may be used to implement one or more processing portions dedicated to a particular process as described.
[0281] The device can be implemented by a semiconductor chip, a chipset, or a (hardware) module that includes such a chip or chipset.
[0282] The implementation can also be implemented as any combination of hardware and software, such as ASIC (Application-Specific IC (Integrated Circuit)) components, FPGA (Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device) components or DSP (Digital Signal Processor) components.
[0283] The embodiments can also be implemented as computer program products, including a computer-usable medium in which computer-readable program code is embodied, the computer-usable program code being adapted to perform the processes described in the embodiments, wherein the computer-usable medium may be a non-transitory medium.
[0284] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0285] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0286] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0287] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0288] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A communication method applied to an RS485 bus communication system, characterized in that, The RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus. The method is applied to the slave device, and the method includes: Determine whether the local slave device needs to send uplink data to the master device; Determine the idle detection duration for the RS485 bus; During the idle detection period, the RS485 bus is idle-detected. When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the first set of uplink time slots pre-configured by the master device; When it is determined that the RS485 bus is busy: If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle; If there is no available time slot in the first set of uplink time slots, the uplink data is postponed to the time slot corresponding to the local slave device in the second set of uplink time slots pre-configured by the master device and sent to the master device.
2. The method according to claim 1, characterized in that, The method further includes: In the downlink time slot pre-configured by the master device, receive the timing parameters sent by the master device; Based on the time parameters, time calibration is performed between the local slave device and the master device.
3. The method according to claim 1, characterized in that, The method further includes: In the downlink time slot pre-configured by the master device, receive the following three sets of time slot configuration information latest determined and sent by the master device: The first set of uplink time slots used to send data from the device to the master device; A set of downlink time slots used by the master device to send data to the slave device; The second set of uplink time slots is used to send data from the device to the master device; Each time slot group includes at least one time slot.
4. A communication method applied to an RS485 bus communication system, characterized in that, The RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus. The method is applied to the master device, and the method includes: Based on the information of the slave devices currently connected to the master device, the following three sets of timeslot configuration information are determined: The first set of uplink time slots used to send data from the device to the master device; A set of downlink time slots used by the master device to send data to the slave device; The second set of uplink time slots is used to send data from the device to the master device; Each time slot group includes at least one time slot; The configuration information of the three sets of time slots is sent to the slave device that has established a connection with the master device.
5. The method according to claim 4, characterized in that, Before sending the configuration information of the three sets of time slots to the slave device that has established a connection with the master device, the method further includes: The master device sends its current time adjustment parameters to the slave device that has established a connection with the master device. The time adjustment parameters are used to instruct the slave device to perform time calibration with the master device.
6. The method according to claim 4, characterized in that, The method further includes: When a new slave device is added or a slave device is deleted in the system, the configuration information of the three sets of time slots is re-determined based on the information of the slave device currently connected to the master device, and the re-determined configuration information of the three sets of time slots is sent to the slave device connected to the master device in the most recent downlink time slot.
7. The method according to claim 4, characterized in that, The configuration information for the three time slots includes: The duration of each time slot; The number of slots in each group.
8. The method according to claim 7, characterized in that, The number of uplink time slots in the first group is N, the number of downlink time slots is N / 2, and the number of uplink time slots in the second group is N; Alternatively, the number of uplink time slots in the first group is N / 2, the number of downlink time slots is N, and the number of uplink time slots in the second group is N; Alternatively, the number of uplink time slots in the first group is N / 2, the number of downlink time slots is N / 2, and the number of uplink time slots in the second group is N; Wherein, N is the total number of slave devices currently connected to the master device.
9. A communication device applied to an RS485 bus communication system, characterized in that, The RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus. The device is applied to the slave device and includes: An uplink data determination unit is used to determine whether the local slave device needs to send uplink data to the master device. The detection duration determination unit is used to determine the idle detection duration for the RS485 bus; An RS485 bus idle detection unit is used to perform idle detection on the RS485 bus during the idle detection duration. The data reporting unit is used for: When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the first set of uplink time slots pre-configured by the master device; When it is determined that the RS485 bus is busy: If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle; If there is no available time slot in the first set of uplink time slots, the uplink data is postponed to the time slot corresponding to the local slave device in the second set of uplink time slots pre-configured by the master device and sent to the master device.
10. A communication device applied to an RS485 bus communication system, characterized in that, The RS485 bus communication system includes: a master device, and at least one slave device connected to the master device via the RS485 bus. The device is applied to the master device and includes: The time slot configuration unit is used to determine the configuration information of the following three sets of time slots based on the information of the slave device currently connected to the master device: The first set of uplink time slots used to send data from the device to the master device; A set of downlink time slots used by the master device to send data to the slave device; The second set of uplink time slots is used to send data from the device to the master device; Each time slot group includes at least one time slot; The configuration information sending unit is used to send the configuration information of the three sets of time slots to the slave device that has established a connection with the master device.
11. An RS485 bus communication system, characterized in that, include: A master device, and at least one slave device connected to the master device via an RS485 bus, wherein: The main device is used for: Based on the information of the slave devices currently connected to the master device, the following three sets of timeslot configuration information are determined: The first set of uplink time slots used to send data from the device to the master device; A set of downlink time slots used by the master device to send data to the slave device; The second set of uplink time slots is used to send data from the device to the master device; Each time slot group includes at least one time slot; The configuration information of the three sets of time slots is sent to the slave device that has established a connection with the master device through the downlink time slot; The slave device is used for: Determine whether the local slave device needs to send uplink data to the master device; Determine the idle detection duration for the RS485 bus; During the idle detection period, the RS485 bus is idle-detected. When it is determined that the RS485 bus is idle, the uplink data is sent to the master device through one or more of the uplink time slots in the first group of uplink time slots; When it is determined that the RS485 bus is busy: If there is an available time slot in the first group of uplink time slots, the uplink data is postponed to the available time slot and sent to the master device when the RS485 bus is idle; If there is no available time slot in the first group of uplink time slots, the uplink data is shifted to the time slot corresponding to the local slave device in the second group of uplink time slots and sent to the master device.
12. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method according to any one of claims 1 to 8.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing the computer to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data conflict transmission method based on RS485 communication
CN107659456A
RS485 bus communication method based on group calling and time slot allocation
CN113094321A
Bus scheduling method and device based on time slot allocation, equipment and medium
CN119484196A
Identification of Hybrid ARQ (HARQ ID) and Repetition Window for Autonomous Repeated Uplink Transmissions
US20210014003A1