Two-bus data transmission method

By introducing a communication frame transmission method in the time domain of request preemption and event contention in a two-bus fire communication system, and using current values ​​to characterize event types and make decisions based on priority, the problem of low communication efficiency in the prior art is solved, and timely reporting of emergency events is realized.

CN121619191APending Publication Date: 2026-03-06HANGZHOU HIKFIRE TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511751638.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-03-06

Smart Images

  • Figure CN121619191A_ABST
    Figure CN121619191A_ABST
Patent Text Reader

Abstract

The invention provides a two-bus data transmission method, which is applied to a master station machine, and comprises the following steps that: the master station machine responds to a preemption communication frame which is sent by a slave station machine in a code returning area of a request preemption time domain and carries a request preemption signal, and sends a response communication frame which carries a bus state response signal in a code sending area of the request preemption time domain; the master station machine receives an event communication frame which is sent by the slave station machine in a code returning area of the event competition time domain and carries an event competition signal, and the event communication frame is generated after the slave station machine judges that the request is allowed to be preempted according to the bus state response signal; the main station machine generates an event competition result signal according to the event priority; and the master station machine sends a two-bus distribution communication frame carrying an event competition result signal in a code sending area of the event competition time domain so as to notify the slave station machine to reserve competition for the two buses according to the event competition result signal, so that the slave station machine reports an event according to a competition reservation result of the two buses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method for transmitting two-bus data. Background Technology

[0002] Two-wire bus is a two-wire communication line that can transmit information and power simultaneously. This type of line only requires two wires to complete communication and power supply between devices, reducing wiring complexity and improving system reliability and maintainability. It is widely used in the fire protection industry.

[0003] In a fire communication system based on a two-wire bus, the controller connects to multiple monitoring devices, such as smoke detectors, heat detectors, manual reporting devices, and fire hydrants. Typically, the controller retrieves alarm information from different monitoring devices by polling in turn. However, this polling method has low communication efficiency; the polling time increases with the number of monitoring devices, slowing down event reporting. In emergency applications such as fire alarms, it cannot promptly report fire alarms occurring at the monitoring devices to the controller, posing a safety hazard. Summary of the Invention

[0004] This application provides a method for transmitting data via a two-bus system to solve the problem of important events not being reported in a timely manner in a two-bus fire communication system.

[0005] In a first aspect, this application provides a method for transmitting two-bus data. The method is applied to a master station, whereby the master station and at least one slave station transmit communication frames according to an agreed-upon protocol. Each communication frame includes a preemption request time domain and an event contention time domain following the preemption request time domain. The method includes: The master station responds to the slave station's preemption communication frame carrying the preemption request signal sent in the code return area of ​​the preemption request time domain, and sends a response communication frame carrying the bus status response signal in the code transmission area of ​​the preemption request time domain. The master station receives the event communication frame carrying the event contention signal sent by the slave station in the code area of ​​the event contention time domain. The event communication frame is the communication frame generated by the slave station after determining that the request to preempt is allowed based on the bus status response signal. The master station generates an event contention result signal based on event priority; The master station sends a two-bus allocation communication frame carrying the event contention result signal within the coding zone of the event contention time domain, in order to notify the slave station to retain the contention for the two-bus according to the event contention result signal, so that the slave station can report the event according to the contention retention result of the two-bus.

[0006] Furthermore, the event contention signal uses different current values ​​to characterize different event types; The master station generates event contention result signals based on event priority, including: The master station detects the magnitude of the superimposed current value on the two buses within the code return area of ​​the event contention time domain, and determines the type combination of events reported by the slave station based on the detected superimposed current value. The master station generates an event contention result signal based on the highest priority event type among the event type combinations.

[0007] Furthermore, when the master station determines that there are at least two different types of combinations based on the superposition value of the current on the two buses in the code region of the event contention time domain, the master station generates the first event contention result signal according to the first event type with the highest priority among the at least two different types of combinations. After the master station sends a two-bus allocation communication frame carrying the result signal of the first event contention, if the master station does not receive a response signal from the slave station within the agreed time, the master station will exclude the combination of types containing the first event type. The master station generates a second event contention result signal based on the second event type with the highest priority among the remaining combinations of types, and sends a two-bus allocation communication frame carrying the second event contention result signal.

[0008] Furthermore, the transmission method also includes: The master station obtains the combination of event types that match the detected current superposition values ​​on the two buses in the code region of the event contention time domain and the mapping table. The mapping table is constructed by the master station based on the number of slave stations connected to the master station and the event types reported by each slave station. It is a mapping table that combines the superimposed current values ​​on the two buses in the code region of the event contention time domain with the types of events reported by the slave stations.

[0009] Furthermore, the master station determines the number of slave stations participating in the competition based on the magnitude of the superimposed current value on the two buses detected in the code region of the event contention time domain, combined with the type combination.

[0010] Furthermore, the master station generates an event contention result signal based on the highest priority event type in the combination of event types, including: In response to the master station determining the high-priority different event types in the event type combination, the master station changes the high-level pulse width on the second bus in the coding area of ​​the event contention time domain to form different event contention result signals corresponding to the different high-priority different event types.

[0011] Furthermore, following the event contention time domain, there are also device priority contention time domains and event data time domains. In the code return area of ​​the device priority contention time domain, the master station receives the device priority contention communication frame sent by the slave station, which carries the slave station's device address bits. The device priority contention communication frame is a communication frame that notifies the master station to make a decision on the two-bus contention of the slave station based on the device priority. The master station generates a priority contention result communication frame based on the device priority and the order of the slave device address bits in the device priority contention communication frame. The priority contention result communication frame is generated by the master station and is used to notify the slave device of at least one target device address bit that it has successfully competed for. In the coding zone of the device priority contention time domain, the master station sends out a priority contention result communication frame. Each target device address bit matches at least one slave device's address bit in the same order, so as to notify the slave station that matches the target device address bit to continue reporting the next slave device's address bit in another coding zone of the device priority contention time domain, until all slave device address bits of any slave device match the target device address bit notified by the master station. The master station then receives the event reported by the slave station in the coding zone of the event data time domain.

