Periodic time-sharing communication method, system and device and storage medium

Through the periodic time-sharing communication method and the MODBUS_RTU protocol, the problems of low communication efficiency and poor data synchronization in the multi-slave communication system are solved, efficient, real-time and flexible data transmission are achieved, and the reliability and adaptability of the system are improved. Suitable for complex industrial control environments.

CN119094273APending Publication Date: 2024-12-06JIANGSU TRINATEC ELECTRIC CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411185684.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing multi-slave communication system has problems such as low communication efficiency, poor data synchronization, difficulty in flexibly adapting to different data needs and low system reliability in industrial control, especially in application scenarios with high real-time and high efficiency requirements. .

Method used

The periodic time-sharing communication method is adopted, and the fixed communication period is defined by the host and divided into multiple time periods. The high-level pulse control signal is sent to the slave in turn within each time period, and independent control signal lines and interrupts are used. The detection mechanism combines the MODBUS_RTU protocol for data transmission to ensure data synchronization and reliability.

Benefits of technology

It improves communication efficiency and data synchronization, flexibly adapts to different data needs, enhances the reliability and anti-interference ability of the system, meets efficient, real-time and flexible communication requirements, and is suitable for diversified industrial control scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094273A_ABST
    Figure CN119094273A_ABST
Patent Text Reader

Abstract

The invention relates to the field of industrial communication, in particular to a periodic time-sharing communication method, system and device and a storage medium. The problems of low communication efficiency, poor data synchronism and the like exist in the prior art. The method comprises the following steps: defining a fixed communication period; dividing the communication cycle into a plurality of time periods according to data requirements; the host sends control signals to the slave machines in sequence in the time periods; the slave machine detects a control signal; and the slave responds to the control signal and sends data. The system comprises a host, a plurality of slaves, a communication bus and a plurality of control signal lines. The host is connected with a plurality of slaves through a communication bus, and each control signal line is connected with the host and one slave. Through time-sharing control and independent control of the signal lines, the communication efficiency and the data synchronism are improved, efficient and real-time communication of multiple slaves is achieved, different data requirements can be flexibly met, and good system reliability and expansibility are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial communication, and in particular to a periodic time-sharing communication method, system, equipment and storage medium. Background Art

[0002] In industrial control systems, the master controller needs to collect data from multiple slaves regularly. Existing multi-slave communication systems usually use polling or interrupt triggering to collect data. However, these methods have some shortcomings.

[0003] In the polling mode, the master controller sends data requests to each slave in a fixed order. This method is simple to implement, but the communication efficiency is low. When there are many slaves in the system, the data update cycle of each slave will become longer, making it difficult to meet the real-time requirements. In addition, the polling method makes it difficult to flexibly adjust the collection frequency according to the data requirements of different slaves, which may lead to untimely collection of some key data.

[0004] The interrupt trigger mode allows the slave to actively send an interrupt request to the master controller when there is new data. This method can improve the real-time performance of data, but it is easy to cause communication conflicts in a multi-slave system. When multiple slaves send interrupt requests at the same time, data loss or system response delay may occur. In addition, frequent interrupt requests will increase the processing burden of the master controller and affect the stability of the system.

[0005] The existing multi-slave communication system also faces the problem of poor data synchronization. In complex industrial environments, the inconsistent data collection time points of different slaves may lead to deviations in data analysis and decision-making. At the same time, the communication protocols of existing systems are often complex, which increases the difficulty of system implementation and the failure rate.

[0006] These problems make it difficult for existing multi-slave communication systems to simultaneously meet the requirements of high efficiency, high real-time performance, good data synchronization, and flexible adaptation to different data needs. In some industrial application scenarios that require high data acquisition accuracy and timeliness, such as process control and energy management, the limitations of existing technologies are becoming increasingly prominent. Summary of the invention

[0007] The purpose of the present invention is to provide a periodic time-sharing communication method and system to solve the problems existing in the prior art, such as low communication efficiency, poor data synchronization, difficulty in flexibly adapting to different data requirements and low system reliability.

