Internal bus communication method and device with hardware synchronization and related equipment
By adopting the internal bus communication method of hardware synchronization in the remote IO system, the coupler communicates with multiple remote IO modules and detects feedback. If there is no feedback, it will be disconnected, which solves the problem of low communication efficiency of remote IO modules and realizes the implementation of Hot plug and efficient control.
Patent Information
- Application Number
- CN202410965109.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing remote IO system, the data communication efficiency between remote IO modules is low, resulting in low control efficiency.
The internal bus communication method with hardware synchronization is adopted, and data is sent and feedback information is detected simultaneously with multiple remote IO modules through a coupler. If the target module has no feedback, it will be disconnected to achieve hot plugging effect.
It improves the control efficiency of remote IO modules, supports hot swapping of modules, avoids handshake communication only when hardware is powered on and reset in the prior art, and enhances communication speed and flexibility.
Smart Images

Figure CN119011322A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communications, and in particular to an internal bus communication method, apparatus and related equipment with hardware synchronization. Background Art
[0002] In the existing remote IO system, the data communication between the coupler and the remote IO module adopts a question-and-answer mode. The time for the coupler to fully interact with n remote IO modules' data = (coupler data preparation time + coupler data sending time + remote IO module data processing time + remote IO module data preparation time + remote IO module data sending time) * n. Each remote IO module must wait until the previous remote IO module completes the data interaction before it can receive the data sent by the coupler and start data processing and data preparation, which leads to the problem of low control efficiency of the remote IO module. Summary of the invention
[0003] The embodiment of the present application provides an internal bus communication method, device and related equipment with hardware synchronization to solve the problem of low image and audio matching efficiency in the prior art and improve the control efficiency of the remote IO module.
[0004] To solve the above problems, this application is implemented as follows: In a first aspect, an embodiment of the present application provides an internal bus communication method with hardware synchronization, the method comprising: Acquire multiple remote IO modules, wherein the multiple remote IO modules include multiple connection interfaces; Controlling the coupler to establish communication connection with the plurality of remote IO modules; The coupler simultaneously sends data information to the multiple remote IO modules, and detects feedback information sent by the multiple remote IO modules based on the data information; When the coupler fails to detect the feedback information of the target remote IO module, it is determined that the connection between the target remote IO module and the coupler is disconnected, and the target remote IO module is any one of the plurality of remote IO modules.
[0005] Optionally, the control coupler is communicatively connected with the plurality of remote IO modules, including: Determine a first connection interface, a second connection interface, a third connection interface, and a fourth connection interface included in each of the remote IO modules; Controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line; Wherein, the communication line is an RS485 communication line.
[0006] Optionally, after controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line, the method further includes: Control the coupler to be connected in series with the plurality of remote IO modules respectively through control lines; Among them, in the Nth remote IO module among the multiple remote IO modules, the second connection interface of the Nth remote IO module is connected to the third connection interface of the N-1th remote IO module, and the third connection interface of the Nth remote IO module is connected to the third connection interface of the N+1th remote IO module, and N is greater than 1.
[0007] Optionally, after controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line, the method further includes: The control coupler is communicatively connected to the fourth connection interfaces of the plurality of remote IO modules via a synchronization signal line.
[0008] Optionally, when the coupler fails to detect the feedback information of the target remote IO module, determining that the connection between the target remote IO module and the coupler is disconnected includes: In a first preset time period, when the coupler does not detect the feedback information of the target remote IO module, determining that the target remote IO module is in a state to be detected; Sending target data information a preset number of times to the target remote IO module; Within a second preset time period, if the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information, it is determined that the connection between the target remote IO module and the coupler is disconnected, and the length of the second preset time period is greater than the first preset time period.
[0009] Optionally, in the case where the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information within the second preset time period, after determining that the connection between the target remote IO module and the coupler is disconnected, the method further includes: The coupler receives the handshake data or response information sent by the target remote IO module through the RS485 bus, and determines that the remote IO module resumes the communication connection with the coupler.
[0010] In a second aspect, an embodiment of the present application further provides an internal bus communication device with hardware synchronization, comprising: An acquisition module, used for acquiring a plurality of remote IO modules, wherein the plurality of remote IO modules include a plurality of connection interfaces; A control module, used for controlling the coupler to communicate with the plurality of remote IO modules; A detection module, used for the coupler to send data information to the multiple remote IO modules at the same time, and detect feedback information sent by the multiple remote IO modules based on the data information; A determination module is used to determine that the connection between the target remote IO module and the coupler is disconnected when the coupler fails to detect the feedback information of the target remote IO module, and the target remote IO module is any one of the multiple remote IO modules.
[0011] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor; the processor is used to read the program in the memory to implement the steps of the method described in the first aspect above.
[0012] In a fourth aspect, an embodiment of the present application further provides a readable storage medium for storing a program, which, when executed by a processor, implements the steps in the method described in the first aspect above.
[0013] In a fifth aspect, an embodiment of the present application further provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps in the method described in the first aspect.
[0014] The present application provides an internal bus communication method, device and related equipment with hardware synchronization, the method comprising: obtaining multiple remote IO modules, wherein the multiple remote IO modules include multiple connection interfaces; controlling a coupler to communicate with the multiple remote IO modules; the coupler simultaneously sends data information to the multiple remote IO modules, and detects feedback information sent by the multiple remote IO modules based on the data information; when the coupler does not detect the feedback information of the target remote IO module, it is determined that the connection between the target remote IO module and the coupler is in a disconnected state, and the target remote IO module is any one of the multiple remote IO modules. The present application simultaneously communicates with multiple remote IO modules through a coupler, and when the target remote IO module does not send feedback information based on the data information, it is determined that the target remote IO module is disconnected, thereby achieving the hot-swap effect of the remote IO module and improving the control efficiency of the remote IO module. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 It is a flowchart of an internal bus communication method with hardware synchronization provided by an embodiment of the present application; Figure 2 It is a module schematic diagram of the IO system provided in an embodiment of the present application; Figure 3 This is a diagram of the internal bus interface of the remote IO module provided in an embodiment of the present application; Figure 4 is a diagram of the internal bus interface of the coupler provided in an embodiment of the present application; Figure 5 It is a structural diagram of the IO system provided in an embodiment of the present application; Figure 6 It is a structural diagram of an internal bus communication device with hardware synchronization provided by the present application; Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0018] The terms "first", "second" etc. in the embodiments of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. In addition, the terms "include" and "have" and any variation thereof are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. In addition, "and / or" is used in the present application to represent at least one of connected objects, such as A and / or B and / or C, representing the inclusion of separate A, separate B, separate C, and A and B all exist, B and C all exist, A and C all exist, and 7 situations that A, B and C all exist.
[0019] See also Figure 1 , Figure 1 1 is a flow chart of internal bus communication with hardware synchronization provided by an embodiment of the present application. Figure 1 As shown, the internal bus communication method with hardware synchronization may include the following steps: Step 101: Acquire multiple remote IO modules, wherein the multiple remote IO modules include multiple connection interfaces.
[0020] In this embodiment, the internal bus communication method with hardware synchronization provided in this embodiment can be applied to a remote IO system, wherein the remote IO system is composed of a coupler and a plurality of remote IO modules. The coupler communicates data with the configuration software through a field real-time bus based on Ethernet, and communicates data with the remote IO modules through an internal bus. A typical remote IO system is as follows: Figure 2 As shown, a remote IO system must have only one coupler, while remote IO modules can be multiple and various random combinations.
[0021] It should be noted that the remote IO modules can be divided into switch input and output, relay output, pulse output, pulse input, current and voltage input, current and voltage output and RTD input according to their functions. These modules have different data structures and communicate with the coupler through multiple connection interfaces.
[0022] Step 102: Control the coupler to establish communication connection with the plurality of remote IO modules.
[0023] In this embodiment, if Figure 3 and Figure 4 As shown, Figure 3 This is the internal bus interface diagram of the remote IO module. Figure 4 This is the internal bus interface diagram of the coupler. Specifically, the remote IO module interface includes: control line IN, control line OUT, 485 bus, SYNC line; the coupler interface includes: control line OUT, 485 bus, SYNCOUT line. The connection relationship between each interface is: the control line OUT of the coupler is connected to the control line input of the first card, and the control line OUT of the first card is connected to the control line IN of the second card; the 485 bus of the coupler and the 485 bus of the IO module are connected in parallel, and the SYNCOUYT line of the coupler is connected in parallel to the SYNC lines of all remote IO modules.
[0024] Step 103: The coupler sends data information to the multiple remote IO modules simultaneously, and detects feedback information sent by the multiple remote IO modules based on the data information.
[0025] In this embodiment, multiple remote IO modules may be offline. Therefore, when sending data information to multiple remote IO modules, it is necessary to receive feedback information sent by multiple remote IOs based on the data information, wherein the feedback information can be feedback information or detected changes in current or voltage, which is not specifically limited in this embodiment.
[0026] Step 104: when the coupler fails to detect the feedback information of the target remote IO module, determine that the connection between the target remote IO module and the coupler is disconnected, and the target remote IO module is any one of the multiple remote IO modules.
[0027] In this embodiment, when the target remote IO module does not send feedback information, it is determined that the target remote IO module has been disconnected from the coupler, and the coupler will not send data information to the target remote IO module when sending data information to other multiple remote IO modules. After the target remote IO module restores the connection with the coupler, when the coupler detects that the target remote IO module is connected, it will continue to send data information to the target remote IO module when sending data information to other multiple remote IO modules, thereby achieving the effect of hot-swapping all remote IO modules.
[0028] It should be noted that in the prior art, the handshake communication in the existing remote IO system is only run once when all the hardware in the entire system is powered on and reset, so the hot-swappable effect of the remote IO module cannot be achieved. The operation mechanism is explained. Specifically, after the remote IO system is assembled and connected, it is powered on, and all remote IO modules enter the internal bus to be initialized state and are set to RS485 receiving mode; the coupler is set to RS485 receiving mode, and the control line Out changes from a low level to a high level to output a rising edge; after module No. 1 detects the rising edge through the Control In pin, it sends its own module type information through the RS485 bus, and other modules will not send any data here. After receiving the module type information, the coupler allocates memory for the module of this type to establish a data structure, and sends it to the address allocated to module No. 1 through the RS485 bus. After receiving its own address, module No. 1 writes the received address into the serial port register, and the serial port starts the silent mode and is set to address match wake-up, and then the control line Out outputs a rising edge. After module No. 2 detects the rising edge through the rising edge interrupt, it sends its own module type information through the RS485 bus. Other modules here will not send any data. After receiving the module type information, the coupler allocates memory for this type of module to establish a data structure, and sends it to the address allocated to module No. 2 through the RS485 bus. Steps 2 and 3 are repeated in this way to traverse all remote IO modules. When the last module is set, a timeout can be defined in the coupler program to determine whether all remote IO modules have been traversed.
[0029] RS485 is a master-multiple slave bus. Because the remote IO module assigned an address has written its address into the serial port register and the serial port mode is set to silent mode and the wake-up method is address matching, the remote IO module will only be awakened to receive the data after the address when it receives the address matching its own address. If it receives an address that does not match its own address, the remote IO module's serial port will continue to remain in silent mode. After all the remote IO module addresses are set, the coupler first pulls down the Control Out control line and then forms a whole data frame according to the first remote IO module address + the first remote IO module data + the second remote IO module address + the second remote IO module data... to the last remote IO module address + the last remote IO module data through the RS485 bus. When all the data are sent, the coupler pulls up the Control Out control line; After receiving an address that matches its own address, the first remote IO module wakes up the serial port to receive subsequent data and process the data. When it encounters the address of the second remote IO module, it re-enters silent mode and pulls down its Control Out line. After receiving the rising edge signal, its Control In line returns the prepared data to the coupler. After the data is successfully returned to the coupler, its Control Out line is pulled high. If a Control In rising edge signal is received without receiving data, no data response is made and the rising edge signal is forwarded through Control Out. Similarly, subsequent remote IO modules receive data from the coupler and respond to the coupler according to the first remote IO module. In this way, the coupler can complete data interaction with all remote IO modules, and the subsequent IO modules can start data reception processing when the current remote IO module is preparing to receive data response, which increases time overlap and improves the communication rate.
[0030] The state described in step 1 is entered only when all hardware in the entire system is powered on and reset, resulting in the inability to support hot plugging. The improved communication mechanism can realize hot plugging of remote IO modules. The following describes the implementation method by taking the replacement of module type of module No. 3 as an example. When module No. 3 needs to be replaced and unplugged, all subsequent modules will also be disconnected. This is determined by the connection structure of the remote IO module. Compared with the prior art, this application provides hot plugging technology for remote IO modules, which effectively improves the control efficiency of remote IO modules.
[0031] The present application provides an internal bus communication method with hardware synchronization, the method comprising: obtaining multiple remote IO modules, wherein the multiple remote IO modules include multiple connection interfaces; controlling a coupler to communicate with the multiple remote IO modules; the coupler simultaneously sends data information to the multiple remote IO modules, and detects feedback information sent by the multiple remote IO modules based on the data information; when the coupler does not detect the feedback information of the target remote IO module, it is determined that the connection between the target remote IO module and the coupler is in a disconnected state, and the target remote IO module is any one of the multiple remote IO modules. The present application simultaneously communicates with multiple remote IO modules through a coupler, and when the target remote IO module does not send feedback information based on the data information, it is determined that the target remote IO module is disconnected, thereby achieving the hot-swappable effect of the remote IO module and improving the control efficiency of the remote IO module.
[0032] In some feasible implementations, optionally, the control coupler is communicatively connected with the plurality of remote IO modules, including: Determine a first connection interface, a second connection interface, a third connection interface, and a fourth connection interface included in each of the remote IO modules; Controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line; Wherein, the communication line is an RS485 communication line.
[0033] In this embodiment, if Figure 5 As shown, Figure 5 This is a connection diagram of the IO system. The remote IO module includes a first connection interface, a second connection interface, a third connection interface and a fourth connection interface, which correspond to the synchronization line SYNC, SYNCOUT, the control line OUT and the 485 bus respectively.
[0034] Specifically, all remote IO modules are mounted on the RS485 communication line, and all remote IO modules are connected to the RS485 communication line through the RS485 bus interface.
[0035] Optionally, after controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line, the method further includes: Control the coupler to be connected in series with the plurality of remote IO modules respectively through control lines; Among them, in the Nth remote IO module among the multiple remote IO modules, the second connection interface of the Nth remote IO module is connected to the third connection interface of the N-1th remote IO module, and the third connection interface of the Nth remote IO module is connected to the third connection interface of the N+1th remote IO module, and N is greater than 1.
[0036] In this embodiment, for the coupler, the control line is the output connected to an IO pin of the coupler CPU, and for the remote IO module, one control line is the input connected to an IO pin of the remote IO module CPU, and the other control line is the output connected to the remote IO pin, that is, the previous remote IO module is connected to the next remote IO module through the control line, and all the remote IO modules are connected in sequence.
[0037] Optionally, after controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line, the method further includes: The control coupler is communicatively connected to the fourth connection interfaces of the plurality of remote IO modules via a synchronization signal line.
[0038] In this embodiment, the synchronization signal line is connected in parallel to all remote IO modules. For the coupler, the synchronization signal line is the output connected to an IO pin of the coupler CPU. For the remote IO module, the synchronization signal line is connected to the input of an IO pin of the remote IO module CPU.
[0039] The control line Out of the coupler is connected to the control line In of module No. 1, the control line Out of module No. 1 is connected to the control line In of module No. 2, and so on. Finally, the control line Out of module No. n is left floating without connection.
[0040] It should be noted that no matter how many remote IO modules a coupler supports at most in a remote IO system, this number is always fixed in an actual field application. It is known that it may be 16, 32, or other numbers, and is not specifically limited in this embodiment.
[0041] Optionally, when the coupler fails to detect the feedback information of the target remote IO module, determining that the connection between the target remote IO module and the coupler is disconnected includes: In a first preset time period, when the coupler does not detect the feedback information of the target remote IO module, determining that the target remote IO module is in a state to be detected; Sending target data information a preset number of times to the target remote IO module; Within a second preset time period, if the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information, it is determined that the connection between the target remote IO module and the coupler is disconnected, and the length of the second preset time period is greater than the first preset time period.
[0042] In this embodiment, when the target remote IO module is unplugged, the data interaction of the coupler with the target remote IO module will time out, i.e., the module response timeout. Specifically, when the coupler continuously identifies the module response timeout for a specified number of times, it determines that the module is in a possible offline state. When the module is determined to be in a possible offline state, the data frame sent by the coupler to the module still carries the addresses and data of all modules. After waiting for the module response timeout to occur, the coupler performs point-to-point communication with the module in the possible offline state. Point-to-point communication means that the coupler sends a data frame with only the address and data of the module, and requires the module to respond immediately after receiving the data frame without waiting for the rising edge of Control In. A response timeout is set, i.e., the first preset time period. If the module point-to-point response times out, then point-to-point communication is performed with the next module in the possible offline state.
[0043] Within the first preset time period, if the coupler continuously identifies that the point-to-point communication response of a module that may be offline has timed out for a specified number of times, then it is determined that the module is completely offline. When the module is completely offline, the data frame sent by the coupler still carries the addresses and data of all modules, and no point-to-point communication is performed on the module that is completely offline after a module response timeout occurs.
[0044] Exemplarily, the target remote IO module is explained by taking module No. 3 as an example. When module No. 3 is unplugged, modules No. 3 to No. n have continuous response timeouts and are in a possible offline state, and then continuous point-to-point communication response timeouts occur and they are completely offline.
[0045] After modules 3 to n are completely offline, the coupler sends out the data frame with the addresses and data of all modules. Modules 1 and 2 take their own data respectively and pull down their respective Control Out pins. Then their respective Control In pins wait for the rising edge signal. After receiving the rising edge signal, the Control In pin of module 1 responds to the coupler through RS485. After the response is completed, the Control Out pin sends a rising edge signal. After receiving the rising edge signal, the Control In pin of module 2 responds to the coupler through RS485. After the response is completed, the Control Out pin sends a rising edge signal. Because modules 3 to n are completely offline, there will be no data transmission on the RS485 bus after the Control Out pin of module 2 sends a rising edge signal. The coupler starts the next round of data interaction after waiting for the response times out.
[0046] Optionally, in the case where the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information within the second preset time period, after determining that the connection between the target remote IO module and the coupler is disconnected, the method further includes: The coupler receives the handshake data or response information sent by the target remote IO module through the RS485 bus, and determines that the remote IO module resumes the communication connection with the coupler.
[0047] In this embodiment, when the target remote IO module is reinserted, the coupler will determine that the target remote IO module has restored the communication connection with the coupler based on the information of the rising edge signal appearing on the pin of the remote IO module. Specifically, when the replaced module No. 3 is reinserted, after module No. 2 responds to the data of the coupler, the Control Out pin of module No. 2 outputs a rising edge signal. After the Control In pin of module No. 3 receives the rising edge signal, module No. 3 begins to repeat the above operation. After receiving the address reassigned by the coupler, the Control Out pin of module No. 3 outputs a rising edge signal. The subsequent modules to n modules repeat the above operation in sequence. Then the coupler can interact with all cards for data to restore the operation of the entire system, thereby realizing the hot-swap function.
[0048] It should be noted that it also includes synchronous mode and asynchronous mode. Specifically, it is explained with n digital output modules. Specifically, in the asynchronous mode, during the data interaction between the coupler and the remote IO module, the coupler sends the output control of the digital output channels of the n digital output modules to the n remote IO modules. After receiving the data sent by the coupler, the first remote IO module immediately controls the digital output channel to output. Similarly, the subsequent remote IO modules immediately perform output control after receiving their own data. In synchronous mode, during the data interaction between the coupler and the remote IO module, the coupler sends the output control of the digital output channels of n digital output modules to n remote IO modules. After receiving the data sent by the coupler, the first remote IO module is in the output ready state and does not immediately control the digital output channel for output control. Similarly, the subsequent remote IO modules are in the output ready state after receiving their own data. When the n digital output modules are in the output ready state, the coupler controls the Sync signal line to output a rising edge signal. Because the Sync signal line of the coupler and the Sync lines of each remote IO module are connected in parallel, when the coupler controls the Sync signal line to output a rising edge, the Sync signal lines of the n digital output modules receive the rising edge signal at the same time, and then control the digital output channels to perform output operations at the same time.
[0049] The present application simultaneously communicates with multiple remote IO modules through a coupler, and when the target remote IO module does not send feedback information based on data information, it is determined that the target remote IO module is disconnected, thereby achieving a hot-swap effect of the remote IO module and improving the control efficiency of the remote IO module.
[0050] See also Figure 6 , Figure 6 1 is a structural diagram of an internal bus communication device with hardware synchronization provided by an embodiment of the present application. Figure 6As shown, the internal bus communication device 600 with hardware synchronization includes: An acquisition module 610 is used to acquire a plurality of remote IO modules, wherein the plurality of remote IO modules include a plurality of connection interfaces; A control module 620, used for controlling the coupler to communicate with the plurality of remote IO modules; A detection module 630, configured for the coupler to simultaneously send data information to the multiple remote IO modules, and to detect feedback information sent by the multiple remote IO modules based on the data information; The determination module 640 is used to determine that the connection between the target remote IO module and the coupler is disconnected when the coupler fails to detect the feedback information of the target remote IO module, and the target remote IO module is any one of the multiple remote IO modules.
[0051] Optionally, the control module 620 includes: A first determining submodule, used to determine a first connection interface, a second connection interface, a third connection interface and a fourth connection interface included in each of the remote IO modules; A first control submodule, used for controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line; Wherein, the communication line is an RS485 communication line.
[0052] Optionally, also include: A second control submodule, used for controlling the coupler to be connected in series with the plurality of remote IO modules through control lines; Among them, in the Nth remote IO module among the multiple remote IO modules, the second connection interface of the Nth remote IO module is connected to the third connection interface of the N-1th remote IO module, and the third connection interface of the Nth remote IO module is connected to the third connection interface of the N+1th remote IO module, and N is greater than 1.
[0053] Optionally, also include: The third control submodule is used to control the coupler to communicate with the fourth connection interface of the plurality of remote IO modules through a synchronization signal line.
[0054] Optionally, the determination module 640 includes: A second determination submodule is used to determine that the target remote IO module is in a state to be detected when the coupler does not detect the feedback information of the target remote IO module within a first preset time period; A sending submodule, used for sending target data information a preset number of times to the target remote IO module; The third determination submodule is used to determine that the connection between the target remote IO module and the coupler is in a disconnected state when the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information within a second preset time period, and the length of the second preset time period is greater than the first preset time period.
[0055] Optionally, also include: The fourth determining submodule is used for the coupler to receive the handshake data or response information sent by the target remote IO module through the RS485 bus, and determine that the remote IO module restores the communication connection with the coupler.
[0056] The present application simultaneously communicates with multiple remote IO modules through a coupler, and when the target remote IO module does not send feedback information based on data information, it is determined that the target remote IO module is disconnected, thereby achieving a hot-swap effect of the remote IO module and improving the control efficiency of the remote IO module.
[0057] The present application also provides an electronic device. Figure 7 , the electronic device may include a processor 701, a memory 702, and a program 7021 stored in the memory 702 and executable on the processor 701.
[0058] When program 7021 is executed by processor 701, it can achieve Figure 1 Any step in the corresponding method embodiment: Acquire multiple remote IO modules, wherein the multiple remote IO modules include multiple connection interfaces; Controlling the coupler to establish communication connection with the plurality of remote IO modules; The coupler simultaneously sends data information to the multiple remote IO modules, and detects feedback information sent by the multiple remote IO modules based on the data information; When the coupler fails to detect the feedback information of the target remote IO module, it is determined that the connection between the target remote IO module and the coupler is disconnected, and the target remote IO module is any one of the plurality of remote IO modules.
[0059] Optionally, the control coupler is communicatively connected with the plurality of remote IO modules, including: Determine a first connection interface, a second connection interface, a third connection interface, and a fourth connection interface included in each of the remote IO modules; Controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line; Wherein, the communication line is an RS485 communication line.
[0060] Optionally, after controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line, the method further includes: Control the coupler to be connected in series with the plurality of remote IO modules respectively through control lines; Among them, in the Nth remote IO module among the multiple remote IO modules, the second connection interface of the Nth remote IO module is connected to the third connection interface of the N-1th remote IO module, and the third connection interface of the Nth remote IO module is connected to the third connection interface of the N+1th remote IO module, and N is greater than 1.
[0061] Optionally, after controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line, the method further includes: The control coupler is communicatively connected to the fourth connection interfaces of the plurality of remote IO modules via a synchronization signal line.
[0062] Optionally, when the coupler fails to detect the feedback information of the target remote IO module, determining that the connection between the target remote IO module and the coupler is disconnected includes: In a first preset time period, when the coupler does not detect the feedback information of the target remote IO module, determining that the target remote IO module is in a state to be detected; Sending target data information a preset number of times to the target remote IO module; Within a second preset time period, if the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information, it is determined that the connection between the target remote IO module and the coupler is disconnected, and the length of the second preset time period is greater than the first preset time period.
[0063] Optionally, in the case where the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information within the second preset time period, after determining that the connection between the target remote IO module and the coupler is disconnected, the method further includes: The coupler receives the handshake data or response information sent by the target remote IO module through the RS485 bus, and determines that the remote IO module resumes the communication connection with the coupler.
[0064] The present application simultaneously communicates with multiple remote IO modules through a coupler, and when the target remote IO module does not send feedback information based on data information, it is determined that the target remote IO module is disconnected, thereby achieving a hot-swap effect of the remote IO module and improving the control efficiency of the remote IO module.
[0065] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned internal bus communication method embodiment with hardware synchronization is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0066] An embodiment of the present application further provides a computer program product, which is stored in a storage medium. The computer program product is executed by at least one processor to implement the various processes of the above-mentioned internal bus communication method embodiment with hardware synchronization, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0067] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0068] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0069] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An internal bus communication method with hardware synchronization, It is characterized in that The method comprises: Acquire multiple remote IO modules, wherein the multiple remote IO modules include multiple connection interfaces; Controlling the coupler to establish communication connection with the plurality of remote IO modules; The coupler simultaneously sends data information to the multiple remote IO modules, and detects feedback information sent by the multiple remote IO modules based on the data information; When the coupler fails to detect the feedback information of the target remote IO module, it is determined that the connection between the target remote IO module and the coupler is disconnected, and the target remote IO module is any one of the plurality of remote IO modules.
2. The method according to claim 1, It is characterized in that The control coupler is communicatively connected with the plurality of remote IO modules, including: Determine a first connection interface, a second connection interface, a third connection interface, and a fourth connection interface included in each of the remote IO modules; Controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line; Wherein, the communication line is an RS485 communication line.
3. The method according to claim 2, It is characterized in that After controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line, the method further includes: Control the coupler to be connected in series with the plurality of remote IO modules respectively through control lines; Among them, in the Nth remote IO module among the multiple remote IO modules, the second connection interface of the Nth remote IO module is connected to the third connection interface of the N-1th remote IO module, and the third connection interface of the Nth remote IO module is connected to the third connection interface of the N+1th remote IO module, and N is greater than 1.
4. The method according to claim 2, It is characterized in that After controlling the coupler to communicate with the first connection interfaces of the plurality of remote IO modules through a communication line, the method further includes: The control coupler is communicatively connected to the fourth connection interfaces of the plurality of remote IO modules via a synchronization signal line.
5. The method according to claim 1, It is characterized in that When the coupler fails to detect the feedback information of the target remote IO module, determining that the connection between the target remote IO module and the coupler is in a disconnected state includes: In a first preset time period, when the coupler does not detect the feedback information of the target remote IO module, determining that the target remote IO module is in a state to be detected; Sending target data information a preset number of times to the target remote IO module; Within a second preset time period, if the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information, it is determined that the connection between the target remote IO module and the coupler is disconnected, and the length of the second preset time period is greater than the first preset time period.
6. The method according to claim 5, It is characterized in that In the case where the coupler does not detect the target feedback information sent by the target remote IO module based on the target data information within the second preset time period, after determining that the connection between the target remote IO module and the coupler is disconnected, the method further includes: The coupler receives the handshake data or response information sent by the target remote IO module through the RS485 bus, and determines that the remote IO module resumes the communication connection with the coupler.
7. An internal bus communication device with hardware synchronization, It is characterized in that The device comprises: An acquisition module, used for acquiring a plurality of remote IO modules, wherein the plurality of remote IO modules include a plurality of connection interfaces; A control module, used for controlling the coupler to communicate with the plurality of remote IO modules; A detection module, used for the coupler to send data information to the multiple remote IO modules at the same time, and detect feedback information sent by the multiple remote IO modules based on the data information; A determination module is used to determine that the connection between the target remote IO module and the coupler is disconnected when the coupler fails to detect the feedback information of the target remote IO module, and the target remote IO module is any one of the multiple remote IO modules.
8. An electronic device, include: A memory, a processor, and a program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the internal bus communication method with hardware synchronization as described in any one of claims 1 to 6.
9. A readable storage medium for storing a program, It is characterized in that When the program is executed by a processor, the steps of the internal bus communication method with hardware synchronization according to any one of claims 1 to 6 are implemented.
10. A computer program product, It is characterized in that The computer program product is stored in a storage medium, and the computer program product is executed by at least one processor to implement the steps of the internal bus communication method with hardware synchronization according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent household electrical appliance network configuration method, storage medium, network configuration terminal and intelligent household electrical appliance
CN112383437A
Online state detection method and device of equipment
CN115801645A
Remote IO module control system and method based on RS485 communication
CN117194302A
Alarm method and device based on intelligent key and computer equipment
CN118334821A
Distributed control system within apparatus
JP2003345422A
Cited By
Pluggable EtherCAT device and bus expansion system
CN119676024A
IO module hot plugging method, device and equipment based on FPGA and storage medium
CN121326814A
FPGA-based IO module hot plug method, device and equipment and storage medium
CN121326814B