[0012] Furthermore, the transmission method also includes: After receiving the event reported by the slave station in the code return area of ​​the event data time domain, the master station sends an event end communication frame indicating the termination of the event in the code transmission area of ​​the event data time domain, so as to notify the slave station to stop reporting and withdraw from the current competition after reporting the event.

[0013] Based on the two-bus data transmission method provided in the first aspect of this application, the master station first receives a request to preempt signal. The master station responds to the request by sending a bus status response signal indicating whether the two buses are idle, ensuring that the slave station actively initiates contention when the two buses are idle. When two-bus contention is permitted, the master station receives an event communication frame from the slave station carrying an event contention signal. This event contention signal characterizes the event type that the slave station will report. The master station generates an event contention result signal based on the high-priority event type. This result signal instructs the slave device reporting the high-priority event type to retain contention for event reporting, thus achieving priority filtering based on event type and prioritizing contention for emergency alarm events, ensuring timely handling of emergency events.

[0014] Secondly, this application also provides a two-bus data transmission method applied to a slave station, wherein the slave station and the master station transmit communication frames according to an agreed protocol. The communication frame includes a request-preemption time domain and an event contention time domain following the request-preemption time domain. The method includes: The slave station sends a preemption communication frame carrying a preemption request signal in the code return area of ​​the preemption request time domain, and receives a response communication frame carrying a bus status response signal from the master station in the code transmission area of ​​the preemption request time domain. The slave station determines whether preemption is allowed based on the bus status response signal. If it is allowed, the slave station sends an event communication frame carrying the event contention signal in the code area of ​​the event contention time domain. The slave station receives the two-bus allocation communication frame carrying the event contention result signal from the master station within the code transmission zone of the event contention time domain; The slave station responds when the event type and event contention result signal reported by itself are successfully matched, retains the contention for the two buses, and reports the event.

[0015] Furthermore, following the event contention time domain, there are also device priority contention time domains and event data time domains. The slave station reports its device address bits in the code return area of ​​the device priority contention time domain; In response to the priority contention result communication frame sent by the master station in the coding zone of the device priority contention time domain, the slave station performs a slave station device address bit matching operation, including: When the slave station responds to the fact that the slave station device address bit reported by itself matches the target device address bit in the priority contention result communication frame, the slave station continues to report the next slave station device address bit in another code area of ​​the device priority contention time domain. The slave station responds to a matching failure and withdraws from the current competition. The slave station performs a slave station device address bit matching operation until the slave station device address bit completely matches the target device address bit in the priority contention result communication frame sent by the master station, and reports the event in the return code area of ​​the event data time domain.

[0016] Based on the two-bus data transmission method provided in the second aspect of this application, the slave station first sends a request to preempt signal in the code area of ​​the request preemption time domain. After receiving a bus status response signal from the master station indicating that the two-bus is in an idle state, subsequent contention occurs, ensuring that the slave station actively initiates contention while the two-bus is idle. The slave station sends an event contention signal representing the type of reported event in the code area of ​​the event contention time domain. The master station receives the event contention signal and generates an event contention result signal based on the high-priority event type. The event contention result signal can instruct the slave device reporting the high-priority event type to retain contention, thus achieving priority filtering based on event type and prioritizing contention for emergency alarm events, ensuring timely handling of emergency events. Attached Figure Description

[0017] Figure 1This is a flowchart of a two-bus data transmission method provided in one embodiment of this application; Figure 2 This is a time-domain schematic diagram of a slave station actively initiating contention, provided in one embodiment of this application. Figure 3 A flowchart illustrating how a master station generates an event contention result signal based on event priority, according to one embodiment of this application; Figure 4 This is a time-domain schematic diagram of a slave station actively initiating contention, provided as another embodiment of this application. Figure 5 This is a schematic diagram of the code elements of a fire-fighting two-wire communication system provided in one embodiment of this application; Figure 6 A timing diagram illustrating the communication status between the master station and the slave station in a fire-fighting two-wire communication system provided in one embodiment of this application; Figure 7 This is a schematic diagram of a fire-fighting two-wire communication system provided in one embodiment of this application; Figure 8 This is a schematic diagram of a two-bus communication system provided in one embodiment of this application; Figure 9 This is a schematic diagram of the code-sending and preemption process of a fire-fighting two-bus communication system provided in one embodiment of this application. Detailed Implementation

[0018] The present application will be described in detail below with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present application. Any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the protection scope of the present application.

[0019] A two-wire bus is a communication line that can transmit information and power simultaneously. This type of line requires only two wires to complete communication and power supply between devices, and typically uses a polling method where the controller sequentially queries different monitoring devices to obtain alarm information. However, this polling alarm method has low communication efficiency, especially in emergency applications such as fire alarms, where it cannot promptly report fire alarms occurring at the monitoring devices to the controller, posing a safety hazard.

[0020] Since the two-bus communication system itself lacks physical bus collision detection, attempting to improve communication efficiency by having slave devices actively report data may result in multiple devices simultaneously attempting to send data, leading to collisions. While different priorities can be assigned to different devices, and the master station can coordinate to ensure high-priority devices have priority access to the bus, thus guaranteeing contention for data transmission, this method may result in high-priority devices consistently using the bus first, causing other devices to miss the event processing deadline by the time they acquire the bus.

[0021] The purpose of this application is to provide a two-bus data contention transmission method that can ensure timely reporting of important events.

[0022] Firstly, such as Figure 1 As shown, this application provides a two-bus data transmission method. The transmission method is applied to a master station, and the master station and at least one slave station transmit communication frames according to an agreed protocol. In one embodiment of this application, the communication frame includes a request preemption time domain and an event contention time domain located after the request preemption time domain. Based on the communication frame, the transmission method includes the following steps: Step S11: In response to the preemption communication frame carrying the preemption request signal sent by the slave station in the code return area of ​​the preemption request time domain, the master station sends a response communication frame carrying the bus status response signal in the code transmission area of ​​the preemption request time domain. Step S12: The master station receives the event communication frame carrying the event contention signal sent by the slave station in the code area of ​​the event contention time domain. The event communication frame is the communication frame generated by the slave station after determining that the request to preempt is allowed based on the bus status response signal. Step S13: The master station generates an event contention result signal based on the event priority; Step S14: The master station sends a two-bus allocation communication frame carrying the event contention result signal in the coding area of ​​the event contention time domain, so as to notify the slave station to retain the contention for the two-bus according to the event contention result signal, so that the slave station can report the event according to the contention retention result of the two-bus.