[0008] To achieve the above object, the present invention adopts the following technical solution:

[0009] In a first aspect, the present invention provides a periodic time-sharing communication method, comprising the following steps: the host defines a fixed communication cycle; the host divides the fixed communication cycle into a plurality of time periods; the host sends a control signal to each slave in turn within each of the time periods; the host receives data sent by the slave.

[0010] Furthermore, the control signal is a high level pulse signal.

[0011] Specifically, the host sends the received data after responding to the control signal through the input / output interrupt function.

[0012] In addition, the data is transmitted using the MODBUS_RTU protocol.

[0013] In a second aspect, the present invention also provides a periodic time-sharing communication method, comprising the following steps: the slave detects a control signal from the host; the slave responds to the control signal; the slave determines the current time period based on the control signal; the slave prepares corresponding data based on the current time period; and the slave sends the data.

[0014] Furthermore, the control signal is a high level pulse signal.

[0015] Specifically, the slave detects the control signal through an input / output interrupt function.

[0016] In addition, the data is transmitted using the MODBUS_RTU protocol.

[0017] In a third aspect, the present invention also provides a periodic time-sharing communication method, comprising the following steps: the host defines a fixed communication cycle; the host divides the fixed communication cycle into multiple time periods; the host sends a control signal to each slave in turn within each time period; the slave detects the control signal; the slave responds to the control signal and sends data.

[0018] Furthermore, the control signal is a high level pulse signal.

[0019] Specifically, the slave detects the control signal through an input / output interrupt function.

[0020] In addition, the data is transmitted using the MODBUS_RTU protocol.

[0021] In a fourth aspect, the present invention also provides a periodic time-sharing communication system, comprising: a host; multiple slaves; a communication bus, the host and the multiple slaves are all connected to the communication bus; multiple control signal lines, one end of each of the control signal lines is connected to the host, and the other end is connected to one of the slaves.

[0022] Specifically, the control signal line is an independent input / output line.

[0023] Furthermore, the host includes a plurality of input / output ports, and each of the input / output ports is connected to a slave via one of the control signal lines.

[0024] In addition, each of the slaves includes an interrupt detection module, which is connected to the corresponding control signal line and is used to detect the control signal.

[0025] In addition, the communication bus adopts the RS485 standard. The host and the plurality of slaves are connected to the communication bus via RS485 interfaces.

[0026] Finally, the multiple slaves are connected in parallel or in series on the communication bus.

[0027] In a fifth aspect, the present invention further provides a communication device, comprising a processor and a memory, wherein the processor is used to execute a computer program stored in the memory, so that the communication device executes the method described in the third aspect.

[0028] In a sixth aspect, the present invention further provides a computer storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in the third aspect is implemented.

[0029] The present invention realizes efficient time-sharing communication by dividing a fixed communication cycle into multiple time periods and sending control signals to each slave in turn in each time period. This method improves communication efficiency, improves data synchronization, and can flexibly adapt to different data requirements. Through the precise control of the host over the communication process, data conflicts are avoided and the reliability of the system is improved.

[0030] The present invention adopts independent control signal lines and interrupt detection mechanisms to further improve the response speed and reliability of the system. The use of RS485 bus and MODBUS_RTU protocol makes the system have good compatibility and scalability. Through flexible parallel or series connection methods, the system can adapt to different application scenarios and meet diverse industrial control needs. The design of independent input / output lines and interrupt detection modules enhances the anti-interference ability and real-time performance of the system, while the configuration of multiple input / output ports improves the scalability and flexibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A flow chart of a periodic time-sharing communication method in one embodiment of the present invention Figure 1 ;

[0032] Figure 2 A flow chart of a periodic time-sharing communication method in one embodiment of the present invention Figure 2 ;

[0033] Figure 3 A flow chart of a periodic time-sharing communication method in one embodiment of the present invention Figure 3 ;

