A dual-valve cold and hot water dual-channel interconnection drinking water control method and system
By generating a drinking water control input set and processing the target channel determination, the problem of inconsistency between hot and cold water requests and connection requests in intelligent drinking water equipment is solved, realizing the continuity and stability of hot and cold water dual-channel interconnected drinking water control, which is applicable to dual-valve hot and cold water dual-channel interconnected drinking water control system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU ZHONGKA INTELLIGENT TECH CO LTD
- Filing Date
- 2026-05-13
- Publication Date
- 2026-06-12
AI Technical Summary
Existing smart drinking water devices lack a unified encapsulation in handling hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests. This leads to inconsistent target channel determination and processing, discontinuous session management, and discontinuous status viewing and parameter adjustment, making it difficult to achieve stable drinking water control and remote monitoring.
By generating a drinking water control input set, performing target channel determination processing, generating a valve control target status set, performing temperature regulation processing, executing dual-channel session management, performing unified mobile terminal entry interaction, generating a device response result set, and finally performing status record feedback processing, a unified control process is formed.
It enables synchronous processing of hot and cold water requests and connection requests, continuous correspondence between Bluetooth and 4G connections, and continuous execution of status viewing and parameter adjustment, ensuring the continuity of drinking water control and communication sessions. It is suitable for scenarios where hot and cold water requests coexist.
Smart Images