[0023] Specifically, in a two-bus communication system, the master station and slave stations are connected via two buses. All slave stations are connected in parallel on the buses and powered by them. One bus serves as the reference ground for power and signals, while the other serves as the power supply line. In this embodiment, the high-level interval on the two buses is defined as the code transmission area, and the low-level interval as the code return area. In the code transmission area, the master station sends downlink voltage-modulated communication frames to the slave stations. The slave stations can parse the information expressed by the master station based on the received voltage value or pulse width. In the code return area, the slave stations send uplink current-modulated communication frames to the master station. The master station can parse the information expressed by the slave station based on the received current value. Through this uplink current and downlink voltage modulation method, bidirectional communication between the master station and slave stations is achieved.

[0024] like Figure 2The diagram illustrates the time domain after a slave station initiates contention, as provided in an embodiment of this application. According to the two-bus data transmission method provided in this embodiment, the time domain during which the slave station initiates contention includes a preemption request time domain and an event contention time domain. The preemption request time domain represents the time domain in which the slave station requests control of the two-bus, and the event contention time domain represents the time domain in which the slave station competes for use of the two-bus based on the reported event type. The event contention time domain can either follow the preemption request time domain or be spaced a certain time apart from it.

[0025] In step S11, after receiving the preemption communication frame, the master station sends a response communication frame carrying a bus status response signal within the coding area of ​​the request preemption time domain. The bus status response signal can indicate the bus occupancy status, such as whether the bus is idle or preempted. By sending the response communication frame, the master station indicates to the slave station whether the two buses are idle. If the two buses are idle, the slave station is allowed to preempt the two buses.

[0026] The preemption communication frame is a communication frame sent by the slave station in the code area of ​​the request preemption time domain, carrying a request preemption signal. The preemption communication frame is used to notify the master station that a slave station has requested to preempt the two-wire bus. The request preemption signal can be a "bit" signal or a field in the preemption communication frame.

[0027] In step S12, the slave station receives the response communication frame. The slave station determines whether preemption is allowed based on the bus status response signal. If it is allowed, the slave station sends an event communication frame carrying the event contention signal to the master station in the code return area of ​​the event contention time domain. The master station receives the event communication frame sent by the slave station.

[0028] The response communication frame carries a bus status response signal, which indicates the status of the two buses (e.g., both buses are idle). The response communication frame is used by the master station to notify the slave station of the current status of the two buses. The event communication frame carries an event contention signal, which is initiated by the slave station. The event contention signal represents the event type that the slave station will report. The event communication frame is used to notify the master station to make a decision regarding the slave station's two-bus contention based on the priority of the event type.

[0029] In step S13, the master station generates an event contention result signal based on the event priority.

[0030] The event competition result signal is a signal initiated by the master station. This signal represents the master station's arbitration process in a competition among numerous slave stations based on event type, determining the winning event type. The master station selects the highest-priority event type from the competing events based on their priority. The priorities of different event types are preset, taking into account the urgency of the events. For example, an equipment alarm event indicates a potential fire or other emergency at the reporting slave station, while an equipment failure event indicates a potential malfunction at the reporting slave station, with lower urgency. Therefore, when setting priorities for different event types, the priority of equipment alarm events can be set higher than that of equipment failure events. In this embodiment, the high-priority event types are relative, referring to the top N event types in the competition, where N is a positive integer and can be set by those skilled in the art based on actual circumstances.

[0031] In step S14, the master station sends a two-bus allocation communication frame carrying the event contention result signal within the coding zone of the event contention time domain. The two-bus allocation communication frame carries the event contention result signal. The two-bus allocation communication frame is a communication frame initiated by the master station to reply to the slave station's event contention request (i.e., the event communication frame). When the slave station receives the two-bus allocation communication frame, it matches the event contention result information with the event type of the event that the slave station will report (i.e., the event type represented by the event contention signal reported by the slave station). If the event types are the same, it means that the slave station has won in this round of contention. Thus, the slave station can retain the contention for the two-bus according to the event contention result signal, so that the slave station can report the event according to the contention retention result of the two-bus.

[0032] There are two possible outcomes for a slave station's contention for the two-wire bus. One outcome is contention failure, where the slave station reports an event type with a lower priority than other slave stations. In this case, the slave station with the lower priority event type loses the contention and can withdraw from the current contention. Another possible outcome is a contested victory. If the priority of the event type reported by a slave station is higher than that of other slave stations, then the slave station with the highest priority of its reported event type wins the contest. In one scenario, only one slave station reports an event type with the highest priority relative to the other slave stations. In this case, the slave station with the highest priority of its reported event type wins the contest, and no other slave stations continue to participate in the contest for the second bus. The slave station with the highest priority of its reported event type can report the specific event in subsequent communication frames. In another scenario, multiple slave stations may report event types with the same priority, and their priority is the highest relative to the other slave stations. In this case, all of these slave stations with the highest priority can retain the contest for the second bus. These slave stations that retain the contest for the second bus can continue to compete for the second bus in other ways until only one slave station remains. The remaining slave station can then report the specific event in subsequent communication frames.

[0033] Based on this, in the two-bus data transmission method provided in this application, the master station first receives a request to preempt signal. The master station responds to the request by sending a bus status response signal indicating whether the two buses are idle, ensuring that the slave station actively initiates contention when the two buses are idle. When two-bus contention is permitted, the master station receives an event communication frame from the slave station carrying an event contention signal. This event contention signal characterizes the event type that the slave station will report. The master station generates an event contention result signal based on the high-priority event type. This result signal instructs the slave device reporting the high-priority event type to retain contention, thus achieving priority filtering based on event type and prioritizing contention for emergency alarm events, ensuring timely emergency event handling.

[0034] As an optional implementation, within the code-return region of the event contention time domain, the slave station generates an event contention signal by changing the current magnitude on the two buses. Different current values ​​can represent different event types. For example, the slave station can have alarm event types and fault event types. A first current value can represent the alarm event type, and a second current value can represent the fault event type, with the first and second current values ​​having different magnitudes. Furthermore, the event types can be further subdivided, using even more different current values ​​to represent each event type. In this embodiment, a certain error range is allowed for the current values ​​representing different event types, but the condition must be met that the master station can accurately identify and distinguish them.

