Serial port screen unit and control method thereof, multi-screen control system and control method thereof
By receiving synchronous heartbeat packets in the multi-screen control system to establish a unified communication timeline, prioritizing the processing of setting instructions and using a random number timer, the problem of data packet collision on the RS485 bus is solved, achieving efficient and stable multi-screen control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-29
AI Technical Summary
In multi-screen control systems, data packet collisions occur on the RS485 bus, resulting in poor real-time performance and reliability of communication. This is especially true when there are many serial port screens or frequent data updates, as the polling cycle is long and the real-time response is slow, making it difficult to meet the needs of efficient and smooth multi-screen interaction.
By receiving synchronous heartbeat packets periodically sent by the main control module, a unified communication timeline is established, setting instructions are processed first and the polling instruction flow is restored. Combined with a random number generation instruction sending timer, concurrent instruction conflicts are avoided, and a closed-loop design for instruction sending and response data is achieved.
It improves the real-time performance and reliability of communication in the multi-screen control system, reduces data packet collisions, ensures rapid response to critical operations, and guarantees communication stability and data transmission accuracy.
Smart Images

Figure CN122111357A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-screen control technology, and in particular to a serial port screen unit and its control method, and a multi-screen control system and its control method. Background Technology
[0002] In the current field of intelligent control, such as smart home and RV control systems, serial port displays are often chosen as human-machine interfaces due to their high integration and ease of development. In practical applications, this serial port display is upgraded to an RS485 network via an RS232 to RS485 converter module.
[0003] However, when multiple serial port displays are connected in parallel to the same RS485 bus and then to the main control module, the RS485 bus typically uses user-defined communication protocols such as Modbus. Its mechanism differs from hardware-level conflict detection mechanisms like CAN bus, lacking inherent arbitration and priority management functions. Therefore, in multi-screen control systems, when multiple serial port displays simultaneously upload data or the main control device continuously issues commands, data packet collisions (command packet collisions) are highly likely to occur on the bus. Once a collision occurs, data frame transmission errors or loss will result, causing a sharp decline in the efficiency of the entire communication link, or even paralysis. While basic strategies such as polling exist for multi-device communication on the RS485 bus, in scenarios with a large number of serial port displays or frequent data updates, the long polling cycle and slow real-time response become prominent, making it difficult to meet the needs of efficient and smooth multi-screen interaction. Therefore, the existing multi-screen control systems suffer from poor real-time performance and reliability. Summary of the Invention
[0004] This invention provides a serial port screen unit and its control method, as well as a multi-screen control system and its control method, to solve the problems of data packet collisions, poor real-time communication, and poor reliability in multi-screen control systems.
[0005] This invention discloses a control method for a serial port screen unit, wherein at least two serial port screen units can be connected in parallel and communicate with an external main control module via an RS485 bus. The control method for the serial port screen unit includes the following steps: The system receives synchronization heartbeat packets periodically sent by the main control module. The synchronization heartbeat packets include heartbeat period parameters, and a unified communication timeline is established based on the heartbeat period parameters. Determine if there are any setup commands to be sent. If there is a setting instruction to be sent, the current polling instruction sending process is stopped, and the setting instruction sending process of the setting instruction is executed first. After receiving the first response data returned by the main control module in response to the setting instruction, the polling instruction sending process resumes. If there are no setting instructions to be sent at present, the polling instruction sending process will be executed; Receive the second response data returned by the main control module in response to the polling command.
[0006] Optionally, after determining whether there is a setting command to be sent, the control method of the serial port screen unit further includes the following steps: If there is a setting command to be sent, determine whether other parallel serial port screen units have already sent the same setting command to the main control module; If other parallel serial port screen units have already sent the same setting command to the main control module, the setting command sending process will be abandoned within the current heartbeat cycle, and the polling command sending process will be executed. If no other parallel serial port screen unit sends the same setting command to the main control module, the current polling command sending process is terminated, and the setting command sending process of the setting command is executed first.
[0007] Optionally, after determining whether there is a setting command to be sent, the control method of the serial port screen unit further includes the following steps: If there is no setting command to be sent, then determine whether there are other parallel serial port screen units that have sent the same polling command as their own polling command to be sent. If other parallel serial port screens have already sent the same polling instruction as the polling instruction to be sent, then the polling instruction sending process of the polling instruction is abandoned within the current heartbeat cycle. If no other parallel serial port screen has sent a polling instruction identical to its own pending polling instruction, then the polling instruction sending process is executed.
[0008] Optionally, the setting instruction sending process specifically includes: A random number is generated based on the synchronized heartbeat packet, and a timer is triggered by the random number to send an instruction. The setting instruction is then sent to the main control module through the timer. The value of the random number is less than the heartbeat cycle parameter in the synchronized heartbeat packet.
[0009] Optionally, the polling instruction sending process specifically includes: The random number is generated based on the synchronized heartbeat packet, and the random number is used to trigger an instruction sending timer. The instruction sending timer is then used to send a polling instruction to the main control module.
[0010] Optionally, the control method for the serial port screen unit further includes the following steps: If the first response data is detected as an erroneous instruction, or if the first response data is not received within the preset response time, the setting instruction sending process is triggered to re-execute the setting instruction. If the first response data is not received after the number of times the setting command sending process is re-executed reaches a preset threshold, a setting failure message will be output, and the polling command sending process will be automatically resumed.
[0011] Optionally, the control method for the serial port screen unit further includes the following steps: If the polling instruction sending process for all polling instructions is not completed within the current heartbeat cycle, the remaining polling instruction sending process will continue to be executed according to the original sending rules after the start of the next heartbeat cycle. Once all polling commands have been sent, the system will automatically enter the next polling cycle.
[0012] The present invention also discloses a serial port screen unit, including a serial port screen and a controller. The controller is connected to the serial port screen and generates a setting command to be sent in response to the human-machine operation of the serial port screen. The controller is connected to an external main control module via an RS485 bus. The controller is used to execute the steps of the control method of the serial port screen unit as described in any of the above claims.
[0013] The present invention also discloses a multi-screen control system, which includes a main control module and multiple serial port screen units as described above. The controllers of the multiple serial port screen units are connected in parallel and communicate with the main control module through an RS485 bus.
[0014] This invention also discloses a control method for a multi-screen control system, applied to the multi-screen control system described above. The control method for the multi-screen control system includes the following steps: The main control module periodically sends out synchronous heartbeat packets. The controller of the serial port screen unit receives the synchronization heartbeat packets periodically sent by the main control module. The synchronization heartbeat packets include heartbeat period parameters, and a unified communication timeline is established based on the heartbeat period parameters. The controller of the serial port screen unit determines whether there is a setting command to be sent. If there is a setting command to be sent, the controller of the serial port screen unit will stop the current polling command sending process and prioritize the setting command sending process of the setting command. After receiving the first response data returned by the main control module in response to the setting command, the controller of the serial port screen unit controls the resumption of the polling command sending process. If there are no setting instructions to be sent at present, the controller of the serial port screen unit will control the execution of the polling instruction sending process; The controller of the serial port screen unit receives the second response data returned by the main control module in response to the polling command.
[0015] The beneficial effects of the control method for the serial port screen unit provided in this invention are as follows: the serial port screen unit can be connected in parallel with other serial port screen units and communicate with an external main control module via an RS485 bus. Within the serial port screen unit, by receiving synchronization heartbeat packets from the main control module, a unified communication timeline can be established based on these heartbeat packets, ensuring consistent communication timing with other parallel serial port screen units. The sending of setting instructions takes precedence over the execution of polling instructions, and the polling process resumes after the setting instruction sending process is executed. This ensures rapid response to setting instructions and improves real-time communication. Furthermore, by unifying timing and prioritizing instructions, packet collisions caused by concurrent instruction sending from other parallel serial port screen units are avoided, reducing communication conflicts. Simultaneously, the closed-loop design of instruction sending and response data reception, as well as the orderly switching between polling and setting instructions, ensures communication stability and effectively improves communication reliability and data transmission accuracy in scenarios with multiple serial port screen units connected in parallel. Attached Figure Description
[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is one of the flowcharts illustrating the control method for the serial port screen unit provided in this embodiment of the invention; Figure 2 This is a second flowchart illustrating the control method for the serial port screen unit provided in this embodiment of the invention. Figure 3 This is the third flowchart illustrating the control method for the serial port screen unit provided in this embodiment of the invention; Figure 4 This is a structural block diagram of the serial port screen unit provided in an embodiment of the present invention; Figure 5 This is a timing diagram of the communication interaction between the serial port screen unit and the main control module provided in an embodiment of the present invention; Figure 6 This is a structural block diagram of the multi-screen control system provided in an embodiment of the present invention; Figure 7 This is a flowchart illustrating the control method of the multi-screen control system provided in an embodiment of the present invention; Figure 8 This is a schematic diagram illustrating the specific implementation process of the control method for the multi-screen control system provided in this embodiment of the invention under one heartbeat cycle.
[0017] The labels for the attached figures are as follows: 100. Serial port screen unit; 10. Serial port screen; 20. Controller; 200. Main control module; 300. RS485 bus; 400. Battery; 500. Inverter; 600. Coulomb meter; 700. Photovoltaic controller; 800. Distribution box. Detailed Implementation
[0018] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0019] This invention provides a control method for a serial port screen unit 100. At least two serial port screen units 100 can be connected in parallel and communicate with an external main control module 200 via an RS485 bus 300. The RS485 bus 300 has strong anti-interference capabilities and supports multi-point connections, effectively meeting the monitoring and control needs of deploying multiple serial port screens 10 over a large area and in multiple regions. Figure 1 , Figure 4 and Figure 5 As shown, the control method for the serial port screen unit 100 includes the following steps: S110: Receive the synchronization heartbeat packet sent by the main control module 200 at regular intervals. The synchronization heartbeat packet includes heartbeat period parameters. Establish a unified communication timeline based on the heartbeat period parameters. S120. Determine if there are any setting instructions to be sent. S130. If there is a setting instruction to be sent, the current polling instruction sending process is stopped, and the setting instruction sending process is executed first. S140. After receiving the first response data returned by the main control module 200 in response to the setting command, resume the polling command sending process. S150. If there are no setting instructions to be sent at present, then execute the polling instruction sending process; S160, Receive the second response data returned by the main control module 200 in response to the polling command.
[0020] The serial port screen unit 100 in this embodiment can be connected in parallel with other serial port screen units 100 and communicate with the external main control module 200 via RS485 bus 300. In the serial port screen unit 100, by receiving the synchronization heartbeat packet sent by the main control module 200, a unified communication timeline can be established based on the synchronization heartbeat packet, ensuring that the communication timing is consistent with other serial port screen units 100 connected in parallel. The sending of setting instructions takes precedence over the execution of polling instructions, and the polling process is restored after the setting instruction sending process is executed. This ensures a fast response to setting instructions and improves communication real-time performance. Furthermore, by unifying the timing and dividing the instruction priority, the packet collision problem caused by the concurrent sending of instructions by the serial port screen unit 100 and other serial port screen units 100 connected in parallel is avoided, reducing communication conflicts. At the same time, the closed-loop design of instruction sending and response data reception, as well as the orderly switching between polling instructions and setting instructions, can ensure communication stability and effectively improve the communication reliability and data transmission accuracy in scenarios where multiple serial port screen units 100 are connected in parallel.
[0021] Specifically, in step S110, the serial port screen unit 100 receives the synchronization heartbeat packet sent by the external master control module 200. Based on the heartbeat period parameters of the synchronization heartbeat packet, a unified communication timeline is established. That is, the heartbeat period parameters of the synchronization heartbeat packet are extracted and used as its own timing reference. The timeline starts at the moment the synchronization heartbeat packet is received, and combined with the extracted heartbeat period parameters, a local unified communication timeline is generated. The communication on the entire RS485 bus 300 is based on the synchronized heartbeat packets periodically broadcast by the master control module 200, forming an ordered communication timeline. Through this communication timeline, the serial port screen unit 100 can maintain consistent communication timing with other parallel serial port screen units 100, and can be effectively managed by the external master control module 200, reducing the possibility of data packet collisions with other serial port screen units 100. The reception of the synchronization heartbeat packet also establishes a unified communication timeline between each unrelated serial port screen unit 100, while significantly reducing the number of instructions each serial port screen unit 100 needs to send to obtain the same data.
[0022] In steps S120 to S130, it is determined whether there are any setting instructions to be sent, such as parameter configuration, working mode switching, function start / stop, and other key instructions. These setting instructions are generated by the serial port screen unit 100 in response to human-machine operation. For example, the serial port screen unit 100 is equipped with a virtual button for working mode switching. When the user operates this virtual button, the serial port screen unit 100 generates a setting instruction corresponding to the working mode switching. This setting instruction needs to be sent to the external main control module 200, which controls the execution of the corresponding setting operation. If a setting instruction to be sent is detected, the currently ongoing polling instruction sending process is immediately paused, and the setting instruction is sent to the main control module 200 first, giving the setting instruction the highest execution priority. This ensures that key setting requirements are quickly transmitted to the main control module 200, improves the real-time communication of core operations, and avoids setting delays caused by polling queuing affecting the normal operation of the overall device.
[0023] In step S140, after the serial port screen unit 100 successfully receives the first response data returned by the main control module 200 for the setting command, such as setting confirmation or execution result feedback, the previously suspended polling command sending process is resumed. This achieves an orderly connection between the priority execution of the setting command and the uninterrupted regular polling command, ensuring the closed-loop execution of the setting command and avoiding long-term stagnation of the polling process, thus ensuring the continuity of regular status monitoring and data interaction.
[0024] In steps S150 and S160, if there are no setting instructions to be sent, the polling instruction sending process is directly started or continues, such as routine polling instructions like device operation status reporting, data requests, and fault detection. This ensures the stable execution of routine communication needs, allowing the serial port screen unit 100 to provide real-time feedback on its operating status to the main control module 200. The serial port screen unit 100 receives the second response data returned by the main control module 200 in response to the polling instructions, such as status confirmation, requested data feedback, and control instruction issuance, forming a closed loop of polling communication. This confirms that the routine polling instructions have been received and processed by the main control module 200, ensuring the accuracy of data transmission. Simultaneously, it obtains feedback from the main control module 200 through the first response data, providing an execution basis for the next round of communication and further improving communication reliability.
[0025] In optional embodiments of this application, such as Figure 1 , Figure 2 and Figure 4 As shown, after determining whether there is a setting command to be sent, the control method of the serial port screen unit 100 further includes the following steps: S210. If there is a setting command to be sent, determine whether other parallel serial port screen units 100 have sent the same setting command to the main control module 200. S220. If other parallel serial port screen units 100 have already sent the same setting command to the main control module 200, the setting command sending process is abandoned in the current heartbeat cycle, and the polling command sending process is executed. S230. If no other parallel serial port screen unit 100 sends the same setting command to the main control module 200, the current polling command sending process is terminated, and the setting command sending process is executed first.
[0026] Specifically, the serial port display unit 100 may be on the same interface or not on the same interface as other parallel serial port display units 100. When on the same interface, the required data is the same, and the commands sent are the same. Therefore, when the serial port display unit 100 has a setting command to send, and other parallel serial port display units 100 have already sent the same setting command to the main control module 200, the setting command sending process is abandoned in the current heartbeat cycle. This reduces the number of commands sent, reduces redundant commands occupying the RS485 bus 300 bandwidth, and ensures that the regular polling requirements of the serial port display unit 100 are not interrupted, maintaining basic data interaction with the main control module 200 and ensuring communication efficiency and continuity. When no other parallel serial port display units 100 send the same setting command to the main control module 200, the setting command sending process is executed first. While avoiding command conflicts, the priority execution of the serial port display unit 100's setting command is ensured, ensuring that core configuration requirements are quickly conveyed, balancing communication stability and improving the real-time performance of critical operations.
[0027] In optional embodiments of this application, such as Figure 1 , Figure 3 and Figure 4 As shown, after determining whether there is a setting command to be sent, the control method of the serial port screen unit 100 further includes the following steps: S310. If there is no setting command to be sent, determine whether there are other parallel serial port screen units 100 that have sent the same polling command as their own polling command to be sent. S320. If other parallel serial port screens 10 have already sent the same polling instruction as their own pending polling instruction, then abandon the polling instruction sending process within the current heartbeat cycle. S330. If no other parallel serial port screen 10 has sent a polling instruction identical to its own pending polling instruction, then the polling instruction sending process is executed.
[0028] Specifically, if there are no pending setup commands and other parallel serial port screens 10 have already sent the same polling command, the polling command sending process is abandoned within the current heartbeat cycle. This eliminates redundant polling command sending, reduces bus data volume, and lowers the probability of communication conflicts. Simultaneously, it avoids invalid commands consuming bandwidth, ensuring bus resources are allocated to more necessary communication needs, improving overall communication response speed, and preventing bus congestion or data collisions caused by multiple parallel serial port screen units 100 simultaneously sending the same regular polling command, thus optimizing communication efficiency from a process perspective. If no other parallel serial port screen unit 100 is detected sending the same polling command, the serial port screen unit 100's own pending polling command is sent normally to the main control module 200. While avoiding conflicts, this ensures the effective transmission of the serial port screen unit 100's regular polling needs, guaranteeing communication stability and orderliness.
[0029] In an optional embodiment of this application, the instruction sending process is set, specifically including: A random number is generated based on the synchronous heartbeat packet. The random number is used to trigger a timer to send a setting command to the main control module 200. The value of the random number is less than the heartbeat period parameter in the synchronous heartbeat packet.
[0030] Specifically, the external main control module 200 periodically sends synchronization heartbeat packets. The serial port screen unit 100 on the communication network receives these heartbeat packets and generates a random number accordingly. The trigger times of the instruction sending timers for each parallel serial port screen unit 100 are random and dispersed, preventing multiple serial port screen units 100 from simultaneously sending setting instructions due to consistent timing, thus reducing the risk of packet collisions at the execution level. Furthermore, the generated random number is limited to be less than the heartbeat period parameter to ensure that the setting instructions sent by the instruction sending timer do not collide with the synchronization heartbeat packets.
[0031] In an optional embodiment of this application, the polling instruction sending process specifically includes: Random numbers are generated based on the synchronous heartbeat packets. The random numbers are used to trigger a timer to send instructions. The timer sends polling instructions to the main control module 200.
[0032] Specifically, the external main control module 200 periodically sends synchronization heartbeat packets. The serial port screen unit 100 on the communication network receives these heartbeat packets and generates a random number accordingly. This ensures that the polling command transmission is always within a unified communication timeline, does not deviate from the heartbeat cycle benchmark, maintains the regular communication timing of the serial port screen unit 100, and avoids command loss or delay due to incorrect transmission timing. The trigger times of the command transmission timers for each parallel serial port screen unit 100 are random and dispersed, preventing multiple serial port screen units 100 from simultaneously sending the required polling commands due to consistent timing, thus reducing the risk of packet collisions at the execution level. Furthermore, the generated random number is limited to be less than the heartbeat cycle parameter to ensure that the polling commands sent by the command transmission timer do not collide with the synchronization heartbeat packets.
[0033] In an optional embodiment of this application, the control method for the serial port screen unit 100 further includes the following steps: If the first response data is detected as an erroneous command, or if the first response data is not received within the preset response time, the setting command sending process will be triggered to re-execute the setting command. If the number of times the setting command sending process is re-executed reaches a preset threshold and no first response data is received, a setting failure message will be output, and the polling command sending process will be automatically resumed.
[0034] Specifically, to address transmission issues related to response errors or timeouts in the return of the first response data, an automatic retransmission mechanism prevents setup commands from failing due to single communication failures. This ensures that the needs of the serial port display unit 100 are effectively communicated to the external main control module 200, adapting to complex communication environments. When the number of consecutive re-executions of the setup command transmission process reaches a preset threshold, the polling command transmission process automatically resumes. This prevents unsuccessful setup commands from being continuously retransmitted and occupying the RS485 bus 300 bandwidth for an extended period, affecting communication with other serial port display units 100 or regular polling, thus ensuring reasonable allocation of bus resources. Failure prompts allow maintenance personnel to quickly identify problems, facilitating timely troubleshooting and improving problem-solving efficiency.
[0035] In an optional embodiment of this application, the control method for the serial port screen unit 100 further includes the following steps: If the polling instruction sending process for all polling instructions is not completed within the current heartbeat cycle, the remaining polling instruction sending process will continue to be executed according to the original sending rules after the start of the next heartbeat cycle. Once all polling commands have been sent, the system will automatically enter the next polling cycle.
[0036] Specifically, if, within the current heartbeat cycle, the polling command sending process cannot be completed due to a large number of polling commands or a large amount of data, the remaining polling commands will continue to be sent according to the original sending rules of the current heartbeat cycle after the start of the next heartbeat cycle. This avoids the omission of some polling commands due to the capacity limit of a single heartbeat cycle, ensuring that all routine monitoring and data reporting requirements are gradually implemented and that the status is fully reported to the external serial port display unit 100. Executing according to the original rules in the next heartbeat cycle avoids timing or logic confusion, ensuring communication stability. The cross-cycle continuation mechanism balances the contradiction between the heartbeat cycle duration and the total number of polling commands. Once all pending polling commands have been successfully sent, without additional triggering, the system automatically switches to the next polling cycle and starts a new round of polling command sending according to the established rules, improving overall communication reliability.
[0037] This application embodiment also provides a serial port screen unit 100, such as Figures 1 to 5 As shown, the serial port screen unit 100 includes a serial port screen 10 and a controller 20. The controller 20 is connected to the serial port screen 10 and generates setting commands to be sent in response to human-machine operations on the serial port screen 10. The controller 20 communicates with an external main control module 200 via an RS485 bus 300. The controller 20 is used to execute the steps of the control method of the serial port screen unit 100 as described above. Detailed steps and beneficial effects can be found above and will not be repeated here.
[0038] This application also provides a multi-screen control system, such as... Figures 1 to 6 As shown, the multi-screen control system includes a main control module 200 and multiple serial port screen units 100 as described above. The controllers 20 of the multiple serial port screen units 100 are connected in parallel and communicate with the main control module 200 via an RS485 bus 300. The controllers 20 of the serial port screen units 100 are used to execute the steps of the control method for the serial port screen units 100 as described above. Detailed steps and beneficial effects can be found above and will not be repeated here.
[0039] In specific embodiments, the multi-screen control system can be applied to RV and smart home application scenarios. Figure 6This is a structural block diagram of a multi-screen control system applied in a motorhome scenario. The multi-screen control system also includes a battery 400, an inverter 500, a coulomb counter 600, a photovoltaic controller 700, and a power distribution box 800. The coulomb counter 600 connects to the inverter 500, photovoltaic controller 700, battery 400, power distribution box 800, and main control module 200. The inverter 500 converts the DC power from the battery 400 to AC power. The coulomb counter 600 detects parameters such as current, voltage, and power level. The photovoltaic controller 700 manages the power supply for the photovoltaic system. The power distribution box 800 distributes the electrical energy output from the battery 400, inverter 500, or photovoltaic controller 700 to the main control module 200, each serial port screen unit 100, and other electrical components; it also automatically cuts off the power supply in case of circuit overload or short circuit, protecting system components from damage and improving system operational safety. The main control module 200 is responsible for monitoring and controlling the serial port screen unit 100 and other modules.
[0040] exist Figure 6 In the multi-screen control system shown, in a specific implementation scenario, the heartbeat cycle parameters of the synchronization heartbeat packet sent by the main control module 200 are... The heartbeat packet, which lasts 1 second, contains the following information: interface information bar data (such as time, Bluetooth, and Wi-Fi information), main control relay button information (such as status, name, and image), device status, and fault information. The communication baud rate is 115200. The random number triggered by sending polling and setting commands is set to... ,in The range is 0~90, used to generate intervals between 40ms and 940ms, which are within the heartbeat cycle parameters. Within this range, the main page of the serial port screen 10 displays virtual buttons corresponding to multiple relay switches of the main control module 200, dynamic graphs of energy flow for the controller 20 (charging, inverter, bypass, generator charging, etc.), real-time data on solar input, AC input, AC output, DC input, DC output voltage, current, and power, fault alerts, and other display elements. Setting commands are sent to the main control module 200 via the virtual buttons, and the main control module 200 receives the setting commands and controls the lights connected to the relay switches. At this time, the setting commands are prioritized through an arbitration mechanism, and then polling commands are sent based on the synchronization heartbeat packets.
[0041] This application also provides a control method for a multi-screen control system, applied to the multi-screen control system described above. Figures 1 to 5 , Figure 7 As shown, the control method of the multi-screen control system includes the following steps: S410: The main control module 200 periodically sends out synchronous heartbeat packets; S420: The controller 20 of the serial port screen unit 100 receives the synchronous heartbeat packets periodically sent by the main control module 200. The synchronous heartbeat packets include heartbeat cycle parameters, and a unified communication timeline is established based on the heartbeat cycle parameters. S430: The controller 20 of the serial port screen unit 100 determines whether there is a setting command to be sent. S440. If there is a setting command to be sent, the controller 20 of the serial port screen unit 100 will control the current polling command sending process to be stopped, and the setting command sending process will be executed first. S450: After receiving the first response data returned by the main control module 200 in response to the setting command, the controller 20 of the serial port screen unit 100 controls the resumption of the polling command sending process. S460. If there is no setting command to be sent at present, the polling command sending process is controlled by the controller 20 of the serial port screen unit 100. S470: The controller 20 of the serial port screen unit 100 receives the second response data returned by the main control module 200 in response to the polling command.
[0042] In this embodiment, multiple serial port screen units 100 are connected in parallel and communicate with an external main control module 200 via an RS485 bus 300. The main control module 200 periodically sends synchronization heartbeat packets, and the controller 20 of each serial port screen unit 100 receives these synchronization heartbeat packets from the main control module 200. This allows for the establishment of a unified communication timeline based on the synchronization heartbeat packets, ensuring consistent communication timing with other parallel serial port screen units 100. In each serial port screen unit 100, the sending of setting instructions takes precedence over the execution of polling instructions, and the polling process resumes after the setting instruction sending process is completed. This ensures rapid response to setting instructions and improves real-time communication. Furthermore, by unifying the timing and prioritizing instructions, it avoids packet collisions caused by concurrent instruction sending from other parallel serial port screen units 100, reducing communication conflicts. Simultaneously, the closed-loop design of instruction sending and response data reception, as well as the orderly switching between polling and setting instructions, ensures communication stability and effectively improves communication reliability and data transmission accuracy in scenarios with multiple serial port screen units 100 connected in parallel.
[0043] In step S410, when the network established between the main control module 200 and the serial port screen unit 100 is powered on, the main control module 200 will first send the first synchronization heartbeat packet. Each serial port screen unit 100 on the network will generate a random number. This random number will be used to control the instruction sending timer of the serial port screen unit 100. The instruction sending timer will determine whether there are setting instructions and polling instructions that need to be sent.
[0044] The control method of the multi-screen control system is applied to the multi-screen control system described above. The multi-screen control system includes a main control module 200 and multiple serial port screen units 100 as described above. The controllers 20 of the multiple serial port screen units 100 are connected in parallel and communicate with the main control module 200 via an RS485 bus 300. The controllers 20 of the serial port screen units 100 are used to execute the steps of the control method described above for the serial port screen units 100. The control method of the multi-screen control system has the same steps and beneficial effects as the control method of the serial port screen units 100 described above. The steps and beneficial effects of the control method of the serial port screen units 100 have been described in detail in the foregoing embodiments and will not be repeated here.
[0045] The following description, in conjunction with the accompanying drawings, details the specific execution steps of the control method for the multi-screen control system according to an embodiment of this application within one heartbeat cycle.
[0046] like Figure 8 As shown, within one heartbeat cycle, the control method of the multi-screen control system specifically executes the following steps: S510, the main control module 200 sends a synchronization heartbeat packet; S520, the serial port screen unit 100 determines whether there is a setting command; S530, the polling command is stopped and a random number is generated, triggering the control command sending timer to send the setting command; S540, the serial port screen unit 100 determines whether it has received the first response data returned by the main control module 200; S550, a random number is generated, triggering the control command sending timer to send polling command 1; S560, the serial port screen unit 100 determines whether it has received the second response data returned by the main control module 200; S570, the serial port screen unit 100 determines whether there is a setting command. S580, Serial port screen unit 100 determines whether other serial port screen units 100 have sent the setting command; S590, Polling command is stopped and a random number is generated, triggering the control command sending timer to send the setting command; S610, Serial port screen unit 100 determines whether it has received the first response data returned by the main control module 200; S620, Serial port screen unit 100 determines whether other serial port screen units 100 have sent polling command N; S630, A random number is generated, triggering the control command sending timer to send polling command N; S640, Serial port screen unit 100 determines whether it has received the second response data returned by the main control module 200; S650, Main control module 200 sends the next synchronization heartbeat packet.
[0047] It should be understood that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Those skilled in the art can modify the technical solutions described in the above embodiments, or make equivalent substitutions for some of the technical features; and all such modifications and substitutions should fall within the protection scope of the appended claims of the present invention.
Claims
1. A control method for a serial port screen unit, characterized in that, At least two of the serial port screen units can be connected in parallel and communicate with an external main control module via an RS485 bus. The control method of the serial port screen unit includes the following steps: The system receives synchronization heartbeat packets periodically sent by the main control module. The synchronization heartbeat packets include heartbeat period parameters, and a unified communication timeline is established based on the heartbeat period parameters. Determine if there are any setup commands to be sent. If there is a setting instruction to be sent, the current polling instruction sending process is stopped, and the setting instruction sending process of the setting instruction is executed first. After receiving the first response data returned by the main control module in response to the setting instruction, the polling instruction sending process is resumed. If there are no setting instructions to be sent at present, the polling instruction sending process will be executed; Receive the second response data returned by the main control module in response to the polling command.
2. The control method for the serial port screen unit according to claim 1, characterized in that, After determining whether there is a setting command to be sent, the control method of the serial port screen unit further includes the following steps: If there is a setting command to be sent, determine whether other parallel serial port screen units have already sent the same setting command to the main control module; If other parallel serial port screen units have already sent the same setting command to the main control module, the setting command sending process will be abandoned within the current heartbeat cycle, and the polling command sending process will be executed. If no other parallel serial port screen unit sends the same setting command to the main control module, the current polling command sending process is terminated, and the setting command sending process of the setting command is executed first.
3. The control method for the serial port screen unit according to claim 2, characterized in that, After determining whether there is a setting command to be sent, the control method of the serial port screen unit further includes the following steps: If there is no setting command to be sent, then determine whether there are other parallel serial port screen units that have sent the same polling command as their own polling command to be sent. If other parallel serial port screens have already sent the same polling instruction as the polling instruction to be sent, then the polling instruction sending process of the polling instruction is abandoned within the current heartbeat cycle. If no other parallel serial port screen has sent a polling instruction identical to its own pending polling instruction, then the polling instruction sending process of the polling instruction is executed.
4. The control method for the serial port screen unit according to any one of claims 1-3, characterized in that, The setting instruction sending process specifically includes: A random number is generated based on the synchronized heartbeat packet, and a timer is triggered by the random number to send an instruction. The setting instruction is then sent to the main control module through the timer. The value of the random number is less than the heartbeat cycle parameter in the synchronized heartbeat packet.
5. The control method for the serial port screen unit according to claim 4, characterized in that, The polling instruction sending process specifically includes: The random number is generated based on the synchronized heartbeat packet, and the random number is used to trigger an instruction to send a timer. The instruction to send the timer sends a polling instruction to the main control module.
6. The control method for the serial port screen unit according to claim 1, characterized in that, The control method for the serial port screen unit also includes the following steps: If the first response data is detected as an erroneous instruction, or if the first response data is not received within the preset response time, the setting instruction sending process is triggered to re-execute the setting instruction. If the first response data is not received after the number of times the setting command sending process is re-executed reaches a preset threshold, a setting failure message will be output, and the polling command sending process will be automatically resumed.
7. The control method for the serial port screen unit according to claim 1, characterized in that, The control method for the serial port screen unit also includes the following steps: If the polling instruction sending process for all polling instructions is not completed within the current heartbeat cycle, the remaining polling instruction sending process will continue to be executed according to the original sending rules after the start of the next heartbeat cycle. Once all polling commands have been sent, the system will automatically enter the next polling cycle.
8. A serial port screen unit, characterized in that, The device includes a serial port screen and a controller. The controller is connected to the serial port screen and generates a setting command to be sent in response to the human-machine operation of the serial port screen. The controller is connected to an external main control module via an RS485 bus. The controller is used to execute the steps of the control method of the serial port screen unit as described in any one of claims 1-7.
9. A multi-screen control system, characterized in that, The multi-screen control system includes a main control module and multiple serial port screen units as described in claim 8. The controllers of the multiple serial port screen units are connected in parallel and communicate with the main control module via an RS485 bus.
10. A control method for a multi-screen control system, applied to the multi-screen control system as described in claim 9, wherein the control method for the multi-screen control system includes the following steps: The main control module periodically sends out synchronous heartbeat packets. The controller of the serial port screen unit receives the synchronization heartbeat packets periodically sent by the main control module. The synchronization heartbeat packets include heartbeat period parameters, and a unified communication timeline is established based on the heartbeat period parameters. The controller of the serial port screen unit determines whether there is a setting command to be sent. If there is a setting command to be sent, the controller of the serial port screen unit will stop the current polling command sending process and prioritize the setting command sending process of the setting command. After receiving the first response data returned by the main control module in response to the setting command, the controller of the serial port screen unit controls the resumption of the polling command sending process. If there are no setting instructions to be sent at present, the controller of the serial port screen unit controls the execution of the polling instruction sending process; The controller of the serial port screen unit receives the second response data returned by the main control module in response to the polling command.