[0034] Figure 4 A timing diagram of a periodic time-sharing communication method in one embodiment of the present invention;

[0035] Figure 5 A structural block diagram of a periodic time-sharing communication system in one embodiment of the present invention;

[0036] Figure 6 The present invention is a structural block diagram of a communication device in an embodiment of the present invention.

[0037] In the figure: 1. host, 2. slave, 3. communication bus, 4. control signal line, 11. processor, 12. memory, 13. input / output port, 14. RS485 interface, 21. interrupt detection module, 22. data processing module, 23. RS485 interface, 24. processor, 25. memory. DETAILED DESCRIPTION

[0038] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the described embodiments are only used to explain the technical principles of the present invention, rather than to limit the scope of its rights protection. Those skilled in the art should understand that, without departing from the spirit and scope of the present invention, various changes, modifications or equivalent substitutions can be made to these embodiments. These changes, modifications or equivalent substitutions should all be deemed to fall within the scope of protection defined by the patent claims of the present invention. The specific embodiments of the present invention have been described by way of example, but it should be understood that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work belong to the scope of protection of the present invention.

[0039] Embodiment 1

[0040] Reference Figure 1 This embodiment provides a periodic time-sharing communication method, which specifically includes the following steps:

[0041] Step S1, the host defines a communication cycle. In this embodiment, the communication cycle is preferably 90ms. The selection of this cycle is based on a comprehensive consideration of factors such as the real-time requirements of the system, the number of devices in the network, the expected data transmission volume, and processing power. The 90ms cycle can provide sufficient data transmission time for multiple devices while ensuring real-time performance, and is suitable for most industrial control scenarios.

[0042] Step S2, the host divides the communication cycle into multiple communication time periods. In this embodiment, the 90ms communication cycle is divided into three equal time periods, each of which is 30ms long. The division of time periods needs to be considered based on the number of devices in the network, the amount of data of each device, the priority of the data, and the network transmission rate. Equal division simplifies time management, but in actual applications, unequal division can be performed according to specific needs to adapt to the data characteristics of different devices.

[0043] Step S3, the host sends a control signal. The host sends control signals to other devices in the network in turn in each time period. The control signal is a high-level pulse signal, which is sent through an independent control signal line. This design can effectively reduce signal interference and improve the reliability and real-time performance of communication. Each device has its own dedicated control signal line, so that the host can accurately control the communication timing of each device.

[0044] Step S4, the host receives data. The host receives data sent by other devices through the communication interface, performs data verification, and stores valid data in the memory. In this embodiment, the data received by the host is obtained after the input / output interrupt function responds to the control signal.

[0045] In addition, the data transmission protocol used in this embodiment is MODBUS_RTU. This protocol has good reliability and efficiency and is widely used in the field of industrial control. The use of MODBUS_RTU protocol simplifies the structure of the data frame, reduces the transmission overhead, and ensures the integrity and reliability of the data.

[0046] Embodiment 2

[0047] Reference Figure 2 This embodiment provides a periodic time-sharing communication method, comprising the following steps:

[0048] Step S11: The slave detects the external control signal. The slave continuously monitors the signal changes on its dedicated control signal line through the input / output interrupt function. This interrupt-based detection method can ensure that the slave can quickly respond to the host's control command and minimize communication delays.

[0049] Step S12: The slave responds to the control signal. Once the rising edge of the control signal is detected by the input / output interrupt function, the slave immediately triggers the corresponding interrupt service routine to prepare for subsequent data preparation and transmission. This fast response mechanism is the key to ensure efficient operation of the system.

[0050] Step S13: The slave determines the current time period according to the control signal. Since each time period corresponds to a specific data type or data portion, the slave needs to accurately determine the current time period. This can be achieved by analyzing the characteristics of the control signal (such as the duration of the high level pulse or the number of times the control signal is received).

[0051] Step S14: The slave generates corresponding data according to the current time period. This process may include reading the latest data from the sensor, performing necessary data conversion or calculation, adding timestamps, etc. The data preparation process needs to be carried out efficiently to ensure that all operations can be completed within the allocated time period.