[0035] If multiple slave devices need to report events simultaneously in the code return area, multiple slave devices will change the current on the two buses, and the current on the two buses will be accumulated, thus forming a superimposed current value. For example... Figure 3 As shown, as an optional implementation, the master station generates event contention result signals based on event priority, including: The master station detects the magnitude of the superimposed current value on the two buses in the code region of the event contention time domain, and determines the type combination of events reported from the station level based on the detected superimposed current value. The master station generates an event competition result signal based on the combination of event types and the highest priority event type in the combination.

[0036] Specifically, the event contention signal is an uplink current modulation signal sent by the slave station. Different current values ​​represent different event types. For example, a current value of 200µA represents a "fault event type," and a current value of 500µA represents an "alarm event type." Since multiple slave stations may participate in the contention simultaneously, and each slave station changes the current on the two-wire bus within the same event contention time domain's return code area, the current value detected by the master station within the event contention time domain's return code area is the sum of the currents uploaded by multiple slave devices. The master station finds it difficult to distinguish the event type reported by each slave station. Therefore, in this embodiment, the master station determines the combination of event types reported by the slave station based on the summed current value. For example, if the master station detects a current value of 400µA within the event contention time domain's return code area, it can determine that the slave station only reported a fault event type; if the master station detects a current value of 700µA within the event contention time domain's return code area, it can determine that the slave station reported both fault and alarm event types. By detecting the superimposed current value, the master station can determine the combination of event types reported by the slave station (for example, if the superimposed current value is detected to be 400ua, the slave station only reports "fault event type"; if the superimposed current value is detected to be 700ua, the slave station reports both "fault event type" and "alarm event type").

[0037] After the master station determines the combination of event types reported by the slave stations, it can generate an event contention result signal based on event priority. This signal is a downlink voltage modulation signal sent by the master station, which uses the pulse width of the high-level region to indicate different event types, thus instructing the slave stations to retain contention for the two-wire bus based on the event contention result signal. For example, it prioritizes slave devices reporting "alarm event types," ensuring that emergency events are given priority and that urgent events can be handled promptly.

[0038] In some embodiments, the master station can also obtain the number of slave stations participating in the competition by detecting the superimposed current value in the return code region of the event contention time domain. For example, assuming the master station detects a current value of 600ua in the return code region of the event contention time domain, it can be determined that three slave stations are participating in the competition, and the event types reported by the three slave stations are all fault event types. Assuming the master station detects a current value of 900ua in the return code region of the event contention time domain, it can also be determined that three slave stations are participating in the competition, and two slave stations should report event types as fault event types, and one slave station should report event type as an alarm event type.

[0039] As an optional implementation, when the master station determines that there are at least two different types of combinations based on the superposition value of the current on the two buses in the code region of the event contention time domain, the master station generates the first event contention result signal according to the first event type with the highest priority among the at least two different types of combinations. After the master station sends a two-bus allocation communication frame carrying the first event contention result signal, if the master station does not receive a response signal from the slave station within the agreed time, the master station excludes the type combination containing the first event type. The master station generates a second event contention result signal based on the second event type with the highest priority among the remaining type combinations, and sends a two-bus allocation communication frame carrying the second event contention result signal.

[0040] Specifically, assuming the master station detects a current value of 1000ua in the return code region of the event contention time domain, there are two possible combinations of event types. The first is that the slave stations only reported a fault event (all 5 slave stations reported a fault event), and the second is that the slave stations only reported an alarm event (two slave stations reported an alarm event). In this case, the master station can first generate an event contention result signal based on the highest priority event type (such as an alarm event) among the two combinations. When a slave station receives the event contention result signal, if there is an alarm event reported by a slave station, then that slave station is successfully matched, and the slave station retains its contention for the two-bus system. According to the subsequent bus preemption process, the slave station will continue to upload an uplink current modulation signal, which can be regarded as a response to the master station's event contention result signal. Thus, the master station can determine that the selected priority event is correct. If there is no alarm event reported by a slave station, the slave station will automatically determine that the event contention result signal is not an indication to itself, and the slave station will not respond. If the master station does not receive a response signal from the slave station within the agreed time, the master station can determine that no slave station has reported an alarm event type. The master station excludes the combination of types containing alarm event types, and generates a second event contention result signal based on the second event type (such as a fault event type) with the highest priority among the remaining combinations. The master station then sends a two-bus allocation communication frame carrying the second event contention result signal.

[0041] Based on the above description, in the transmission method provided in this application embodiment, when faced with the situation where the current superposition values ​​on the two buses in the return code region of the event contention time domain may have multiple combinations, the event types among the multiple combinations are prioritized and filtered, and the event contention result signal is generated with the highest priority first event type. After the master station sends the event contention result signal, if the master station does not receive a response signal from the slave station within a specified time, it indicates that no slave device is currently reporting the first event type, and the combination of types inferred by the master station containing the first event type is incorrect. The master station excludes the combination of types containing the first event type and generates the event contention result signal based on the highest priority second event type among the remaining combinations. This process continues until the highest priority event type currently reported by the slave station is found.

[0042] For ease of explanation, the above embodiments only illustrate two event types. When the number of event types expands to three or more, the combinations of event types become more complex. Based on the current superposition value detected by the master station in the code return area of ​​the event contention time domain, there may be multiple combinations. By using this method of eliminating error event priority options based on combinations of types, the currently correct highest priority event type can be quickly identified, enabling rapid filtering of event priorities and ensuring timely alarm for emergency events.

[0043] As an optional implementation, the master station obtains the combination of event types that match the detected current superposition values ​​on the two buses in the code region of the event contention time domain and the mapping table. The mapping table is constructed by the master station based on the number of slave stations connected to the master station and the event types reported by each slave station. It is a mapping table that combines the superimposed current values ​​on the two buses in the code region of the event contention time domain with the types of events reported by the slave stations.