Figure CN122194757A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent drinking water equipment control and wireless interconnection communication, and in particular to a dual-valve hot and cold water dual-channel interconnected drinking water control method and system. Background Technology
[0002] In the field of intelligent drinking water equipment control, temperature regulation and wireless interconnection communication, the existing solutions for dual-valve hot and cold water drinking water equipment usually use the main button to control hot and cold water requests, drive the cold valve and hot valve separately, make local adjustments based on the temperature status, and complete status viewing, parameter adjustment or remote monitoring data upload through Bluetooth connection or fourth-generation mobile communication link. There are limitations such as the lack of unified organization between hot and cold water requests and cold valve status, the lack of linkage judgment between temperature status and valve action, and the lack of collaborative processing between connection requests and control links.
[0003] Existing methods often disperse hot and cold water control, temperature regulation, and communication access in different processing stages, relying on separate valve action judgments, separate temperature status processing, or separate link access judgments. In scenarios where hot and cold water requests and connection requests arrive simultaneously, Bluetooth connections and fourth-generation mobile communication links coexist, and status viewing and parameter adjustment occur concurrently, it is easy to encounter inconsistent target channel switching and inconsistent session processing, making it difficult to meet the requirements for stable implementation of drinking water control, status viewing, parameter adjustment, and remote monitoring data generation.
[0004] For the joint processing of hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests, existing technologies generally suffer from common shortcomings, such as a lack of unified encapsulation of drinking water control input sets, a lack of multi-state constraints in target channel determination processing, a lack of prior state inheritance in dual-channel session management processing, and a lack of sequential connection between device response result sets and remote monitoring datasets. This makes it difficult to form a consistent process in dual-valve hot and cold water dual-channel interconnected drinking water scenarios, including data acquisition, target channel determination processing, temperature control processing, dual-channel session management processing, unified mobile terminal entry interaction processing, and status record feedback processing. As a result, the connection between drinking water control and communication sessions is scattered, and the correspondence between parameter adjustments and status records is unclear. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a dual-valve, dual-channel interconnected drinking water control method, comprising:
[0006] S100: Collect hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests to generate a drinking water control input set; S200. Based on the drinking water control input set, perform target channel determination processing to generate a valve control target status set containing target channel identifier, dual valve drive command, associated temperature status, session request identifier, and link status identifier; S300. Based on the valve control target state set, perform temperature regulation processing to generate a temperature control result set containing water supply permission status, temperature zone determination result, heating control command, session request identifier and link status identifier; S400. Based on the temperature control result set, perform dual-channel session management processing, execute Bluetooth instant connection establishment or 4G remote connection establishment, and generate a communication session state set. S500. Based on the communication session state set, perform unified entry interaction processing for the mobile terminal, perform status viewing and parameter adjustment, and generate a device response result set. S600. Based on the device response result set, perform status record feedback processing to generate a remote monitoring dataset.
[0007] Further, S100 includes: The system collects hot and cold water requests from the buttons on the main body of the data acquisition device, hot and cold water requests from the near end of the mobile terminal, and hot and cold water requests from the far end of the mobile terminal. Collect feedback status of cold valve opening / closing and hot valve opening / closing; Collect hot water outlet temperature value, cold water outlet temperature value, and temperature sensor status code; Collect Bluetooth connection requests, 4G connection requests, and the current link online status; The collected results are aligned with timestamps, normalized and uniformly encapsulated to generate a drinking water control input set containing request type, device number, cold valve status, hot valve status, temperature value, connection request type, link status and timestamp.
[0008] Further, S200 includes: Parse the request type in the drinking water control input set to generate a cold water target channel identifier or a hot water target channel identifier; Read the cold valve status, hot valve status, temperature status, connection request, and link status from the drinking water control input set, and perform channel executable verification; Generate a near-end session request identifier or a far-end session request identifier based on the connection request; When the cold water target channel identifier is established, a dual-valve drive command is generated to open the cold valve and close the hot valve. When the hot water target channel identifier is established, a dual-valve drive command is generated to open the hot valve and close the cold valve. The target channel identifier, the dual-valve drive command, the temperature status, the session request identifier, and the link status are encapsulated to generate a valve-controlled target status set.
[0009] Further, S300 includes: Read the target channel identifier, associated temperature status, dual valve drive command, session request identifier, and link status identifier from the valve control target status set; The associated temperature state is compared with the preset target temperature zone and the safe temperature zone to generate a temperature zone determination result; When the target channel is identified as a hot water target channel and the temperature value is lower than the preset target temperature zone lower limit, a heating maintenance command and a water supply prohibition status are generated. When the target channel is identified as a hot water target channel and the temperature value is higher than the upper limit of the safe temperature zone, a heating shutdown command and an over-temperature protection status are generated. When the target channel identifier is a cold water target channel identifier, a cold water supply permission status is generated; The temperature zone determination result, water supply permit status, heating control command, session request identifier, and link status identifier are encapsulated to generate a temperature control result set.
[0010] Further, S400 includes: Read the session request identifier and link status identifier from the temperature control result set; When the session request identifier corresponds to a near-end scenario and the Bluetooth link is online, a Bluetooth communication session is established; When the session request identifier corresponds to a remote scenario and the 4G link is online, a 4G communication session is established. When both Bluetooth and 4G communication sessions exist simultaneously, session arbitration is performed in the following order: security protection, Bluetooth real-time water discharge control, and 4G parameter writing. Encapsulate the session type, connection establishment result, link priority, online status, and session abnormal status to generate a communication session state set.
[0011] Further, S500 includes: Receive status viewing requests or parameter adjustment requests sent from the unified entry point on mobile terminals; Read the session type and link priority from the communication session state set, and select a valid link; When the parameter adjustment request is received, range verification is performed on the target temperature zone parameter, valve opening duration parameter, status reporting cycle parameter, and link hold duration parameter. The status viewing request or the parameter adjustment request is sent to the device-side main control module according to the effective link; The request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number are encapsulated to generate a device response result set.
[0012] Further, S600 includes: Read the request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result and parameter version number from the device response result set; Record the request type, target channel identifier, dual-valve drive command, temperature zone determination result, session type, parameter writing result, and exception status code; When the 4G link is offline, the device response result set and record result are written to the local storage queue; When the 4G link is restored, the recorded results in the local storage queue are sent in chronological order. The device number, online status, cold valve status, hot valve status, temperature status, session type, parameter version number, and abnormal status code are encapsulated to generate a remote monitoring dataset.
[0013] Furthermore, the dual-valve drive commands include a cold valve mutual exclusion control command, a hot valve mutual exclusion control command, and a valve action timing command, wherein the valve action timing command specifies: Before the cold valve opening command is written, the hot valve is in an effective closed state. Before the hot valve opening command is written, the cold valve is in an active closed state. Within the same control cycle, the cold valve opening state and the hot valve opening state cannot be established simultaneously; Once the valve is unlocked, it will receive the next hot or cold water request.
[0014] Furthermore, the session arbitration includes: When the Bluetooth communication session is in the water outlet control phase, the parameter writing command in the 4G communication session is suspended. When the Bluetooth communication session ends and the device is in an idle state, the parameter writing instruction is executed; When the Bluetooth link is disconnected and the 4G link is online, the current session type will be switched to a 4G communication session. When an abnormal state of the communication session is established, write the abnormal status code and freeze the current parameter version number.
[0015] Furthermore, a dual-valve hot and cold water dual-channel interconnected drinking water control system includes: a main control module, an input acquisition module, a target channel determination module, a temperature control module, a dual-channel session management module, a mobile terminal unified entry interaction module, and a status recording and feedback module; the modules are connected in sequence to implement the method described in any of the above-mentioned embodiments.
[0016] The key innovations of this invention include: (1) The hot and cold water requests, cold valve status, hot valve status, temperature status and connection requests are uniformly generated into a drinking water control input set, and the drinking water control input set is input into the target channel judgment processing to generate a valve control target status set containing the target channel identifier, dual valve drive command, associated temperature status, session request identifier and link status identifier.
[0017] (2) Input the temperature control result set into the dual-channel session management process, generate a communication session status set according to the Bluetooth instant connection establishment or 4G remote connection establishment, and uniformly organize the session type, link establishment result, link priority, online status and session abnormal status within the communication session status set.
[0018] (3) Construct a sequential processing link around the drinking water control input set, valve control target status set, temperature control result set, communication session status set, equipment response result set and remote monitoring dataset, and incorporate status viewing, parameter adjustment and status record feedback processing into the same method flow.
[0019] The following are its main beneficial effects: (1) In view of the problem that hot and cold water requests, cold valve status, hot valve status, temperature status and connection requests are processed separately in the existing solution, the continuous organization of drinking water control input set and valve control target status set makes the target channel identifier, dual valve drive command, associated temperature status, session request identifier and link status identifier form a corresponding relationship in the same processing link. The processing path from hot and cold water request to dual valve drive command is consistent. The temperature status and the connection request participate in the processing synchronously in the target channel determination process. It is suitable for drinking water control scenarios where hot and cold water requests and connection requests coexist.
[0020] (2) In response to the problems of separate processing of Bluetooth instant connection establishment and 4G remote connection establishment in the existing solution and unclear correspondence between session type and device status, the session request identifier and link status identifier in the temperature control result set are uniformly processed by dual-channel session management processing, so that a continuous correspondence is formed between the communication session status set and the water supply permission status, temperature zone determination result and heating control command. Status viewing and parameter adjustment are performed under the same link rule under the communication session status set, which is suitable for drinking water control scenarios where near-end scenarios and far-end scenarios alternate or coexist.
[0021] (3) In response to the problems of the separation of status viewing, parameter adjustment and status record feedback processing in the existing solution and the lack of correspondence between the remote monitoring dataset and the previous processing results, the sequential processing of the drinking water control input set to the remote monitoring dataset is used to make the request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone judgment result, valve status, temperature status, session type, parameter writing result and parameter version number in the device response result set enter the status record feedback processing to form the remote monitoring dataset. The field correspondence between the device response result set and the remote monitoring dataset is kept continuous, which is suitable for drinking water control scenarios where status viewing, parameter adjustment and status record feedback processing run continuously. Attached Figure Description
[0022] Figure 1 A schematic flowchart illustrating a dual-valve, dual-channel, interconnected drinking water control method for hot and cold water provided in this application embodiment; Figure 2 This is a structural block diagram of a dual-valve hot and cold water dual-channel interconnected drinking water control system provided in an embodiment of this application. Detailed Implementation
[0023] Example 1: Refer to Figure 1 This is a flowchart illustrating a dual-valve, dual-channel, interconnected drinking water control method for hot and cold water provided in an embodiment of the present invention. The process may include at least steps S100-S600: S100: Collect hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests to generate a drinking water control input set; S200. Based on the drinking water control input set, perform target channel determination processing to generate a valve control target status set containing target channel identifier, dual valve drive command, associated temperature status, session request identifier, and link status identifier; S300. Based on the valve control target state set, perform temperature regulation processing to generate a temperature control result set containing water supply permission status, temperature zone determination result, heating control command, session request identifier and link status identifier; S400. Based on the temperature control result set, perform dual-channel session management processing, execute Bluetooth instant connection establishment or 4G remote connection establishment, and generate a communication session state set. S500. Based on the communication session state set, perform unified entry interaction processing for the mobile terminal, perform status viewing and parameter adjustment, and generate a device response result set. S600. Based on the device response result set, perform status record feedback processing to generate a remote monitoring dataset.
[0024] S100: Collect hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests to generate a drinking water control input set; Specifically, S100 is initiated by the main control module on the device side and enters operation when the device powers on, passes self-test, establishes standby state, a mobile terminal approaches and connects, is triggered by a button on the device itself, or a polling command is issued by the remote management side. The hot / cold water request refers to a control request representing the user's intention to obtain hot or cold water, originating from sources including hot / cold water requests issued by buttons on the device itself, near-end requests from the mobile terminal, and remote-end requests from the mobile terminal. The cold valve status refers to the current open / closed position, action feedback result, and locked state of the cold valve. The hot valve status refers to the current open / closed position, action feedback result, and locked state of the hot valve. The temperature status refers to the temperature-related status composed of the hot water outlet temperature value, the cold water outlet temperature value, and the temperature sensor status code. The connection request refers to a Bluetooth communication link access request, a fourth-generation mobile communication link access request, and the current online status of the link. Here, "Bluetooth" is used for the first time, and "Fourth Generation Mobile Communication" (4G) is used for the first time. When the main control module reads the above statuses, the device body buttons are collected by the local button scanning circuit, the near-end requests from the mobile terminal are received by the Bluetooth communication unit, the far-end requests from the mobile terminal are received by the 4G communication unit, the cold valve status and hot valve status are obtained by the position feedback interface and action report code on the valve drive board, and the temperature status is collected by the temperature sensors arranged at the hot water outlet and cold water outlet.
[0025] Furthermore, the acquisition of hot and cold water requests is not simply recording button presses, but synchronously recording the request source, request type, and request timing. For hot and cold water requests issued by buttons on the device itself, the main control module performs debouncing processing after detecting a change in button level, and then writes the request type and trigger time. For hot and cold water requests issued by the mobile terminal at the near end, the Bluetooth communication unit receives the control frame sent by the mobile terminal, and the main control module parses the device number, request type, and session identifier in the control frame, and verifies whether the control frame comes from the currently paired terminal. For hot and cold water requests issued by the mobile terminal at the far end, the 4G communication unit receives the data packet sent by the remote management side, and the main control module parses the device number, request type, user identifier, and timestamp in the packet, and verifies the packet signature and the current online link status. The acquisition of the cold valve status and the hot valve status is continuously performed in the valve stationary state, valve active state, and valve abnormal state. The main control module reads the valve opening feedback signal and valve closing feedback signal from the valve position feedback port, reads the current action code from the drive status register area, and reads the valve locking status from the locking flag bit. The temperature status acquisition continues before, during, and after the arrival of hot and cold water requests. The hot water outlet temperature and cold water outlet temperature are periodically read by the temperature sampling circuit, and the temperature sensor status code is generated by the main control module based on the sensor's online status, sampling range status, and continuous change status. The connection request acquisition is performed in parallel by the Bluetooth, Bluetooth communication unit, and 4G communication unit. The main control module reads Bluetooth pairing requests, 4G connection establishment requests, Bluetooth link online status, and 4G link online status, and records the order of request arrival for subsequent target channel determination and processing.
[0026] Furthermore, after receiving the aforementioned raw acquisition results, the main control module performs timestamp alignment, field normalization, and unified encapsulation on the hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests. Timestamp alignment refers to mapping the device body button sampling time, Bluetooth communication unit reception time, 4G communication unit reception time, valve feedback sampling time, and temperature sampling time to the same device clock reference, and grouping the sampling times of different sampling links into the same chronological order. Field normalization refers to uniformly mapping hot and cold water requests to a request type field, cold valve status and hot valve status to a valve status field, hot water outlet temperature value, cold water outlet temperature value, and temperature sensor status code to a temperature value field and a temperature status field, and Bluetooth connection requests, 4G connection requests, and current link online status to a connection request type field and a link status field. Unified encapsulation refers to writing the request type, device number, cold valve status, hot valve status, temperature value, connection request type, link status, and timestamp according to a fixed data structure, and retaining the request source identifier, acquisition round identifier, and abnormal status identifier within the same data packet. If an abnormal temperature sensor status code, missing valve feedback, Bluetooth link disconnection, or 4G link offline occurs during the data acquisition process, the main control module will write the abnormal status into an abnormal status identifier and complete this round of encapsulation. The abnormal status identifier will be output along with the data packet.
[0027] Understandably, the drinking water control input set is the output of S100 and also the direct input object for the target channel determination processing in S200. The request type field in this drinking water control input set corresponds to the request parsing position in S200, the device number field corresponds to the device identity verification position, the cold valve status and hot valve status correspond to the channel executable verification position, the temperature value and temperature status correspond to the associated temperature status generation position, the connection request type and link status correspond to the session request identifier generation position, the timestamp corresponds to the input timing verification position, and the abnormal status identifier corresponds to the abnormal interception position. In one engineering embodiment, the device is deployed in a drinking water terminal in an office area. Simultaneously, when the user presses the hot water button on the device, the mobile terminal sends a status viewing command via Bluetooth. The main control module synchronously reads the hot water request, cold valve closing feedback status, hot valve closing feedback status, hot water outlet temperature value, cold water outlet temperature value, Bluetooth connection request, and current 4G online status within the same acquisition cycle. After timestamp alignment and field normalization, these are encapsulated into a drinking water control input set and written to the main control module's buffer for use by S200.
[0028] The technical effects of this step can be summarized as follows: Step S100 integrates hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests into the same acquisition link, forming a unified entry data structure for a dual-valve hot and cold water dual-channel interconnected drinking water control method and system. The drinking water control input set integrates device body control, near-end Bluetooth, Bluetooth access, and far-end 4G access into the same timing framework, ensuring that the data source read by subsequent target channel determination and processing remains consistent. After the abnormal status identifier and timestamp are synchronously written, the call path, recording path, and feedback path of subsequent steps remain closed.
[0029] S200. Based on the drinking water control input set, perform target channel determination processing to generate a valve control target status set containing target channel identifier, dual valve drive command, associated temperature status, session request identifier, and link status identifier; Specifically, S200 receives the drinking water control input set output by S100 and is processed by the target channel determination and processing logic in the main control module on the device side. The target channel determination and processing logic includes request parsing logic, channel executable verification logic, session request identifier generation logic, and dual valve drive instruction generation logic. After the drinking water control input set enters the buffer of the main control module as the input source for this step, the main control module reads the request type, device number, cold valve status, hot valve status, temperature value, temperature sensor status code, connection request type, link status, and timestamp in the buffer according to the timestamp sequence. The main control module triggers the target channel determination and processing in this round when it receives a new hot or cold water request, detects a change in the cold valve status or hot valve status, detects that the temperature value crosses the current temperature zone boundary, or detects a change in the connection request type. The target channel identifier refers to the determination result indicating whether the water supply object belongs to the cold water channel or the hot water channel in the current control cycle, specifically including the cold water target channel identifier and the hot water target channel identifier; the dual valve drive command refers to the group drive command for the cold valve and the hot valve, specifically including the cold valve mutual exclusion control command, the hot valve mutual exclusion control command, and the valve action timing command; the associated temperature status refers to the temperature status bound to the current target channel after the target channel determination is completed. If the target channel identifier is the cold water target channel identifier, the associated temperature status corresponds to the cold water outlet temperature value and the cold water side temperature sensor status. If the target channel identifier is the hot water target channel identifier, the associated temperature status corresponds to the hot water outlet temperature value and the hot water side temperature sensor status; the session request identifier refers to the identification result indicating whether the current control request belongs to the near-end scenario or the far-end scenario, specifically including the near-end session request identifier and the far-end session request identifier; the link status identifier refers to the status result indicating the current Bluetooth link status and the Fourth Generation Mobile Communication (4G) link status.
[0030] Furthermore, the main control module first parses the request types in the drinking water control input set and maps the parsing results to target channel identifiers. If the request type is a cold water request, a cold water target channel identifier is written; if the request type is a hot water request, a hot water target channel identifier is written. If both cold water and hot water requests are received within the same control cycle, the main control module selects the priority request according to the timestamp order. If the timestamps are the same, the current control request is selected in the order of device body button request, mobile terminal near-end request, and mobile terminal far-end request, and the unselected requests are written to the waiting register. After the target channel identifier is generated, the main control module reads the cold valve status and the hot valve status to perform channel executable verification. The channel executable verification includes valve opening / closing feedback consistency verification, valve locking status verification, target channel mutual exclusion verification, and temperature sensor status code validity verification. For the cold water target channel identifier, the main control module verifies whether the hot valve closing feedback state is valid, whether the hot valve locking state is released, and whether the cold valve action feedback state allows opening. Simultaneously, it verifies whether the temperature sensor status code corresponding to the cold water outlet temperature value is valid. For the hot water target channel identifier, the main control module verifies whether the cold valve closing feedback state is valid, whether the cold valve locking state is released, and whether the hot valve action feedback state allows opening. Simultaneously, it verifies whether the temperature sensor status code corresponding to the hot water outlet temperature value is valid. If the channel's executable verification passes, the current target channel identifier is retained. If the channel's executable verification fails, the main control module writes the current target channel identifier to the "keep previous state" or "idle state," sets the dual-valve drive command to "cold valve closed" and "hot valve closed," and writes the abnormal status to the local status register for subsequent abnormal protection processing.
[0031] Furthermore, after completing the target channel identifier determination and the channel executable verification, the main control module performs session request identifier generation processing on the connection request type and the link status. The connection request type includes Bluetooth connection request and 4G connection request, and the link status includes Bluetooth link online status and 4G link online status. If the connection request type corresponds to a Bluetooth connection request and the Bluetooth link online status is established, a near-end session request identifier is written; if the connection request type corresponds to a 4G connection request and the 4G link online status is established, a far-end session request identifier is written; if both Bluetooth connection requests and 4G connection requests exist simultaneously within the same control cycle, the main control module maps the current control request source and link online status, with the current control request from a device body button request or a mobile terminal near-end request corresponding to a near-end session request identifier, and the current control request from a mobile terminal far-end request corresponding to a far-end session request identifier. The link status identifier is generated by the main control module after performing a binary mapping between the Bluetooth link online status and the 4G link online status. When the Bluetooth link online status is established, the Bluetooth online field is written into the link status identifier; when the 4G link online status is established, the 4G online field is written into the link status identifier; when both types of links are online, the link status identifier retains both the Bluetooth online field and the 4G online field, and maintains the original timestamp for the S300 to read.
[0032] Further, the main control module generates the dual-valve drive command based on the target channel identifier. The generation of the dual-valve drive command follows the dual-valve mutual exclusion control rules and valve action timing rules. If the cold water target channel identifier is valid, the main control module first writes the hot valve mutual exclusion control command to keep the hot valve closed. Then, it checks whether the hot valve closing feedback state is valid. If the hot valve closing feedback state is valid, it writes the cold valve mutual exclusion control command to open the cold valve and simultaneously writes the valve action timing command. The valve action timing command records the hot valve closing confirmation time, the cold valve opening writing time, and the current control cycle number. If the hot water target channel identifier is valid, the main control module first writes the cold valve mutual exclusion control command to keep the cold valve closed. Then, it checks whether the cold valve closing feedback state is valid. If the cold valve closing feedback state is valid, it writes the hot valve mutual exclusion control command to open the hot valve and simultaneously writes the valve action timing command. The valve action timing command records the cold valve closing confirmation time, the hot valve opening writing time, and the current control cycle number. If, after writing the mutual exclusion control command for the cold valve or the mutual exclusion control command for the hot valve, the main control module detects that the cold valve open state and the hot valve open state are simultaneously established within the same control cycle, it immediately cancels the current opening command and rewrites the dual-valve drive command to cold valve closed and hot valve closed, while simultaneously writing the valve lock state. The module will continue to receive the next hot or cold water request until the valve lock state is released. During this stage, the associated temperature state is synchronously bound to the target channel identifier. The cold water target channel identifier corresponds to the cold water outlet temperature value and the cold water side temperature sensor status code, and the hot water target channel identifier corresponds to the hot water outlet temperature value and the hot water side temperature sensor status code. The main control module writes the binding result into the associated temperature state field.
[0033] Understandably, in a complete engineering embodiment, the device is installed in the drinking water terminal in the office area. After the user presses the hot water button on the device, S100 generates a drinking water control input set containing the request type, device number, cold valve status, hot valve status, temperature value, connection request type, link status, and timestamp. In S200, the main control module reads the drinking water control input set, parses out that the current request type is a hot water request, generates a hot water target channel identifier, and reads that the cold valve status is closed and the hot valve status is closed and the hot water outlet temperature value and temperature sensor status code are normal, and that the Bluetooth link is online and the 4G link is online. After completing the channel executable verification, it writes the remote session request identifier or the near session request identifier, and generates a dual valve drive command in the order of first confirming the cold valve is closed and then writing the hot valve is open. Finally, it binds the hot water outlet temperature value and the hot water side temperature sensor status code as an associated temperature status. The main control module ultimately encapsulates the target channel identifier, dual-valve drive command, associated temperature status, session request identifier, and link status identifier into a valve control target status set. The target channel identifier is used for the target channel reading position in S300, the dual-valve drive command is used for the dual-valve drive command reading position in S300, the associated temperature status is used for the associated temperature status comparison position in S300, and the session request identifier and the link status identifier are retained by S300 when encapsulating the temperature control result set and continue to be transmitted to S400, thereby forming a cross-step connection from the drinking water control input set to the valve control target status set.
[0034] The technical effects of this step can be summarized as follows: This step integrates request parsing, channel executable verification, session request identifier generation, and dual-valve mutual exclusion drive writing into the same processing link, establishing a direct correspondence between the target channel identifier and the dual-valve drive command. The associated temperature status is bound during the target channel determination stage, and the data path read by the S300 remains singular. The session request identifier and the link status identifier are synchronously retained within the valve control target status set, and the calling relationship between the near-end link and the far-end link remains continuous in subsequent steps.
[0035] S300. Based on the valve control target state set, perform temperature regulation processing to generate a temperature control result set containing water supply permission status, temperature zone determination result, heating control command, session request identifier and link status identifier; Specifically, S300 receives the valve control target state set output by S200 and is executed by the temperature regulation processing logic in the main control module on the device side. After the valve control target state set enters the buffer of the main control module, the temperature regulation processing logic reads the target channel identifier, dual-valve drive command, associated temperature status, session request identifier, and link status identifier in the time stamp order, and triggers the current round of temperature regulation processing when hot water request is established, cold water request is established, target channel identifier is switched, associated temperature status crosses the temperature zone boundary, temperature sensor status code changes, or dual-valve drive command is written. Water supply permit status refers to the status result of whether the equipment has entered the water outlet stage within the current control cycle, specifically including cold water supply permit status, hot water supply permit status, water supply prohibition status, and over-temperature protection status; temperature zone determination result refers to the determination result obtained by corresponding the associated temperature status with the preset target temperature zone and safe temperature zone, specifically including the status within the target temperature zone, the status below the target temperature zone, the status above the safe temperature zone, and the sensor abnormality status; heating control command refers to the control command written by the main control module to the heating execution unit, specifically including heating maintenance command and heating shutdown command; session request identifier and link status identifier retain their original values in this step and are transmitted synchronously with the temperature regulation processing, the former representing the near-end scenario or the far-end scenario, and the latter representing the current link online status; temperature control result set refers to the data structure formed after the temperature regulation processing is completed, which contains water supply permit status, temperature zone determination result, heating control command, session request identifier, and link status identifier, and is read by the dual-channel session management processing in S400.
[0036] Specifically, the temperature control processing logic first extracts the hot water outlet temperature value, cold water outlet temperature value, and temperature sensor status code from the associated temperature status, and establishes the current control object in conjunction with the target channel identifier. When the target channel identifier is a hot water target channel identifier, the main control module selects the hot water outlet temperature value as the current judgment temperature, and calls the temperature zone determination module to compare this temperature with the preset target temperature zone lower limit, preset target temperature zone upper limit, and safe temperature zone upper limit in sequence; when the target channel identifier is a cold water target channel identifier, the main control module selects the cold water outlet temperature value as the current judgment temperature, and checks whether the cold water side temperature sensor status code is in a valid state. The temperature zone determination module here consists of a temperature sampling interface, a temperature zone boundary register area, a status comparison unit, and a result writing unit. The temperature sampling interface is responsible for receiving the associated temperature status, the temperature zone boundary register area stores the preset target temperature zone and the safe temperature zone, the status comparison unit is responsible for comparing the temperature value with the temperature zone boundary, and the result writing unit is responsible for generating the temperature zone determination result. The preset target temperature zone is the smallest set of core parameters in this invention, representing the temperature range within which the device is allowed to enter the corresponding water supply stage. The safe temperature zone is also the smallest set of core parameters in this invention, representing the upper temperature limit boundary corresponding to the hot water channel. The hot water outlet temperature value, cold water outlet temperature value, temperature sensor status code, and target channel identifier together constitute the smallest input set for temperature control processing. If the temperature sensor status code indicates sampling interruption, sampling out of bounds, or continuous sampling abnormality, the main control module writes the temperature zone determination result as a sensor abnormality state, writes the water supply permission state as a water supply prohibition state, rewrites the dual valve drive command to cold valve closed and hot valve closed, and then writes the abnormal state into the local status register area. Subsequent abnormality protection processing reads this write result.
[0037] Furthermore, when the target channel is identified as a hot water target channel and the hot water outlet temperature is lower than the preset target temperature zone lower limit, the main control module writes the temperature zone determination result to the state below the target temperature zone, writes the water supply permission state to the water supply prohibition state, and writes a heating maintenance command to the heating execution unit. The heating execution unit consists of a heating relay drive interface, a temperature control status register area, and an execution feedback interface. After receiving the heating maintenance command, the heating relay drive interface maintains the heating circuit conduction. The temperature control status register area records the command writing time and the current heating stage. The execution feedback interface returns the heating circuit connection state. During the heating maintenance stage, the temperature control processing logic repeatedly reads the hot water outlet temperature value according to a preset sampling period. When the hot water outlet temperature value enters the preset target temperature zone, the temperature zone determination result is rewritten to the state within the target temperature zone, the water supply permission state is rewritten to the hot water supply permission state, and the hot valve opening condition in the dual-valve drive command remains unchanged. When the target channel is identified as a hot water target channel and the hot water outlet temperature is higher than the upper limit of the safe temperature zone, the main control module writes the temperature zone determination result as "above the safe temperature zone", writes the water supply permission status as "over-temperature protection status", and writes a heating shutdown command to the heating execution unit. Then, it freezes the hot valve opening conditions and writes the hot valve shutdown status to the local control register. When the target channel is identified as a hot water target channel and the hot water outlet temperature is within the preset target temperature zone, the main control module writes the temperature zone determination result as "within the target temperature zone", writes the water supply permission status as "hot water supply permission status", and maintains the original heating control command or rewrites it as a heating shutdown command based on the current heating stage.
[0038] Furthermore, when the target channel identifier is a cold water target channel identifier, the temperature control processing logic reads the cold water outlet temperature value and the cold water side temperature sensor status code. If the cold water side temperature sensor status code is valid, the water supply permission status is written as the cold water supply permission status, and the temperature zone determination result is written as the current cold water temperature zone status. If the cold water side temperature sensor status code is abnormal, the water supply permission status is written as the water supply prohibition status, and the temperature zone determination result is written as the sensor abnormal status. At the same time, the dual valve drive command is rewritten as cold valve closed and hot valve closed. For the cold water target channel identifier, the heating control command remains in an idle write state or a closed write state; for the hot water target channel identifier, the heating control command remains a heating maintenance command or a heating shutdown command depending on the range of the hot water outlet temperature value. Understandably, the session request identifier and the link status identifier do not undergo remapping during the entire temperature control processing. The main control module directly copies the session request identifier and the link status identifier from the valve control target status set and encapsulates them together with the newly generated water supply permission status, temperature zone determination result, and heating control command. Within the temperature control result set thus formed, the water supply permit status corresponds to the water outlet control stage determination position in S400, the temperature zone determination result corresponds to the status viewing and display position in S500, the heating control command corresponds to the current action record position of the local heating execution unit, and the session request identifier and link status identifier correspond to the dual-channel session management processing input position in S400.
[0039] In a complete engineering embodiment, after the office area drinking water terminal receives a hot water request, step S200 generates a valve control target state set containing a hot water target channel identifier, a dual-valve drive command for opening the hot water valve, the associated temperature status corresponding to the hot water outlet temperature value, a near-end session request identifier, and a link status identifier. The main control module reads this valve control target state set in step S300, determines that the current hot water outlet temperature value is lower than the preset target temperature zone lower limit, and then writes the temperature zone determination result as "below the target temperature zone," writes the water supply permission status as "water supply prohibited," and writes a heating maintenance command to the heating execution unit. When subsequent sampling shows that the hot water outlet temperature value enters the preset target temperature zone, the main control module rewrites the temperature zone determination result as "within the target temperature zone," rewrites the water supply permission status as "hot water supply permission," and retains the near-end session request identifier and the link status identifier unchanged, finally encapsulating the result to obtain the temperature control result set. If the same device receives a cold water request in another control cycle, the main control module reads the associated temperature status corresponding to the cold water target channel identifier and the cold water outlet temperature value. When the cold water side temperature sensor status code is normal, it directly writes the cold water supply permission status and writes the heating control command to the off write status. Then, it writes the corresponding fields into the temperature control result set for the S400 to call.
[0040] The technical effects of this step can be summarized as follows: This step integrates the target channel identifier, associated temperature status, and dual-valve drive command into the same temperature control link, while maintaining separate decision paths for the hot water and cold water channels. Water supply permission status, temperature zone determination results, and heating control commands are generated within the same control cycle, with session request identifiers and link status identifiers retained simultaneously, ensuring continuous data read during subsequent dual-channel session management processing. Over-temperature protection status, water supply prohibition status, and sensor anomaly status are written within this step, maintaining a single read path for subsequent anomaly protection processing and status record feedback processing.
[0041] S400. Based on the temperature control result set, perform dual-channel session management processing, execute Bluetooth instant connection establishment or 4G remote connection establishment, and generate a communication session state set. Specifically, the S400 receives the temperature control result set output by the S300 and is executed by the dual-channel session management processing logic in the main control module on the device side. After the temperature control result set enters the buffer of the main control module, the dual-channel session management processing logic reads the water supply permission status, temperature zone determination result, heating control command, session request identifier, and link status identifier in the time stamp order. This round of processing is triggered when the near-end session request identifier is written, the far-end session request identifier is written, the Bluetooth link online status changes, the 4G link online status changes, the water supply permission status switches from the water supply prohibited state to the cold water supply permission state or the hot water supply permission state, the mobile terminal initiates a link establishment handshake request, or the original session times out. The dual-channel session management process refers to a session management link consisting of a Bluetooth communication unit, a 4G communication unit, a session state register, a link arbitration unit, a handshake verification unit, and an abnormal state writing unit. The Bluetooth communication unit is responsible for near-end short-range access, the 4G communication unit is responsible for far-end online access, the session state register is responsible for storing the current session type, link establishment result, link priority, online status, and session abnormal status, the link arbitration unit is responsible for determining the order in the dual-link coexistence scenario, the handshake verification unit is responsible for verifying the device number, session sequence number, and request source, and the abnormal state writing unit is responsible for recording link loss, handshake failure, and handover failure. The Bluetooth instant connection establishment refers to the process of discovery, pairing, handshake, and session registration between the Bluetooth communication unit and the mobile terminal in a near-end scenario; the 4G remote connection establishment refers to the process of online confirmation, message verification, session registration, and state maintenance between the 4G communication unit and the remote management side in a remote scenario; the communication session state set refers to the data structure formed after completing dual-channel session management processing, which includes session type, connection establishment result, link priority, online status, and session abnormal status, and is available for interactive processing and reading by the unified entry point of the mobile terminal in the S500.
[0042] Furthermore, the dual-channel session management processing logic first reads the session request identifier and the link status identifier, and establishes the current session scenario. If the session request identifier corresponds to a near-end scenario, and the Bluetooth online field in the link status identifier is valid, the main control module calls the Bluetooth communication unit to enter the Bluetooth instant connection establishment process. The Bluetooth instant connection establishment process includes device broadcasting, mobile terminal discovery, pairing request reception, device number verification, handshake password verification, and session sequence number writing. After completion, the Bluetooth communication session is written as the session type in the session status register, and the connection establishment result is written as a successful status, and the online status is written as Bluetooth online status. If the session request identifier corresponds to a remote scenario, and the 4G online field in the link status identifier is valid, the main control module calls the 4G communication unit to enter the 4G remote connection establishment process. The 4G remote connection establishment process includes receiving the remote management side's online request, verifying the device number, checking message integrity, allocating session sequence numbers, writing state maintenance parameters, and registering the session. Upon completion, a 4G communication session is written into the session state register as the session type, and the connection establishment result is written as a successful state, while the online state is written as a 4G online state. If the near-end and remote scenarios arrive simultaneously within the same control cycle, the main control module first reads the water supply permit status. If it is currently in a cold water supply permit state or a hot water supply permit state, and the Bluetooth online field is valid, then the Bluetooth communication session is written first. If it is not currently in the water supply stage, and the 4G online field is valid, then the 4G communication session is written first, and then the module waits for the Bluetooth communication unit to initiate a subsequent preemption determination. If both the Bluetooth online field and the 4G online field are invalid, the main control module writes the connection establishment result as a failure state and writes a session exception state into the session state register.
[0043] Furthermore, the Bluetooth instant connection establishment is not simply a link connection, but is managed synchronously with the current water supply status. Upon receiving the near-end session request identifier, the dual-channel session management logic first checks the water supply permission status. If the current state is water supply prohibited or over-temperature protection, the Bluetooth communication unit still completes the handshake and pairing, but writes the current session type as a Bluetooth communication session in the session status register, writes the connection establishment result as successful, and writes the interaction permission as read-only for the S500 to view the execution status. If the current state is cold water supply permitted or hot water supply permitted, the interaction permission is written as read-write for the S500 to view the execution status and adjust parameters. The 4G remote connection establishment also follows the water supply permission status. If the current state is water supply prohibited, over-temperature protection, or session abnormal, the 4G communication unit only maintains the status viewing channel after completing online registration; if the current link is online and no abnormal state is triggered, the 4G communication session maintains both the status viewing channel and the parameter writing channel. The session state register writes the session hold duration, the most recent handshake time, and the most recent online confirmation time after each link establishment. The main control module polls the link status according to a preset scanning cycle. If the Bluetooth communication unit does not receive keep-alive information within several consecutive scanning cycles, the online status is changed from Bluetooth online status to offline status. If the 4G communication unit does not receive status confirmation from the remote management side within several consecutive scanning cycles, the online status is changed from 4G online status to offline status, and a session abnormal status is written.
[0044] Furthermore, when both Bluetooth and 4G communication sessions exist simultaneously, the link arbitration unit performs session arbitration. The session arbitration follows the order of security protection, Bluetooth real-time water supply control, and 4G parameter writing. If the current water supply permission status is set to over-temperature protection, water supply prohibition, or the main control module detects an abnormal temperature sensor status code, the link arbitration unit freezes all write operations, retaining only the status viewing channel, and sets the link priority to security protection priority. If the current Bluetooth communication session is in the water supply control phase, the link arbitration unit suspends the parameter writing instructions in the 4G communication session and sets the link priority to Bluetooth priority in the session status register. When the Bluetooth communication session ends and the device is idle, the link arbitration unit releases the suspension, allowing the parameter writing instructions in the 4G communication session to proceed to subsequent processing. If the Bluetooth link is disconnected but the 4G link remains online, the main control module switches the current session type to a 4G communication session and rewrites the link priority to 4G priority. If the 4G link is offline but the Bluetooth remains online, the current session type remains the Bluetooth communication session. If a handshake failure, state register write failure, or session sequence number conflict occurs during the handover process, the abnormal state writing unit will write the session abnormal state into the communication session state set and freeze the current parameter version number for subsequent state record back transmission processing to read.
[0045] Understandably, in a complete engineering embodiment, after the hot water supply permit status is established at the office area drinking water terminal, S300 has output a temperature control result set containing the water supply permit status, temperature zone determination result, heating control command, near-end session request identifier, and simultaneously online link status identifier. The main control module reads this temperature control result set in S400, recognizes that the near-end session request identifier and the Bluetooth online field are established simultaneously, and then calls the Bluetooth communication unit to complete device broadcasting, terminal discovery, device number verification, handshake password verification, and session sequence number writing. It writes the Bluetooth communication session as the session type, the successful writing status as the link establishment result, the Bluetooth priority as the link priority, and the Bluetooth online status as the online status in the session status register. If the remote management side sends a parameter writing request via the 4G communication unit at the same time, the link arbitration unit detects that the Bluetooth communication session is in the water outlet control stage, so it suspends the parameter writing request and writes the session abnormal status corresponding to the suspended state into the temporary register; after the Bluetooth communication session ends and the device enters the idle state, it releases the suspension and resumes the 4G communication session. After the above processing, the main control module encapsulates the session type, link establishment result, link priority, online status, and session abnormal status into a unified communication session status set. The session type and link priority are used for the effective link selection position in S500, the link establishment result and online status are used for the status viewing return position in S500, and the session abnormal status is used for the abnormal status code recording position in S600, thereby completing the cross-step connection from the temperature control result set to the communication session status set.
[0046] The technical effects of this step can be summarized as follows: This step integrates the Bluetooth communication unit and the 4G communication unit into the same dual-channel session management link, and the connection establishment and switching for near-end and far-end scenarios are completed within the same main control module. Session type, connection establishment result, link priority, online status, and session abnormal status are written within the same control cycle, and the S500 reading path remains continuous. The Bluetooth real-time water supply control and 4G parameter writing are sequentially managed during the session arbitration phase, and the calling relationship between the communication link and the water supply link remains closed.
[0047] S500. Based on the communication session state set, perform unified entry interaction processing for the mobile terminal, perform status viewing and parameter adjustment, and generate a device response result set. Specifically, S500 receives the communication session state set output by S400 and is executed by the mobile terminal unified entry interaction processing logic in the device-side main control module. The mobile terminal unified entry interaction processing refers to an interaction processing link composed of a request access unit, a link selection unit, a range verification unit, a command issuance unit, a status reading unit, and a response encapsulation unit. Specifically, the request access unit receives status viewing requests or parameter adjustment requests sent by the mobile terminal unified entry; the link selection unit reads the session type and link priority from the communication session state set and generates the currently valid link; the range verification unit performs range verification on the target temperature zone parameter, valve opening duration parameter, status reporting cycle parameter, and link holding duration parameter; the command issuance unit sends the status viewing request or the parameter adjustment request to the device-side main control module according to the currently valid link; the status reading unit reads the target channel identifier, dual-valve drive command, temperature zone determination result, valve status, temperature status, and session type from the local status register and execution feedback register; and the response encapsulation unit combines the fields from the request processing process into a device response result set. The status viewing request refers to a read request issued by the unified entry point of the mobile terminal for the current status of the device, including online status query, hot and cold aisle status query, temperature zone status query, valve status query, and current link status query. The parameter adjustment request refers to a write request issued by the unified entry point of the mobile terminal for the device control parameters, including target temperature zone parameter writing, valve opening duration parameter writing, status reporting cycle parameter writing, and link hold duration parameter writing. The device response result set refers to the data structure formed after completing the status viewing and parameter adjustment, which includes the write request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter write result, and parameter version number, and is read by the status record feedback processing in S600.
[0048] Specifically, the unified entry point interaction processing of the mobile terminal is triggered when a new request is received, a switch in the current session type is detected, a change in link priority is detected, a parameter adjustment request arrives, a status check request arrives, or a session abnormal status is written. The request access unit first performs device number verification, request source verification, and timestamp registration on the data packets sent by the unified entry point of the mobile terminal, and classifies the received requests as status check requests or parameter adjustment requests. If it is a status check request, the request access unit writes the request type as a read request; if it is a parameter adjustment request, the request access unit writes the request type as a write request and writes the parameter to be adjusted into the input buffer of the range verification unit. Subsequently, the link selection unit reads the session type, link establishment result, link priority, online status, and session abnormal status from the communication session status set. The session type indicates whether the current communication session is a Bluetooth communication session or a 4G communication session, the link establishment result indicates whether the current session is in a successful state, the online status indicates whether the current Bluetooth link or 4G link is online, and the session abnormal status indicates whether there is a disconnection, conflict, or handshake failure. If the session type is a Bluetooth communication session, the connection establishment result is successful, and the online status corresponds to the Bluetooth online status, then the link selection unit writes the currently valid link as a Bluetooth link. If the session type is a 4G communication session, the connection establishment result is successful, and the online status corresponds to the 4G online status, then the link selection unit writes the currently valid link as a 4G link. If a Bluetooth communication session and a 4G communication session exist simultaneously, then the link selection unit performs routing according to the link priority. If the link priority is Bluetooth first, it writes the Bluetooth link; if the link priority is 4G first, it writes the 4G link; if the link priority is security protection first, it stops write requests and retains read requests. If the connection establishment result is a failure or a session abnormality is established, then the link selection unit writes the currently valid link as invalid and pre-writes the execution status code as a failure.
[0049] Furthermore, when the request access unit identifies the parameter adjustment request, the range verification unit performs range verification on the target temperature zone parameter, valve opening duration parameter, status reporting cycle parameter, and link hold duration parameter. The target temperature zone parameter refers to the set of parameters consisting of the lower limit and upper limit of the hot water target temperature zone. The range verification unit checks its relationship with the current safe temperature zone and verifies that the lower limit value is not higher than the upper limit value. The valve opening duration parameter refers to the holding time of the cold valve and the holding time of the hot valve. The range verification unit checks whether it is within the time interval pre-stored by the main control module on the device side. The status reporting cycle parameter refers to the periodic parameter for the device to write monitoring status to the remote management side. The range verification unit checks whether it is within the pre-stored period interval. The link hold duration parameter refers to the duration parameter for the Bluetooth or 4G communication session to enter the hold phase. The range verification unit checks whether it is within the time interval allowed by the communication unit. If any of the above parameters exceeds the pre-stored range, the range verification unit will set the parameter writing result to a failure status and the execution status code to a parameter out-of-bounds status, while freezing the parameter version number. If all the above parameters pass the range verification, the parameter writing result will be set to a pending writing status, and the pending parameter and its version number will be sent to the command issuing unit. Here, the parameter version number refers to the version identifier assigned by the device-side main control module to the current control parameter configuration set, including the currently effective version number and the version number to be updated, used to record the order of parameter changes. For status viewing requests, the range verification unit does not perform parameter comparison; it only keeps the parameter writing result in an idle or unwritten state and sends the request directly to the command issuing unit.
[0050] Furthermore, the command issuing unit sends the status viewing request or the parameter adjustment request to the device-side main control module according to the currently valid link. If the currently valid link is a Bluetooth link, the command issuing unit writes the interactive command into the near-end control channel through the Bluetooth communication unit; if the currently valid link is a 4G link, the command issuing unit writes the interactive command into the remote control channel through the 4G communication unit. For the status viewing request, the device-side main control module calls the status reading unit to extract the current status from the target channel register area, valve drive register area, temperature determination register area, valve feedback register area, temperature status register area, and session status register area. Among them, the target channel register area outputs the target channel identifier, the valve drive register area outputs the dual valve drive command, the temperature determination register area outputs the temperature zone determination result, the valve feedback register area outputs the cold valve status and hot valve status, the temperature status register area outputs the hot water outlet temperature value, the cold water outlet temperature value, and the temperature sensor status code, and the session status register area outputs the session type. For parameter adjustment requests, the main control module on the device side first writes the parameters to be adjusted, then reads back the write feedback for the target temperature zone parameters, valve opening duration parameters, status reporting cycle parameters, and link hold duration parameters. If the writing is successful, the parameter writing result is rewritten to a success status, and the parameter version number is updated to the new version number. If the writing fails, the parameter writing result is rewritten to a failure status, while the current parameter version number remains unchanged. If the command issuing unit detects that the currently valid link has switched from online to offline status during the sending process, the execution status code is rewritten to a link interruption status, and the current round of writing operations is stopped.
[0051] Understandably, after this round of interaction processing is completed, the response encapsulation unit will encapsulate the request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number into a unified device response result set. Specifically, the request type corresponds to the category of the status viewing request or the parameter adjustment request; the execution status code corresponds to the success status, parameter out-of-bounds status, link interruption status, write failure status, or read completion status; the current valid link corresponds to the Bluetooth link, 4G link, or invalid status; the target channel identifier corresponds to the cold water target channel identifier or the hot water target channel identifier; the dual valve drive command corresponds to the current cold valve mutual exclusion control command, hot valve mutual exclusion control command, and valve action timing command; the temperature zone determination result corresponds to the current status within the target temperature zone, the status below the target temperature zone, the status above the safe temperature zone, or the sensor abnormal status; the valve status corresponds to the cold valve status and the hot valve status; the temperature status corresponds to the hot water outlet temperature value, the cold water outlet temperature value, and the temperature sensor status code; the session type corresponds to the Bluetooth communication session or the 4G communication session; the parameter write result corresponds to the success status, failure status, pending write status, or not written status; and the parameter version number corresponds to the currently effective version number or the updated version number. The request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number in the device response result set are used as direct input fields for the status record feedback processing in the S600. After reading the device response result set, the S600 performs recording, caching, and feedback.
[0052] In a complete engineering embodiment, when the Bluetooth communication session of the water dispenser in the office area has been established and the link priority is set to Bluetooth first, the mobile terminal sends a parameter adjustment request through the unified entry point. The request content includes the target temperature zone parameter and the valve opening duration parameter. The request access unit recognizes the request as a write request. After reading the communication session state set, the link selection unit writes the currently valid link as the Bluetooth link. The range verification unit compares the order of the target temperature zone parameter and the safe temperature zone, and the correspondence between the valve opening duration parameter and the pre-stored duration interval. After the comparison is successful, the command issuing unit writes the parameters to the device-side main control module via the Bluetooth communication unit. After the device-side main control module completes the parameter writing, it reads the target channel identifier, dual-valve drive command, temperature zone determination result, valve status, temperature status, and session type from the local state register area, and writes the parameter writing result as a success status, updates the parameter version number to the new version number, and then the response encapsulation unit generates the device response result set. If, during another control cycle, the remote management side issues a status check request via the 4G link and the current link priority is set to 4G priority, then the link selection unit will set the currently valid link to the 4G link, the command issuing unit will only initiate a status read, and the response encapsulation unit will directly write the read fields into the device response result set for the S600 to call.
[0053] The technical effects of this step can be summarized as follows: This step integrates the unified entry point of the mobile terminal, the selection of the currently valid link, parameter range verification, and the status readback of the device-side main control module into the same interaction link. The request read path and the write path are closed within the same data structure. Request type, execution status code, currently valid link, target channel identifier, dual-valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter write result, and parameter version number are uniformly encapsulated within this step, and the input source of the S600 remains singular. Bluetooth communication sessions and 4G communication sessions share the same response structure under the unified entry point, and the near-end interaction path and the far-end interaction path remain consistent at the field level.
[0054] S600. Based on the device response result set, perform status recording and feedback processing to generate a remote monitoring dataset; Specifically, S600 receives the device response result set output by S500 and is executed by the status record feedback processing logic in the device-side main control module. The status record feedback processing logic consists of a record extraction unit, a status archiving unit, a local storage queue, a feedback scheduling unit, and a monitoring data encapsulation unit. The record extraction unit is responsible for reading the request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number from the device response result set. The status archiving unit is responsible for writing the key statuses formed in this round of interaction processing into the local record area. The local storage queue is responsible for temporarily storing the device response result set and record results when the 4G link is offline. The feedback scheduling unit is responsible for sending the record results in the local storage queue in chronological order after the 4G link is restored to online status. The monitoring data encapsulation unit is responsible for combining the device number, online status, cold valve status, hot valve status, temperature status, session type, parameter version number, and abnormal status code into a remote monitoring dataset. The remote monitoring dataset is the output of this step. It belongs to the unified monitoring data structure for remote management. Its fields correspond to the device response result set, and the recorded results and the feedback results are written in a closed loop within the same main control module.
[0055] Specifically, the status record feedback process is triggered when a new device response result set is received, a switch of the currently valid link is detected, a change in the execution status code is detected, a parameter writing result is detected as a failure, a switch of the session type is detected, or an abnormal status code is detected. The record extraction unit first extracts the request type from the device response result set, whereby the request type indicates whether the current interaction is a status viewing request or a parameter adjustment request; it extracts the execution status code, which indicates a read completion status, write success status, write failure status, parameter out-of-bounds status, link interruption status, or session abnormal status; it extracts the currently valid link, which indicates whether the current response is carried by a Bluetooth link or a 4G link; it extracts the target channel identifier and dual-valve drive instructions, whereby the target channel identifier indicates whether the current target channel is cold water or hot water, and the dual-valve drive instructions indicate cold valve mutual exclusion control instructions, hot valve mutual exclusion control instructions, and valve action timing instructions; it extracts the temperature zone determination result, valve status, and temperature status, whereby the temperature zone determination result indicates the current temperature zone status, the valve status indicates the cold valve status and hot valve status, and the temperature status indicates the hot water outlet temperature value, the cold water outlet temperature value, and the temperature sensor status code; and it extracts the session type, parameter write result, and parameter version number, whereby the session type indicates a Bluetooth communication session or a 4G communication session, the parameter write result indicates the write status corresponding to the parameter adjustment request, and the parameter version number indicates the currently effective parameter configuration version. After completing field extraction, the status archiving unit writes the request type, target channel identifier, dual-valve drive command, temperature zone determination result, session type, parameter writing result, and exception status code into the local record area. The exception status code is generated based on the execution status code, temperature sensor status code, link status, and parameter writing result. If the parameter writing result is a failure, the status archiving unit keeps the current parameter version number unchanged and maps the parameter failure status to the corresponding exception status code and writes it into the local record area.
[0056] Furthermore, the local storage queue handles temporary storage and recovery / retransmission of disconnected links. The main control module reads the 4G link online status in each recording cycle. If the 4G link is offline, the status archiving unit writes the device response result set and recording results to the local storage queue by timestamp. Each queue record in the local storage queue includes the device number, record generation time, request type, execution status code, currently valid link, target channel identifier, dual-valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, parameter version number, and exception status code. The local storage queue uses a sequential write and sequential read method; records enqueued first are dequeued first, and the queue number, generation time, and current queue length are recorded after each write operation. If the 4G link returns to online status, the backhaul scheduling unit initiates a retransmission process. It first reads the current 4G link online status and session type, then extracts record results from the head of the local storage queue and sends them sequentially in chronological order. After sending, it waits for a reception confirmation from the remote management side. When the reception confirmation arrives, the backhaul scheduling unit deletes the current queue record and moves to the next one. If the reception confirmation does not arrive, the current queue position remains unchanged, and retransmission occurs in the next backhaul cycle. If the 4G link goes offline again during the retransmission period, the backhaul scheduling unit suspends this round of transmission and keeps the untransmitted records in the local storage queue. Understandably, the Bluetooth link handles near-end interaction, while the 4G link handles remote management data transmission. Therefore, the local storage queue establishes a buffer process around the 4G link online status, and the Bluetooth link status does not change the queue writing and retransmission rules.
[0057] Further, after completing local recording and queue processing, the monitoring data encapsulation unit generates the remote monitoring dataset. The device number comes from the device identifier register of the device-side main control module. The online status is generated based on the current valid link and 4G link online status; if the 4G link is online, the online status is written as "online"; if the 4G link is offline, the online status is written as "offline". The cold valve status and the hot valve status come from the valve status field. The temperature status comes from the hot water outlet temperature value, cold water outlet temperature value, and temperature sensor status code in the device response result set. The session type comes from the session type field. The parameter version number comes from the parameter version number field. The abnormal status code comes from the abnormal status write result in the local recording area. The monitoring data encapsulation unit encapsulates the above fields into a remote monitoring dataset according to a unified message format and sends it to the remote management side by the backhaul scheduling unit when the 4G link is online; when the 4G link is offline, it is first written to the local storage queue to await resending. The remote monitoring dataset here is not simply a concatenation of states, but rather a unified encapsulation of the device operating status, session status, and parameter status generated in this round of interaction, enabling continuous monitoring records for the same device across different control cycles. The device number, online status, cold valve status, hot valve status, temperature status, session type, parameter version number, and abnormal status code in the remote monitoring dataset maintain a one-to-one correspondence with the fields in the aforementioned steps. The remote management side can then read this data to reconstruct the original request, execution, and feedback paths.
[0058] In a complete engineering embodiment, after the office area drinking water terminal completes a parameter adjustment request processing in S500, it generates a device response result set containing the request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number. The main control module reads this device response result set in S600. If it detects that the current 4G link is offline, it writes the device response result set and the synchronously generated record results into a local storage queue. If it later detects that the 4G link has returned to online, the backhaul scheduling unit sends the aforementioned records sequentially from the head of the local storage queue, and deletes the corresponding queue item after each record receives a reception confirmation. For this round of parameter adjustment requests, if the parameter writing result is successful, the status archiving unit writes the new parameter version number; if the parameter writing result is a failure, the status archiving unit retains the current parameter version number and maps the failure status to an abnormal status code, writing it into the remote monitoring dataset. The final generated remote monitoring dataset includes device number, online status, cold valve status, hot valve status, temperature status, session type, parameter version number, and abnormal status code, and is sent to the remote management side as the end output message of the entire S100 to S600 link.
[0059] The technical effects of this step can be summarized as follows: This step integrates the device response result set, local records, local storage queue, and 4G link recovery retransmission into the same status record backhaul link, ensuring seamless connection between interaction results and remote monitoring results within the same data path. Abnormal status codes, parameter version numbers, session types, and valve status are uniformly archived and encapsulated within this step, maintaining a single source for fields in the remote monitoring dataset. Link breakage temporary storage and online retransmission are managed sequentially within this step, ensuring continuity between status records generated by the near-end interaction link and monitoring records generated by the remote management link.
[0060] Example 2: Figure 2 A structural block diagram of a dual-valve, dual-channel, interconnected drinking water control system for hot and cold water according to an embodiment of the present invention is shown. Figure 2 As shown, the structure may include: The main control module 01 is used to call the input acquisition module, target channel determination module, temperature control module, dual-channel session management module, mobile terminal unified entry interaction module, and status recording feedback module, and to process the drinking water control input set, valve control target status set, temperature control result set, communication session status set, device response result set, and remote monitoring dataset sequentially. Specifically, the main control module receives device button actions, Bluetooth link access actions, fourth-generation mobile communication link access actions, cold valve status changes, hot valve status changes, temperature status changes, and mobile terminal unified entry requests as trigger sources, and sequentially calls the input acquisition module, target channel determination module, temperature control module, dual-channel session management module, mobile terminal unified entry interaction module, and status recording feedback module within the same control cycle. The main control module performs sequential writing, sequential reading, and status retention on the drinking water control input set, valve control target status set, temperature control result set, communication session status set, device response result set, and remote monitoring dataset, and retains the parameter version number, abnormal status code, and currently valid link in the local status register area at the end of the current control cycle for use in the next control cycle. When the main control module detects an abnormal temperature sensor status code, a link interruption, a parameter writing failure, or a valve action feedback status inconsistent with the dual-valve drive command, it calls the status recording feedback module to write the abnormal status code and maintains the current parameter version number unchanged. When it detects that the fourth-generation mobile communication link has been restored to online status, it calls the status recording feedback module to send the recorded results in the local storage queue. The main control module sends the drinking water control input set generated by the input acquisition module to the target channel determination module, sends the valve control target status set generated by the target channel determination module to the temperature control module, sends the temperature control result set generated by the temperature control module to the dual-channel session management module, sends the communication session status set generated by the dual-channel session management module to the mobile terminal unified entry interaction module, and sends the device response result set generated by the mobile terminal unified entry interaction module to the status recording feedback module, forming a closed-loop processing link from acquisition to feedback.
[0061] Input acquisition module 02 is used to collect hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests. It performs timestamp alignment, field normalization, and unified encapsulation on the collected results to generate a drinking water control input set containing request type, device number, cold valve status, hot valve status, temperature value, connection request type, link status, and timestamp. This drinking water control input set is then sent to the target channel determination module. Specifically, the input acquisition module receives raw status data from the device body buttons, cold valve feedback terminals, hot valve feedback terminals, hot water outlet temperature sampling terminals, cold water outlet temperature sampling terminals, Bluetooth link access terminals, and 4G mobile communication link access terminals. The hot and cold water requests correspond to requests issued by the device body buttons, near-end requests from the mobile terminal, and far-end requests from the mobile terminal. The cold valve status and hot valve status correspond to open / close feedback status and locked status, respectively. The temperature status corresponds to the hot water outlet temperature value, cold water outlet temperature value, and temperature sensor status code. The connection request corresponds to the Bluetooth connection request, the 4G mobile communication connection request, and the current link online status. After the main control module issues the acquisition command, the input acquisition module performs timestamp alignment, mapping sampling times from different sources to the same device clock. It then performs field normalization, mapping hot and cold water requests to request types, and connection requests to connection request types and link status. The hot water outlet temperature and cold water outlet temperature are written into the temperature value field. During this round of unified encapsulation, the input acquisition module writes the request type, device number, cold valve status, hot valve status, temperature value, connection request type, link status, and timestamp into the drinking water control input set. If a temperature sensor status code error, Bluetooth link offline, or fourth-generation mobile communication link offline occurs during acquisition, the corresponding status is written into the link status or temperature status, maintaining the time order of the drinking water control input set for this round. The input acquisition module sends the request type, cold valve status, hot valve status, temperature status, connection request, and link status from the drinking water control input set to the target channel determination module for invocation, and provides the device number and timestamp to the main control module for registration.
[0062] The target channel determination module 03 is used to read the request type, cold valve status, hot valve status, temperature status, connection request, and link status from the drinking water control input set, generate a cold water target channel identifier or a hot water target channel identifier, perform channel executable verification, generate a near-end session request identifier or a far-end session request identifier, write a dual-valve drive command (cold valve open and hot valve closed or hot valve open and cold valve closed), and encapsulate and generate a valve control target status set containing the target channel identifier, dual-valve drive command, associated temperature status, session request identifier, and link status identifier, and send it to the temperature control module. Specifically, after receiving the drinking water control input set sent by the input acquisition module, the target channel determination module first parses the request type and determines whether the current control request belongs to a cold water request or a hot water request according to the timestamp order. If there are multiple requests within the same control cycle, the current control request is selected according to the order of the device body request, the mobile terminal near-end request, and the mobile terminal far-end request. The target channel determination module generates a cold water target channel identifier or a hot water target channel identifier based on the current control request, and reads the cold valve status, hot valve status, temperature status, connection request, and link status to perform executable channel verification. The executable channel verification includes valve opening / closing feedback status verification, valve locking status verification, temperature sensor status code validity verification, and current link status verification. When the cold water target channel identifier is established, the target channel determination module writes a dual-valve drive command (cold valve open, hot valve closed); when the hot water target channel identifier is established, it writes a dual-valve drive command (hot valve open, cold valve closed). It also extracts the hot water outlet temperature value or cold water outlet temperature value from the temperature status according to the current target channel to form an associated temperature status. Simultaneously, it generates a near-end session request identifier or a far-end session request identifier based on the connection request, and organizes the current link status into a link status identifier. The target channel determination module encapsulates the target channel identifier, dual-valve drive command, associated temperature status, session request identifier, and link status identifier into a valve control target status set, and sends it to the temperature control module for subsequent processing.
[0063] The temperature control module 04 is used to read the target channel identifier, associated temperature status, dual-valve drive command, session request identifier, and link status identifier from the valve control target status set. It compares the associated temperature status with a preset target temperature zone and a safe temperature zone to generate a temperature zone determination result. When the target channel identifier is a hot water target channel identifier and the temperature value is lower than the lower limit of the preset target temperature zone, it writes a heating maintenance command and a water supply prohibition status. When the target channel identifier is a hot water target channel identifier and the temperature value is higher than the upper limit of the safe temperature zone, it writes a heating shutdown command and an over-temperature protection status. When the target channel identifier is a cold water target channel identifier, it writes a cold water supply permission status. It then encapsulates and generates a temperature control result set containing the water supply permission status, temperature zone determination result, heating control command, session request identifier, and link status identifier, and sends it to the dual-channel session management module. Specifically, after receiving the valve control target status set sent by the target channel determination module, the temperature control module reads the target channel identifier, associated temperature status, dual-valve drive command, session request identifier, and link status identifier, and selects the current temperature value for comparison based on the target channel identifier. The temperature control module compares the current temperature value with the preset target temperature zone and the safe temperature zone, generating temperature zone determination results corresponding to the state within the target temperature zone, the state below the target temperature zone, the state above the safe temperature zone, or the sensor abnormality state. When the hot water target channel identifier is established and the temperature value is lower than the lower limit of the preset target temperature zone, the heating maintenance command and water supply prohibition state are written into the current control cycle. When the hot water target channel identifier is established and the temperature value is higher than the upper limit of the safe temperature zone, the heating shutdown command and over-temperature protection state are written into the current control cycle. When the cold water target channel identifier is established, the cold water supply permission state is written into the current control cycle. After generating the temperature zone determination results and heating control commands, the temperature control module encapsulates the session request identifier and link status identifier together with the water supply permission state into a temperature control result set, and sends the temperature control result set to the dual-channel session management module. If an abnormal temperature sensor status code is detected, the temperature control module writes the abnormal status into the water supply permission state and synchronously sends it back to the main control module for registration.
[0064] The dual-channel session management module 05 is used to read the session request identifier and link status identifier from the temperature control result set. When the session request identifier corresponds to a near-end scenario and the Bluetooth link is online, a Bluetooth communication session is established. When the session request identifier corresponds to a far-end scenario and the fourth-generation mobile communication link is online, a fourth-generation mobile communication session is established. When both Bluetooth and fourth-generation mobile communication sessions exist simultaneously, session arbitration is performed in the order of security protection, Bluetooth real-time water supply control, and fourth-generation mobile communication parameter writing. The module encapsulates and generates a communication session status set containing session type, link establishment result, link priority, online status, and session abnormal status, and sends it to the unified entry interaction module of the mobile terminal. Specifically, after receiving the temperature control result set sent by the temperature control module, the dual-channel session management module reads the session request identifier and link status identifier, and determines the current session establishment method in conjunction with the water supply permit status. The dual-channel session management module completes Bluetooth pairing, handshake verification, and session registration to establish a Bluetooth communication session when the session request identifier corresponds to a near-end scenario and the Bluetooth link is online. When the session request identifier corresponds to a remote scenario and the fourth-generation mobile communication link is online, it completes remote access confirmation, message verification, and session registration to establish a fourth-generation mobile communication session. If both Bluetooth and fourth-generation mobile communication sessions exist simultaneously, the dual-channel session management module performs session arbitration in the order of security protection, Bluetooth real-time water discharge control, and fourth-generation mobile communication parameter writing. During arbitration, it maintains the synchronous update of the current link priority and current online status, and writes a session abnormal status when a link interruption, handshake failure, or session conflict occurs. The dual-channel session management module encapsulates the session type, link establishment result, link priority, online status, and session abnormal status into a communication session status set and sends it to the mobile terminal unified entry interaction module, allowing the mobile terminal unified entry interaction module to read the session type and link priority to select the currently valid link.
[0065] The mobile terminal unified entry interaction module 06 is used to receive status viewing requests or parameter adjustment requests sent by the mobile terminal unified entry, read the session type and link priority in the communication session status set, select the currently valid link, and when receiving the parameter adjustment request, perform range verification on the target temperature zone parameter, valve opening duration parameter, status reporting cycle parameter, and link holding duration parameter. It then sends the status viewing request or parameter adjustment request to the main control module according to the currently valid link, and encapsulates and generates a device response result set containing the request type, execution status code, currently valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number, and sends it to the status record feedback module. Specifically, after receiving the communication session status set sent by the dual-channel session management module, the mobile terminal unified entry interaction module generates the currently valid link according to the session type, link establishment result, link priority, and online status, and receives the status viewing request or parameter adjustment request sent by the mobile terminal unified entry. When the unified entry interaction module of the mobile terminal receives a status viewing request, it calls the main control module to read the target channel identifier, dual-valve drive command, temperature zone determination result, valve status, temperature status, and session type. When it receives a parameter adjustment request, it first performs range verification on the target temperature zone parameters, valve opening duration parameters, status reporting cycle parameters, and link hold duration parameters. If the verification passes, it sends the parameter adjustment request to the main control module according to the currently valid link. If the verification fails, it writes the parameter writing result and execution status code. After reading the feedback status and parameter writing result, the unified entry interaction module of the mobile terminal encapsulates the request type, execution status code, currently valid link, target channel identifier, dual-valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number into a device response result set and sends it to the status recording feedback module. The parameter version number corresponds to the current parameter version number retained by the main control module for archiving and feedback by the status recording feedback module.
[0066] The status recording feedback module 07 is used to read the request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number from the device response result set. It records the request type, target channel identifier, dual valve drive command, temperature zone determination result, session type, parameter writing result, and abnormal status code. When the fourth-generation mobile communication link is offline, it writes the device response result set and the recorded results into a local storage queue. When the fourth-generation mobile communication link is restored to online, it sends the recorded results in the local storage queue in chronological order and encapsulates them to generate a remote monitoring dataset containing device number, online status, cold valve status, hot valve status, temperature status, session type, parameter version number, and abnormal status code. Specifically, after receiving the device response result set sent by the unified entry interaction module of the mobile terminal, the status recording feedback module extracts the request type, execution status code, current valid link, target channel identifier, dual-valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number, and writes the request type, target channel identifier, dual-valve drive command, temperature zone determination result, session type, parameter writing result, and abnormal status code into the local recording area. When the fourth-generation mobile communication link is detected to be offline, the status recording feedback module writes the device response result set and recording results into the local storage queue in timestamp order, maintaining the queue order unchanged; when the fourth-generation mobile communication link is detected to be online again, the module sends the recording results in the local storage queue in chronological order, and deletes the corresponding record after receiving the reception confirmation. At the end of the current recording cycle, the status recording feedback module encapsulates the device number, online status, cold valve status, hot valve status, temperature status, session type, parameter version number, and abnormal status code into a remote monitoring dataset, and sends the remote monitoring dataset to the remote management side. At the same time, it writes the abnormal status code and parameter version number back to the main control module for the next round of input acquisition and mobile terminal unified entry point interaction processing call.
Claims
1. A dual-valve, dual-channel interconnected drinking water control method, characterized in that, include: S100: Collect hot and cold water requests, cold valve status, hot valve status, temperature status, and connection requests to generate a drinking water control input set; S200. Based on the drinking water control input set, perform target channel determination processing to generate a valve control target status set containing target channel identifier, dual valve drive command, associated temperature status, session request identifier, and link status identifier; S300. Based on the valve control target state set, perform temperature regulation processing to generate a temperature control result set containing water supply permission status, temperature zone determination result, heating control command, session request identifier and link status identifier; S400. Based on the temperature control result set, perform dual-channel session management processing, execute Bluetooth instant connection establishment or 4G remote connection establishment, and generate a communication session state set. S500. Based on the communication session state set, perform unified entry interaction processing for the mobile terminal, perform status viewing and parameter adjustment, and generate a device response result set. S600. Based on the device response result set, perform status record feedback processing to generate a remote monitoring dataset.
2. The method according to claim 1, characterized in that, S100 includes: The system collects hot and cold water requests from the buttons on the main body of the data acquisition device, hot and cold water requests from the near end of the mobile terminal, and hot and cold water requests from the far end of the mobile terminal. Collect feedback status of cold valve opening / closing and hot valve opening / closing; Collect hot water outlet temperature value, cold water outlet temperature value, and temperature sensor status code; Collect Bluetooth connection requests, 4G connection requests, and the current link online status; The collected results are aligned with timestamps, normalized and uniformly encapsulated to generate a drinking water control input set containing request type, device number, cold valve status, hot valve status, temperature value, connection request type, link status and timestamp.
3. The method according to claim 2, characterized in that, S200 includes: Parse the request type in the drinking water control input set to generate a cold water target channel identifier or a hot water target channel identifier; Read the cold valve status, hot valve status, temperature status, connection request, and link status from the drinking water control input set, and perform channel executable verification; Generate a near-end session request identifier or a far-end session request identifier based on the connection request; When the cold water target channel identifier is established, a dual-valve drive command is generated to open the cold valve and close the hot valve. When the hot water target channel identifier is established, a dual-valve drive command is generated to open the hot valve and close the cold valve. The target channel identifier, the dual-valve drive command, the temperature status, the session request identifier, and the link status are encapsulated to generate a valve-controlled target status set.
4. The method according to claim 3, characterized in that, The S300 includes: Read the target channel identifier, associated temperature status, dual valve drive command, session request identifier, and link status identifier from the valve control target status set; The associated temperature state is compared with the preset target temperature zone and the safe temperature zone to generate a temperature zone determination result; When the target channel is identified as a hot water target channel and the temperature value is lower than the preset target temperature zone lower limit, a heating maintenance command and a water supply prohibition status are generated. When the target channel is identified as a hot water target channel and the temperature value is higher than the upper limit of the safe temperature zone, a heating shutdown command and an over-temperature protection status are generated. When the target channel identifier is a cold water target channel identifier, a cold water supply permission status is generated; The temperature zone determination result, water supply permit status, heating control command, session request identifier, and link status identifier are encapsulated to generate a temperature control result set.
5. The method according to claim 4, characterized in that, The S400 includes: Read the session request identifier and link status identifier from the temperature control result set; When the session request identifier corresponds to a near-end scenario and the Bluetooth link is online, a Bluetooth communication session is established; When the session request identifier corresponds to a remote scenario and the 4G link is online, a 4G communication session is established. When both Bluetooth and 4G communication sessions exist simultaneously, session arbitration is performed in the following order: security protection, Bluetooth real-time water discharge control, and 4G parameter writing. Encapsulate the session type, connection establishment result, link priority, online status, and session abnormal status to generate a communication session state set.
6. The method according to claim 5, characterized in that, The S500 includes: Receive status viewing requests or parameter adjustment requests sent from the unified entry point on mobile terminals; Read the session type and link priority from the communication session state set, and select a valid link; When the parameter adjustment request is received, range verification is performed on the target temperature zone parameter, valve opening duration parameter, status reporting cycle parameter, and link hold duration parameter. The status viewing request or the parameter adjustment request is sent to the device-side main control module according to the effective link; The request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result, and parameter version number are encapsulated to generate a device response result set.
7. The method according to claim 6, characterized in that, The S600 includes: Read the request type, execution status code, current valid link, target channel identifier, dual valve drive command, temperature zone determination result, valve status, temperature status, session type, parameter writing result and parameter version number from the device response result set; Record the request type, target channel identifier, dual-valve drive command, temperature zone determination result, session type, parameter writing result, and exception status code; When the 4G link is offline, the device response result set and record result are written to the local storage queue; When the 4G link is restored to online status, the recorded results in the local storage queue are sent in chronological order. The device number, online status, cold valve status, hot valve status, temperature status, session type, parameter version number, and abnormal status code are encapsulated to generate a remote monitoring dataset.
8. The method according to claim 3, characterized in that, The dual-valve drive commands include cold valve mutual exclusion control commands, hot valve mutual exclusion control commands, and valve action timing commands. The valve action timing commands specify: Before the cold valve opening command is written, the hot valve is in an active closed state. Before the hot valve opening command is written, the cold valve is in an active closed state. Within the same control cycle, the cold valve opening state and the hot valve opening state cannot be established simultaneously; Once the valve is unlocked, it will receive the next hot or cold water request.
9. The method according to claim 5, characterized in that, The session arbitration includes: When the Bluetooth communication session is in the water outlet control phase, the parameter writing command in the 4G communication session is suspended. When the Bluetooth communication session ends and the device is in an idle state, the parameter writing instruction is executed; When the Bluetooth link is disconnected and the 4G link is online, the current session type will be switched to a 4G communication session. When an abnormal state of the communication session is established, write the abnormal status code and freeze the current parameter version number.
10. A dual-valve, dual-channel interconnected drinking water control system for hot and cold water, characterized in that, include: The system comprises a main control module, an input acquisition module, a target channel determination module, a temperature control module, a dual-channel session management module, a mobile terminal unified entry interaction module, and a status record feedback module; these modules are connected in sequence to implement the method described in any one of claims 1-9.