[0052] Step S15: The slave sends the data. The prepared data is sent out through a pre-configured communication interface (such as RS485). In this embodiment, the data is transmitted using the MODBUS_RTU protocol. This protocol selection takes into account both communication efficiency and reliability and is suitable for industrial control environments. The use of the MODBUS_RTU protocol ensures the standardization and compatibility of data transmission, which is conducive to system integration and maintenance.

[0053] Through the above steps, the slave can efficiently complete the preparation and transmission of data within the specified time period, realizing efficient and reliable periodic time-sharing communication.

[0054] Embodiment 3

[0055] Reference Figure 3 and Figure 4 The present invention provides a periodic time-sharing communication method. The method aims to solve the problems existing in the prior art, such as low communication efficiency, poor data synchronization, difficulty in flexibly adapting to different data requirements, and low system reliability.

[0056] like Figure 3 As shown, the method comprises the following steps:

[0057] Step S21: The host defines a fixed communication cycle. In this embodiment, the fixed communication cycle is preferably set to 90ms. The selection of this cycle is based on a comprehensive consideration of the real-time requirements of the system and the amount of data.

[0058] Step S22: The host divides the fixed communication cycle into multiple time periods according to data requirements. In this embodiment, assuming that the system includes 3 slaves, each slave needs to send 3 parts of data, then the 90ms communication cycle can be divided into 3 equal time periods, each time period is 30ms. Combined with the 3 slaves, the specific division of the communication cycle is as follows:

[0059] -0-10ms: Slave 1 sends the first part of data

[0060] -10-20ms: Slave 2 sends the first part of data

[0061] -20-30ms: Slave 3 sends the first part of data

[0062] -30-40ms: Slave 1 sends the second part of data

[0063] -40-50ms: Slave 2 sends the second part of data

[0064] -50-60ms: Slave 3 sends the second part of data

[0065] -60-70ms: Slave 1 sends the third part of data

[0066] -70-80ms: Slave 2 sends the third part of data

[0067] -80-90ms: Slave 3 sends the third part of data

[0068] Step S23: The host sends a control signal to each slave in turn in each time period. The control signal is a high-level pulse signal, which is sent through an independent control signal line. In this embodiment, the host is connected to the three slaves through three independent control signal lines.

[0069] Step S24: The slave detects the control signal. The slave detects the control signal through input / output interruption. When a rising edge is detected, an interrupt service routine is triggered.

[0070] Step S25: The slave responds to the control signal and sends data. After detecting the control signal, the slave prepares the corresponding part of the data according to the current time period and sends it through the RS485 interface.

[0071] like Figure 4 As shown, the timing control process of the method is as follows:

[0072] Time point ① indicates the beginning of a communication cycle T. In this embodiment, it is assumed that the complete parameters of each slave 2 need to be read three times. Time point ② indicates that the host 1 enables the first control signal line 4, controls the first slave 2, and obtains the first part of its state parameters. Time point ③ indicates that the host 1 enables the second control signal line 4, controls the second slave 2, and obtains the first part of its state parameters. Time point ④ indicates that the host 1 enables the third control signal line 4, controls the third slave 2, and obtains the first part of its state parameters.

[0073] Time points ⑤ to ⑦ indicate that the host 1 sequentially obtains the second part of the state parameters of the three slaves 2. Time points ⑧ to ⑩ indicate that the host 1 sequentially obtains the third part of the state parameters of the three slaves 2, at which time the parameters of the three slaves 2 have been completely obtained. The last time point ① in the figure indicates the starting point of a new communication cycle T, and the above process is repeated periodically.

[0074] This timing control method ensures that within a complete communication cycle, the host 1 can obtain the complete status parameters of all slaves 2 in an orderly manner, avoiding data conflicts and improving communication efficiency and data synchronization.

[0075] Embodiment 4