[0044] Specifically, given a predetermined number of slave stations connected to the master station, since the number of slave stations is fixed, the current superposition value corresponding to different event type combinations reported by the slave stations can be logically deduced. Based on this, a mapping table between current superposition values ​​and event type combinations can be pre-built in the master station. By pre-building this mapping table, the master station can easily look up the event type combination after detecting the current superposition value on the two buses in the code region of the event contention time domain, facilitating rapid event priority filtering. If new slave stations are subsequently connected to the master station, or if some slave stations are disconnected from the master station, the number of slave stations connected to the master station changes. In this case, the mapping table between current superposition values ​​and event type combinations can be rebuilt according to the modified number of slave stations.

[0045] like Figure 4As shown, this diagram illustrates another time-domain scenario after a slave station initiates contention. Following the event contention time domain, a device priority contention time domain and an event data time domain are sequentially set. The device priority contention time domain is the time domain in which the slave station competes for information reporting using the two-wire bus based on the device address; the event data time domain is the time domain in which the slave station reports event data after winning the two-wire bus contention.

[0046] After the competition for event types is completed in the event contention time domain, the slave devices that successfully compete for the remaining event types further compete for the two-bus according to the device priority in the device priority contention time domain. The master station performs arbitration operation on the two-bus competition of the slave devices according to the device priority. Thus, based on the priority of important events, events are reported according to the device priority, ensuring that emergency events can be handled first, protecting important equipment, and reducing the potential losses caused by alarm events.

[0047] As an optional implementation, in the code return area of ​​the device priority contention time domain, the master station receives the device priority contention communication frame sent by the slave station, which carries the slave station's device address bits. The device priority contention communication frame is a communication frame that notifies the master station to make a decision on the two-bus contention of the slave station based on the device priority. The master station generates a priority contention result communication frame based on device priorities and the order of slave device address bits in the priority contention communication frame. This priority contention result communication frame is generated by the master station to notify the slave station of at least one target device address bit that it has successfully acquired. In the coding zone of the device priority contention time domain, the master station sends out a priority contention result communication frame. Each target device address bit matches at least one slave device's address bit in the same order. This notifies the slave station whose address bit matches the target device address bit to continue reporting the next slave device's address bit in another coding zone of the device priority contention time domain, until all slave device address bits of any slave device match the target device address bit notified by the master station. The master station then receives the events reported by the slave devices in the coding zone of the event data time domain.

[0048] Specifically, the address of each slave station can be a string of binary bytes, which contains only two data bits: "0" and "1". When a slave station reports its device address to the master station, it can use uplink current modulation to represent the "0" and "1" data bits with different current values.

[0049] During device priority contention, each slave station reports its ID address in sequence, using the binary bytes of its ID address. The master station can pre-sort the slave device address bits of all slave stations based on their priorities, thus determining the slave device address bit corresponding to the highest-priority device address at the nth bit of the slave device address. This corresponding slave device address bit is then used as the target device address bit. The master station then sends the target device address bit to the slave stations, instructing them to match their reported slave device address bits with the target device address bit. If the match fails, the slave station withdraws from the competition; if the match succeeds, the slave station continues to report the next slave device address bit for the next round of matching. The master station progressively compares the slave device address bits, ultimately determining the slave station with the highest priority.

[0050] For example, the slave device ID is 4 bytes, containing 32 slave device address bits in the binary byte string. Each slave device synchronously uploads the current value corresponding to the first slave device address bit. The master device, based on the current value detected in the code return area of ​​the device priority contention time domain, sets the device address bit priority to "0" or "1". According to the set device address bit priority, the master device can send a priority contention result communication frame carrying the corresponding target device address bit in the code transmission area of ​​the device priority contention time domain. Different high-level pulse widths in the priority contention result communication frame indicate the target device address bit (e.g., "0" or "1" priority). The slave device checks if the currently competing slave device address bit matches the target device address bit sent by the master device. If they do not match, the slave device exits the current device priority contention. If they match, the slave device continues to upload the next slave device address bit until only one slave device remains, completing the device priority contention.

[0051] For example, suppose there are seven slave stations participating in device priority contention, with device addresses of 001, 010, 011, 100, 101, 110, and 111. Assume the device priorities of these seven slave stations increase from 001 to 111, meaning the slave station with address 111 has the highest priority and the slave station with address 001 has the lowest priority. When the slave stations compete for the two-wire bus based on device priority, the master station can set the device address bit "1" as the priority, that is, use the data bit "1" as the target device address bit. When each slave station reports its first slave station address bit, because the device address bit "1" is set as the priority, the master station sends a communication frame carrying the target device address bit "1" in the coding area of ​​the device priority contention time domain. After receiving the target device address bit, the slave station matches it with the slave station device address bit it sent. The device address bits of slave stations 001, 010, and 011 fail to match and exit the competition. The device address bits of slave stations 100, 101, 110, and 111 match successfully and continue to report the second device address bit. At this time, the master station also returns the target device address bit "1". The four slave stations match the reported second device address bit with the target device address bit. The remaining two slave stations 110 and 111 match successfully and continue to report the third device address bit. After receiving the target device address bit returned by the master station, the slave station matches its own reported third device address bit with the target device address bit. Finally, the slave station with device address 111 successfully competes for the two-bus.

[0052] When setting the target device address bit, it can be set separately for different slave device address bits. The target device address bit can be the same or different. For example, in the previous example, the target device address bits are the same, and all target device address bits are set to "1". There can also be cases where the target device address bits are different. For example, assuming that the slave device with device address 110 has a higher priority than the slave device with device address 111, then when matching the third slave device address bit, the target device address bit sent by the master station is set to "0", which is different from the "1" target device address bit set when matching the first two device address bits.

[0053] As an optional implementation, in step S13 of this embodiment, the master station generates an event competition result signal based on event priority. The master station selects the highest-priority event type from the competing events to win. In this embodiment, the high-priority event type can refer to a preset number (e.g., two) of the highest-priority event types among the competing event types. In this case, after the slave stations compete on the two-bus system based on event type, there can be two types of slave stations corresponding to different event types that retain the two-bus competition. This expands the range of slave stations that can subsequently participate in the two-bus competition based on device priority. In this way, the influence of event type and device priority on the two-bus competition of slave stations can be balanced, and the slave station with the best event type and device priority can be selected to report the event.

