Dual-thermostat port expansion method and apparatus, device, and computer-readable medium
By synchronizing the communication protocols of the main and auxiliary temperature controllers and flexibly configuring port functions, the problem of poor functional expandability of temperature controllers is solved, and flexible, low-cost functional expansion and stability improvement are achieved.
Patent Information
- Application Number
- PCT/CN2025/105983
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-12
- Filing Date
- 2025-06-30
- Publication Date
- 2026-02-19
AI Technical Summary
Existing temperature controllers suffer from poor functional expandability due to the limited number of 24V function interfaces. Traditional hardware modification methods are costly and inconvenient, and existing solutions on the market have failed to fundamentally simplify the process and reduce costs.
By synchronizing the communication protocols of the main and auxiliary temperature controllers, the port functions can be flexibly configured. The communication protocol is used to determine and transmit data flags, enabling the auxiliary temperature controller or the main temperature controller to execute port function logic, synchronizing signal status, and avoiding hardware modifications.
This allows for flexible expansion of functional interfaces without altering the original temperature controller hardware design, reducing costs, avoiding compatibility issues, and improving system stability and user convenience.
Smart Images

Figure CN2025105983_19022026_PF_FP_ABST
Abstract
Description
Dual-thermostat port expansion method, device, equipment and computer readable medium
[0001] The present application claims priority from the Chinese patent application No. 2024111020591 filed on August 12, 2024, and entitled "Dual-thermostat port expansion method, device, equipment and computer readable medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of port expansion, and in particular to a dual-thermostat port expansion method, device, equipment and computer readable medium. BACKGROUND
[0003] A thermostat is an electronic device that controls the operation of equipment by changing the on-off action of internal electronic components according to the temperature changes in the working environment, mainly used to control the start-stop of heating or refrigeration equipment to achieve the preset temperature value. Currently, due to the limitation of the number of 24V function interfaces of the thermostat, the expandability of its functions is directly limited. With the increasing application demand, the traditional method mainly adds interfaces by modifying the hardware circuit design and mold, which not only consumes time and effort, but also increases the complexity and cost of product update iteration, and may cause compatibility problems. To solve this problem, although interface expansion boards or adapter boxes have appeared in the market, they still need customized circuit design and cannot fundamentally simplify the process and cost. Therefore, there is an urgent need for a solution that can flexibly and efficiently expand the function interfaces without changing the original thermostat main body design, while ensuring the compatibility and upgrade convenience of the product.
[0004] At present, there is no effective solution to the above problems. SUMMARY
[0005] The present application provides a dual-thermostat port expansion method, device, equipment and computer readable medium to solve the technical problem of "high cost and low convenience of interface expansion of the thermostat by hardware modification".
[0006] According to one aspect of the embodiments of the present application, the present application provides a dual temperature controller port expansion method, comprising: configuring a port function corresponding to a signal output port of a main temperature controller and a secondary temperature controller according to user demand; judging whether a data flag bit of the port function exists in a communication protocol between the main temperature controller and the secondary temperature controller; if the data flag bit exists, transmitting the data flag bit to the secondary temperature controller based on the communication protocol by the main temperature controller; executing a logic of the port function by the secondary temperature controller to judge opening or closing of the signal output port corresponding to the port function; if the data flag bit does not exist, executing the logic of the port function by the main temperature controller to judge opening or closing of the signal output port corresponding to the port function; and if the port function is configured on the secondary temperature controller, synchronizing a signal state of the port function to the secondary temperature controller.
[0007] Optionally, the configuring the port function corresponding to the signal output port of the main temperature controller and the secondary temperature controller according to the user demand comprises: determining user demand; setting the port function corresponding to the main temperature controller and the secondary temperature controller according to the user demand; and configuring the communication protocol between the main temperature controller and the secondary temperature controller based on the port function.
[0008] Optionally, the judging whether the data flag bit of the port function exists in the communication protocol between the main temperature controller and the secondary temperature controller comprises: obtaining the communication protocol between the main temperature controller and the secondary temperature controller; parsing the communication protocol to obtain all data flag bits contained in the communication protocol; matching the all data flag bits with a data flag bit of a port function to be expanded; if the matching is successful, the communication protocol exists the data flag bit of the port function to be expanded, and if the matching fails, the communication protocol does not exist the data flag bit of the port function to be expanded.
[0009] Optionally, the transmitting the data flag bit to the secondary temperature controller based on the communication protocol by the main temperature controller comprises: packing the data flag bit of the port function into a data packet in a format supported by the communication protocol; sending the data packet to the secondary temperature controller based on the communication protocol by the main temperature controller; and parsing the data packet after the secondary temperature controller receives the data packet to update configuration information of the port function in the secondary temperature controller.
[0010] Optionally, the executing the logic of the port function by the secondary temperature controller to judge opening or closing of the signal output port corresponding to the port function comprises: calling a logic control instruction of the logic corresponding to the port function; executing the logic control instruction by the secondary temperature controller; and judging opening or closing of the signal output port corresponding to the port function according to an execution result of the logic control instruction.
[0011] Optionally, the logic for executing the port function by the main temperature controller judges the opening and closing of the signal output port corresponding to the port function, comprising: calling the logic control instruction of the logic corresponding to the port function; executing the logic control instruction by the main temperature controller; and judging the opening or closing of the signal output port corresponding to the port function according to the execution result of the logic control instruction.
[0012] Optionally, when the port function is configured on the secondary temperature controller, the signal state of the port function is synchronized to the secondary temperature controller, comprising: judging that the port function is configured on the secondary temperature controller; calling the signal state of the port function; and synchronizing the signal state of the port function to the secondary temperature controller by the main temperature controller.
[0013] According to another aspect of the embodiment of the present application, the present application provides a dual-temperature-controller port expansion device, comprising: a function configuration module, configured to configure the port function corresponding to the signal output port of the main temperature controller and the secondary temperature controller according to user demand; a data judgment module, configured to judge whether the data flag bit of the port function exists in the communication protocol between the main temperature controller and the secondary temperature controller; a data transmission module, configured to transmit the data flag bit to the secondary temperature controller based on the communication protocol by the main temperature controller; a first logic judgment module, configured to execute the logic of the port function by the secondary temperature controller to judge the opening and closing of the signal output port corresponding to the port function; a second logic judgment module, configured to execute the logic of the port function by the main temperature controller to judge the opening and closing of the signal output port corresponding to the port function; and a signal synchronization module, configured to synchronize the signal state of the port function to the secondary temperature controller when the port function is configured on the secondary temperature controller.
[0014] According to another aspect of the embodiment of the present application, the present application provides an electronic device, comprising a memory, a processor, a communication interface and a communication bus, the memory stores a computer program executable on the processor, the memory, the processor and the communication interface communicate through the communication bus, and the processor executes the computer program to implement the steps of the dual-temperature-controller port expansion method.
[0015] According to another aspect of the embodiment of the present application, the present application further provides a computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to execute the dual-temperature-controller port expansion method.
[0016] The above technical solution provided by the embodiment of the present application has the following advantages compared with related art:
[0017] The application extends the new function interface to the secondary temperature controller by distinguishing the main and secondary line controllers in the program, synchronizes the function interface data to the corresponding temperature controller function port through communication, and at least doubles the function interface. The flexible port function configuration allows the user to flexibly configure the port function corresponding to the signal output port of the main and secondary temperature controllers according to the user's needs, and meets the needs of different application scenarios. It is judged whether the communication protocol between the main and secondary temperature controllers supports the port function data flag bit to be expanded, so as to decide whether to execute the corresponding logic through the main or secondary temperature controller, greatly reducing the workload of manual configuration and debugging. After confirming that the communication protocol is supported, the main temperature controller transmits the data flag bit of the port function to the secondary temperature controller, or synchronizes the signal state to the secondary temperature controller when the main temperature controller executes the logic, ensuring the data consistency and real-time between the two. Whether the main or secondary temperature controller executes the logic of the port function, it is realized through calling the logic control instruction, executing the instruction and judging the opening and closing of the signal output port according to the execution result, realizing the accurate management of temperature control. The whole expansion process does not need to change the hardware circuit design or mold, reduces the cost, and also avoids the compatibility problems that may be caused by hardware changes. BRIEF DESCRIPTION OF DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the accompanying drawings needed to be used in the embodiments or related art description will be briefly introduced. Obviously, those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0020] Fig. 1 is a flow diagram of a dual temperature controller port expansion method according to an embodiment of the present application;
[0021] Fig. 2 is a schematic diagram of the connection mode of the main and secondary temperature controllers according to an embodiment of the present application;
[0022] Fig. 3 is a block diagram of a dual temperature controller port expansion device according to an embodiment of the present application;
[0023] Fig. 4 is a schematic diagram of an optional electronic device structure according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0025] In the following description, the suffixes such as "module", "part", or "unit" used for an element are only for facilitating the description of the present application, and have no particular meaning by themselves. Therefore, "module" and "part" can be used interchangeably.
[0026] In the related art, the function port expansion of the temperature controller is mainly expanded by the hardware modification method. The modification cost of the function port expansion by this method is high, and the convenience is low.
[0027] In order to solve the problems mentioned in the background art, according to an aspect of the embodiments of the present application, a dual-temperature controller function port expansion method is provided, as shown in FIG. 1, comprising:
[0028] Step S102, configuring the port function corresponding to the signal output port of the main temperature controller and the auxiliary temperature controller according to the user demand.
[0029] Further, step S102 comprises:
[0030] determining the user demand;
[0031] setting the port function corresponding to the main temperature controller and the auxiliary temperature controller according to the user demand;
[0032] This embodiment primarily expands the functional ports of a dual-temperature controller. This expansion is achieved by synchronizing the functional port data to the dual-temperature controller's functional interface via communication. The dual-temperature controller mainly consists of a main temperature controller and a secondary temperature controller, with the main temperature controller being a host computer. In this embodiment, the control function signals are synchronized through communication between the secondary temperature controller and the host computer. When new functions need to be added to the dual-temperature controller, the hardware interface of the dual-temperature controller does not need to be modified. First, user requirements are determined. The user's specific requirements for the temperature controller's functional ports are collected through the user interface, including the devices the user wants the ports to control, such as humidifiers, dehumidifiers, and air conditioners, as well as the control logic for these devices. The control logic includes automatic switching of temperature, humidity, and other conditions. After obtaining the user's requirements, corresponding functions are assigned to each port of the main and secondary temperature controllers according to these requirements, including recording the configuration information of each port in the internal database of the temperature controller. Since the main and secondary temperature controllers need to maintain synchronization, the configured port function information needs to be shareable or synchronized between the two temperature controllers. After determining the port function of each port, the communication protocol between the main and auxiliary temperature controllers is configured according to the port function. This includes determining the information that needs to be transmitted between the two temperature controllers, including port function configuration information, real-time status information, and control commands. Configuring the communication protocol is crucial to ensuring that the two temperature controllers can efficiently and accurately synchronize information. By properly configuring the communication protocol, redundancy and errors in data transmission can be reduced, improving the overall performance and stability of the system.
[0033] Specifically, the main temperature controller a includes n 24V signal output ports, namely X1, ..., X... n The secondary temperature controller b also includes n 24V signal output ports, namely X n+1 ..., X 2n Each signal output terminal can be connected to a functional device. However, the signal output ports of the secondary thermostat and the primary thermostat have the same function. Therefore, the 2n signal output ports of the dual thermostat can achieve n functions, including humidifiers, dehumidifiers, temperature control systems, etc., configured according to user needs (X1, ..., X...). 2n Port functions of signal output ports. Referring to Figure 2, the connection methods of the main temperature controller a and the auxiliary temperature controller b before and after port function expansion are shown. Before port function expansion, the signal output terminals of the auxiliary temperature controller b and the main temperature controller a were connected together. After port function expansion via communication synchronization, the signal output ports of the auxiliary temperature controller b and the main temperature controller a are no longer connected. However, this is not achieved by directly changing the hardware connection between the main temperature controller a and the auxiliary temperature controller b, but rather by changing the connection method through the program.
[0034] In this embodiment, for example, a user wants to control six different environmental devices, including a humidifier, a dehumidifier, a heater, an air purifier, a smart fan and floor heating, in a smart home environment through a main temperature controller and a secondary temperature controller. However, the main temperature controller and the secondary temperature controller each have only three signal output ports. The three signal output ports of the main temperature controller are X1, X2 and X3, and the three signal output ports of the secondary temperature controller are X4, X5 and X6. The signal output port X1 and the signal output port X4 have the same port function, and the corresponding functional devices are both humidifiers. The signal output port X2 and the signal output port X5 have the same port function, and the corresponding functional devices are both dehumidifiers. The signal output port X3 and the signal output port X6 have the same port function, and the corresponding functional devices are both heaters. The user wants to expand the functions of the main temperature controller to control the remaining air purifier, smart fan and floor heating. The corresponding port functions of the signal output port X1, the signal output port X2, the signal output port X3, the signal output port X4, the signal output port X5 and the signal output port X6 are reconfigured, for example, the port functions of the three signal output ports of the main temperature controller are reconfigured in this embodiment, and for the secondary temperature controller, the original port functions of the three signal output ports are retained. The corresponding relationship between the reconfigured signal output ports and their port signals is that the signal output port X1 corresponds to the air purifier, the signal output port X2 corresponds to the smart fan, the signal output port X3 corresponds to the floor heating, the signal output port X4 corresponds to the humidifier, the signal output port X5 corresponds to the dehumidifier, and the signal output port X6 corresponds to the heater. The corresponding relationship between the signal output ports and the functional devices is set in the communication protocol, and the data flag bits and control codes of the new port functions corresponding to each functional device are defined in the communication protocol to represent and transmit the control signals of the main temperature controller to the new devices.
[0035] In the above embodiments, the user can freely configure the function of each port according to actual needs, without being limited by the preset functions of the temperature controller, so that the temperature controller can adapt to more diverse application scenarios and user needs. By extending the function ports of the temperature controller and allowing the user to customize the port functions, great convenience is provided for the functional expansion of the temperature controller, which can easily expand the functions of the temperature controller through software upgrades or configuration adjustments when new devices are added or user needs change. By reasonably configuring the communication protocol between the main temperature controller and the auxiliary temperature controller, the two temperature controllers can remain highly consistent in function execution, not only improving the stability and reliability of the system, but also allowing the user to view and control the status of the entire system on any temperature controller. By software configuration and communication protocol adjustment to achieve functional expansion, the modification cost and time cost are greatly reduced, and at the same time, since no hardware devices need to be replaced, resource waste and environmental pollution are also reduced. By reconfiguring the signal output port function of the main temperature controller, control of more types of environmental devices such as air purifiers, intelligent fans, and heaters is achieved without the need for additional hardware devices, significantly improving the functional flexibility and scalability of the temperature control system, meeting the user's diverse smart home control needs. On the basis of retaining the original functions of the auxiliary temperature controller, the idle port resources of the main temperature controller are fully utilized, avoiding repeated construction and resource waste. Through the new data flag bit and control code defined in the communication protocol, the information synchronization and collaborative work between the main temperature controller and the auxiliary temperature controller, as well as between them and each environmental device, are ensured, which helps to build a more stable, reliable, and efficient smart home environmental control system.
[0036] In step S104, it is determined whether the communication protocol between the main temperature controller and the auxiliary temperature controller has a data flag bit of the port function.
[0037] Further, step S104 includes:
[0038] obtaining the communication protocol between the main temperature controller and the auxiliary temperature controller;
[0039] parsing the communication protocol to obtain all data flag bits contained in the communication protocol;
[0040] matching all data flag bits with the data flag bits of the port function to be expanded;
[0041] If the matching is successful, the communication protocol has the data flag bit of the port function to be expanded, and if the matching fails, the communication protocol does not have the data flag bit of the port function to be expanded.
[0042] Specifically, it is determined whether the communication protocol between the main temperature controller and the auxiliary temperature controller has a signal output port X acorresponding to the port function of the signal output port X a corresponding to the port function of the signal output port X
[0043] In the above embodiments, by parsing and matching the data flags in the communication protocol, it can be quickly judged whether the communication protocol supports the newly added port function, thereby avoiding the cumbersome process of manual checking and configuration, and improving the configuration efficiency. Through the strict matching process, it is ensured that the newly added port function will not conflict with the existing communication protocol or be incompatible, thereby ensuring the stability and reliability of the system. By judging in advance whether the communication protocol supports the new function and taking corresponding measures to solve the problem, the risk can be effectively reduced. By supporting flexible port function expansion, the diversified needs of users can be met, and users can have a more convenient and efficient temperature control experience.
[0044] Step S106, if there is, transmitting the data flag from the main temperature controller to the secondary temperature controller based on the communication protocol.
[0045] Further, step S106 includes:
[0046] packaging the data flag of the port function into a data packet in a format supported by the communication protocol;
[0047] sending the data packet to the secondary temperature controller based on the communication protocol through the main temperature controller;
[0048] After receiving the data packet, the secondary temperature controller parses and updates the configuration information of the internal port function of the secondary temperature controller.
[0049] Specifically, the data flag corresponding to the port function of the signal output port X aThe data flag of the port function is packaged in the format specified by the communication protocol, including adding header information and check code, etc. The header information at least includes the type and length of the data packet to ensure the integrity and accuracy of the data packet during transmission. By packaging into the format supported by the communication protocol, the data packet can be smoothly transmitted through the communication network. After the data packet is prepared, the main temperature controller sends the data packet to the secondary temperature controller through the communication network based on the corresponding communication interface according to the communication protocol. The communication interface includes RS-485, WI-FI, etc. When the secondary temperature controller receives the data packet, it first checks the integrity and correctness of the data packet. If the check is passed, the secondary temperature controller will parse the data packet according to the communication protocol and extract the data flag of the port function of the signal output port X a . Then, the secondary temperature controller will update the configuration information of its internal port function according to these data flags to ensure that it is functionally synchronized with the main temperature controller.
[0050] In the above embodiment, the main temperature controller packages and transmits the data flag of the port function to the secondary temperature controller in the format supported by the communication protocol, realizing real-time synchronization of the port function configuration information between the main and secondary temperature controllers, shortening the configuration time and improving the work efficiency. The data packet undergoes strict formatting and checking process before transmission. Through the processes of packaging, sending, receiving and parsing, it can ensure that the data flag of the port function will not be lost or damaged during transmission, thereby ensuring the consistency of data between the main and secondary temperature controllers and the integrity and accuracy of data during transmission. At the same time, the use of the communication protocol optimizes the data transmission process, improves the efficiency of data transmission, and makes the information exchange between the main and secondary temperature controllers more rapid and reliable. By realizing the functional synchronization between the main and secondary temperature controllers, users can provide more consistent and convenient temperature control experience without the need to configure two temperature controllers separately to achieve comprehensive temperature control and management.
[0051] Step S108, the logic of the port function is executed by the secondary temperature controller to determine the opening and closing of the signal output port corresponding to the port function.
[0052] Further, step S108 includes:
[0053] retrieve the logic control instruction of the port function corresponding logic;
[0054] execute the logic control instruction by the secondary temperature controller;
[0055] determine to open or close the signal output port corresponding to the port function according to the execution result of the logic control instruction.
[0056] Specifically, the secondary temperature controller will retrieve the corresponding logical control instructions from the internal database or control logic according to the previously configured port function, which defines the execution mode of the port function under specific conditions, including the time of opening or closing the signal output port. After retrieving the logical control instructions, the secondary temperature controller executes the corresponding operations according to the requirements of the instructions, including reading sensor data, making condition judgments, sending control signals, etc. Through the execution of these logical control instructions, the secondary temperature controller can achieve precise control of external devices. After executing the logical control instructions, the secondary temperature controller determines whether to open or close the signal output port corresponding to the port function according to the execution results of the instructions. If the execution results meet the opening conditions, the secondary temperature controller will send an opening signal to the corresponding port; if the closing conditions are met, a closing signal will be sent. Since the direct operation is performed on the main temperature controller, the secondary temperature controller needs to send the logical control instructions or state information to the main temperature controller through the communication protocol. After receiving this information, the main temperature controller changes its port function mapping accordingly through the logical control instructions, so that the ports originally used to control the humidifier, dehumidifier, and hot air machine can "simulate" the control of the air purifier, intelligent fan, and floor heating.
[0057] In the above embodiments, by executing precise logical control instructions, the secondary temperature controller can achieve precise control of external devices, which helps to reduce errors and unnecessary energy consumption, and improves the control accuracy of the entire temperature control system. The execution results of the logical control instructions directly determine the opening and closing state of the signal output port, thereby ensuring the stable operation of the system. Even in complex and variable environments, accurate judgments and controls can be made according to the preset logic. By implementing precise port function control and signal output port opening and closing, users can be provided with a more comfortable and convenient temperature control experience. Users can set the functions of the temperature controller according to actual needs and understand the running state of the system through real-time feedback.
[0058] Step S110, if not, execute the logic of the port function through the main temperature controller to determine the opening and closing of the signal output port corresponding to the port function.
[0059] Further, step S110 includes:
[0060] Retrieve the logical control instructions of the logic corresponding to the port function;
[0061] Execute the logical control instructions through the main temperature controller;
[0062] Determine whether to open or close the signal output port corresponding to the port function according to the execution results of the logical control instructions.
[0063] Specifically, when the signal output port X aWhen the data flag bit of the port function of the specific port Xa does not exist in the communication protocol, the main temperature controller retrieves the corresponding logical control instruction from the control logic. The logical control instruction defines the execution logic of the port function under certain conditions, including when to turn on or off the signal output port, etc. After retrieving the logical control instruction, the main temperature controller performs the corresponding operation according to the requirements of the instruction, including reading the system state, making condition judgments, sending control signals to the secondary temperature controller or directly controlling external devices, etc. Through the execution of the above instructions, the main temperature controller can realize the control of the port function and judge the opening and closing state of the signal output port. After executing the logical control instruction, the main temperature controller originally used to control the ports of the humidifier, dehumidifier, and hot air machine are mapped to new ports that can control the air purifier, intelligent fan, and floor heating. If the execution result meets the opening condition, the main temperature controller will send the corresponding control signal, and if it meets the closing condition, it will perform the corresponding closing operation. For example, the execution result of the logical control instruction is that the signal output port X1, the signal output port X2, and the signal output port X3 are turned on, then the port function of the signal output port X1, the signal output port X2, and the signal output port X3 is modified to the corresponding air purifier, intelligent fan, and floor heating.
[0064] In the above embodiment, when the secondary temperature controller cannot handle a specific port function, the main temperature controller can take over and execute the corresponding logic, thereby enhancing the redundancy and reliability of the entire temperature control system, and helping to avoid the impact of single-point failure on the entire system. Since the main temperature controller can take over the functions that the secondary temperature controller cannot handle, the entire temperature control system is more flexible in terms of function configuration, and users can selectively enable or disable certain functions according to actual needs without worrying about the system's inability to support. When the secondary temperature controller fails or cannot handle a specific function, the user can simply take over these functions through the main temperature controller, thereby simplifying the fault handling process and helping to reduce downtime and maintenance costs. When the data flag bit of the port function of the specific port Xa does not exist in the communication protocol, the main temperature controller can automatically retrieve the corresponding logical control instruction from the control logic, and can dynamically adapt to different control requirements and environmental changes, improving the intelligence and flexibility of the system. The logical control instruction not only defines the execution logic of the port function, but also includes complex operations such as condition judgment and system state reading, which enables the main temperature controller to make intelligent decisions based on real-time data and optimize the control effect of the functional device. By remapping the port function, the main temperature controller converts the ports originally used to control the humidifier, dehumidifier, and hot air machine into new ports that can control the air purifier, intelligent fan, and floor heating, and also improves the utilization efficiency of port resources.
[0065] Step S112, if the port function is configured on the secondary temperature controller, synchronize the signal state of the port function to the secondary temperature controller.
[0066] Further, step S112 includes:
[0067] determining that the port function is configured on the secondary temperature controller;
[0068] retrieve the signal state corresponding to the port function;
[0069] synchronize the signal state of the port function to the secondary temperature controller through the primary temperature controller.
[0070] Specifically, before performing signal state synchronization, it is necessary to first confirm that the port function of the signal output port X a is indeed configured on the secondary temperature controller, which is completed by checking the status information of the secondary temperature controller, to ensure the accuracy and effectiveness of the synchronization operation. Once it is confirmed that the port function of the signal output port X a is configured on the secondary temperature controller, it is necessary to retrieve the current signal state of the port function, which usually includes reading sensor data, control signals, etc. associated with the port function, to obtain the most accurate signal state information. After obtaining the signal state of the port function, the primary temperature controller transmits the obtained signal state to the secondary temperature controller through a communication protocol. After receiving the signal state, the secondary temperature controller updates its internal state record to ensure consistency with the primary temperature controller. When it is determined that the port function change of the primary temperature controller needs to be synchronized to the secondary temperature controller, the primary temperature controller packages the port function change information into synchronization data, which includes the changed port number, the original function and the new function. These data may include the changed port number, the original function, the new function, etc. The primary temperature controller sends the synchronization data to the secondary temperature controller through a communication protocol. After receiving the synchronization data, the secondary temperature controller analyzes and updates its internal state to reflect the change of the port function of the primary temperature controller.
[0071] In the above embodiments, by synchronizing the signal state of the port function to the secondary temperature controller in real time, the consistency of the entire temperature control system can be ensured, which helps to reduce control errors and faults caused by inconsistent states. When the port function is configured on the secondary temperature controller, the synchronization of the signal state by the main temperature controller can further improve the reliability of the system. Even if the secondary temperature controller fails or abnormally in some cases, the main temperature controller can still accurately grasp the state of the system and make corresponding control decisions. Through the explicit synchronization mechanism and process, the control process of the temperature control system can be optimized, and when the signal state of the port function changes, the state information can be quickly responded and updated, thereby realizing accurate control of external devices. Through the logical control instructions configured inside the secondary temperature controller, accurate control of external devices can be realized. The logical control instructions not only define the execution mode of the port function under certain conditions, but also allow dynamic adjustment of the control strategy according to real-time data, thereby providing a more flexible and intelligent port expansion solution for the temperature controller. When new port functions or control of new external devices are needed, new logical control instructions can be simply configured on the secondary temperature controller to realize, without the need for large-scale hardware modification, which can quickly adapt to different use scenarios and requirements, enhancing the scalability and maintainability of the system.
[0072] According to another aspect of the embodiments of the present application, as shown in FIG. 3, a dual-temperature controller function port expansion device is provided, comprising:
[0073] The function configuration module 301 is configured to configure the port function corresponding to the signal output port of the main temperature controller and the secondary temperature controller according to user requirements.
[0074] The data judgment module 303 is configured to judge whether there is a data flag bit of the port function in the communication protocol between the main temperature controller and the secondary temperature controller.
[0075] The data transmission module 305 is configured to transmit the data flag bit to the secondary temperature controller based on the communication protocol by the main temperature controller.
[0076] The first logic judgment module 307 is configured to judge the opening and closing of the signal output port corresponding to the port function by executing the logic of the port function by the secondary temperature controller.
[0077] The second logic judgment module 309 is configured to judge the opening and closing of the signal output port corresponding to the port function by executing the logic of the port function by the main temperature controller.
[0078] The signal synchronization module 311 is configured to synchronize the signal state of the port function to the secondary temperature controller when the port function is configured on the secondary temperature controller.
[0079] It should be noted that the function configuration module 301 in this embodiment can be used to execute step S102 in the embodiments of the present application, the data determination module 303 in this embodiment can be used to execute step S104 in the embodiments of the present application, the data transmission module 305 in this embodiment can be used to execute step S106 in the embodiments of the present application, the first logic determination module 307 in this embodiment can be used to execute step S108 in the embodiments of the present application, the second logic determination module 309 in this embodiment can be used to execute step S110 in the embodiments of the present application, and the signal synchronization module 311 in this embodiment can be used to execute step S112 in the embodiments of the present application.
[0080] According to another aspect of the embodiments of the present application, the present application provides an electronic device, as shown in FIG. 4, comprising a memory 401, a processor 403, a communication interface 405 and a communication bus 407, the memory 401 stores a computer program capable of running on the processor 403, the memory 401 and the processor 403 communicate through the communication interface 405 and the communication bus 407, and the processor 403 implements the steps of the above method when executing the computer program.
[0081] The memory and the processor in the above electronic device communicate through the communication bus and the communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0082] The memory can include a Random Access Memory (RAM) and can also include a non-volatile memory, for example, at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0083] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0084] According to another aspect of the embodiments of the present application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of any of the above embodiments.
[0085] Optionally, in the embodiments of the present application, the computer readable medium is configured to store program codes for the processor to execute the following steps:
[0086] In step S102, the port functions corresponding to the signal output ports of the main temperature controller and the auxiliary temperature controller are configured according to the user demand.
[0087] In step S104, it is judged whether there is a data flag bit of the port function between the communication protocol of the main temperature controller and the auxiliary temperature controller.
[0088] In step S106, if there is, the data flag bit is transmitted from the main temperature controller to the auxiliary temperature controller based on the communication protocol.
[0089] In step S108, the opening and closing of the signal output port corresponding to the port function are judged by the auxiliary temperature controller executing the logic of the port function.
[0090] In step S110, if there is not, the opening and closing of the signal output port corresponding to the port function are judged by the main temperature controller executing the logic of the port function.
[0091] In step S112, if the port function is configured on the auxiliary temperature controller, the signal state of the port function is synchronized to the auxiliary temperature controller.
[0092] Optionally, the specific examples in the embodiments of the present application can refer to the examples described in the above embodiments, and the embodiments of the present application will not be described here.
[0093] The embodiments of the present application can refer to the above-mentioned embodiments for specific implementation, and have corresponding technical effects.
[0094] It can be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing units can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described in the embodiments of the present application, or a combination thereof.
[0095] For software implementation, the technologies described herein can be implemented by units performing the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0096] Those of ordinary skill in the art can be aware that, in combination with the embodiments disclosed in the specification, units and algorithm steps of the examples described in combination with the embodiments disclosed in the specification can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solutions. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0097] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0098] In the embodiments provided by the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the above-described device embodiments are only schematic. The division of the modules is only a logical function division. There can be another division manner in actual implementation. For example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different parts can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.
[0099] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e. may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0100] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0101] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products, and the computer software products are stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, and various program codes that can be stored in the medium. It should be noted that in this paper, terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or include elements inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0102] The above is only a specific embodiment of the present application, which enables those skilled in the art to understand or implement the present application. Various modifications of these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A method for port expansion of a dual temperature controller, comprising: configuring a port function corresponding to a signal output port of a main temperature controller and a secondary temperature controller according to user requirements; judging whether a data flag bit of the port function exists in a communication protocol between the main temperature controller and the secondary temperature controller; if the data flag bit exists, transmitting the data flag bit to the secondary temperature controller based on the communication protocol by the main temperature controller; judging opening or closing of the signal output port corresponding to the port function by the secondary temperature controller executing a logic of the port function; if the data flag bit does not exist, judging opening or closing of the signal output port corresponding to the port function by the main temperature controller executing the logic of the port function; if the port function is configured on the secondary temperature controller, synchronizing a signal state of the port function to the secondary temperature controller.
2. The dual thermostat port expansion method of claim 1, wherein, The configuring of the port function corresponding to the signal output port of the main temperature controller and the secondary temperature controller according to the user requirements comprises: determining user requirements; setting the port function corresponding to the main temperature controller and the secondary temperature controller according to the user requirements; configuring the communication protocol between the main temperature controller and the secondary temperature controller based on the port function.
3. The dual thermostat port expansion method of claim 1, wherein, The judging of whether the data flag bit of the port function exists in the communication protocol between the main temperature controller and the secondary temperature controller comprises: obtaining the communication protocol between the main temperature controller and the secondary temperature controller; analyzing the communication protocol to obtain all data flag bits contained in the communication protocol; matching the all data flag bits with a data flag bit of a port function to be expanded; if the matching is successful, the communication protocol has the data flag bit of the port function to be expanded, and if the matching fails, the communication protocol does not have the data flag bit of the port function to be expanded.
4. The dual thermostat port expansion method of claim 1, wherein, The transmitting of the data flag bit to the secondary temperature controller based on the communication protocol by the main temperature controller comprises: packing the data flag bit of the port function into a data packet in a format supported by the communication protocol; sending the data packet to the secondary temperature controller based on the communication protocol by the main temperature controller; analyzing the data packet after the secondary temperature controller receives the data packet, and updating configuration information of the port function in the secondary temperature controller.
5. The dual thermostat port expansion method of claim 1, wherein, The judging of opening or closing of the signal output port corresponding to the port function by the secondary temperature controller executing the logic of the port function comprises: calling a logic control instruction corresponding to the logic of the port function; executing the logic control instruction by the secondary temperature controller; judging opening or closing of the signal output port corresponding to the port function according to an execution result of the logic control instruction.
6. The dual thermostat port expansion method of claim 1, wherein, The judging of opening or closing of the signal output port corresponding to the port function by the main temperature controller executing the logic of the port function comprises: calling a logic control instruction corresponding to the logic of the port function; executing the logic control instruction by the main temperature controller; judging opening or closing of the signal output port corresponding to the port function according to an execution result of the logic control instruction.
7. The dual-thermostat port expansion method of claim 1, wherein, The synchronizing of the signal state of the port function to the secondary temperature controller if the port function is configured on the secondary temperature controller comprises: judging that the port function is configured on the secondary temperature controller; acquiring a signal state corresponding to the port function; synchronizing the signal state of the port function to the secondary temperature controller through the primary temperature controller. 8.A dual-temperature-controller port expansion device, applicable to the dual-temperature-controller port expansion method according to any one of claims 1 to 7, comprising: a function configuration module configured to configure a port function corresponding to a signal output port of a primary temperature controller and a secondary temperature controller according to user demand; a data judgment module configured to judge whether a data flag bit of the port function exists in a communication protocol between the primary temperature controller and the secondary temperature controller; a data transmission module configured to transmit the data flag bit to the secondary temperature controller based on the communication protocol through the primary temperature controller; a first logic judgment module configured to judge opening and closing of a signal output port corresponding to the port function through the secondary temperature controller executing a logic of the port function; a second logic judgment module configured to judge opening and closing of a signal output port corresponding to the port function through the primary temperature controller executing the logic of the port function; a signal synchronization module configured to synchronize a signal state of the port function to the secondary temperature controller when the port function is configured on the secondary temperature controller.
9. An electronic device comprising a memory, a processor, a communication interface and a communication bus, the memory having stored therein a computer program executable on the processor, the memory, the processor being in communication via the communication bus and the communication interface, wherein, The processor executes the computer program to implement the dual-temperature-controller port expansion method according to any one of claims 1 to 7.
10. A computer readable medium having non-transitory program code executable by a processor, wherein, The program code causes the processor to execute the dual-temperature-controller port expansion method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Double-purpose computer temperature controller
CN105607676A
Controller port expansion device and method
CN114741343A
Communication protocol adaptation method and device, equipment and storage medium
CN114827302A
User defined port and protocol scheme for programmable logic controller
CN1171851A
Double-temperature controller port expansion method, device and equipment and computer readable medium
CN119002228A