Redundant communication control method and system, electronic equipment and storage medium
By determining the execution method of the switching command in the control center of the redundant communication system, the problem of excessive switching frequency in the redundant communication system is solved, communication jitter is improved, and user experience is improved.
Patent Information
- Application Number
- CN202411395072.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-02-28
AI Technical Summary
In a communication system using a redundant solution, the switching frequency between the control centers is too high, resulting in serious communication jitter and affecting the user experience.
By implementing a redundant communication control method in the control center, the execution method of the handover instruction is determined based on the default device type of the control center, the communication status with the slave station, and the target device type, thereby reducing the unreasonable handover frequency.
It effectively reduces the number of times the unreasonable switching of the control center working mode in the redundant communication system, improves the communication jitter of the system, and improves the user experience.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a redundant communication control method, system, electronic device and storage medium. Background Art
[0002] In order to ensure the stability of data transmission, current communication systems often use redundant solutions, that is, more than one control center is set up upstream, and only one control center is used as the actual master station at the same time to communicate with the downstream slave stations, and the remaining control centers are on standby as actual backup stations. When switching is required, a backup station is selected to replace the original actual master station as the new actual master station.
[0003] However, switching between the actual master station and the actual standby station will affect the ongoing communication in the communication system. When the communication conditions in the system are poor, for example, due to signal interference, the communication between the control center and the downstream slave stations is repeatedly interrupted for a short period of time, the actual master station is repeatedly considered offline, and several control centers frequently switch working modes and take turns to serve as the actual master station. This situation, combined with the signal interference, will cause large-scale communication jitter, affecting the user experience. Summary of the invention
[0004] In view of this, the present invention is committed to providing a redundant communication control method, system, electronic device and storage medium, so as to reduce the frequency of switching the actual device type of the control center in a communication system using a redundant scheme and improve the communication jitter of the system.
[0005] In a first aspect, an embodiment of the present application provides a redundant communication control method, which is applied to any one of a plurality of control centers in a redundant communication system, wherein the control center is an actual master station or an actual standby station of the redundant communication system, and the communication system further includes a slave station controlled by the control center, the method comprising:
[0006] In response to a switching instruction carrying a target device type, determining an execution mode of the switching instruction according to a default device type of the control center, a communication state between the control center and the slave station, and the target device type;
[0007] The target device type is used to characterize the working mode that the control center needs to switch to, and the target device type includes an actual master station and an actual standby station. The default device type is a fixed attribute of the control center, and the default device type includes a default master station and a default standby station.
[0008] The switching instruction is executed according to the execution mode of the switching instruction.
[0009] Optionally, determining the execution mode of the switching instruction according to the default device type of the control center, the communication state between the control center and the slave station, and the target device type includes:
[0010] When the default device type is a default master station or a default standby station, the communication state is communication offline, and the target device type is an actual standby station, determining that the execution mode is normal execution;
[0011] or,
[0012] When the default device type is a default master station or a default standby station, the communication state is online communication, and the target device type is an actual master station, it is determined that the execution mode is normal execution.
[0013] Optionally, determining the execution mode of the switching instruction according to the default device type of the control center, the communication state between the control center and the slave station, and the target device type includes:
[0014] When the default device type is a default master station, the communication state is online communication, and the target device type is an actual standby station, the execution mode is determined to be abandonment execution.
[0015] Optionally, determining the execution mode of the switching instruction according to the default device type of the control center, the communication state between the control center and the slave station, and the target device type includes:
[0016] When the default device type is a default standby station, the communication state is online communication, and the target device type is an actual standby station, determining that the execution mode is normal execution;
[0017] or,
[0018] When the default device type is the default standby station, the communication status is online communication and the target device type is the actual standby station, a supplementary judgment is performed, and the supplementary judgment is used to reconfirm whether the switching instruction needs to be executed, and the execution method of the switching instruction is determined according to the result of the supplementary judgment.
[0019] Optionally, the performing of the supplementary judgment, the supplementary judgment being used to reconfirm whether the switching instruction needs to be executed, and determining the execution mode of the switching instruction according to the result of the supplementary judgment, includes:
[0020] Searching for a second control center in the redundant communication system that has received a switching instruction with a target device type of an actual master station; obtaining a communication status between the second control center and the slave station; when the communication status between the second control center and the slave station is online, determining that the execution mode is normal execution, or, when the communication status between the second control center and the slave station is offline, determining that the execution mode is abandonment execution;
[0021] or,
[0022] Sending a secondary confirmation message to a sending source of the switching instruction, and upon receiving a confirmation switching instruction sent by the sending source according to the secondary confirmation message, determining that the execution mode is normal execution;
[0023] or,
[0024] Enter a waiting state with a duration of a preset first waiting time; when in the waiting state, when a switching instruction with the same content as the switching instruction is received again, determine that the execution mode is normal execution, or, when the waiting state ends and no switching instruction with the same content as the switching instruction is received again, determine that the execution mode is to abandon execution.
[0025] Optionally, determining the execution mode of the switching instruction according to the default device type of the control center, the communication state between the control center and the slave station, and the target device type includes:
[0026] When the default device type is a default master station or a default standby station, the communication state is communication offline, and the target device type is an actual master station, a switching record is obtained; the switching record includes an operation record of the control center performing an operation of switching the working mode within a preset recording time;
[0027] When the switching record is empty, the execution mode is determined to be normal execution; or, when the switching record is not empty, a waiting state is entered with a preset second waiting time; when in the waiting state, when a switching instruction with the same content as the switching instruction is received again, the execution mode is determined to be normal execution, or, when the waiting state ends and no switching instruction with the same content as the switching instruction is received again, the execution mode is determined to be abandoned execution.
[0028] Optionally, the duration of the preset second waiting time is not less than the duration of a maximum time of a polling connection;
[0029] The maximum time of a polling connection is the sum of the time required to determine the interruption of the normal communication link and the time required to poll all downstream slave stations;
[0030] The duration of polling all downstream slave stations is the product of the first variable and the maximum duration required for the control center to establish a communication connection with the downstream slave stations;
[0031] The first variable is the product of the total number of communication addresses of the slave stations and the preset maximum number of reconnection times minus one.
[0032] In a second aspect, an embodiment of the present application provides a serial bus redundant communication system, including:
[0033] A plurality of control centers and slave stations controlled by the control centers, wherein the control center includes an actual master station and at least one actual standby station;
[0034] The control center is used to respond to a switching instruction carrying a target device type, and determine the execution mode of the switching instruction according to the default device type of the control center, the communication status between the control center and the slave station, and the target device type; the target device type is used to characterize the working mode that the control center needs to switch to, the target device type includes an actual master station and an actual standby station, the default device type is a fixed attribute of the control center, and the default device type includes a default master station and a default standby station; the switching instruction is executed according to the execution mode of the switching instruction.
[0035] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor;
[0036] The memory is connected to the processor and is used to store programs;
[0037] The electronic device implements the redundant communication control method as described in the first aspect by running the program in the memory through the processor.
[0038] In a fourth aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the redundant communication control method as described in the first aspect is implemented.
[0039] The present application provides a redundant communication control method. When a switching instruction is received, a judgment is made based on the default device type, communication status, and target device type to determine the rationality of the switching instruction, execute reasonable switching instructions normally, and abandon the execution of unreasonable switching instructions. The method in the present application can effectively reduce the number of unreasonable switching of the control center working mode in the redundant communication system and improve the communication jitter of the system. In addition, the method in the present application is an autonomous algorithm with simple implementation logic. There is no need to add a physical communication link to the control center, which is easy to transplant and has good multi-platform applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0041] Figure 1 A schematic diagram of the structure of a redundant communication system provided in an embodiment of the present application.
[0042] Figure 2 A flowchart of a redundant communication control method provided in an embodiment of the present application.
[0043] Figure 3 A schematic diagram of the logical structure of a redundant communication system provided in an embodiment of the present application.
[0044] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] 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 only 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.
[0046] This application is applied to redundant communication systems, such as Figure 1 As shown, it is a redundant communication system with two control centers and multiple downstream devices (also known as downstream slave stations). The actual master station is named FEP-A, the actual standby station is named FEP-B, the actual master station and the actual standby station are connected to the downstream slave stations, communicate with the downstream slave stations and control the operation of the downstream slave stations. The present application can be applied to redundant communication systems with various communication modes, such as redundant communication systems based on Ethernet or serial bus for communication.
[0047] The control center in the redundant communication system has two attributes: default device type and working mode. The default device type is a static attribute of the control center, including two types: default master station and default standby station. The default device type is a fixed attribute of each control center. Unless under special circumstances, the default device type will not change from the start of each control center. The working mode is a dynamic attribute of the control center, including two working modes: actual master station and actual standby station. The working mode of each control center is related to the work content of the control center. Under normal circumstances, the actual master station is the control center that is responsible for the redundant communication system, and the actual standby station is in standby state, waiting to switch to the control center of the actual master station. Therefore, the switching of the working mode of the control center is accompanied by changes in the work content of the control center.
[0048] In addition, the control center will only analyze the received meaningful switching instructions in principle. Meaningless switching instructions, such as the instructions to switch from the actual standby station to the actual standby station or from the actual master station to the actual master station, will not be analyzed, processed or executed.
[0049] The first embodiment of the present application provides a redundant communication control method, which is applied to any one of a plurality of control centers in a redundant communication system, wherein the control center is the actual master station or the actual backup station of the redundant communication system, and the communication system also includes slave stations controlled by the control center. Figure 2 As shown, the method may include the following steps:
[0050] Step 201, in response to a switching instruction carrying a target device type, determining the execution method of the switching instruction according to the default device type of the control center, the communication status between the control center and the slave station, and the target device type; the target device type is used to characterize the working mode that the control center needs to switch to, the target device type includes the actual master station and the actual standby station, the default device type is a fixed attribute of the control center, and the default device type includes the default master station and the default standby station.
[0051] The method in this embodiment is specifically applied to a control center in a redundant communication system. Specifically, no matter the control center is an actual master station or an actual standby station, the method in this embodiment can be used.
[0052] It should be understood that the more formal description is "the working mode of the control center A is the actual master station mode / actual standby station mode". For the purpose of simplifying the description, the description of "control center A is the actual master station / actual standby station" is sometimes used instead. The two descriptions are only different in words, and the actual meanings are exactly the same.
[0053] The target device types in the switching instruction include two types: actual master station (instructing the control center to switch from the actual standby station to the actual master station) and actual standby station (instructing the control center to switch from the actual master station to the actual standby station). The default device types include two types: default master station and default standby station. The communication status between the control center and the downstream slave station includes two types: communication online and communication offline. Therefore, the above information can be combined to generate a total of 8 information combinations of 2*2*2.
[0054] Step 202: Execute the switching instruction according to the execution mode of the switching instruction.
[0055] The execution mode of the switching instruction includes two modes: normal execution and abandonment of execution. When the switching logic of the switching instruction is judged to be reasonable, the switching instruction is executed normally. When the switching logic of the switching instruction is judged to be unreasonable, the execution of the switching instruction is abandoned.
[0056] For example, the default device type of the control center can be determined according to the working capacity of the control center. For example, the control center that can handle the largest amount of concurrency is selected as the default master station, and the redundant communication system is started with this control center as the actual master station. When the actual master station and the default master station are the same control center, and the communication between the control center and the slave station is also online, no matter which of the other control centers in the redundant communication system is used to replace the control center as the new actual master station, the working capacity of the redundant communication system will be reduced. Obviously, the logic of the switching instruction is not reasonable at this time, and the execution of the switching instruction should be abandoned.
[0057] It should be noted that if Figure 3 As shown in 301, the method of the present application is based on the existing master-slave station switching algorithm and is executed before the actual switching. Figure 3 It can be seen that, without adding an additional physical communication link to the control center, the method in the present application can be executed in each control center in an autonomous manner (without communicating with the outside again to obtain information, it can decide the execution method of the switching instruction by itself). As long as the information received by each control center is unified (the meaning of "unified" here is not exactly the same, but in line with the control logic, for example, the switching instruction received by the actual master station is to switch from the actual master station to the actual standby station, then at the same time, the switching instruction received by the actual standby station should be to switch from the actual standby station to the actual master station), based on the same redundant communication control method, even if no communication related to the execution method is carried out between the control centers, the execution results of each control center should be in line with the control logic (for example, if the actual master station abandons the execution of the switching instruction, then the actual slave station will also abandon the execution of the switching instruction).
[0058] The second embodiment of the present application further defines the redundant communication control method in the first embodiment in more detail and specificity. Some or all of the technical features in the second embodiment can be combined with or replaced with the first embodiment alone or in combination, so as to obtain more feasible redundant communication control methods.
[0059] The redundant communication control method in the second embodiment of the present application is described in detail below:
[0060] Optionally, the execution mode of the switching instruction is determined according to the default device type of the control center, the communication status between the control center and the slave station, and the target device type, including: when the default device type is the default master station or the default standby station, the communication status is communication offline and the target device type is the actual standby station, determining that the execution mode is normal execution; or, when the default device type is the default master station or the default standby station, the communication status is communication online and the target device type is the actual master station, determining that the execution mode is normal execution.
[0061] This embodiment provides two reasonable switching logics, specifically including four of the eight information combinations of the first embodiment.
[0062] One is that the communication status is offline and the switching instruction indicates that the working mode of the control center is switched to the actual standby station. Obviously, due to being offline, the control center can no longer communicate with the downstream slave station and control the work of the downstream slave station. Therefore, no matter which default device type is, it is reasonable to switch to the actual standby station at this time, so the execution mode is determined to be normal execution.
[0063] The other is that the communication status is online and the switching instruction indicates that the working mode of the control center is switched to the actual master station. This situation usually occurs when the previous actual master station fails and goes offline. Therefore, no matter which type of default device is used, at this time, the control center starts to be responsible for the redundant communication system, and it is reasonable to switch to the actual master station, so the execution mode is determined to be normal execution.
[0064] Optionally, the execution mode of the switching instruction is determined based on the default device type of the control center, the communication status between the control center and the slave station, and the target device type, including: when the default device type is the default master station, the communication status is communication online and the target device type is the actual standby station, the execution mode is determined to be abandoned.
[0065] This embodiment provides a switching logic that is determined to be an unreasonable switching, which specifically includes one of the eight information combinations of the first embodiment.
[0066] It should be understood that, in general, the default master station will be set to the one with the strongest working capacity among all available control centers. Therefore, when the control center is both the actual master station and the default master station, and is communicating online with the slave station, it should not be switched to other control centers to avoid reducing the working capacity of the redundant communication system. At this time, the execution of the switching instruction should be abandoned.
[0067] In addition, special cases can be handled specially. For example, in general, the master-slave switch is performed only after the current actual master fails and goes offline. However, there is a special case where control center A is both the actual master and the default master, and is communicating online with the slave, and control center B is the actual standby and the default standby, and is communicating online with the slave. At this time, a set of switching instructions is: instructing control center A to switch from the actual master to the actual standby, and instructing control center B to switch from the actual standby to the actual master. At this time, a contradictory situation will occur in which control center A abandons the execution of the switching instruction, but control center B executes the switching instruction normally.
[0068] However, the generation of the above switching instructions does not conform to the control logic of "switching between the master and standby stations after the actual master station fails and goes offline" under normal circumstances. It can also be understood that the above contradiction does not occur under normal circumstances. The above contradiction is common in the case of manual operation by technicians. In this case, the technicians can make manual adjustments, and special cases can be handled specially.
[0069] Optionally, the execution mode of the switching instruction is determined according to the default device type of the control center, the communication status between the control center and the slave station, and the target device type, including: when the default device type is the default standby station, the communication status is communication online, and the target device type is the actual standby station, determining the execution mode to be normal execution; or, performing a supplementary judgment, the supplementary judgment is used to reconfirm whether the switching instruction needs to be executed, and determining the execution mode of the switching instruction according to the result of the supplementary judgment.
[0070] This embodiment provides a switching logic that can directly determine whether something is reasonable and can also perform further in-depth judgment, specifically including one of the eight information combinations in the first embodiment.
[0071] When the default device type is the default standby station and the communication with the downstream slave station is online, if the switching instruction indicates switching to the actual standby station, based on the perspective of this control center, the switching logic is reasonable, so the execution mode can be determined to be normal execution.
[0072] However, considering that it is currently uncertain whether the next actual master station will be offline or online after the switch, in order to prevent the actual host from being switched back to the control center to increase communication jitter when the next actual master station is found to be offline after the switch, this embodiment proposes that a supplementary judgment can be performed to reconfirm whether the switching instruction needs to be executed. Only after the supplementary judgment is passed, the execution mode will be determined to be normal.
[0073] Optionally, a supplementary judgment is performed, and the supplementary judgment is used to reconfirm whether the switching instruction needs to be executed, and the execution mode of the switching instruction is determined according to the result of the supplementary judgment, including: searching for a second control center in the redundant communication system that receives the switching instruction carrying the target device type of the actual master station; obtaining the communication status between the second control center and the slave station; when the communication status between the second control center and the slave station is online communication, determining that the execution mode is normal execution, or, when the communication status between the second control center and the slave station is offline communication, determining that the execution mode is abandoned; or, sending a secondary confirmation message to the sending source of the switching instruction, when receiving the confirmation switching instruction sent by the sending source according to the secondary confirmation message, determining that the execution mode is normal execution; or, entering a waiting state with a duration of a preset first waiting time; when in the waiting state, when a switching instruction with the same content as the switching instruction is received again, determining that the execution mode is normal execution, or, when the waiting state ends and no switching instruction with the same content as the switching instruction is received again, determining that the execution mode is abandoned.
[0074] This embodiment specifically provides three supplementary judgment methods.
[0075] The first supplementary judgment method is to directly find the second control center that replaces the current control center as the new actual master station. Confirm with the second control center whether it is online in communication with the slave station. When the second control center is online in communication with the slave station, determine the execution mode as normal execution, or, when the second control center is offline in communication with the slave station, determine the execution mode as abandonment.
[0076] The second supplementary judgment method is to directly send a message to the upstream functional module that issued the switching command for secondary confirmation. When the upstream functional module notifies the switching for the second time, it is determined that the execution mode is normal execution.
[0077] It should be noted that the functional module that issues the switching command is upstream in terms of control logic, but this does not mean that the actual position of the functional module must be upstream. For example, the functional module that issues the switching command can be located in the upper-level control device that controls all control centers. In this case, the actual position and logical position of the functional module are higher than the control center. Alternatively, the processor in a certain control center serves as the functional module that issues the switching command and issues a switching command to all other control centers and itself. In this case, the actual position of the functional module is at the same level as the control center, but the logical position is still higher than the control center.
[0078] A third supplementary judgment method is to wait silently for a first waiting time when a switching instruction is received for the first time. If a switching instruction with the same content is received again within the first waiting time, the execution mode is determined to be normal execution.
[0079] It should be noted that the three supplementary judgment methods provided in this embodiment, the first and second methods are more efficient and accurate, but these two methods will cause the redundant communication control method to communicate with the outside world and lose its autonomous characteristics; the third method is less efficient, but the entire redundant communication control method is still autonomous.
[0080] Optionally, the execution mode of the switching instruction is determined according to the default device type of the control center, the communication status between the control center and the slave station, and the target device type, including: when the default device type is the default master station or the default standby station, the communication status is communication offline and the target device type is the actual master station, obtaining a switching record, the switching record including an operation record of the control center executing the operation of switching the working mode within a preset recording time; when the switching record is empty, determining that the execution mode is normal execution; or, when the switching record is not empty, entering a waiting state with a preset second waiting time; when in the waiting state, when a switching instruction with the same content as the switching instruction is received again, determining that the execution mode is normal execution, or, when the waiting state ends and no switching instruction with the same content as the switching instruction is received again, determining that the execution mode is to abandon execution.
[0081] This embodiment provides a switching logic that needs to be further judged for rationality, specifically including 2 of the 8 information combinations in the first embodiment.
[0082] When the communication status is offline and the switching instruction indicates that the working mode of the control center is switched to the actual master station, if the switching record is empty, it can be considered that the control center has never been the actual master station within the preset recording time. At this time, it is worth directly switching the control center to the actual master station and trying to establish a connection with the slave station.
[0083] When the communication status is offline and the switch command indicates that the working mode of the control center is switched to the actual master station, if the switch record is not empty, it can be considered that the control center has failed to communicate with the slave station within the preset record time. Regardless of whether the control center is the default master station or the default backup station, the control center is offline at this time, and switching to the control center is unlikely to improve the communication situation. At this time, the current actual host should be given enough time to reconnect with the slave station. If the current actual host cannot establish a connection with the slave station, the control center will assume the responsibility of the actual host and start trying to connect with the slave station to try to enter the communication online state.
[0084] Optionally, the duration of the preset second waiting time is not less than the duration of the maximum time of a polling connection; the duration of the maximum time of a polling connection is the sum of the time required to determine the interruption of the normal communication link and the time for polling all downstream slave stations; the time for polling all downstream slave stations is the product of the first variable and the maximum time required for the control center to establish a communication connection with the downstream slave station; the first variable is the product of the total number of communication addresses of the slave station and the preset maximum number of reconnection times minus one.
[0085] This embodiment specifically provides a method for obtaining the waiting time. Specifically, the waiting time should be no less than the maximum time for a control center to perform a polling connection on all slave stations.
[0086] The maximum duration of a polling connection is calculated as shown in the following formula:
[0087] Tm=T0+(KN-1)·T1
[0088] in:
[0089] Tm represents the maximum time for the control center to establish a polling connection with all slave stations when the equipment is normal.
[0090] The meaning of the formula of T0 in this embodiment is: the time when the current actual host determines that the established communication link is disconnected. The value of T0 is the maximum time required to determine that any active communication link is disconnected, and is a characteristic constant related to the control center and the slave station. For example, T0 = 5000 milliseconds, which means that once the control center and the slave station find that a certain active communication link has been established and has not received the other party's message within the agreed range for more than 5000 milliseconds, the control center and the slave station will regard the connection as no longer valid and have the right to close the connection.
[0091] N represents the number of device IPs that allow the control center to communicate with the slave station. Obviously, N≥1. For example, N=2 means that the device provides two IPs (a slave station may have multiple IPs. The significance of redundant IP is that when there is a problem in the communication between slave station A and the control center through the first IP, the second IP can be enabled to continue to realize the communication between slave station A and the control center).
[0092] T1 indicates the timeout period for the control center to connect to the slave station. For example, when T1 = 2000 milliseconds, it means that if the control center and the slave station try to connect for 2000 milliseconds without success, the connection is considered to have failed.
[0093] K represents the maximum number of times the control center can continuously reconnect to each slave IP, k≥1. For example, when k=3, it means that the control center has tried the slave IP for 3 times in a row, and each time the master station and the device have not been successfully connected for 2000 milliseconds, the master station will change to the next device IP and continue to try to connect.
[0094] In addition, the reason for "KN-1" in the formula is because the number of time intervals is the total number of reconnections - 1.
[0095] In this method, even if the current actual host determines that the established communication link is disconnected at T0, at (KN-1)·T1, the communication link that has been determined to be disconnected at T0 will still be tried to be reconnected again.
[0096] In addition, the duration of the first waiting time mentioned above can also be obtained based on Tm in this embodiment using the method in this embodiment.
[0097] A third embodiment of the present application provides a redundant communication control system, including:
[0098] A plurality of control centers and slave stations controlled by the control centers, wherein the control center includes an actual master station and at least one actual standby station;
[0099] The control center is used to respond to a switching instruction carrying a target device type, and determine the execution mode of the switching instruction according to the default device type of the control center, the communication status between the control center and the slave station, and the target device type; the target device type is used to characterize the working mode that the control center needs to switch to, the target device type includes the actual master station and the actual standby station, the default device type is a fixed attribute of the control center, and the default device type includes the default master station and the default standby station; the switching instruction is executed according to the execution mode of the switching instruction.
[0100] The redundant communication control system provided in this embodiment belongs to the same application concept as the redundant communication control method provided in the above embodiments of this application, and can execute the redundant communication control method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of the execution method. For the technical details not fully described in this embodiment, please refer to the specific processing content of the redundant communication control method provided in the above embodiments of this application, and will not be repeated here.
[0101] The fourth embodiment of the present application also provides an electronic device, see Figure 4 As shown, the device includes:
[0102] Memory 400 and processor 410;
[0103] The memory 400 is connected to the processor 410 and is used to store programs;
[0104] The processor 410 is used to implement the redundant communication control method disclosed in any of the above method embodiments by running the program stored in the memory 400.
[0105] Specifically, the computing device may further include: a bus, a communication interface 420 , an input device 430 and an output device 440 .
[0106] The processor 410, the memory 400, the communication interface 420, the input device 430 and the output device 440 are connected to each other via a bus.
[0107] A bus may include a pathway that transfers information between components of a computer system.
[0108] Processor 410 may be a general purpose processor, such as a general purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0109] The processor 410 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0110] The memory 400 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 400 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0111] The input device 430 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0112] Output device 440 may include a device that allows information to be output to a user, such as a display screen, a printer, a speaker, etc.
[0113] The communication interface 420 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0114] The processor 410 executes the program stored in the memory 400 and calls other devices, which can be used to implement the various steps of the distributed service load distribution method provided in the above embodiment of the present application.
[0115] The fifth embodiment of the present application further proposes a storage medium on which a computer program is stored. The computer program is used by a processor to execute the steps of the distributed service load distribution method described in the above “Exemplary Method” section of this specification, and specifically the following steps can be implemented:
[0116] Step 101, in response to a switching instruction carrying a target device type, determining an execution method of the switching instruction according to a default device type of the control center, a communication status between the control center and a slave station, and a target device type; the target device type is used to characterize a working mode to which the control center needs to switch, the target device type includes an actual master station and an actual standby station, the default device type is a fixed attribute of the control center, and the default device type includes a default master station and a default standby station.
[0117] Step 102: Execute the switching instruction according to the execution mode of the switching instruction.
[0118] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0119] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0120] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0121] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0122] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0123] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0125] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0126] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0127] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants 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, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0128] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A redundant communication control method, applied to any one of a plurality of control centers in a redundant communication system, wherein the control center is an actual master station or an actual standby station of the redundant communication system, and the communication system further comprises a slave station controlled by the control center, characterized in that: The method comprises: In response to a switching instruction carrying a target device type, determining an execution mode of the switching instruction according to a default device type of the control center, a communication state between the control center and the slave station, and the target device type; The target device type is used to characterize the working mode that the control center needs to switch to, and the target device type includes an actual master station and an actual standby station. The default device type is a fixed attribute of the control center, and the default device type includes a default master station and a default standby station. The switching instruction is executed according to the execution mode of the switching instruction.
2. The method according to claim 1, characterized in that The determining, according to the default device type of the control center, the communication state between the control center and the slave station, and the target device type, the execution mode of the switching instruction includes: When the default device type is a default master station or a default standby station, the communication state is communication offline, and the target device type is an actual standby station, determining that the execution mode is normal execution; or, When the default device type is a default master station or a default standby station, the communication state is online communication, and the target device type is an actual master station, it is determined that the execution mode is normal execution.
3. The method according to claim 1, characterized in that The determining, according to the default device type of the control center, the communication state between the control center and the slave station, and the target device type, the execution mode of the switching instruction includes: When the default device type is a default master station, the communication state is online communication, and the target device type is an actual standby station, the execution mode is determined to be abandonment execution.
4. The method according to claim 1, characterized in that: The determining, according to the default device type of the control center, the communication state between the control center and the slave station, and the target device type, the execution mode of the switching instruction includes: When the default device type is a default standby station, the communication state is online communication, and the target device type is an actual standby station, determining that the execution mode is normal execution; or, When the default device type is the default standby station, the communication status is online communication and the target device type is the actual standby station, a supplementary judgment is performed, and the supplementary judgment is used to reconfirm whether the switching instruction needs to be executed, and the execution method of the switching instruction is determined according to the result of the supplementary judgment.
5. The method according to claim 4, characterized in that The performing of the supplementary judgment, wherein the supplementary judgment is used to reconfirm whether the switching instruction needs to be executed, and determining the execution mode of the switching instruction according to the result of the supplementary judgment, includes: Searching for a second control center in the redundant communication system that has received a switching instruction with a target device type of an actual master station; obtaining a communication status between the second control center and the slave station; when the communication status between the second control center and the slave station is online, determining that the execution mode is normal execution, or, when the communication status between the second control center and the slave station is offline, determining that the execution mode is abandonment execution; or, Sending a secondary confirmation message to a sending source of the switching instruction, and upon receiving a confirmation switching instruction sent by the sending source according to the secondary confirmation message, determining that the execution mode is normal execution; or, Enter a waiting state with a duration of a preset first waiting time; when in the waiting state, when a switching instruction with the same content as the switching instruction is received again, determine that the execution mode is normal execution, or, when the waiting state ends and no switching instruction with the same content as the switching instruction is received again, determine that the execution mode is to abandon execution.
6. The method according to claim 1, characterized in that The determining, according to the default device type of the control center, the communication state between the control center and the slave station, and the target device type, the execution mode of the switching instruction includes: When the default device type is a default master station or a default standby station, the communication state is communication offline, and the target device type is an actual master station, a switching record is obtained; the switching record includes an operation record of the control center performing an operation of switching the working mode within a preset recording time; When the switching record is empty, the execution mode is determined to be normal execution; or, when the switching record is not empty, a waiting state is entered with a preset second waiting time; when in the waiting state, when a switching instruction with the same content as the switching instruction is received again, the execution mode is determined to be normal execution, or, when the waiting state ends and no switching instruction with the same content as the switching instruction is received again, the execution mode is determined to be abandoned execution.
7. The method according to claim 6, characterized in that The duration of the preset second waiting time is not less than the duration of the maximum time of a polling connection; The maximum time of a polling connection is the sum of the time required to determine the interruption of the normal communication link and the time required to poll all downstream slave stations; The duration of polling all downstream slave stations is the product of the first variable and the maximum duration required for the control center to establish a communication connection with the downstream slave stations; The first variable is the product of the total number of communication addresses of the slave stations and the preset maximum number of reconnection times minus one.
8. A serial bus redundant communication system, characterized in that: include: A plurality of control centers and slave stations controlled by the control centers, wherein the control center includes an actual master station and at least one actual standby station; The control center is used to respond to a switching instruction carrying a target device type, and determine the execution mode of the switching instruction according to the default device type of the control center, the communication status between the control center and the slave station, and the target device type; the target device type is used to characterize the working mode that the control center needs to switch to, the target device type includes an actual master station and an actual standby station, the default device type is a fixed attribute of the control center, and the default device type includes a default master station and a default standby station; the switching instruction is executed according to the execution mode of the switching instruction.
9. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The electronic device implements the redundant communication control method as claimed in any one of claims 1 to 7 by running the program in the memory through the processor.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the redundant communication control method according to any one of claims 1 to 7 is implemented.