[0054] For example, suppose the master station sends two event contention result signals (e.g., corresponding to a first event type and a second event type, with the first event type having a higher priority than the second event type). In this case, a first slave station (assuming the reported event type is the first event type) and a second slave station (assuming the reported event type is the second event type) can participate in the subsequent two-bus contention based on device priority. If the device priority of the second slave station is higher than that of the first slave station, then the second slave station will ultimately succeed in winning the two-bus contention. In this way, the impact of event type and device priority on the slave station's two-bus contention can be balanced, and the slave station that ultimately succeeds in winning the two-bus contention has the characteristics of relatively high event type and relatively high device priority.

[0055] Optionally, when the pulse width duration of the high-level pulse is t1, an error of 0.1ms above or below can be allowed for fault tolerance. For example, if the high-level pulse width duration t in the coding area of ​​the device priority contention time domain is within the range of t1-0.1ms≤t≤t1+0.1ms, then it is determined that the slave device matching the address bit of the currently contentious slave device is consistent with the address bit of the target device.

[0056] In the response code region of the device priority contention time domain, the master station detects the sum of the currents reported by each slave station. Since there are only two data bits, "0" and "1", the master station can determine from the sum of the currents which of the following three scenarios the slave devices are uploading: all slave stations are uploading all "0" data bits, all slave stations are uploading all "1" data bits, or all slave stations are uploading a mix of "0" and "1" data bits. Based on the parsed data bit information from the slave stations, the master station can choose to prioritize either "0" bits or "1" bits, and determine the winning slave station through a bit-by-bit contention process.

[0057] In this embodiment, information is distinguished by the high-level pulse width in the coding area. For example, three different pulse widths can be agreed upon. If the master station has no instruction to the slave station, a high-level signal with the first pulse width is sent in the coding area. If the master station needs to send a bit "1" signal to the slave station, a high-level signal with the second pulse width is sent in the coding area. If the master station needs to send a bit "0" signal to the slave station, a high-level signal with the third pulse width is sent in the coding area. The slave station parses the information sent by the master station by detecting the high-level signal pulse width. The first pulse width is greater than the second pulse width and also greater than the third pulse width; the second pulse width is less than the third pulse width. Sufficient differentiation is required between the three pulse widths to ensure that the slave station can accurately parse the information.

[0058] For example, such as Figure 5 The diagram shows a symbol representation. The first pulse width is configured to be 1.8~2.1ms, the second pulse width is configured to be 0.9±0.1ms (representing bit "1"), and the third pulse width is configured to be 1.2±0.1ms (representing bit "0"). The slave station can obtain the information sent by the master station based on the detected pulse width of the transmission area.

[0059] The return code area uses a low-level signal of a predetermined width and is configured sequentially with the transmission code area. For example, the predetermined low-level width of the return code area is 0.5ms. After the master station sends a downlink voltage-modulated communication frame, a low-level return code area of ​​0.5ms is provided for the slave station to feed back an uplink current-modulated communication frame. The low-level width of this return code area is sufficiently distinguishable from the low-level width under quiescent current; for example, the low-level width under quiescent current is set to 0.7ms.

[0060] like Figure 6 The diagram illustrates the communication timing between the master and slave stations. Before any data contention occurs on the two buses, voltage modulation is performed according to a preset rule of 2ms high level and 0.7ms low level. When a slave station needs to report an event, it sends an uplink current-modulated communication frame. At this time, the master station detects current fluctuations (different from the normal static current) in the low-level region. The master station then transmits a code in the following high-level region, changing the subsequent high-level pulse width to send a bit "1" or bit "0," and provides a 0.5ms response period after the code transmission region for the slave station to send its uplink current-modulated response information.

[0061] Furthermore, when the master station detects a contention reporting event from a slave station (i.e., a current fluctuation is detected in the 0.7ms low-level interval), a start bit can be added before entering the coding area to ensure that the information sent by the master station can be correctly parsed by the slave station. For example, the high-level pulse width of the start bit is designed to be the fourth pulse width, which is different from the first to third pulse widths, such as... Figure 5 As shown, in this embodiment, the width of the fourth pulse is designed to be 3±0.2ms. When the master station detects a slave station contention reporting event, the master station first sends a start bit signal, and then sends a response signal of bit "1" or bit "0" to ensure that the slave station can accurately identify the information sent by the master station.

[0062] Based on the above description, the transmission method provided in this application further filters by device priority after determining the priority of the event, with higher priority devices reporting first, to ensure timely alarm for emergency events.

[0063] As an optional implementation, the transmission method also includes: After receiving the event reported by the slave station in the code return area of ​​the event data time domain, the master station sends an event end communication frame indicating the termination of the event in the code transmission area of ​​the event data time domain, so as to notify the slave station to stop reporting and withdraw from the current competition after reporting the event.

[0064] Specifically, after the master station receives the event reported by the slave station in the code return area of ​​the event data time domain, the master station sends an event end communication frame in the code transmission area of ​​the event data time domain to indicate that the event reported by the slave station has been received. After the slave station receives the event end communication frame within the agreed interval, the slave station terminates the reporting of the event and withdraws from the current competition to avoid other slave stations being unable to report due to repeated preemption of the bus by high-priority events.

[0065] As an alternative implementation, after a slave device wins a priority contention, the master device can cache the slave device's address. If, within a preset time, the master device detects the cached slave address again in the code return area of ​​the priority contention segment, it sends a priority contention result signal indicating the address of the next lower priority slave device in the code transmission area of ​​the priority contention segment. In this way, the addresses of slave devices that have successfully reported events within a certain period are recorded. If the slave device is detected participating in the contention again within the preset time, the master device sends a command indicating that the next lower priority device has won the contention, thus avoiding the problem of high-priority devices repeatedly preempting the bus and preventing other slave devices from preempting it.

[0066] As an optional implementation, the master station generates an event contention result signal based on the highest priority event type in the combination of event types, including: In response to the master station determining the high-priority different event types in the event type combination, the master station changes the high-level pulse width on the second bus in the coding area of ​​the event contention time domain to form different event contention result signals corresponding to the different high-priority different event types.

[0067] Specifically, the master station represents the competition results of different event types by changing the high-level pulse width on the two buses within the coding zone of the event competition time domain. The high-level pulse width representing the competition results of different event types must be able to be accurately distinguished and identified by the slave station within the allowable error range.