[0076] Reference Figure 5 , the present invention provides a periodic time-sharing communication system.

[0077] The system comprises a host 1, a plurality of slaves 2, a communication bus 3 and a plurality of control signal lines 4. The host 1 is connected to the plurality of slaves 2 via the communication bus 3, and each of the control signal lines 4 connects the host 1 with one slave 2 respectively.

[0078] The host 1 includes a processor 11, a memory 12, an input / output port 13 and an RS485 interface 14. The processor 11 can be a high-performance single-chip microcomputer or an industrial computer CPU, which is used to execute program instructions stored in the memory 12 to control the entire system. The input / output port 13 is used to connect the control signal line 4, and each port corresponds to a control signal line 4. The RS485 interface 14 is used to connect the communication bus 3.

[0079] The slave 2 includes an interrupt detection module 21, a data processing module 22 and an RS485 interface 23. The interrupt detection module 21 is connected to the corresponding control signal line 4 and is used to detect the control signal, which can be implemented using the external interrupt function of the single-chip microcomputer. The data processing module 22 is used to process and prepare the data to be sent, including functions such as data acquisition and format conversion. The RS485 interface 23 is used to connect to the communication bus 3 to realize data transmission.

[0080] In this embodiment, the number of the plurality of slaves 2 is preferably three, and the slaves 2 are connected in series to the communication bus 3. This connection method can improve the flexibility and scalability of the system.

[0081] Working principle:

[0082] 1. Initialization: After the host 1 and all slaves 2 are powered on, system initialization is performed, including configuration of the RS485 interfaces 14 and 23 , the input / output port 13 and the interrupt detection module 21 .

[0083] 2. Communication cycle design: The processor 11 of the host 1 defines a fixed communication cycle and divides it into multiple time periods.

[0084] 3. Control signal transmission: At the beginning of each time period, the processor 11 of the host 1 sends a high-level pulse control signal to the target slave 2 through the input / output port 13 and the corresponding control signal line 4.

[0085] 4. Slave response:

[0086] a) The interrupt detection module 21 of the slave 2 detects the rising edge of the control signal.

[0087] b) Trigger the interrupt service routine and determine the data portion to be sent based on the current time period.

[0088] c) The data processing module 22 prepares the data, including adding the slave address, function code and CRC check.

[0089] d) Send data to the communication bus 3 via the RS485 interface 23.

[0090] 5. Data reception: The host 1 receives data sent by the slave 2 through the RS485 interface 14 , the processor 11 performs CRC check, and stores valid data in the memory 12 .

[0091] 6. Cycle repetition: The host 1 repeats steps 3-5 until a complete communication cycle is completed.

[0092] 7. Parameter setting: When the parameters of the slave 2 need to be set, the processor 11 of the host 1 sends a control signal with a long duration through the input / output port 13. After the interrupt detection module 21 of the slave 2 detects the long pulse, it switches to the parameter setting mode and waits for the host 1 to send a setting command.

[0093] like Figure 6 As shown, an embodiment of the present application provides a communication device. The communication device includes a processor 24 and a memory 25. The memory 25 is used to store computer instructions; the processor 24 is used to run the computer instructions stored in the memory, so that the communication device can execute Figure 5 The operations performed by the device 1 in the illustrated embodiment.

[0094] The processor in the embodiment of the present application can be a computing unit of various types, including but not limited to a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) and other general or special processors. In addition, it may also include a programmable logic device, a transistor logic device and various hardware components. These processing units can be used alone or in any combination according to the needs to meet different computing needs.

[0095] The periodic time-sharing communication method and system of the present invention improve communication efficiency and system performance. By adopting the method of time-sharing control and independent control signal lines, the host can obtain the complete data of all slaves within a fixed communication cycle, thereby improving communication efficiency. The smaller communication cycle and precise time period division contribute to the real-time performance of the system, enabling it to respond in time and obtain the status of the slave. This design also improves data synchronization, completes the collection of all slave data within one communication cycle, ensures the time correlation of the data, and provides a basis for subsequent data analysis and processing. Through the design of time period division, the system can adapt to the data volume and importance of different slaves and achieve configuration optimization.

