Communication method, controller, communication system, and air conditioner
By connecting multiple sensors through a single GPIO port and utilizing a polling mechanism and a communication switch to achieve data transmission, the problem of insufficient serial port resources in the controller hardware is solved, costs are reduced, and the controller's processing power is improved.
Patent Information
- Application Number
- CN202410896782.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The insufficient serial port resources of the controller hardware in industrial control terminals necessitate the addition of extra serial port expansion chips to meet the communication needs of multiple sensors, which is costly and inconvenient to use.
It connects to multiple sensors through a single general purpose input/output (GPIO) port, and uses a communication switch and timer to implement a polling mechanism to determine the target sensor and control the communication switch to turn on, thereby receiving sensor data.
It reduces communication costs, saves communication interface resources for the controller, and improves the controller's processing power and functionality.
Smart Images

Figure CN118859795B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of air conditioners, and particularly relates to a communication method, a controller, a communication system and an air conditioner. BACKGROUND
[0002] In the field of industrial control, serial ports are widely used because of their simple protocol and convenient use. The serial interface can adopt a serial communication mode to sequentially transmit data bit by bit to a data receiving party. With the functional integration and expansion of industrial control terminals, many industrial control terminals will face the situation of insufficient hardware serial port resources of the controller (such as a microcontroller unit, MCU).
[0003] Taking an air conditioner as an example, more and more sensors (such as oxygen concentration sensors and oxygen flow sensors commonly used in oxygen production air conditioners) are gradually integrated into air conditioners, making the functions of air conditioners more abundant. However, due to the limited serial ports of the controller, the demand is usually met by replacing the controller or adding an additional serial port expansion chip to the controller, which is costly and inconvenient to use. SUMMARY
[0004] To overcome the problems in the related art, the present disclosure provides a communication method, which is designed to realize communication between a controller and multiple sensors based on one general-purpose input / output (GPIO) port, not only improving the convenience of communication between the two, but also reducing the communication cost. In addition, since the communication interface resources of the controller are saved, the controller can enrich its functions based on the remaining communication interfaces, thereby improving the processing capacity of the controller.
[0005] According to a first aspect of an embodiment of the present disclosure, a communication method is provided, applied to a controller, the controller being connected with multiple sensors through one general-purpose input / output (GPIO) port, and a communication switch being arranged between each of the sensors and the GPIO port of the controller, the communication method comprising:
[0006] determining a target sensor to be connected in a polling order of the multiple sensors;
[0007] controlling a communication switch between a currently connected sensor and the GPIO port to be turned off, and controlling a communication switch between the target sensor and the GPIO port to be turned on;
[0008] in response to receiving an external interrupt signal sent by the target sensor through the GPIO port, controlling a timer to start, and receiving data sent by the target sensor through the GPIO port;
[0009] in response to a time from receiving the external interrupt signal reaching a preset polling time, returning the polling order of the plurality of sensors to determine a target sensor to be connected.
[0010] Optionally, a time base of the timer is determined based on a maximum data transmission rate among data transmission rates of the plurality of sensors.
[0011] Optionally, the time base of the timer is determined as twice a reciprocal of the maximum data transmission rate.
[0012] Optionally, the communication method further comprises:
[0013] determining whether the level signal of the GPIO port meets a serial port protocol of the target sensor;
[0014] in response to determining that the level signal of the GPIO port meets the serial port protocol of the target sensor, determining whether a time from receiving the external interrupt signal reaches the polling time.
[0015] Optionally, the communication method further comprises:
[0016] in response to determining that the level signal of the GPIO port does not meet the serial port protocol of the target sensor, generating an alarm information, and / or returning a step of turning off a communication switch between a currently connected sensor and the GPIO port and turning on a communication switch between the target sensor and the GPIO port.
[0017] Optionally, the controller controls the on-off of the communication switch by controlling a relay.
[0018] According to a second aspect of the embodiments of the present disclosure, a controller is provided, comprising:
[0019] at least one general input / output (GPIO) port, the controller being connected with a plurality of sensors through one GPIO port, and a communication switch being arranged between each of the sensors and the one GPIO port;
[0020] a timer;
[0021] a processor;
[0022] a memory for storing processor-executable instructions;
[0023] wherein the processor is configured to execute the computer program in the memory to implement the steps of the communication method according to the first aspect of the present disclosure.
[0024] According to a third aspect of the embodiments of the present disclosure, a communication system is provided, comprising:
[0025] a controller comprising at least one general input / output (GPIO) port and a timer;
[0026] a plurality of sensors, the controller being connected with the plurality of sensors through the at least one GPIO port, and a communication switch being arranged between each of the sensors and the at least one GPIO port;
[0027] the controller is configured to perform the steps of the communication method according to the first aspect of the present disclosure.
[0028] Optionally, the communication system further comprises:
[0029] a relay connected with the controller, the controller controlling the communication switch by controlling the relay.
[0030] According to a fourth aspect of the embodiments of the present disclosure, a communication system is provided, comprising the communication system according to the third aspect of the present disclosure.
[0031] The technical solutions provided by the embodiments of the present disclosure can have the following beneficial effects: the controller is connected with the plurality of sensors through the at least one GPIO port, the target sensor to be connected currently, i.e., the target sensor to receive the data collected thereby, is determined according to a polling order through a polling mechanism, and then the communication switch between the target sensor and the GPIO port is turned on to receive the data of the target sensor through the GPIO port. In this way, only one GPIO port of the controller is occupied when realizing the data communication between the controller and the plurality of sensors, which not only facilitates the data communication between the controller and the sensors, but also reduces the communication cost because no additional modification is needed for the controller. In addition, only one GPIO port is occupied during the communication, which saves the communication interface resources of the controller, so that the controller can meet the communication needs of other operations based on the remaining communication interface, i.e., more operations can be performed through one controller, thus not only enriching the functions of the controller, but also improving the processing capability of the controller.
[0032] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0033] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0034] Figure 1 is a hardware schematic diagram of a communication system according to an exemplary embodiment.
[0035] Figure 2is a flow chart of a communication method according to an example embodiment.
[0036] Figure 3 is a flow chart of another communication method according to an example embodiment. DETAILED DESCRIPTION
[0037] The example embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements or features in the figures. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements or features in the figures. The following example embodiments described in the following detailed description are not meant to be all inclusive or to be the only embodiments that are consistent with the disclosure. Rather, they are merely examples that can be consistent with some aspects of the disclosure as detailed in the appended claims.
[0038] The following example embodiments described in the following detailed description are not meant to be all inclusive or to be the only embodiments that are consistent with the disclosure. Rather, they are merely examples that can be consistent with some aspects of the disclosure as detailed in the appended claims.
[0039] It should be noted that all the actions of obtaining signals, information or data in the disclosure are carried out in accordance with the corresponding data protection regulations and policies of the country where the device is located, and with the authorization of the corresponding device owner.
[0040] Before describing the specific embodiments of the disclosure, the process and principle of the communication method in the related art are described.
[0041] In electronic engineering, GPIO port refers to the pin on the controller or single-chip microcomputer, which is used to connect external devices and is used as input or output signal. The difference between one-way GPIO port and two-way GPIO port lies in the number of pins and the number of channels that GPIO can handle at the same time. One-way GPIO port has only one input or output channel, which means sending data or receiving data through one pin. Two-way GPIO port provides independent input and output channels, which means sending data and receiving data through two pins respectively.
[0042] In the related art, due to the limited serial port of the controller on the terminal device, the sensor usually needs to add an additional GPIO port to realize communication with the controller. In the related art, if multiple sensors want to communicate with the controller, each sensor needs to be connected with the controller through an independent two-way GPIO port, which makes the communication cost higher.
[0043] Reference Figure 1 , Figure 1is a hardware schematic diagram of a communication system according to an exemplary embodiment. The communication system 900 can include a controller 901 and a plurality of sensors S1, S2, …, S n . The controller 901 includes at least one GPIO port and a timer 902. The controller 901 is connected with the plurality of sensors through the GPIO port, and a communication switch, such as communication switches K1, K2, …, K n , is arranged between each sensor and the GPIO port. The controller 901 is configured to perform the communication method proposed by the present disclosure.
[0044] Referring to Figure 2 , Figure 2 is a flowchart of a communication method according to an exemplary embodiment. As shown in Figure 2 , the communication method is applied to a controller, such as the controller 901 shown in Figure 1 , which is connected with a plurality of sensors through a GPIO port, and a communication switch is arranged between each sensor and the GPIO port of the controller. The communication method includes the following steps.
[0045] In step S11, a target sensor to be connected is determined according to a polling order of the plurality of sensors.
[0046] By way of example, the communication method proposed by the present disclosure is applied to a controller in a communication system, which can be a communication system in an air conditioner.
[0047] It should be noted that the above examples of scenarios are merely for the purpose of illustrating the present disclosure and are not intended to limit the present disclosure.
[0048] The plurality of sensors may, for example, include various types of sensors, such as temperature sensors, humidity sensors, light sensors, air pressure sensors, etc.
[0049] The polling order is used to represent the receiving order of the controller for collecting data from the plurality of sensors, which is usually determined according to user requirements. For example, the user can set to obtain temperature data, humidity data, light data, and air pressure data in sequence. Thus, the polling order is set to be temperature sensors, humidity sensors, light sensors, and air pressure sensors in sequence.
[0050] It should be understood that the target sensor to be connected, i.e., the next target sensor to be connected, can be determined based on the currently connected sensor and the polling order. After polling the last sensor according to the polling order, the first sensor can be returned to start polling again.
[0051] In step S12, the communication switch between the currently connected sensor and the GPIO port is controlled to be turned off, and the communication switch between the target sensor and the GPIO port is controlled to be turned on.
[0052] A GPIO port can only send or receive data through a single pin, and accordingly, the controller can only receive data sent by a sensor through the GPIO port at a time. For this reason, the controller needs to control the communication switch between the currently connected sensor and the GPIO port to be disconnected and the communication switch between the target sensor and the GPIO port to be connected before receiving the data sent by the target sensor, so that the controller can receive the data sent by the target sensor through the GPIO port.
[0053] For example, controlling the communication switch between the sensor and the GPIO port to be disconnected or connected can be achieved by controlling at least one of the following components: a relay, a transistor, and an optocoupler.
[0054] In step S13, in response to receiving the external interrupt signal sent by the target sensor through the GPIO port, the timer is started, and the data sent by the target sensor is received through the GPIO port.
[0055] The external interrupt signal is an interrupt signal triggered by an external device, which is used to inform the controller that an important task needs to be processed immediately.
[0056] The target sensor triggers the external interrupt signal when sending data to the controller to inform the controller that data needs to be received. Therefore, when the controller receives the external interrupt signal sent by the target sensor through the GPIO port, the timer is started, and the data sent by the target sensor is received through the GPIO port.
[0057] The timer is a kind of timer used for timing and generating periodic events. After the timer is started, its own calculation logic is opened, and the timer itself interrupt mechanism is triggered every time the timer interrupt time (time base) during the process of receiving the data sent by the sensor by the controller. For example, when the time base of the timer is 208us, the timer will trigger an interrupt every 208us during the process of receiving the data sent by the sensor by the controller.
[0058] For example, the number of timers is multiple, and each sensor corresponds to a timer. The time base of the timer is determined according to the data transmission rate of the sensor corresponding to the timer. In this way, in response to receiving the external interrupt signal sent by the target sensor through the GPIO port, the timer corresponding to the target sensor is started to receive the data of the target sensor according to the time base of the timer corresponding to the target sensor, so as to ensure that the collected data of the target sensor can be completely received.
[0059] In response to the time from receiving the external interrupt signal reaching the preset polling time, returning to determining the target sensor to be connected according to the polling order of the plurality of sensors, that is, returning to step S11, and re-executing step S11 and the subsequent steps.
[0060] The polling time is the preset receiving duration of the data transmitted by the sensor. That is, the controller can ensure that the data transmitted by each sensor can be completely received within the polling time. Therefore, the polling time is determined by the amount of data transmitted by the sensor at a time and the data transmission rate.
[0061] It should be understood that the data transmission rate and the amount of data transmitted by the sensor at a time are generally within a certain time range. For example, the amount of data transmitted by a temperature sensor, a humidity sensor, an illumination sensor, and a barometric pressure sensor at a time is generally 2-4 bytes, and the data transmission rate is generally 2400 baud, 4800 baud, etc. The baud rate is used to represent the number of bytes transmitted per second. For example, 2400 baud represents 2400 bytes transmitted per second; 4800 baud represents 4800 bytes transmitted per second.
[0062] For example, the preset polling time is 1 second. In this way, when the controller responds to the time from receiving the external interrupt signal reaching the preset polling time, it can be determined that the data transmitted by the target sensor is received, and returns to determining the target sensor to be connected according to the polling order of the plurality of sensors to receive the data transmitted by the next sensor.
[0063] The technical scheme provided by the embodiments of the present disclosure can include the following beneficial effects: the controller is connected with the plurality of sensors through one GPIO port, the target sensor to be connected, that is, the target sensor whose collected data is to be received, is determined according to the polling order through the polling mechanism, and then the communication switch between the target sensor and the GPIO port is turned on to receive the data of the target sensor through the GPIO port. In this way, when realizing the data communication between the controller and the plurality of sensors, only one GPIO port of the controller needs to be occupied, which not only facilitates the data communication between the controller and the sensors, but also reduces the communication cost because no additional modification of the controller is required. In addition, only one GPIO port needs to be occupied during the communication, which saves the communication interface resources of the controller, so that the controller can meet the communication needs of other operations based on the remaining communication interfaces, that is, more operations can be performed through one controller, thereby not only enriching the functions of the controller, but also improving the processing capacity of the controller.
[0064] Optionally, in response to the time from receiving the external interrupt not reaching the preset polling time, the data transmitted by the target sensor is continuously received through the GPIO port.
[0065] Optionally, the time base of the timer is determined based on a maximum data transmission rate among the data transmission rates of the plurality of sensors.
[0066] For example, the transmission rate of the temperature sensor is 2400 baud, and the transmission rate of the humidity sensor is 4800 baud. The transmission time of one byte of data of the temperature sensor is 1 / 2400 = 416us, and the transmission time of one byte of data of the humidity sensor is 1 / 4800 = 208us. It can be seen that the greater the data transmission rate of a sensor, the shorter the transmission time of one byte of data corresponding to the sensor; the smaller the data transmission rate of a sensor, the longer the transmission time of one byte of data corresponding to the sensor. Therefore, the time base of the timer is determined based on the maximum data transmission rate among the data transmission rates of the plurality of sensors, so that the timer can process each byte of data sent by the sensor with the maximum data transmission rate within the time base of the timer. It should be understood that for data sent by a sensor with a smaller data transmission rate, the timer can trigger multiple interrupts based on the time base of the timer to receive the data.
[0067] For example, the time base of the timer is set to 208us. In this way, the timer triggers an interrupt every 208us to receive data sent by the sensor. For one byte of data sent by the temperature sensor, the timer needs to trigger an interrupt to receive the data; for one byte of data sent by the humidity sensor, the timer needs to trigger two interrupts to receive the data. Thus, the time base of the timer is determined based on the maximum data transmission rate among the data transmission rates of the plurality of sensors, which can achieve accurate and complete reception of data sent by each sensor.
[0068] Optionally, the time base of the timer is determined as twice the inverse of the maximum data transmission rate.
[0069] For example, the time base of the timer can be determined by the following formula:
[0070]
[0071] wherein T is the time base of the timer, and B is the maximum data transmission rate among the data transmission rates of the plurality of sensors.
[0072] In the above manner, accurate and complete reception of data sent by each sensor can be achieved.
[0073] Optionally, the communication method of the present disclosure further comprises: determining whether the level signal of the GPIO port meets the serial port protocol of the target sensor; and in response to determining that the level signal of the GPIO port meets the serial port protocol of the target sensor, determining whether the time from receiving the external interrupt signal reaches the polling time.
[0074] For example, the serial port protocol of the target sensor at least includes a transmission format of a start bit, a transmission format of a stop bit and a transmission format of a data bit. Thus, it can be determined whether the level signal of the GPIO port meets the transmission format specified by the serial port protocol of the target sensor, so as to determine whether the level signal of the GPIO port meets the serial port protocol of the target sensor.
[0075] It should be understood that, if the level signal of the GPIO port meets the transmission format specified by the serial port protocol of the target sensor, it is determined that the received level signal is the level signal triggered by the target sensor, that is, it is determined that the received data is valid data sent by the target sensor; if the level signal of the GPIO port does not meet the transmission format specified by the serial port protocol of the target sensor, it is determined that the received level signal is not the level signal triggered by the target sensor, that is, it is determined that the received data is invalid data.
[0076] For example, the serial port protocol of the target sensor includes one of Modbus RTU, I 2 C, SPI, UART. Taking the serial port protocol of the target sensor as UART (universal asynchronous receiver-transmitter) as an example, the UART protocol at least includes a transmission format of a start bit, a transmission format of a stop bit and a transmission format of a data bit. The transmission format of the start bit is a logic low, that is, 0; the transmission format of the stop bit is a logic high, that is, 1. The data bit format is determined by the data bit length agreed in the UART protocol, for example, 8 bits, which corresponds to a level signal sequence of 0, 1, 0, 0, 0, 1, 1, 0. Therefore, the transmission format specified by the serial port protocol of the target sensor is determined as:
[0077] Start bit | Data bit | Stop bit
[0078] 0 | 0 1 0 0 0 1 1 0 | 1
[0079] Thus, when it is determined that the level signal of the GPIO port meets the above transmission format, it is determined that the received level signal is the level signal triggered by the target sensor.
[0080] Through the above method, it can be determined that the data sent by the target sensor is valid data, and the stability in the communication process is enhanced.
[0081] On the basis of the above embodiment, the communication method of the present disclosure can further include: in response to determining that the level signal of the GPIO port does not meet the serial port protocol of the target sensor, generating an alarm information, and / or returning to the step of controlling the communication switch between the currently connected sensor and the GPIO port to be turned off and controlling the communication switch between the target sensor and the GPIO port to be turned on.
[0082] The alarm information is used to indicate that the currently connected sensor is not the target sensor.
[0083] For example, when it is determined that the level signal of the GPIO port does not meet the serial port protocol of the target sensor, the alarm information is generated to indicate that the currently connected sensor is not the target sensor. In this way, the relevant personnel can check and adjust according to the alarm information to connect the target sensor with the controller through the GPIO port.
[0084] For example, when the communication switch between the other sensor and the GPIO port is controlled to be turned on by mistake, the level signal of the GPIO port may not meet the serial port protocol of the target sensor. Therefore, when it is determined that the level signal of the GPIO port does not meet the serial port protocol of the target sensor, the step of controlling the communication switch between the currently connected sensor and the GPIO port to be turned off and the communication switch between the target sensor and the GPIO port to be turned on, i.e., step S12, is returned to control the communication between the target sensor and the GPIO port again.
[0085] The above method not only improves the reliability and stability of the communication process, but also optimizes the operation and maintenance process to ensure that the data sent by the target sensor can be correctly received.
[0086] Optionally, the controller can control the on-off of the communication switch through the relay.
[0087] It should be understood that the controller controls the on-off of the communication switch through the relay to provide good electrical isolation and ensure the stability of the communication process.
[0088] The communication method provided by the present disclosure will be further described below in combination with Figure 3 For example, the controller can control the on-off of the communication switch through the relay. Figure 3As shown, the controller can be initialized first to obtain a polling sequence of the plurality of sensors, a polling time, and a time base of the timer, and to set a communication switch between the sensors and a GPIO port of the controller. Further, a target sensor to be connected is determined according to the polling sequence of the plurality of sensors, and the communication switch between the currently connected sensor and the GPIO port is controlled to be turned off, and the communication switch between the target sensor and the GPIO port is controlled to be turned on. In response to no external interrupt signal sent by the target sensor being received through the GPIO port, the controller is controlled to normally operate without data receiving processing; and in response to the external interrupt signal sent by the target sensor being received through the GPIO port, the timer is controlled to be started, and data sent by the target sensor is received through the GPIO port. It is determined whether a level signal of the GPIO port satisfies a serial port protocol of the target sensor. Further, in response to the level signal of the GPIO port satisfying the serial port protocol of the target sensor, it is determined whether a time from receiving the external interrupt signal reaches the polling time; and in response to the level signal of the GPIO port not satisfying the serial port protocol of the target sensor, an alarm information is generated, and / or the step of controlling the communication switch between the currently connected sensor and the GPIO port to be turned off, and controlling the communication switch between the target sensor and the GPIO port to be turned on is returned to.
[0089] Further, in response to the time from receiving the external interrupt signal reaching the preset polling time, the step of determining the target sensor to be connected according to the polling sequence of the plurality of sensors is returned to; and in response to the time from receiving the external interrupt signal not reaching the preset polling time, the data sent by the target sensor is continuously received.
[0090] In another exemplary embodiment, the communication system 900 further comprises a relay connected with the controller 901, and the controller 901 controls the communication switch by controlling the relay.
[0091] In another exemplary embodiment, an air conditioner is also provided, which comprises the communication system proposed in the disclosure.
[0092] Those skilled in the art can also understand that the various illustrative logical blocks and steps listed in the embodiments of the present application can be implemented by electronic hardware, computer software, or a combination of both. Whether the functions are implemented by hardware or software depends on the specific application and design requirements of the whole system. Those skilled in the art can implement the functions described in various ways for each specific application, but such implementation should not be understood as beyond the scope of protection of the embodiments of the present application.
[0093] In the detailed description above, reference is made to the accompanying drawings, which form a part hereof, and in which are shown by way of illustration specific aspects in which the disclosure can be practiced. In this regard, directional terminology, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "back," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and other commonly used terms, are used herein for the purpose of illustration only and are not intended to be limiting. Because the described devices can be positioned in a number of different orientations, the directional terminology can be used for illustration purposes only and is not limiting. It is to be understood that other aspects can be utilized and structural or logical changes can be made without departing from the scope of the present disclosure. The following detailed description, therefore, is not to be taken in a limiting sense.
[0094] It is to be understood that the features of the various aspects of the present disclosure described herein can be combined with each other, unless specifically noted otherwise. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items; similarly, "at least one of' includes any and all combinations of one or more of the associated listed items.
[0095] It should be understood that, unless otherwise specifically stated and limited, the terms "joined," "attached," "mounted," "connected," "fixed," and terms similar to these, used in the embodiments of the disclosure, should be understood broadly, for example, can be fixed connection, can also be detachable connection, or integral; can be mechanical connection, can also be electrical connection or communication with each other; can be directly connected, can also be indirectly connected through an intermediate medium, can be the internal communication of two elements or the interaction relationship between two elements, unless otherwise specifically limited. The specific meaning of the above terms in this article can be understood according to the specific circumstances by those skilled in the art.
[0096] In addition, the word "over" used in connection with components, elements or layers of material formed "over" or located "over" a surface can be used herein to mean that the components, elements or layers of material are positioned (e.g., placed, formed, deposited, etc.) "indirectly" on the surface such that one or more additional components, elements or layers are disposed between the surface and the components, elements or layers of material. However, the word "over" used in connection with components, elements or layers of material formed "over" or located "over" a surface can also optionally have the specific meaning that the components, elements or layers of material are positioned (e.g., placed, formed, deposited, etc.) "directly" on the surface, e.g., in direct contact with the surface.
[0097] Although terms such as “first,” “second,” and “third” may be used herein to describe various components, parts, regions, layers, or sections, these components, parts, regions, layers, or sections are not limited to these terms. Rather, these terms are used only to distinguish one component, part, region, layer, or section from another. Therefore, without departing from the teachings of the examples described herein, the first component, part, region, layer, or section mentioned in the examples may also be referred to as the second component, part, region, layer, or section. Furthermore, the terms “first” and “second” 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. Thus, a feature defined as “first” or “second” may explicitly or implicitly include at least one of that feature. In the description herein, “a plurality” means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0098] It should be understood that spatial relative terms, such as “above,” “upper,” “below,” and “lower,” are used herein to describe the relationship between one element and another shown in the figures. In addition to the orientation depicted in the figures, these spatial relative terms are also intended to encompass different orientations of the device in use or operation. For example, if the device in the figures is flipped, an element described as “above” or “upper” relative to another element would be “below” or “lower” relative to that other element. Thus, depending on the spatial orientation of the device, the term “above” encompasses both above and below orientations. Devices may have other orientations (e.g., rotated 90 degrees or in other orientations), and the spatial relative terms used herein should be interpreted accordingly.
[0099] Furthermore, the term “exemplarily” is used herein to indicate that it serves as an example, instance, or illustration. Any aspect or design described herein as “exemplarily” is not necessarily to be construed as advantageous compared to other aspects or designs. Rather, the use of the term “exemplarily” is intended to present concepts in a concrete manner. As used herein, the term “or” is intended to indicate an inclusive “or” rather than an exclusive “or.” That is, unless otherwise specified or clear from the context, “X applies A or B” is intended to indicate any of the natural inclusive arrangements. That is, “X applies A or B” satisfies any of the foregoing instances if X applies A; X applies B; or both X applies A and B. Additionally, unless otherwise specified or clear from the context to the singular form, the articles “a” and “an” as used in this application and the appended claims are generally understood to mean “one or more.”
[0100] Likewise, although the present disclosure has been described and illustrated with respect to one or more implementations, equivalent alterations and modifications will become apparent to those skilled in the art that do not depart from the true spirit and scope of the disclosure. The present disclosure includes all such modifications and alterations and is limited only by the scope of the following claims. In particular regard to the various functions performed by the above described components (e.g., elements, resources, etc.), the terms used to describe such components are intended to correspond, unless otherwise indicated, to any component which performs the specified function of the described component (e.g., a functional equivalent), even though not structurally equivalent to the disclosed structure. In addition, although a particular feature of the disclosure can have been disclosed with respect to only one of several implementations, such feature can be combined with one or more other features of the other implementations as can be desired and advantageous for any given or particular application. Furthermore, to the extent that the terms "includes", "including", "has", "have", "has", "having", or variants thereof are used in either the detailed description or the claims, such terms are intended to be inclusive in a manner similar to the term "comprising."
[0101] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features of the disclosure disclosed herein. It is intended that the present disclosure be considered as including any variations, uses, or adaptations of the disclosure and generic equivalents of the components described herein as covered by the appended claims. The specification and examples are to be construed as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
[0102] It is to be understood that the present disclosure is not limited to the precise construction described and illustrated above and that various modifications and changes can be made therein without departing from the scope of the present disclosure. The scope of the present disclosure is limited only by the claims that follow.
Claims
1. A communication method, characterized in that, Applied to a controller, the controller is connected to multiple sensors via a single general purpose input / output (GPIO) port, and a communication switch is provided between each sensor and the GPIO port of the controller. The communication method includes: The target sensor to be connected is determined according to the polling order of the multiple sensors. Disconnect the communication switch between the currently connected sensor and the GPIO port, and connect the communication switch between the target sensor and the GPIO port; In response to receiving an external interrupt signal from the target sensor via the GPIO port, the timer is started, and data sent by the target sensor is received via the GPIO port; In response to the time elapsed since the external interrupt signal was received reaching a preset polling time, the process returns to the step of determining the target sensor to be connected according to the polling order of the multiple sensors; The time base of the timer is determined based on the maximum data transmission rate among the data transmission rates of the multiple sensors.
2. The communication method according to claim 1, characterized in that, The time base of the timer is determined to be twice the reciprocal of the maximum data transmission rate.
3. The communication method according to claim 1, characterized in that, The communication method further includes: Determine whether the level signal of the GPIO port meets the serial port protocol of the target sensor; In response to determining that the level signal of the GPIO port satisfies the serial port protocol of the target sensor, it is determined whether the polling time has been reached since the external interrupt signal was received.
4. The communication method according to claim 3, characterized in that, The communication method further includes: In response to determining that the level signal of the GPIO port does not meet the serial port protocol of the target sensor, an alarm message is generated, and / or the steps of controlling the communication switch between the currently connected sensor and the GPIO port to be disconnected and controlling the communication switch between the target sensor and the GPIO port to be turned on are returned.
5. The communication method according to claim 1, characterized in that, The controller controls the on / off state of the communication switch by controlling a relay.
6. A controller, characterized in that, include: The controller has at least one general purpose input / output (GPIO) port, and multiple sensors are connected through one GPIO port. A communication switch is provided between each sensor and the GPIO port. Timer; processor; Memory used to store processor-executable instructions; The processor is configured to execute the executable instructions in the memory to implement the steps of the communication method as described in any one of claims 1 to 5.
7. A communication system, characterized in that, include: The controller includes at least one general purpose input / output (GPIO) port and a timer; Multiple sensors are provided, and the controller is connected to the multiple sensors through a GPIO port, and a communication switch is provided between each sensor and the GPIO port. The controller is configured to perform the steps of the communication method according to any one of claims 1-5.
8. The communication system according to claim 7, characterized in that, The communication system also includes: A relay is connected to the controller, which controls the on / off state of the communication switch by controlling the relay.
9. An air conditioner, characterized in that, Includes the communication system described in claim 7 or 8.
Citation Information
Patent Citations
Over-conductive slip ring communication system and method for photoelectric pod
CN117640048A