[0068] Based on the above description, the two-bus data transmission method provided in the first aspect of this application can realize active reporting communication from slave stations, and is suitable for situations where slave stations need to directly report events. For example... Figure 7 As shown in the embodiments of this application, the two-bus data transmission method can be used in a fire protection two-bus communication system. For example, the slave station may include smoke detectors, heat detectors, manual reporting devices, audible and visual alarms, etc., while the master station may be a fire alarm controller, a gas extinguishing controller, etc. In a fire scenario, the ignition point is usually at the slave station. Using the two-bus communication system provided in this application, the slave station can actively report, and the alarm is event-prioritized, allowing for rapid alarm completion and ensuring safety. This is of great significance for improving the timeliness and reliability of the fire early warning system.

[0069] Secondly, this application also provides a two-bus data transmission method applied to a slave station. The slave station and the master station communicate according to an agreed protocol. The communication frame includes a preemption request time domain and an event contention time domain following the preemption request time domain. The method includes: The slave station sends a preemption communication frame carrying a preemption request signal in the code return area of ​​the preemption request time domain, and receives a response communication frame carrying a bus status response signal from the master station in the code transmission area of ​​the preemption request time domain. The slave station determines whether preemption is allowed based on the bus status response signal. If it is allowed, the slave station sends an event communication frame carrying the event contention signal in the code area of ​​the event contention time domain. The slave station receives the two-bus allocation communication frame carrying the event contention result signal from the master station within the code transmission zone of the event contention time domain; The slave station responds when the event type and event contention result signal reported by itself are successfully matched, retains the contention for the two buses, and reports the event.

[0070] According to the two-bus data transmission method provided in the second aspect of this application, the slave station first sends a request to preempt signal in the code area of ​​the request preemption time domain. After receiving a bus status response signal from the master station indicating that the two-bus is in an idle state, subsequent contention occurs, ensuring that the slave station actively initiates contention while the two-bus is idle. The slave station sends an event contention signal representing the type of reported event in the code area of ​​the event contention time domain. The master station receives the event contention signal and generates an event contention result signal based on the high-priority event type. The event contention result signal can instruct the slave device reporting the high-priority event type to retain contention, realizing priority filtering based on event type, prioritizing contention for emergency alarm events, and ensuring the timeliness of emergency event handling.

[0071] As an optional implementation, the device priority contention domain and the event data domain are set sequentially after the event contention domain; The slave station reports its device address bits in the code return area of ​​the device priority contention time domain; In response to the priority contention result communication frame sent by the master station in the coding zone of the device priority contention time domain, the slave station performs a slave station device address bit matching operation, including: When the slave station responds to the fact that the slave station device address bit reported by itself matches the target device address bit in the priority contention result communication frame, the slave station continues to report the next slave station device address bit in another code area of ​​the device priority contention time domain. The slave station responds to a matching failure and withdraws from the current competition. The slave station performs a slave station device address bit matching operation until the slave station device address bit completely matches the target device address bit in the priority contention result communication frame sent by the master station, and reports the event in the return code area of ​​the event data time domain.

[0072] Based on the above description, the transmission method provided in this application further filters based on device priority after determining the priority of the event, with higher priority devices reporting first, to ensure timely alarm for emergency events.

[0073] Thirdly, see Figure 8 As shown, this application also provides a two-bus communication system, which includes a master station and at least one slave station connected to the master station via a two-bus connection. The code preemption process of the two-bus communication system is as follows: Figure 9 As shown.

[0074] Specifically, in combination Figure 8 and Figure 9 The two-bus data contention process includes the following steps: S21. The slave station sends a preemption communication frame carrying a preemption signal in the code area of ​​the preemption time domain. S22. The master station receives the preemption communication frame and sends a response communication frame carrying the bus status response signal in the code transmission area of ​​the request preemption time domain. S23. The slave station receives the response communication frame. The slave station determines whether preemption is allowed based on the bus status response signal. If it is allowed, proceed to step S24; otherwise, return to step S21.

[0075] S24. The slave station sends an event communication frame carrying the event contention signal in the code return area of ​​the event contention time domain; S25. The master station receives the event communication frame and generates an event contention result signal according to the event priority. S26. The master station sends a two-bus allocation communication frame carrying the event contention result signal within the code transmission area of ​​the event contention time domain; S27. The slave station receives the second bus allocation communication frame. The slave station matches the event type it reports with the event contention result signal. If the match is successful, the slave station retains the contention for the second bus and reports the event according to the contention retention result of the second bus.

[0076] like Figure 9 As shown, according to the two-bus communication system provided in the third aspect embodiment of this application, after the event type competition is completed in the event contention time domain, the device priority competition will be further carried out. In this way, based on the event priority, the event will be reported according to the device priority, so as to ensure that emergency events can be handled first, protect important equipment, and reduce the possible losses caused by alarm events.

[0077] Based on the above description, in the two-bus communication system provided in this application embodiment, the slave station sends a request to preempt signal in the code return area of ​​the request preemption time domain, and the master station sends a bus status response signal indicating whether the two buses are idle in the code transmission area of ​​the request preemption time domain, ensuring that the slave station actively initiates contention when the two buses are idle. The slave station sends an event contention signal representing the type of reported event in the code return area of ​​the event contention time domain. The master station receives the event contention signal and generates an event contention result signal based on the high-priority event type. The event contention result signal can instruct the slave device reporting the high-priority event type to retain contention, thus achieving priority filtering based on event type, prioritizing competition for emergency alarm events, and ensuring the timeliness of emergency event handling.

[0078] The two-bus communication system provided in this application can utilize the two-bus data transmission method provided in the first aspect of this application to realize active reporting communication from slave stations. It is suitable for situations where slave stations need to directly report events. For example, in fire emergency alarm scenarios, the ignition point is usually at the slave station. Using the two-bus communication system provided in this application, active reporting from the slave station can be achieved, and alarms are prioritized based on events, enabling rapid alarm completion and ensuring safety.

[0079] In the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. "A plurality of" means two or more, unless otherwise explicitly specified.

[0080] The above-disclosed embodiments are merely preferred embodiments of this application, but are not intended to limit the scope of this application. Those skilled in the art will understand that any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and scope of this application and the appended claims are equivalent substitutions and still fall within the scope of the invention.