[0096] The present invention improves the overall performance and usability of the system in many aspects. Independent control signal lines and interrupt detection mechanisms reduce the possibility of communication conflicts, which is beneficial to the stability and reliability of the system. The use of standard MODBUS_RTU protocol and clear communication process helps to simplify software development and improve the maintainability of the system. By changing the control signal characteristics, the system realizes the switching of data acquisition and parameter setting modes, increasing functionality. The system supports parallel or series connection of multiple slaves, has scalability, and can increase or decrease the number of slaves according to demand. These characteristics make the present invention have application potential in the field of industrial communications.

[0097] The present invention has been described in detail through the above specific embodiments, but it should be understood that the above contents are only illustrative and not intended to limit the scope of the present invention. A person of ordinary skill in the art may make various modifications and variations to the present invention according to specific application scenarios and actual needs without departing from the spirit and scope of the present invention, and these modifications and variations are all within the scope of protection of the present invention.

Claims

1. A periodic time-sharing communication method, characterized in that: The following steps are involved: S1: The host defines a fixed communication cycle; S2: The host divides the fixed communication cycle into multiple time periods; S3: The host sends a control signal to each slave in turn in each time period; S4: The host receives the data fed back by the slave.

2. The method according to claim 1, characterized in that The control signal is a high level pulse signal.

3. The method according to claim 1, characterized in that The data received by the host in step S4 is obtained by the input / output interrupt function in response to the control signal.

4. The method according to claim 1, characterized in that: The data is transmitted using the MODBUS_RTU protocol.

5. A periodic time-sharing communication method, characterized in that: The following steps are involved: S11: The slave detects the external control signal; S12: The slave responds to the control signal; S13: The slave determines the current time period according to the control signal; S14: The slave generates corresponding data according to the current time period; S15: The slave sends the data.

6. The method according to claim 5, characterized in that The control signal is a high level pulse signal.

7. The method according to claim 5, characterized in that The slave detects the control signal through an input / output interrupt function.

8. The method according to claim 5, characterized in that The data is transmitted using the MODBUS_RTU protocol.

9. A periodic time-sharing communication method, characterized in that: The following steps are involved: S21: The host defines a fixed communication cycle; S22: The host divides the fixed communication cycle into multiple time periods; S23: the host sends a control signal to each slave in turn in each time period; S24: The slave device detects the control signal; S25: The slave responds to the control signal and sends data.

10. The method according to claim 9, characterized in that The control signal is a high level pulse signal.

11. The method according to claim 9, characterized in that The slave detects the control signal through an input / output interrupt function.

12. The method according to claim 9, characterized in that The data is transmitted using the MODBUS_RTU protocol.

13. A periodic time-sharing communication system, characterized in that: include: Host; Multiple slaves; A communication bus, the host and the plurality of slaves are connected to the communication bus; A plurality of control signal lines, one end of each of the control signal lines is connected to the host, and the other end is connected to one of the slaves; Each of the slaves includes an interrupt detection module, which is connected to a corresponding control signal line and is used to detect the control signal.

14. The system according to claim 13, characterized in that The control signal line is an independent input / output line.

15. The system according to claim 13, characterized in that The host includes a plurality of input / output ports, and each of the input / output ports is connected to a slave via one of the control signal lines.

16. The system according to claim 13, characterized in that The communication bus adopts the RS485 standard. The host and the plurality of slaves are connected to the communication bus via RS485 interfaces.

17. The system according to claim 13, characterized in that The multiple slaves are connected in parallel or in series on the communication bus.

18. A communication device, characterized in that: The device comprises a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory, so that the communication device executes the method according to any one of claims 9 to 12.

19. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 9 to 12 is implemented.

Citation Information

Cited By

  • Method and apparatus for level-signal-based data transmission using polling, and device

    WO2026199654A1