Signal transmission method and device for master-slave devices, storage medium and electronic device
By adopting the differential signal transmission method in the fire bus, the existing fire bus has solved the problems of short communication distance, high power consumption and poor anti-interference, which has achieved a longer communication distance and lower power consumption, and significantly improved anti-interference.
Patent Information
- Application Number
- CN202211174571.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-26
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-09-26
AI Technical Summary
The existing fire bus communication distance is relatively close, the power consumption of slave equipment is high, and the anti-interference ability is weak, especially in field environments with strong electromagnetic interference.
By adopting the differential signal transmission method, the host downlink data is encoded into two voltage signals through voltage, and transmitted to the first bus and the second bus of the second bus respectively to form a differential signal, thereby enhancing the anti-interference.
Through differential signal transmission, the anti-interference of master-slave signal transmission is significantly improved, the communication distance is extended, and the power consumption of slave equipment is reduced.
Smart Images

Figure CN115550117B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of industrial fire alarm technology, and in particular to a signal transmission method and device for master-slave devices, a storage medium, and an electronic device. Background Art
[0002] At present, the two-bus circuit is widely used in the automatic fire alarm scene. Compared with the four-wire system, the two-bus circuit combines the power line and the signal line into one, realizing the technology of sharing the same bus for signal and power supply. It has certain applications in civil systems with low power consumption, multiple points, long distance, complex wiring, and weak EMC (Electro Magnetic Compatibility) interference.
[0003] However, although the existing bus form has the characteristics of both power supply and communication, due to its communication characteristics, most buses have three states: low level, medium level, and high level. The host device and the slave device are connected through the bus. In fact, the slave device only draws power from the bus during the high level time. The medium and low levels cannot draw power from the bus and can only consume the stored energy. This form of communication and power supply has a great burden on the bus. This also leads to the relatively short communication distance of the existing fire protection bus, and also has high power consumption requirements for the slave device. In addition, the signal form of the existing bus transmission is a common mode signal, which has a weak ability to suppress various electromagnetic interferences that may exist in the application site.
[0004] In view of the problems in the related art such as the poor anti-interference performance of signal transmission between master and slave devices, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a signal transmission method and device for master-slave devices, a storage medium, and an electronic device, so as to at least solve the problem of poor anti-interference performance of signal transmission between master and slave devices in the related art.
[0006] According to an embodiment of the present application, a signal transmission method between a master and a slave device is provided, comprising:
[0007] Acquire host downlink data, wherein the host downlink data is data to be transmitted from the host device to the slave device, and the host device and the slave device are connected via two buses;
[0008] Performing voltage encoding on the host downlink data to obtain two voltage signals, wherein the two voltage signals have a differential relationship;
[0009] The two voltage signals are respectively transmitted to the first bus and the second bus included in the two buses to obtain a host downlink signal.
[0010] Optionally, encoding the host downlink data to obtain two voltage signals includes:
[0011] Inputting the host downlink data into the driving circuit;
[0012] A first voltage signal and a second voltage signal output by the driving circuit are obtained, wherein when the first voltage signal is at a positive level, the second voltage signal is at a zero level, and when the second voltage signal is at a positive level, the first voltage signal is at a zero level.
[0013] Optionally, the transmitting the two voltage signals to a first bus and a second bus included in the two buses respectively to obtain a host downlink signal includes:
[0014] transmitting the first voltage signal to the first bus, and transmitting the second voltage signal to the second bus;
[0015] A differential voltage signal obtained by subtracting a voltage signal transmitted in the second bus from a voltage signal transmitted in the first bus is determined as the host downlink signal.
[0016] Optionally, the method further includes:
[0017] Detecting current signals from the two buses;
[0018] The current signal is current decoded to obtain slave uplink data, wherein the slave uplink data is data transmitted from the slave device to the host device.
[0019] Optionally, the detecting current signals from the two buses includes:
[0020] Transmitting a preset voltage signal to the second bus, wherein the preset voltage signal does not carry downlink data;
[0021] The current signals on the two buses are detected during the process of transmitting the preset voltage signal.
[0022] According to an embodiment of the present application, a signal transmission method between a master and a slave device is also provided, including:
[0023] Receiving two voltage signals respectively transmitted on a first bus and a second bus included in the two buses, wherein the two voltage signals have a differential relationship, and a host device and a slave device are connected to the two buses;
[0024] Converting the two voltage signals into target differential signals;
[0025] The target differential signal is voltage-decoded to obtain host downlink data, wherein the host downlink data is data transmitted from the host device to the slave device.
[0026] Optionally, converting the two voltage signals into a target differential signal includes:
[0027] The target differential signal is obtained by subtracting the second voltage signal from the first voltage signal, wherein the two voltage signals include the first voltage signal and the second voltage signal, the first voltage signal is a voltage signal transmitted on the first bus, and the second voltage signal is a voltage signal transmitted on the second bus.
[0028] Optionally, the method further includes:
[0029] Acquire slave uplink data, wherein the slave uplink data is data transmitted from the slave device to the host device;
[0030] Performing current encoding on the upstream data of the slave to obtain a current signal;
[0031] The current signal is transmitted to the host device through the two buses.
[0032] Optionally, transmitting the current signal to the host device through the second bus includes:
[0033] Detecting voltage signals transmitted in the two buses;
[0034] When a preset voltage signal is detected, the current signal is transmitted to the host device through the second bus, wherein the preset voltage signal does not carry downlink data.
[0035] According to another embodiment of the present application, a signal transmission device of a master-slave device is also provided, including:
[0036] A first acquisition module, used for acquiring host downlink data, wherein the host downlink data is data to be transmitted from the host device to the slave device, and the host device and the slave device are connected via two buses;
[0037] A first encoding module, used for performing voltage encoding on the host downlink data to obtain two voltage signals, wherein the two voltage signals have a differential relationship;
[0038] The first transmission module is used to transmit the two voltage signals to the first bus and the second bus included in the two buses respectively to obtain a host downlink signal.
[0039] According to another embodiment of the present application, a signal transmission device of a master-slave device is also provided, including:
[0040] A receiving module, used for receiving two voltage signals respectively transmitted on a first bus and a second bus included in the two buses, wherein the two voltage signals have a differential relationship, and a host device and a slave device are connected to the two buses;
[0041] A conversion module, used for converting the two voltage signals into a target differential signal;
[0042] The second decoding module is used to perform voltage decoding on the target differential signal to obtain host downlink data, wherein the host downlink data is data transmitted from the host device to the slave device.
[0043] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned master-slave device signal transmission method when running.
[0044] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the signal transmission method between the master and slave devices through the computer program.
[0045] In an embodiment of the present application, host downlink data is obtained, wherein the host downlink data is data to be transmitted from the host device to the slave device, and the host device and the slave device are connected through two buses; voltage encoding is performed on the host downlink data to obtain two voltage signals, wherein there is a differential relationship between the two voltage signals; the two voltage signals are transmitted to the first bus and the second bus included in the two buses respectively, and the host downlink signal is obtained, that is, when the host device needs to send the host downlink data to the slave device through the two buses, the host downlink data is firstly voltage encoded to obtain two voltage signals, and the two voltage signals are transmitted to the first bus and the second bus included in the two buses respectively. Since there is a differential relationship between the two voltage signals, the host downlink signal formed by the two voltage signals belongs to a differential signal and has strong anti-interference. If the waveform encounters severe external interference when transmitting data, normal communication can also be guaranteed. The above technical solution solves the problems of poor anti-interference of signal transmission of master and slave devices in the related technology, and achieves the technical effect of enhancing the anti-interference of signal transmission of master and slave devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0048] Figure 1 It is a hardware environment schematic diagram of a signal transmission method of a master-slave device according to an embodiment of the present application;
[0049] Figure 2 The following is a flow chart of a signal transmission method of a master-slave device according to an embodiment of the present application. Figure 1 ;
[0050] Figure 3 is a schematic diagram of signal transmission between a master and a slave device according to an embodiment of the present application;
[0051] Figure 4 It is a schematic diagram of the waveform anti-interference of the differential two-bus and the traditional two-bus according to the embodiment of the present application;
[0052] Figure 5 is a schematic diagram of a preset voltage signal according to an embodiment of the present application;
[0053] Figure 6 It is a schematic diagram of power supply of a traditional two-bus and a differential two-bus according to an embodiment of the present application;
[0054] Figure 7 The following is a flow chart of a signal transmission method of a master-slave device according to an embodiment of the present application. Figure 2 ;
[0055] Figure 8 The structure frame of a signal transmission device of a master-slave device according to an embodiment of the present application is Figure 1 ;
[0056] Fig. 9 The structure frame of a signal transmission device of a master-slave device according to an embodiment of the present application is Figure 2 . DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0058] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0059] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a device terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 Schematic diagram of the hardware environment of a signal transmission method of a master-slave device according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0060] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for sending message push in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0061] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0062] In this embodiment, a signal transmission method of a master-slave device is provided, which is applied to the above-mentioned computer terminal. Figure 2 The following is a flow chart of a signal transmission method of a master-slave device according to an embodiment of the present application. Figure 1 ,like Figure 2 As shown, the process includes the following steps:
[0063] Step S202, obtaining host downlink data, wherein the host downlink data is data to be transmitted from the host device to the slave device, and the host device and the slave device are connected via two buses;
[0064] Step S204, performing voltage encoding on the host downlink data to obtain two voltage signals, wherein the two voltage signals have a differential relationship;
[0065] Step S206, transmitting the two voltage signals to the first bus and the second bus included in the two buses respectively to obtain a host downlink signal.
[0066] Through the above steps, when the host device needs to send host downlink data to the slave device through the two buses, the host downlink data is first voltage-encoded to obtain two voltage signals, and the two voltage signals are respectively transmitted to the first bus and the second bus included in the two buses. Since there is a differential relationship between the two voltage signals, the host downlink signal formed by the two voltage signals is a differential signal, which has strong anti-interference performance. If the waveform encounters severe external interference when transmitting data, normal communication can also be guaranteed. The above technical solution solves the problem of poor anti-interference performance of signal transmission of master-slave devices in related technologies, and achieves the technical effect of enhancing the anti-interference performance of signal transmission of master-slave devices.
[0067] In the technical solution provided in the above step S202, Figure 3 is a schematic diagram of signal transmission between a master and a slave device according to an embodiment of the present application, such as Figure 3As shown, the host device and the slave device are connected via two buses (A line and B line), and the slave device can obtain and store electrical energy from the two buses via a slave power circuit. At the same time, the host device and the slave device can also communicate via the two buses.
[0068] In the technical solution provided in the above step S204, the coding rules for voltage coding the host downlink data may be, but are not limited to, the following rules: Figure 3 As shown, the differential voltage signal obtained by subtracting the voltage signal transmitted in the second bus (B line) from the voltage signal transmitted in the first bus (A line) is determined as the host downlink signal. When the voltage signal falls into the size range of 0.7H to H, the host downlink data corresponding to the host downlink signal is determined to be 1; when the voltage signal falls into the size range of -0.7H to -H, the host downlink data corresponding to the host downlink signal is determined to be 0; that is, the 0 and 1 of the digital signal are defined. It should be noted that the size range of the voltage can be set according to actual needs. The above size range in this embodiment does not limit the encoding rules in this application. When the host downlink data is "010", the corresponding 3 groups of voltages (U1, U2 and U3) are: U1 falls into -0.7H to -H; U2 falls into 0.7H to H; U3 falls into -0.7H to -H. At this point, the voltage encoding of the host downlink data is completed.
[0069] Optionally, in this embodiment, the differential relationship between the two voltage signals may mean, but is not limited to, that the two voltage signals may constitute a differential signal, and the differential signal has strong anti-interference performance, and the waveform when encountering severe external interference can also ensure normal communication. Figure 4 Schematic diagram of differential two-bus and traditional two-bus waveform anti-interference according to an embodiment of the present application, such as Figure 4 As shown, the waveform of the traditional bus encounters severe external interference when transmitting data. Its waveform has been completely distorted and its data cannot be recognized. The waveform of the differential two-bus encounters the same severe external interference as above when transmitting data. After the positive and negative signals are subtracted, the common mode noise is offset. Although the signal has a certain distortion, it can still ensure normal communication. The bus data transmission form of the present application is transmitted through differential signals, and it shows strong anti-interference in actual tests.
[0070] In an exemplary embodiment, the host downlink data can be encoded in the following manner but is not limited to: the host downlink data is input into a driving circuit; a first voltage signal and a second voltage signal output by the driving circuit are obtained, wherein when the first voltage signal is at a positive level, the second voltage signal is at a zero level, and when the second voltage signal is at a positive level, the first voltage signal is at a zero level.
[0071] Optionally, in this embodiment, if Figure 3 As shown, the host downlink data can be input into the driving circuit but is not limited to, to obtain the first voltage signal and the second voltage signal output by the driving circuit, the first voltage signal can be transmitted through the A line, and the second voltage signal can be transmitted through the B line, wherein, when the first voltage signal (A line) is at a positive level, the second voltage signal (B line) is at a zero level, and when the second voltage signal (B line) is at a positive level, the first voltage signal (A line) is at a zero level, thereby generating differential signals of opposite directions and equal magnitudes.
[0072] In the technical solution provided in the above step S206, the host downlink signal is a differential signal formed by two voltage signals transmitted in the first bus and the second bus.
[0073] In an exemplary embodiment, the two voltage signals can be transmitted to the first bus and the second bus included in the two buses respectively to obtain a host downstream signal in the following manner but is not limited to: the first voltage signal is transmitted to the first bus, and the second voltage signal is transmitted to the second bus; the differential voltage signal obtained by subtracting the voltage signal transmitted in the second bus from the voltage signal transmitted in the first bus is determined as the host downstream signal.
[0074] Optionally, in this embodiment, a differential voltage signal obtained by subtracting a voltage signal transmitted in the second bus from a voltage signal transmitted in the first bus is determined as the host downlink signal. Figure 3 As shown, when the first bus is line A and the second bus is line B, the voltage signal transmitted in line A is subtracted from the voltage signal transmitted in line B to obtain a differential voltage signal. It should be noted that in the same communication system, since a differential signal is used, the differential voltage signal has positive and negative properties, and the subsequent encoding rules involve the positive and negative properties of the differential voltage signal. Therefore, the subtraction rule for obtaining the differential voltage signal corresponds to the encoding rule.
[0075] In an exemplary embodiment, the current signal may be detected from the two buses in the following manner, but is not limited to: current decoding the current signal to obtain slave uplink data, wherein the slave uplink data is data transmitted from the slave device to the host device.
[0076] Optionally, in this embodiment, unlike the host downlink data which is transmitted to the slave device via a differential voltage signal, the slave uplink data is transmitted to the host device via a current signal.
[0077] In an exemplary embodiment, the current signal can be detected from the second bus in the following manner but is not limited to: transmitting a preset voltage signal to the second bus, wherein the preset voltage signal does not carry downlink data; and detecting the current signal on the second bus during the transmission of the preset voltage signal.
[0078] Optionally, in this embodiment, Figure 5 is a schematic diagram of a preset voltage signal according to an embodiment of the present application, such as Figure 5 As shown, the preset voltage signal can be but is not limited to a medium level M. When the preset voltage signal (medium level M) is not transmitted in the second bus, the host performs the task of sending codes, and the slave is not allowed to return codes. However, when the preset voltage signal (medium level M) is transmitted in the second bus, it can be regarded as that the slave can return codes in the second bus, that is, the current signal on the second bus can be detected during the transmission of the preset voltage signal, and then the current signal is current decoded to obtain the slave uplink data.
[0079] Optionally, in this embodiment, Figure 6 is a schematic diagram of power supply of a traditional two-bus and a differential two-bus according to an embodiment of the present application, such as Figure 6 As shown in the slave power supply simulation waveform corresponding to the traditional two-bus (Note: 1 means the slave can draw power from the bus; 0 / M means it cannot draw power from the bus), it is obvious that the efficiency of the traditional two-bus for the slave is far lower than the bus form mentioned in this patent. The power supply capacity of the differential two-bus is about 50% higher than that of the traditional two-bus, which is basically close to the level of direct power drive. The improvement of bus power supply capacity brings many advantages, such as: longer communication distance, more slaves with load, and lower difficulty in low-power development of slaves.
[0080] In this embodiment, a signal transmission method between a master and a slave device is also provided, which is applied to the above-mentioned computer terminal. Figure 7 The following is a flow chart of a signal transmission method of a master-slave device according to an embodiment of the present application. Figure 2 ,like Figure 7 As shown, the process includes the following steps:
[0081] Step S702, receiving two voltage signals respectively transmitted on a first bus and a second bus included in two buses, wherein the two voltage signals have a differential relationship, and a host device and a slave device are connected to the two buses;
[0082] Step S704, converting the two voltage signals into a target differential signal;
[0083] Step S706 , performing voltage decoding on the target differential signal to obtain host downlink data, wherein the host downlink data is data transmitted from the host device to the slave device.
[0084] Through the above steps, when the slave device receives two voltage signals transmitted on the first bus and the second bus respectively included in the two buses, the two voltage signals are converted into a target differential signal, and then the target differential signal is voltage decoded to obtain the host downlink data. Since the target differential signal is a differential signal, it has strong anti-interference performance. If the waveform encounters severe external interference when transmitting data, normal communication can also be guaranteed. The above technical solution solves the problem of poor anti-interference performance of signal transmission of master-slave devices in related technologies, and achieves the technical effect of enhancing the anti-interference performance of signal transmission of master-slave devices.
[0085] In the technical solution provided in the above step S702, the slave device receives two voltage signals, wherein the two voltage signals have a differential relationship.
[0086] In the technical solution provided in the above step S704, there is a differential relationship between the two voltage signals, and the two voltage signals are converted into a target differential signal, and then the target differential signal is decoded to obtain the host downlink data.
[0087] In an exemplary embodiment, the two voltage signals may be converted into a target differential signal in the following manner, but is not limited to: subtracting the second voltage signal from the first voltage signal to obtain the target differential signal, wherein the two voltage signals include the first voltage signal and the second voltage signal, the first voltage signal is a voltage signal transmitted on the first bus, and the second voltage signal is a voltage signal transmitted on the second bus.
[0088] Optionally, in this embodiment, in the same communication system, since a differential signal is used, the differential voltage signal has positive and negative properties, and subsequent encoding rules involve the positive and negative properties of the differential voltage signal, therefore, the subtraction rule for obtaining the differential voltage signal corresponds to the encoding rule.
[0089] In the technical solution provided in the above step S706, if Figure 3 As shown, the target differential signal can be decoded using, but is not limited to, a voltage decoding module deployed on a slave device, wherein a target differential signal falling within -0.7H to -H can be decoded as 0; a target differential signal falling within 0.7H to H can be decoded as 1, and voltage encoding and voltage decoding belong to the protocol content predefined by the host device and the slave device. The above decoding or encoding rules used in this application are only used as an optional embodiment and do not limit the content of this application.
[0090] In an exemplary embodiment, the following methods may be included but are not limited to: obtaining slave uplink data, wherein the slave uplink data is data transmitted by the slave device to the host device; current encoding the slave uplink data to obtain a current signal; and transmitting the current signal to the host device via the second bus.
[0091] Optionally, in this embodiment, the encoding rule for current encoding the slave uplink data may be, but is not limited to, the following rules: Figure 3 As shown, the current signals in the first bus (A line) and the second bus (B line) are detected. When the current signal falls within the size range of 0.7xmA to 1.3xmA, the slave uplink data corresponding to the current signal is determined to be 1; when the current signal falls within the size range of 0xmA to 0.3xmA, the slave uplink data corresponding to the current signal is determined to be 0; that is, the 0 and 1 of the digital signal are defined. It should be noted that the size range of the current signal can be set according to actual needs. The above size range in this embodiment does not limit the encoding rules in this application. When the slave uplink data is "010", the corresponding three groups of currents (I1, I2 and I3) are: I1 falls within 0xmA to 0.3xmA; I2 falls within 0.7xmA to 1.3xmA; I3 falls within 0xmA to 0.3xmA. At this point, the current encoding of the host downlink data is completed.
[0092] In an exemplary embodiment, the current signal can be transmitted to the host device through the second bus in the following manner, but is not limited to: detecting a voltage signal transmitted in the second bus; and transmitting the current signal to the host device through the second bus when a preset voltage signal is detected, wherein the preset voltage signal does not carry downlink data.
[0093] Optionally, in this embodiment, if Figure 5 As shown, when a preset voltage signal (middle level M) is detected, the current signal is transmitted to the host device through the second bus (slave code transmission).
[0094] Through the above implementation method, Figure 3 As shown in the figure, the host device generates a differential signal through the driving circuit. When the A line is at a positive level, the B line is at a zero level; when the A line is at a zero level, the B line is at a positive level. This generates differential signals of opposite directions and equal magnitudes. It is defined that AB=0.7H~H represents 1, and AB=-0.7H~-H represents 0. After defining the 0 and 1 of the digital signal, the host device can send different command signals to the slave device through this bus.
[0095] Through the above implementation methods, the bus form of the differential power two-bus. The main difference from the common mode two-bus form is that it realizes both power supply and communication, and has strong anti-interference performance. Communication method and slave power supply method. The focus is on almost the entire time of voltage downlink data and current uplink data, and the slave can obtain power on the bus by taking the circuit. It overcomes the signal form of the existing fire protection two-bus, which is a common mode signal, and has a weak ability to suppress various electromagnetic interference that may exist in the application site. This is the pain point of all common mode signals, and overcomes the shortcomings of weak carrying capacity and short communication distance of the traditional bus. That is, although the traditional bus form realizes the characteristics of both power supply and communication, because of its communication characteristics, most of the buses have three states: low level, medium level, and high level. In fact, the slave only takes power on the bus for a high level time, and the medium and low levels cannot take power from the bus, and can only consume the power stored in itself. This communication and power supply form has a great burden on the bus. This also leads to the relatively short communication distance of the existing fire protection bus, and also has high requirements on the power consumption of the slave.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0097] Figure 8 The structure frame of a signal transmission device of a master-slave device according to an embodiment of the present application is Figure 1 ;like Figure 8 As shown, including:
[0098] A first acquisition module 802 is used to acquire host downlink data, wherein the host downlink data is data to be transmitted from the host device to the slave device, and the host device and the slave device are connected via two buses;
[0099] A first encoding module 804 is used to perform voltage encoding on the host downlink data to obtain two voltage signals, wherein the two voltage signals have a differential relationship;
[0100] The first transmission module 806 is used to transmit the two voltage signals to the first bus and the second bus included in the two buses respectively to obtain a host downlink signal.
[0101] Through the above embodiment, when the host device needs to send host downlink data to the slave device through the two buses, the host downlink data is first voltage-encoded to obtain two voltage signals, and the two voltage signals are respectively transmitted to the first bus and the second bus included in the two buses. Since there is a differential relationship between the two voltage signals, the host downlink signal formed by the two voltage signals is a differential signal, which has strong anti-interference performance. If the waveform encounters severe external interference when transmitting data, normal communication can also be guaranteed. The above technical solution solves the problem of poor anti-interference performance of signal transmission of master-slave devices in related technologies, and achieves the technical effect of enhancing the anti-interference performance of signal transmission of master-slave devices.
[0102] In an exemplary embodiment, the first encoding module includes:
[0103] An input unit, used for inputting the host downlink data into a driving circuit;
[0104] An acquisition unit is used to acquire a first voltage signal and a second voltage signal output by the driving circuit, wherein when the first voltage signal is at a positive level, the second voltage signal is at a zero level, and when the second voltage signal is at a positive level, the first voltage signal is at a zero level.
[0105] In an exemplary embodiment, the first transmission module includes:
[0106] a first transmission unit, configured to transmit the first voltage signal to the first bus, and transmit the second voltage signal to the second bus;
[0107] The first differential unit is used to determine a differential voltage signal obtained by subtracting a voltage signal transmitted in the second bus from a voltage signal transmitted in the first bus as the host downlink signal.
[0108] In an exemplary embodiment, the apparatus further comprises:
[0109] A detection module, used for detecting current signals from the two buses;
[0110] The first decoding module is used to perform current decoding on the current signal to obtain slave uplink data, wherein the slave uplink data is data transmitted from the slave device to the host device.
[0111] In an exemplary embodiment, the detection module comprises:
[0112] A second transmission unit, configured to transmit a preset voltage signal to the second bus, wherein the preset voltage signal does not carry downlink data;
[0113] The first detection unit is used to detect the current signal on the second bus during the transmission of the preset voltage signal.
[0114] Fig. 9 The structure frame of a signal transmission device of a master-slave device according to an embodiment of the present application is Figure 2 ;like Fig. 9 As shown, including:
[0115] The receiving module 902 is used to receive two voltage signals respectively transmitted on a first bus and a second bus included in the two buses, wherein the two voltage signals have a differential relationship, and the two buses are connected to a host device and a slave device;
[0116] A conversion module 904, configured to convert the two voltage signals into a target differential signal;
[0117] The second decoding module 906 is used to perform voltage decoding on the target differential signal to obtain host downlink data, wherein the host downlink data is data transmitted from the host device to the slave device.
[0118] Through the above embodiment, when the slave device receives two voltage signals transmitted on the first bus and the second bus respectively included in the two buses, the two voltage signals are converted into a target differential signal, and then the target differential signal is voltage decoded to obtain the host downlink data. Since the target differential signal is a differential signal, it has strong anti-interference performance. If the waveform encounters severe external interference when transmitting data, normal communication can also be guaranteed. The above technical solution solves the problem of poor anti-interference performance of signal transmission of master-slave devices in related technologies, and achieves the technical effect of enhancing the anti-interference performance of signal transmission of master-slave devices.
[0119] In an exemplary embodiment, the conversion module comprises:
[0120] A second differential unit is used to subtract the second voltage signal from the first voltage signal to obtain the target differential signal, wherein the two voltage signals include the first voltage signal and the second voltage signal, the first voltage signal is the voltage signal transmitted on the first bus, and the second voltage signal is the voltage signal transmitted on the second bus.
[0121] In an exemplary embodiment, the apparatus further comprises:
[0122] A second acquisition module is used to acquire slave uplink data, wherein the slave uplink data is data transmitted from the slave device to the host device;
[0123] A second encoding module, used for current encoding the uplink data of the slave to obtain a current signal;
[0124] The second transmission module is used to transmit the current signal to the host device through the second bus.
[0125] In an exemplary embodiment, the second transmission module includes:
[0126] A second detection unit, used for detecting the voltage signal transmitted in the second bus;
[0127] The third transmission unit is used to transmit the current signal to the host device through the second bus when a preset voltage signal is detected, wherein the preset voltage signal does not carry downlink data.
[0128] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0129] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0130] S1, obtaining host downlink data, wherein the host downlink data is data to be transmitted from a host device to a slave device, and the host device and the slave device are connected via two buses;
[0131] S2, performing voltage encoding on the host downlink data to obtain two voltage signals, wherein the two voltage signals have a differential relationship;
[0132] S3, transmitting the two voltage signals to the first bus and the second bus included in the two buses respectively to obtain a host downlink signal.
[0133] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0134] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0135] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0136] S1, obtaining host downlink data, wherein the host downlink data is data to be transmitted from a host device to a slave device, and the host device and the slave device are connected via two buses;
[0137] S2, performing voltage encoding on the host downlink data to obtain two voltage signals, wherein the two voltage signals have a differential relationship;
[0138] S3, transmitting the two voltage signals to the first bus and the second bus included in the two buses respectively to obtain a host downlink signal.
[0139] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0140] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0141] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0142] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A signal transmission method between a master and a slave device, characterized in that: include: Acquire host downlink data, wherein the host downlink data is data to be transmitted from the host device to the slave device, and the host device and the slave device are connected via two buses; Performing voltage encoding on the host downlink data to obtain two voltage signals, wherein the two voltage signals have a differential relationship; Transmitting the two voltage signals to the first bus and the second bus included in the two buses respectively to obtain a host downlink signal; The encoding of the host downlink data to obtain two voltage signals includes: inputting the host downlink data into a driving circuit; acquiring a first voltage signal and a second voltage signal output by the driving circuit, wherein the driving circuit is used to encode a digital signal 1 in the host downlink data into the first voltage signal of a positive level and the second voltage signal of a zero level, and to encode a digital signal 0 in the host downlink data into the first voltage signal of a zero level and the second voltage signal of a positive level; The step of transmitting the two voltage signals to the first bus and the second bus included in the two buses to obtain a host downlink signal comprises: transmitting the first voltage signal to the first bus and transmitting the second voltage signal to the second bus; the slave device determines the differential voltage signal obtained by subtracting the voltage signal transmitted in the second bus from the voltage signal transmitted in the first bus as the host downlink signal; Among them, the level of the host downstream signal obtained by encoding the digital signal 1 is greater than or equal to 0.7H and less than or equal to H, the level of the host downstream signal obtained by encoding the digital signal 0 is greater than or equal to -H and less than or equal to -0.7H, and the slave device is set to allow power to be drawn from the second bus when the absolute value of the host downstream signal is greater than or equal to 0.7H.
2. The method according to claim 1, characterized in that The method further comprises: Detecting current signals from the two buses; The current signal is current decoded to obtain slave uplink data, wherein the slave uplink data is data transmitted from the slave device to the host device.
3. The method according to claim 2, characterized in that The detecting current signal from the two buses comprises: Transmitting a preset voltage signal to the second bus, wherein the preset voltage signal does not carry downlink data; The current signals on the two buses are detected during the process of transmitting the preset voltage signal.
4. A signal transmission method between a master and a slave device, characterized in that: include: Receiving two voltage signals respectively transmitted on a first bus and a second bus included in the two buses, wherein the two voltage signals have a differential relationship, and a host device and a slave device are connected to the two buses; Converting the two voltage signals into target differential signals; Performing voltage decoding on the target differential signal to obtain host downlink data, wherein the host downlink data is data transmitted from the host device to the slave device; The encoding of the host downlink data to obtain two voltage signals includes: inputting the host downlink data into a driving circuit; acquiring a first voltage signal and a second voltage signal output by the driving circuit, wherein the driving circuit is used to encode a digital signal 1 in the host downlink data into the first voltage signal of a positive level and the second voltage signal of a zero level, and to encode a digital signal 0 in the host downlink data into the first voltage signal of a zero level and the second voltage signal of a positive level; The converting of the two voltage signals into a target differential signal comprises: subtracting the second voltage signal from the first voltage signal to obtain the target differential signal, wherein the two voltage signals comprise the first voltage signal and the second voltage signal, the first voltage signal is a voltage signal transmitted from the host device to the first bus, and the second voltage signal is a voltage signal transmitted from the host device to the second bus; Among them, the level of the host downstream signal obtained by encoding the digital signal 1 is greater than or equal to 0.7H and less than or equal to H, the level of the host downstream signal obtained by encoding the digital signal 0 is greater than or equal to -H and less than or equal to -0.7H, and the slave device is set to allow power to be drawn from the second bus when the absolute value of the host downstream signal is greater than or equal to 0.7H.
5. The method according to claim 4, characterized in that The method further comprises: Acquire slave uplink data, wherein the slave uplink data is data transmitted from the slave device to the host device; Performing current encoding on the upstream data of the slave to obtain a current signal; The current signal is transmitted to the host device through the two buses.
6. The method according to claim 5, characterized in that The transmitting the current signal to the host device through the two buses includes: Detecting voltage signals transmitted in the two buses; When a preset voltage signal is detected, the current signal is transmitted to the host device through the second bus, wherein the preset voltage signal does not carry downlink data.
7. A signal transmission device for a master-slave device, characterized in that: include: A first acquisition module is used to acquire host downlink data, wherein the host downlink data is data to be transmitted from the host device to the slave device, and the host device and the slave device are connected via two buses; a first encoding module is used to perform voltage encoding on the host downlink data to obtain two voltage signals, wherein the two voltage signals have a differential relationship; A first transmission module, used for transmitting the two voltage signals to the first bus and the second bus included in the two buses respectively, to obtain a host downlink signal; Wherein, the first encoding module is used to: input the host downlink data into the driving circuit; Acquire a first voltage signal and a second voltage signal output by the driving circuit, wherein the driving circuit is used to encode a digital signal 1 in the host downlink data into the first voltage signal of a positive level and the second voltage signal of a zero level, and encode a digital signal 0 in the host downlink data into the first voltage signal of a zero level and the second voltage signal of a positive level; The first transmission module is used to: transmit the first voltage signal to the first bus, and transmit the second voltage signal to the second bus; the slave device determines the differential voltage signal obtained by subtracting the voltage signal transmitted in the second bus from the voltage signal transmitted in the first bus as the host downlink signal; Among them, the level of the host downstream signal obtained by encoding the digital signal 1 is greater than or equal to 0.7H and less than or equal to H, the level of the host downstream signal obtained by encoding the digital signal 0 is greater than or equal to -H and less than or equal to -0.7H, and the slave device is set to allow power to be drawn from the second bus when the absolute value of the host downstream signal is greater than or equal to 0.7H.
8. A signal transmission device for a master-slave device, characterized in that: include: A receiving module, used for receiving two voltage signals respectively transmitted on a first bus and a second bus included in the two buses, wherein the two voltage signals have a differential relationship, and a host device and a slave device are connected to the two buses; A conversion module, used for converting the two voltage signals into a target differential signal; A second decoding module, configured to perform voltage decoding on the target differential signal to obtain host downlink data, wherein the host downlink data is data transmitted from the host device to the slave device; The host device encodes the host downlink data to obtain two voltage signals, including: inputting the host downlink data into a driving circuit; obtaining a first voltage signal and a second voltage signal output by the driving circuit, wherein the driving circuit is used to encode a digital signal 1 in the host downlink data into the first voltage signal of a positive level and the second voltage signal of a zero level, and to encode a digital signal 0 in the host downlink data into the first voltage signal of a zero level and the second voltage signal of a positive level; The conversion module is used to: subtract the second voltage signal from the first voltage signal to obtain the target differential signal, wherein the two voltage signals include the first voltage signal and the second voltage signal, the first voltage signal is a voltage signal transmitted from the host device to the first bus, and the second voltage signal is a voltage signal transmitted from the host device to the second bus; Among them, the level of the host downstream signal obtained by encoding the digital signal 1 is greater than or equal to 0.7H and less than or equal to H, the level of the host downstream signal obtained by encoding the digital signal 0 is greater than or equal to -H and less than or equal to -0.7H, and the slave device is set to allow power to be drawn from the second bus when the absolute value of the host downstream signal is greater than or equal to 0.7H.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
Citation Information
Patent Citations
Dual voltage communication bus
CN105191221A
Two-bus device capable of returning various kinds of information
CN216748486U