[0081] The application fields of the present invention include, but are not limited to, the field of electronic power conversion technology. As long as the essence of the technical solution does not deviate from the scope of the technical solutions of the various embodiments of the present invention, it shall fall within the protection scope of the present invention.

[0082] Although preferred embodiments of the present application have been disclosed for illustrative purposes, those skilled in the art will recognize that various modifications, additions, and substitutions are possible without departing from the scope and spirit of the present application as disclosed in the appended claims.

Claims

1. A method of transmitting data on two buses, characterized by, The transmission method is applied to a master station, and the master station and at least one slave station transmit communication frames according to an agreed protocol, the communication frames include a request preemption time domain and an event competition time domain located after the request preemption time domain, and the method comprises the following steps of: The master station transmits a response communication frame carrying a bus state response signal in a sending code area of the request preemption time domain in response to a preemption communication frame carrying a request preemption signal sent by the slave station in a response code area of the request preemption time domain; The master station receives an event communication frame carrying an event competition signal sent by the slave station in a response code area of the event competition time domain, wherein the event communication frame is a communication frame generated by the slave station after judging that the request preemption is allowed according to the bus state response signal; The master station generates an event competition result signal according to an event priority; The master station transmits a two-bus allocation communication frame carrying the event competition result signal in a sending code area of the event competition time domain to notify the slave station to reserve competition for a two-bus according to the event competition result signal, so that the slave station reports an event according to a competition reservation result of the two-bus.

2. The method of claim 1, wherein, The event competition signal represents different event types through different current values, and the master station generates the event competition result signal according to an event priority, which comprises the following steps of: The master station detects a size of a current superposition value on the two-bus in the response code area of the event competition time domain, determines a category combination of the event types reported by the slave station based on the detected current superposition value, and generates the event competition result signal according to a high-priority event type in the category combination.

3. The two-bus data transmission method according to claim 2, wherein: When the master station judges that there are at least two different category combinations according to the current superposition value on the two-bus in the response code area of the event competition time domain, the master station generates a first event competition result signal according to a first event type with the highest priority in the at least two different category combinations; After the master station transmits the two-bus allocation communication frame carrying the first event competition result signal, if the master station does not receive a response signal of the slave station within an agreed time, the master station excludes the category combination containing the first event type; The master station generates a second event competition result signal according to a second event type with the highest priority in the remaining category combinations, and transmits a two-bus allocation communication frame carrying the second event competition result signal. The transmission method further comprises the following steps of:

4. The method of claim 2, wherein, The master station obtains a category combination of event types matching the detected current superposition value on the two-bus in the response code area of the event competition time domain according to the detected current superposition value and a mapping table; The mapping table is constructed by the master station according to the number of slave stations connected to the master station and the event types reported by each slave station, and is a mapping table of the current superposition value on the two-bus in the response code area of the event competition time domain and the category combination of the event types reported by the slave stations. ​ 5. The method of claim 2, wherein, The master station obtains the number of slave stations participating in the competition based on the size of the current superposition value of the two buses and the category combination.

6. The method of claim 2, wherein, The master station generates the event competition result signal according to the event type with high priority in the category combination of the event type, including: In response to the master station determining different event types with high priority in the category combination of the event type, the master station changes the high level pulse width on the two buses in the code sending area of the event competition time domain to form different event competition result signals corresponding to the different event types with high priority.

7. The two-bus data transmission method of claim 1, wherein The event competition time domain is further sequentially provided with a device priority competition time domain and an event data time domain; In the code receiving area of the device priority competition time domain, the master station receives a device priority competition communication frame carrying a slave station device address bit sent by the slave station, and the device priority competition communication frame is a communication frame for notifying the master station to make a decision on the two-bus competition of the slave station based on the device priority; The master station generates a priority competition result communication frame according to the device priority and the order of the slave station device address bit in the device priority competition communication frame, and the priority competition result communication frame is a communication frame generated by the master station for notifying at least one target device address bit of the slave station of the competition success; In the code sending area of the device priority competition time domain, the master station sends the priority competition result communication frame, and each target device address bit is matched with at least one same-order device address bit of a slave device to notify the slave station matched with the target device address bit to continue reporting a next slave station device address bit in another code receiving area of the device priority competition time domain until all the slave station device address bits of any slave station are matched with the target device address bit notified by the master station; The master station receives the event reported by the slave station in the code receiving area of the event data time domain.

8. The method of claim 7, wherein, The transmission method further includes: After the master station receives the event reported by the slave station in the code receiving area of the event data time domain, the master station sends an event end communication frame indicating the termination of the event in the code sending area of the event data time domain to notify the slave station to terminate the reporting after reporting the event and exit the current competition.

9. A method of transmitting data on two buses, characterized by The transmission method is applied to a slave station, and the slave station and a master station transmit a communication frame according to an agreed protocol, the communication frame includes a request preemption time domain and an event competition time domain located after the request preemption time domain, and the method includes: The slave station sends a preemption communication frame carrying a request preemption signal in the code receiving area of the request preemption time domain and receives a response communication frame carrying a bus state response signal fed back by the master station in the code sending area of the request preemption time domain; The slave station determines whether to allow preemption according to the bus state response signal, and if yes, the slave station sends an event communication frame carrying an event competition signal in the code receiving area of the event competition time domain; The slave station receives the two-bus allocation communication frame carrying the event competition result signal fed back by the master station in the code sending area of the event competition time domain; The slave station reserves the competition for the two-bus and reports the event in response to the successful matching of the event type reported by the slave station and the event competition result signal.

10. The two-bus data transmission method of claim 9, wherein, The event competition time domain is further sequentially provided with a device priority competition time domain and an event data time domain; The slave station reports the slave station device address bit in the code returning area of the device priority competition time domain; The slave station performs the slave station device address bit matching operation in response to the priority competition result communication frame sent by the master station in the code sending area of the device priority competition time domain, including: The slave station continues to report the next slave station device address bit in another code returning area of the device priority competition time domain in response to the successful matching of the slave station device address bit reported by the slave station and the target device address bit in the priority competition result communication frame; The slave station exits the current competition in response to the matching failure; The slave station performs the slave station device address bit matching operation until the device address bit of the slave station is completely matched with the target device address bit in the priority competition result communication frame issued by the master station, and reports the event in the code returning area of the event data time domain.