CN110166306A - Data communications method and system - Google Patents

Data communications method and system Download PDF

Info

Publication number
CN110166306A
CN110166306A CN201910519199.1A CN201910519199A CN110166306A CN 110166306 A CN110166306 A CN 110166306A CN 201910519199 A CN201910519199 A CN 201910519199A CN 110166306 A CN110166306 A CN 110166306A
Authority
CN
China
Prior art keywords
host computer
processing
computer
data
processing order
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910519199.1A
Other languages
Chinese (zh)
Inventor
徐春贤
秦怀阳
包立麒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHANGHAI FITSCO INTELLIGENT TRAFFIC CONTROL CO Ltd
Original Assignee
SHANGHAI FITSCO INTELLIGENT TRAFFIC CONTROL CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI FITSCO INTELLIGENT TRAFFIC CONTROL CO Ltd filed Critical SHANGHAI FITSCO INTELLIGENT TRAFFIC CONTROL CO Ltd
Priority to CN201910519199.1A priority Critical patent/CN110166306A/en
Publication of CN110166306A publication Critical patent/CN110166306A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Abstract

This application provides a kind of data communications method and systems, wherein this method comprises: receiving the task data that at least one host computer in multiple host computers is sent;It is ordered according to processing and carries out data processing, obtain target data;Target data is sent to multiple host computers, so that display interface of multiple host computers according to updating target data;When not receiving the processing order that main host computer is sent in designated time period, the corresponding processing order of task for the main host computer that any host computer in redundancy host computer is sent is received.When can be realized any host computer failure, the transfer of intermediate equipment is not needed, other host computers can be realized as work.

Description

Data communications method and system
Technical field
This application involves fields of communication technology, in particular to a kind of data communications method and system.
Background technique
Currently, the redundancy of man machine operation interface is realized by two-server in the prior art.When previous primary service When device breaks down, standby server then upgrades to primary server, and primary server then switchs to standby server or in not Working condition.This framework needs to pass through transit server when needing to convert primary server.
Summary of the invention
In view of this, the embodiment of the present application is designed to provide a kind of data communications method and system.
In a first aspect, the embodiment of the present application provides a kind of data communications method, be applied to slave computer, the slave computer with Multiple host computer communication connections, wherein the multiple host computer includes main host computer and redundancy host computer, the method packet It includes:
The task data that at least one host computer in the multiple host computer is sent is received, the task data includes institute State the processing order and/or the heartbeat bag data of redundancy host computer of main host computer;
It is ordered according to the processing and carries out data processing, obtain target data;
The target data is sent to the multiple host computer, so that the multiple host computer is according to the target data The display interface of update;
When not receiving the processing order that the main host computer is sent in designated time period, it is upper to receive the redundancy The corresponding processing order of the task for the main host computer that any host computer in machine is sent.
Data communications method provided by the embodiments of the present application is connect with slave computer direct communication using host computer, and passed through Multiple host computers are disposed, while in running order, communicated with slave computer, with offer primary server in the prior art and standby It is compared with server, in any host computer failure, since other host computers have the processing for receiving slave computer to obtain Target data, does not need the switching action for specially executing host computer, and other host computers can be realized as the function of the host computer of failure Energy.
With reference to first aspect, the embodiment of the present application provides the first possible embodiment of first aspect, in which: institute After stating the step of receiving the task data that at least one host computer in the multiple host computer is sent, the method is also wrapped It includes: processing order is detected;
It is described that the step of carrying out data processing, obtaining target data is ordered according to the processing, comprising: when the processing is ordered When the detection of order passes through, processing order is handled one by one, obtains multiple groups target data.
Data communications method provided by the embodiments of the present application, it is advanced when can receive multiple processing order with slave computer Row detection, the slave computer processing order that only processing detection passes through, so as to realize data communication, the safety in treatment process Property.
The first possible embodiment with reference to first aspect, the embodiment of the present application provide first aspect second can The embodiment of energy, in which: described that the step of carrying out data processing, obtaining target data is ordered according to the processing, comprising:
When the detection of the processing order does not pass through, a processing order is selected according to setting rule from processing order It is handled, obtains target data.
Data communications method provided by the embodiments of the present application, when processing order detection not over when, select a processing order It is handled, while reducing the waste of process resource, also reduces the quantity for ignoring the processing order that processing host computer is sent.
The possible embodiment of with reference to first aspect the first or second of possible embodiment, the embodiment of the present application Provide the third possible embodiment of first aspect, wherein described the step of detecting to processing order, packet It includes:
It detects and is ordered in the processing order with the presence or absence of duplicate processing, or is conflicting with the presence or absence of at least two Processing order;
At least two duplicate processing orders if it does not exist, and there is no at least two conflicting processing orders, then The detection for characterizing the processing order passes through.
Data communications method provided by the embodiments of the present application, when processing order duplicates, it is possible to reduce reprocessing The processing of order reduces the waste of process resource.In addition, can also select a processing when processing order conflicts, can keep away Exempt from the conflicting processing order of continuous processing, the device fails for causing slave computer to control.
With reference to first aspect, the embodiment of the present application provides the 4th kind of possible embodiment of first aspect, in which: institute After stating the step of receiving the task data that at least one host computer in the multiple host computer is sent, the method is also wrapped It includes:
Acknowledgement acknowledgement message is sent to the host computer.
By sending acknowledgement acknowledgement message to host computer, host computer can be made to recognize whether the task data of transmission reaches In slave computer, can enable slave computer more efficiently carry out host computer transmission task data in processing order, reduce because For the not sent success of host computer, cause to handle the case where command process is omitted.
It is described that the step of carrying out data processing, obtaining target data is ordered according to the processing, comprising:
Judge whether the quantity of the processing order is identical as the counting of the counter received, and the counter is by described Host computer is determined according to the processing order number sent in advance;
When it is described processing order quantity it is identical with the counting of the counter received when, then according to it is described handle order into Row data processing, obtains target data.
With reference to first aspect, the embodiment of the present application provides the 5th kind of possible embodiment of first aspect, in which: institute State the step of receiving the processing order that the multiple host computer is sent, comprising: receive on the multiple according to the period 1 The processing order that position machine is sent;
It is described that the step of carrying out data processing, obtaining target data is ordered according to the processing, comprising: according to second round Processing order is handled one by one, obtains target data, wherein the period 1 is the integer of the second round Times.
Data communications method provided by the embodiments of the present application, period 1 are the integral multiples of the second round, so as to So as to can also make slave computer completely handle the processing order of host computer transmission even if multiple host computers are arranged, provide data The validity of communication and processing.
Second aspect, the embodiment of the present application also provide a kind of data communications method, are applied to data communication system, the number It include: slave computer according to communication system, multiple host computers with slave computer communication connection, wherein the multiple host computer packet Include main host computer and redundancy host computer, which comprises
At least one host computer sends task data, the task data packet to the slave computer in the multiple host computer Include the processing order and/or the heartbeat bag data of redundancy host computer of the main host computer;
The slave computer orders according to the processing and carries out data processing, obtains target data;
The target data is sent to the multiple host computer by the slave computer;
Each host computer is to other host computer status datas;
The display interface that the multiple host computer is updated according to the target data and the status data;
It is described superfluous when at the appointed time Duan Wei receives the processing order that the main host computer is sent to the slave computer The corresponding processing life of the task for the main host computer that any host computer in remaining host computer is sent to the slave computer It enables.
In conjunction with second aspect, the embodiment of the present application provides the first possible embodiment of second aspect, in which: institute State the step of at least one host computer sends task data to the slave computer in multiple host computers, comprising:
The quantity of the processing order currently sent in advance is included in counter by the host computer by method of counting;
Judge whether counting and the processing order number in order memory of the counter are identical;
When the counting of the counter is identical as the processing order number in order memory, the order storage is obtained Processing order in device is sent to the slave computer.
Whether data communications method provided by the embodiments of the present application can identify host computer by the matching of counter The processing order sent will be all needed to be sent to slave computer, reduction has handled the case where part processing order is missed, Cause processing result imperfect, so that it is more accurate also to can be improved the data processing that slave computer is carried out for processing order.
In conjunction with second aspect, the embodiment of the present application provides second of possible embodiment of second aspect, in which:
For the slave computer after receiving the task data that the host computer is sent, Xiang Suoshu host computer sends acknowledgement receipt Message;
The host computer is after receiving the acknowledgement acknowledgement message, into next job status to be sent.
By sending acknowledgement acknowledgement message to host computer, host computer can be made to recognize whether the processing order of transmission reaches In slave computer, slave computer can be enable to more efficiently carry out the processing order of host computer transmission, reduced because host computer is not sent out Success is sent, causes to handle the case where command process is omitted.
The third aspect, the embodiment of the present application also provide a kind of electronic equipment, comprising: processor, memory and bus, it is described Memory is stored with the executable computer program of the processor, and when electronic equipment operation, the processor is deposited with described By bus communication between reservoir, the computer program executes above-mentioned in a first aspect, or first when being executed by the processor The step of method in any possible embodiment of aspect.
Fourth aspect, the embodiment of the present application also provide a kind of data communication system, and the data communication system includes: bottom Machine, multiple host computers with slave computer communication connection, the multiple host computer includes main host computer and redundancy host computer, Wherein:
The host computer, for sending task data to the slave computer, the task data includes described main upper The processing order of machine and/or the heartbeat bag data of redundancy host computer;
The host computer is also used to other host computer status datas into the multiple host computer;
The slave computer, the task data sent for receiving the multiple host computer;
The slave computer carries out data processing for ordering according to the processing, obtains target data;
The slave computer, for the target data to be sent to the multiple host computer;
The multiple host computer, for updating display interface according to the target data and the status data;
Any host computer in the redundancy host computer is also used to when at the appointed time Duan Wei receives institute to the slave computer When stating the processing order that main host computer is sent, the task for the main host computer that Xiang Suoshu slave computer is sent is corresponding Processing order.
To enable the above objects, features, and advantages of the application to be clearer and more comprehensible, special embodiment below, and appended by cooperation Attached drawing is described in detail below.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the schematic diagram of data communication system provided by the embodiments of the present application.
Fig. 2 is the block diagram of slave computer provided by the embodiments of the present application.
Fig. 3 is the flow chart of data communications method provided by the embodiments of the present application.
Fig. 4 is the functional block diagram of data communication equipment provided by the embodiments of the present application.
Fig. 5 is the flow chart for the data communications method that another embodiment of the application provides.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application is described.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile the application's In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
It is higher to the requirement of man machine operation interface in track traffic control signal system.Rail traffic control letter Number man machine operation interface redundant fashion and switching method may is that
Hot backup redundancy realizes the redundancy of man machine operation interface by configuring two-server.It illustratively, can be with reference to figure Shown in 1.Basic framework can be the aobvious equipment of control and connect hot standby server, be communicated from server to slave computer, under this framework The cost is relatively high for the redundant fashion of offer.
Switching mode, usually when previous primary server breaks down, standby server can be upgraded to primary clothes Business device, primary server switch to standby server or in off positions.In addition, failed server under this framework is cut It changes and needs through transit server, switching mode is relatively inefficient.
Based on this, in the case that how present inventor's research reduces cost, the switching of man machine operation interface is improved Efficiency.
Based on this, a kind of data communications method provided by the present application and system be may be implemented in any host computer failure, Due to the target data that other host computers have the processing for receiving slave computer to obtain, the switching for specially executing host computer is not needed Movement, other host computers can be realized as the function of the host computer of failure.
Embodiment one
For convenient for understanding the present embodiment, first to executing a kind of data communication side disclosed in the embodiment of the present application The data communication system of method describes in detail.
As shown in Figure 1, being the schematic diagram that data communication system provided by the embodiments of the present application interacts.Data communication system System may include slave computer 100 and host computer 200.Wherein, slave computer 100 is communicated by network with multiple host computers 200 Connection, to carry out data communication or interaction.Slave computer 100 can be computer having data processing function, for example, it may be Programmable logic controller (PLC) (Programmable Logic Controller, English abbreviation: PLC), single-chip microcontroller, safety calculate Platform (Enhanced Vital Computer, English abbreviation: EVC) etc..Host computer 200, which can refer to, can directly issue behaviour The computer for controlling order, for example, it may be being personal computer (personal computer, English abbreviation: PC), industrial personal computer Deng.Various signal intensities (hydraulic, water level, temperature etc.) is shown on the screen of host computer 200.Optionally, host computer 200 can wrap Include man machine operation interface.
Illustratively, data communication system provided in this embodiment can be used for controlling subway.Wherein, slave computer 100 can be the fail-safe computer with data processing function and equipment state acquisition.Host computer 200 is displayed for each Each yard information (for example shielding door state, train position, semaphore light are shown) of subway line.Host computer 200 can be with It is deployed in multiple stations of subway line, to facilitate different subway persons on duty it can be seen that real-time identical yard information.It is logical Crossing for host computer 200 to be arranged in may be implemented to integrate each station information and carries out issuing and handling for order in each station, to guarantee Safety shows that disunity may result in accident so as to reduce each host computer.Wherein, host computer shows that disunity may The citing of bring safety accident: if a shield door is really opened, a host computer is shown out, and the display of another host computer is closed, If person on duty is it is seen that close the interface for the host computer that shield door display is closed, at this time permission train is leaving from station, may make At safety accident.
Illustratively, which can design according to Europe superscript SIL4 rank, the safety computer platform Can have the self-test of hardware period, ROM/RAM diagnosis, memory protection diagnosis, cycle of operation monitoring, interlock logic operation, input The functions such as outgoing management, fault management.The operating system of the safety computer platform can be using U.S. WindRiver public affairs Take charge of the embedded real-time operating system (Real Time Operating System, English abbreviation RTOS)-designed and developed VxWorks, to ensure the safety and real-time of system.
Optionally, the cycle of operation of above-mentioned host computer 200 can be the period 1.Host computer 200 is every the period 1 Processing order is sent to slave computer, or refreshes local data to update display interface.The cycle of operation of slave computer 100 is can be with It is second round.Slave computer 100 is handled the processing order received every second round.Illustratively, the period 1 It can be the integral multiple of second round.In an example, the period 1 can be s milliseconds, and second round can be t milliseconds, Wherein, s > t, s are the integral multiple of t.
In one optionally embodiment, 200 quantity of host computer can be s/t.In an example, on s/t Position machine 200 can send processing order to slave computer 100 in order, and slave computer 100 is handled according to s/t 200 transmission of host computer The sequence of order handles processing order.S/t host computer 200 can also send processing life to slave computer 100 simultaneously It enables, slave computer 100 sends processing order to s/t host computer 200 according to the sequence of setting and handles.Based on this, slave computer 100 include s/t process cycle in one s milliseconds, then can handle the processing order of the transmission of s/t host computer 200.
In some alternative embodiments, the quantity of host computer 200 might be less that s/t.Slave computer 100 is at one Include s/t process cycle in s milliseconds, then can handle the processing order of less than s/t host computer 200 transmission.
Optionally, above-mentioned host computer 200 can be man machine operation interface (Human Machine Interaction, English Literary abbreviation HMI).Illustratively, industrial personal computer realization can be used in man machine operation interface.
Optionally, as shown in Figure 1, slave computer 100 may include guest machine, it is used for the cut-in stand-by in main computer failure Machine handles related data.Optionally, slave computer 100 also may include two processors, when one processor fault, can cut It changes and related data is handled by another processor.
Optionally, above-mentioned slave computer 100 may include interlocking operation layer (InterlockingControler, English letter Claim: ILC), the processing order for sending to host computer 200 is handled.
In one embodiment, host computer 200 is connect by secure network with slave computer 100.Avoid server knot Structure, since multiple host computers 200 are always maintained at communication connection with slave computer 100, in any 200 failure of host computer, Its host computer 200 can also keep work.It therefore, can be while cost is reduced, moreover it is possible to make to realize nothing between host computer 200 Seaming and cutting are changed.
It optionally, include main host computer and one or more redundancy host computers in multiple host computers 200.Wherein, the master Want host computer for executing main processing task.Redundancy host computer is used for as backup, in the damage of main host computer, replacement master The work of host computer is wanted, main processing task is executed.Main host computer can also send to communicate to shake hands to slave computer 100 and ask again Information is sought to re-establish link.If re-establishing success, main host computer can be used as redundancy host computer, with slave computer 100 Keep communication.
Optionally, when not receiving the processing order that main host computer is sent in slave computer 100 at the appointed time section, under Position machine 100 can choose the work that any redundancy host computer takes over main host computer.
Optionally, for each host computer 200 also to other 200 status datas of host computer, status data may include it Status data, the status data of host computer 200 itself of subsystem etc. of its host computer 200 control.In an example, above-mentioned Subsystem can be subway control system, the status data of subsystem may include the device data etc. of all yards.It is upper The status data of machine 200 itself may include: communications status, electricity, operating status etc..
Optionally, each host computer 200 is sent according to the slave computer 100 that receives target data and other upper The status data that machine 200 is sent is updated display interface.
As shown in Fig. 2, be the block diagram of a kind of electronic equipment provided by the embodiments of the present application, which can be with It is above-mentioned slave computer 100.Slave computer 100 may include memory 111, processor 112, communication unit 113.This field is common Technical staff is appreciated that structure shown in Fig. 2 is only to illustrate, and does not cause to limit to the structure of slave computer 100.For example, Slave computer 100 may also include than shown in Fig. 2 more perhaps less component or with the configuration different from shown in Fig. 2.
Above-mentioned memory 111, processor 112, each element of communication unit 113 directly or indirectly electrically connect between each other It connects, to realize the transmission or interaction of data.For example, these elements can pass through one or more communication bus or signal between each other Line, which is realized, to be electrically connected.Above-mentioned processor 112 is for executing the executable module stored in memory.
Wherein, memory 111 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc.. Wherein, memory 111 is used for the computer program that storage processor 112 can be performed, the process that the application any embodiment discloses Method performed by the slave computer 100 of definition can be applied in processor 112, or be realized by processor 112.For example, , can be by bus communication between processor 112 and memory 111 when slave computer 100 is run, processor 112 is held receiving After row instruction, processor 112 executes the computer program, to execute data communication side provided by the application any embodiment Method.
Above-mentioned processor 112 may be a kind of IC chip, the processing capacity with signal.Above-mentioned processor 112 can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processes Device (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (DSP), specific integrated circuit (ASIC), field programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present application.It is general Processor can be microprocessor or the processor is also possible to any conventional processor etc..
Above-mentioned communication unit 113 with host computer 200 for being communicated.
Slave computer 100 in the present embodiment can be used for executing each step in each method provided by the embodiments of the present application Suddenly.Below by the realization process of several embodiments detailed description data communications method.
Embodiment two
Referring to Fig. 3, being the flow chart of data communications method provided by the embodiments of the present application.It below will be to shown in Fig. 3 Detailed process is described in detail.
Step S301 receives the task data that at least one host computer in multiple host computers is sent.
Task data includes the processing order and/or the heartbeat bag data of redundancy host computer of the main host computer.
Wherein, redundancy host computer sends heartbeat bag data to slave computer, can maintain the communication connection with slave computer.
Main host computer sends processing order to slave computer, to realize the control to the subsystem connecting with data communication system System.
In some embodiments, slave computer can receive the processing order that host computer is sent according to the period 1.
The above-mentioned period 1 can be by the processing capacity configuration of host computer.
Above-mentioned processing order is different according to the difference of the application scenarios of the data communications method in the present embodiment.One In a example, the data communications method in the present embodiment can be used in the control system of subway system, above-mentioned processing order It then can be the open and close of subway door, the unlatching of subway correlation passageway for fire apparatus.In another example, in the present embodiment Data communications method can be used in finance data management system, and above-mentioned processing order can be the update to a certain numerical value. The specific implementation of no longer exhaustive above-mentioned processing order herein, processing order can may be not according to the difference of application scenarios Same order.
Optionally, slave computer can be sent out after receiving the processing order that any host computer is sent to corresponding host computer Acknowledgement acknowledgement message is sent, to notify its processing order sent of host computer to send successfully.
Host computer can be made to recognize whether processing order sends success by acknowledgement acknowledgement message.On reducing The state to make mistake is presented in position machine.In an example, the state of above-mentioned mistake may be: host computer issues a control one and sets Determine the order of subway door enabling, but slave computer does not receive the order of enabling, but host computer is in the order for sending out enabling, It is the state opened with regard to display setting subway door, but actually there is no open the door for setting subway door.
It optionally, can also include: that slave computer to multiple host computers sends handshake request before step S301, it will The host computer of handshake request is replied at first as main host computer, remaining host computer is as redundancy host computer.
Step S302 orders according to the processing and carries out data processing, obtains target data.
In some embodiments, processing order can be handled according to second round one by one, obtains target Data.
Wherein, the period 1 can be the integral multiple of second round.
Slave computer can connect linear process to the processing order that all host computers issue.
Below by an example, the possible job order of upper computer and lower computer is described.
In an example, the process cycle period 1 of host computer can be 60 milliseconds, the process cycle of slave computer It is 30 milliseconds that two cycles, which can be second round,.Slave computer successively receives the processing life that the first host computer and the second host computer are sent It enables, for example, the first host computer at the 1st millisecond, has sent the first processing order, the second host computer has sent at the 30th millisecond Second processing order.Slave computer handles the first above-mentioned processing order at the 1st millisecond, at the 31st millisecond of next second round Handle second processing order.It is 60 milliseconds by the process cycle of host computer, the first host computer can just be sent at the 61st millisecond New processing order, and slave computer also enters third second round at this time, can handle the first host computer at the 61st millisecond The processing order of transmission.
In an example, slave computer can determine to determine communicate with which host computer according to the period of its operation. In an example, communicate with which host computer to determine according to the following formula:
HMIIndex=ILCCycleNumber%HmiCount;
Wherein, HMIIndex expression refers to that host computer is numbered, and ILCCycleNumber indicates slave computer cycle of operation number (from 0 Configurable host computer quantity is indicated to HmiCount-1), HmiCount.Such as: the period of slave computer can be 100ms, match 5 host computers, that is, HmiCount=5 have been set, slave computer has run 1200ms, 12 periods have exactly been run, that is, ILCCycleNumber=12, according to above-mentioned formula, that is, the host computer index value currently communicated with slave computer is 12%5=2, that is, communicated with the 3rd (0,1,2,3,4) host computer.
In an example, the above-mentioned period 1 can be 500ms, and second round can be 100ms, each slave computer It can be communicated with five host computers.The display picture and state realtime uniform of five host computers.
Therefore, the period 1 is set to the integral multiple of second round, the host computer of configuration integral multiple quantity can be corresponded to It works at the same time, so as to so that host computer and slave computer work are smooth, to realize that multiple host computers become mutually mutual redundancy Equipment.
In some embodiments, after step S301, data communications method can also include: to it is described processing order into Row detection.
In one embodiment, it can detecte and ordered in the processing order with the presence or absence of duplicate processing;If deposited In at least two duplicate processing orders, then the detection for characterizing processing order does not pass through.
In another embodiment, it can detecte processing order with the presence or absence of at least two conflicting processing lives It enables;If there is at least two conflicting processing orders, then the detection for characterizing the processing order does not pass through.
In another embodiment, it can detecte and ordered in the processing order with the presence or absence of duplicate processing, and, inspection Processing order is surveyed with the presence or absence of at least two conflicting processing orders;If there is no at least two duplicate processing lives It enables, and, there is no at least two conflicting processing orders, then the detection for characterizing the processing order passes through.
Optionally, can be no longer exhaustive one by one herein with other properties of detection processing order, detect any one not When meeting rule, then determination processing order detection does not pass through.
Above-mentioned step S302 may include: to order the processing and carry out when the detection of the processing order passes through It handles one by one, obtains multiple groups target data.
Above-mentioned step S302 may include: when the detection of the processing order does not pass through, from processing order A processing order is selected according to setting rule to be handled, and target data is obtained.
Optionally, when the detection of the processing order does not pass through, for example, if there is duplicate processing order, it can be with Handle the processing order received earliest.For example, the communication means in the present embodiment can be used for the control to subway, on two Position machine has sent the open command to a subway door respectively, then slave computer can choose transmission and handle at order earlier Reason.By selecting processing order earlier to be executed, the instruction that host computer can be made to send over is performed earlier, thus real The process demand of existing faster response host computer.
Optionally, when the detection of the processing order does not pass through, for example, the processing if there is at least two conflicts is ordered It enables, can handle comparatively safe processing order.For example, the communication means in the present embodiment can be used for the control to subway, Two host computers have sent the open command and shutdown command to a subway door respectively, then slave computer can choose open command into Row processing.If triggering open command when needing to close, it is understood that there may be related personnel may pent door folder Therefore possibility firmly executes open command by selection, can clamp to avoid the pent door of related personnel, improve relevant people The safety of member.Therefore, by selecting comparatively safe processing order to be executed, the peace of related personnel can be preferably ensured Entirely.
The target data is sent to the multiple host computer by step S303, so that the multiple host computer is according to institute State the display interface of updating target data.
Step S304 receives institute when not receiving the processing order that the main host computer is sent in designated time period State the processing order that any host computer in redundancy host computer is sent.
Illustratively, for slave computer in the processing order for receiving any host computer, slave computer has executed processing order Internal state parameter is updated afterwards.Internal state parameter after will be more aobvious is sent to all host computers of connection, to make upper The state parameter that machine display updates, to guarantee real-time, consistency that the interface information of all host computers is shown.
Optionally, when any redundancy host computer has sent processing order to slave computer, then by currently transmitted processing order Redundancy host computer is switched to main host computer, and main host computer before is switched to redundancy host computer.
Embodiment three
Conceived based on same application, the data communications method pair provided with embodiment two is be provided in the embodiment of the present application The data communication equipment answered, the principle and the above-mentioned reality of the embodiment of the present application solved the problems, such as due to the device in the embodiment of the present application The data communications method for applying the offer of example two is similar, and therefore, the implementation of the data communication equipment in the present embodiment may refer to implement The implementation for the data communications method that example two provides, overlaps will not be repeated.
Referring to Fig. 4, being the functional block diagram of data communication equipment provided by the embodiments of the present application.In the present embodiment Data communication equipment in modules be used to execute it is each in data communication method embodiment in the above embodiments two A step.Data communication equipment includes: receiving module 401, processing module 402, sending module 403 and switching module 404;Its In
Receiving module 401, for receiving the task data of the transmission of at least one host computer in the multiple host computer;
Processing module 402 carries out data processing for ordering according to the processing, obtains target data;
Sending module 403, for the target data to be sent to the multiple host computer, so that the multiple host computer According to the display interface of the updating target data.
Switching module 404, for when the processing order that the main host computer is sent is not received in designated time period, Receive the processing order that any host computer in the redundancy host computer is sent.
In a kind of possible embodiment, data communication equipment further include:
Detection module, for being detected to processing order;
Above-mentioned processing module 402, is also used to: when it is described processing order detection pass through when, to it is described processing order into Row is handled one by one, obtains multiple groups target data.
In a kind of possible embodiment, above-mentioned processing module 402 is also used to:
When the detection of the processing order does not pass through, a processing order is selected according to setting rule from processing order It is handled, obtains target data.
In a kind of possible embodiment, above-mentioned detection module is used for:
It detects and is ordered in the processing order with the presence or absence of duplicate processing, or is conflicting with the presence or absence of at least two Processing order;
At least two duplicate processing orders if it does not exist, and there is no at least two conflicting processing orders, then The detection for characterizing the processing order passes through.
In a kind of possible embodiment, above-mentioned processing module 402 is also used to:
Judge whether the quantity of the processing order is identical as the counting of the counter received, and the counter is by described Host computer is determined according to the processing order number sent in advance;
When it is described processing order quantity it is identical with the counting of the counter received when, then according to it is described handle order into Row data processing, obtains target data.
In a kind of possible embodiment, above-mentioned receiving module 401 is used for: being received according to the period 1 the multiple The processing order that host computer is sent;
Above-mentioned processing module 402, is also used to: is handled one by one according to second round processing order, is obtained Target data, wherein the period 1 is the integral multiple of the second round.
Example IV
The embodiment of the present application provides a kind of data communications method, the method in method and second embodiment in the present embodiment Type, the difference is that, the present embodiment is described based on the data communication system that upper computer and lower computer is formed, and is implemented Example two is based on slave computer side and is described.The implementation of data communications method in the present embodiment may refer in embodiment two The implementation of data communications method, overlaps will not be repeated.
Referring to Fig. 5, being the flow chart of data communications method provided by the embodiments of the present application.It below will be to shown in fig. 5 Detailed process is described in detail.
Step S501, at least one host computer sends task data to slave computer in multiple host computers.
Wherein, task data includes the processing order and/or the heartbeat bag data of redundancy host computer of the main host computer.
Illustratively, step S501 may include: the processing order that host computer will currently be sent in advance by method of counting Quantity is included in counter;Judge whether counting and the processing order number in order memory of the counter are identical;When When the counting of the counter is identical as the processing order number in order memory, the processing in the order memory is obtained Order is sent to the slave computer.
Illustratively, the processing order that host computer issues can be added to UserCommand by AddCommand method, After one processing order of every addition, counter Counter is made to add 1.Communication is communicated to obtain in UserCommand When processing order, check whether the quantity of the processing order in UserCommand at this time is identical as counter, if quantity phase Together, then the processing order in available UserCommand is obtained, and is sent to slave computer.
Illustratively, if in UserCommand processing order in upper primary transmission, exist processing order leakage Whether hair, the then quantity that may result in the processing order in UserCommand are not identical as counter.
By being checked with counter the quantity of the processing order in UserCommand, so as to improve processing Order is handed down to the correctness and safety of slave computer.
Step S502, the slave computer order according to the processing and carry out data processing, obtain target data.
The target data is sent to the multiple host computer by step S503, the slave computer.
Step S504, each host computer is to other host computer status datas.
Each host computer can send task to slave computer with host computer to the frequency of other host computer status datas The frequency of data is identical, can also be different.Optionally, the communication cycle between host computer can be set according to specific requirements.
Step S505, the display interface that the multiple host computer is updated according to the target data and the status data.
Step S506, when at the appointed time Duan Wei receives the processing order that the main host computer is sent to the slave computer When, the task for the main host computer that any host computer in the redundancy host computer is sent to the slave computer is corresponding Processing order.
Optionally, slave computer can also send acknowledgement acknowledgement message to corresponding host computer after receiving task data, To notify host computer that the task data of its transmission has been received.
After host computer receives acknowledgement acknowledgement message, into next job status to be sent.
If host computer does not receive acknowledgement acknowledgement message, task data will be sent again.
By to host computer send confirmation recycling message can make host computer recognize itself send task data whether It sends successfully, if not successfully, can send again, sends success rate so as to improve task data.
By provided by the embodiments of the present application, slave computer can be connect with multiple host computers by network communication.When wherein When a set of host computer is because of failure (e.g., power-off, Network Abnormal etc.) cisco unity malfunction, slave computer is also able to maintain with other host computers It works normally.For example, slave computer does not receive a certain host computer and sends if a set of host computer is because of failure in certain time Efficient message packet, then it is assumed that both sides' communicating interrupt, slave computer can wait the failure host computer send communication handshake request Information is to re-establish link.At the same time, since the host computer of slave computer and remaining configuration is always maintained at proper network communication, So the display interface of remaining host computer is capable of the state of all signalling arrangements of real-time display, remaining host computer of configuration is maintained just Normal working condition is not influenced by equipment fault host computer, to guarantee host computer equity redundancy, and realizes the nothing of host computer Seaming and cutting are changed.
In addition, the embodiment of the present application also provides a kind of computer readable storage medium, on the computer readable storage medium It is stored with computer program, data communication described in above method embodiment is executed when which is run by processor The step of method.
The computer program product of data communications method provided by the embodiment of the present application, including storing program code Computer readable storage medium, the instruction that said program code includes can be used for executing data described in above method embodiment The step of communication means, for details, reference can be made to above method embodiments, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, flow chart and block diagram in attached drawing Show the device of multiple embodiments according to the application, the architectural framework in the cards of method and computer program product, Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code Part, a part of the module, section or code, which includes that one or more is for implementing the specified logical function, to be held Row instruction.It should also be noted that function marked in the box can also be to be different from some implementations as replacement The sequence marked in attached drawing occurs.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes It can execute in the opposite order, this depends on the function involved.It is also noted that every in block diagram and or flow chart The combination of box in a box and block diagram and or flow chart can use the dedicated base for executing defined function or movement It realizes, or can realize using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each functional module in each embodiment of the application can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.It needs Illustrate, herein, relational terms such as first and second and the like be used merely to by an entity or operation with Another entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this realities The relationship or sequence on border.Moreover, the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability Contain, so that the process, method, article or equipment for including a series of elements not only includes those elements, but also including Other elements that are not explicitly listed, or further include for elements inherent to such a process, method, article, or device. In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, article or equipment in there is also other identical elements.
The foregoing is merely preferred embodiment of the present application, are not intended to limit this application, for the skill of this field For art personnel, various changes and changes are possible in this application.Within the spirit and principles of this application, made any to repair Change, equivalent replacement, improvement etc., should be included within the scope of protection of this application.It should also be noted that similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and explained.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is any Those familiar with the art within the technical scope of the present application, can easily think of the change or the replacement, and should all contain Lid is within the scope of protection of this application.Therefore, the protection scope of the application should be subject to the protection scope in claims.

Claims (10)

1. a kind of data communications method, which is characterized in that be applied to slave computer, the slave computer and multiple host computer communication links It connects, wherein the multiple host computer includes main host computer and redundancy host computer, which comprises
The task data that at least one host computer in the multiple host computer is sent is received, the task data includes the master Want the processing order and/or the heartbeat bag data of redundancy host computer of host computer;
It is ordered according to the processing and carries out data processing, obtain target data;
The target data is sent to the multiple host computer, so that the multiple host computer is according to the updating target data Display interface;
When not receiving the processing order that the main host computer is sent in designated time period, receive in the redundancy host computer Any host computer send processing order.
2. the method according to claim 1, wherein described receive at least one of the multiple host computer After the step of task data that position machine is sent, the method also includes: processing order is detected;
It is described that the step of carrying out data processing, obtaining target data is ordered according to the processing, comprising: when the processing order When detection passes through, processing order is handled one by one, obtains multiple groups target data.
3. according to the method described in claim 2, it is characterized in that, it is described according to the processing order carry out data processing, obtain The step of to target data, comprising:
When the detection of the processing order does not pass through, a processing order is selected according to setting rule from processing order and is carried out Processing, obtains target data.
4. according to the method in claim 2 or 3, which is characterized in that described the step of processing order is detected, Include:
It detects and is ordered in the processing order with the presence or absence of duplicate processing, or whether there is at least two conflicting processing Order;
At least two duplicate processing orders if it does not exist, and there is no at least two conflicting processing orders, then it characterizes The detection of the processing order passes through.
5. the method according to claim 1, wherein the processing for receiving the multiple host computer and sending The step of order, comprising: receive the processing order that the multiple host computer is sent according to the period 1;
It is described that the step of carrying out data processing, obtaining target data is ordered according to the processing, comprising: according to second round to institute It states processing order to be handled one by one, obtains target data, wherein the period 1 is the integral multiple of the second round.
6. a kind of data communications method, which is characterized in that be applied to data communication system, under the data communication system includes: Position machine, multiple host computers with slave computer communication connection, wherein the multiple host computer includes main host computer and redundancy Host computer, which comprises
At least one host computer sends task data to the slave computer in the multiple host computer, and the task data includes institute State the processing order and/or the heartbeat bag data of redundancy host computer of main host computer;
The slave computer orders according to the processing and carries out data processing, obtains target data;
The target data is sent to the multiple host computer by the slave computer;
Each host computer is to other host computer status datas;
The display interface that the multiple host computer is updated according to the target data and the status data;
When at the appointed time Duan Wei receives the processing order that the main host computer is sent to the slave computer, in the redundancy The corresponding processing order of the task for the main host computer that any host computer in the machine of position is sent to the slave computer.
7. according to the method described in claim 6, it is characterized in that, at least one host computer is to described in the multiple host computer Slave computer sends the step of processing order, comprising:
The quantity of the processing order currently sent in advance is included in counter by the host computer by method of counting;
Judge whether counting and the processing order number in order memory of the counter are identical;
When the counting of the counter is identical as the processing order number in order memory, obtain in the order memory Processing order be sent to the slave computer.
8. according to the method described in claim 6, it is characterized in that, the method also includes:
After receiving the task data that the host computer is sent, Xiang Suoshu host computer sends acknowledgement receipt and disappears the slave computer Breath;
The host computer is after receiving the acknowledgement acknowledgement message, into next job status to be sent.
9. a kind of electronic equipment characterized by comprising processor, memory and bus, the memory are stored with the place The executable computer program of device is managed, it is logical by bus between the processor and the memory when electronic equipment operation The step of letter, the computer program executes method as claimed in claim 1 to 5 when being executed by the processor.
10. a kind of data communication system, which is characterized in that the data communication system includes: slave computer, logical with the slave computer Believe multiple host computers of connection, the multiple host computer includes main host computer and redundancy host computer, in which:
The host computer, for sending task data to the slave computer, the task data includes the main host computer The heartbeat bag data of processing order and/or redundancy host computer;
The host computer is also used to other host computer status datas into the multiple host computer;
The slave computer, the task data sent for receiving the multiple host computer;
The slave computer carries out data processing for ordering according to the processing, obtains target data;
The slave computer, for the target data to be sent to the multiple host computer;
The multiple host computer, for updating display interface according to the target data and the status data;
Any host computer in the redundancy host computer is also used to when at the appointed time Duan Wei receives the master to the slave computer When the processing order for wanting host computer to send, the corresponding processing of task for the main host computer that Xiang Suoshu slave computer is sent Order.
CN201910519199.1A 2019-06-14 2019-06-14 Data communications method and system Pending CN110166306A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910519199.1A CN110166306A (en) 2019-06-14 2019-06-14 Data communications method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910519199.1A CN110166306A (en) 2019-06-14 2019-06-14 Data communications method and system

Publications (1)

Publication Number Publication Date
CN110166306A true CN110166306A (en) 2019-08-23

Family

ID=67625668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910519199.1A Pending CN110166306A (en) 2019-06-14 2019-06-14 Data communications method and system

Country Status (1)

Country Link
CN (1) CN110166306A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297035A (en) * 2021-06-18 2021-08-24 卡斯柯信号有限公司 Computer interlocking system main operating machine judgment method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201830279U (en) * 2010-10-11 2011-05-11 天津市泰华科技有限公司 Device for realizing hot standby of log data in petroleum logging system
CN103777594A (en) * 2013-12-27 2014-05-07 徐工集团工程机械股份有限公司道路机械分公司 Control method for asphalt mixing station control system with two synchronously online upper computers
CN104407923A (en) * 2014-10-31 2015-03-11 百度在线网络技术(北京)有限公司 Cluster task balancing method and device based on single node triggering
CN105700344A (en) * 2016-03-14 2016-06-22 上海东铸智能科技有限公司 Sewing assembly line redundancy control system
US20160283251A1 (en) * 2015-03-23 2016-09-29 Yokogawa Electric Corporation Redundant pc system
CN106664226A (en) * 2014-05-30 2017-05-10 苹果公司 Controller networks for an accessory management system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201830279U (en) * 2010-10-11 2011-05-11 天津市泰华科技有限公司 Device for realizing hot standby of log data in petroleum logging system
CN103777594A (en) * 2013-12-27 2014-05-07 徐工集团工程机械股份有限公司道路机械分公司 Control method for asphalt mixing station control system with two synchronously online upper computers
CN106664226A (en) * 2014-05-30 2017-05-10 苹果公司 Controller networks for an accessory management system
CN104407923A (en) * 2014-10-31 2015-03-11 百度在线网络技术(北京)有限公司 Cluster task balancing method and device based on single node triggering
US20160283251A1 (en) * 2015-03-23 2016-09-29 Yokogawa Electric Corporation Redundant pc system
CN105700344A (en) * 2016-03-14 2016-06-22 上海东铸智能科技有限公司 Sewing assembly line redundancy control system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297035A (en) * 2021-06-18 2021-08-24 卡斯柯信号有限公司 Computer interlocking system main operating machine judgment method
CN113297035B (en) * 2021-06-18 2022-07-26 卡斯柯信号有限公司 Method for judging main operating machine of computer interlocking system

Similar Documents

Publication Publication Date Title
CN110868451B (en) Edge Internet of things agent terminal based on container technology and work flow thereof
CN105629925B (en) Time stab and synchronization for single line secure communication
CN110376876B (en) Double-system synchronous safety computer platform
CN103019836B (en) State switching method and electronic equipment
CN107660289A (en) Automatic network controls
CN101609308A (en) A kind of industrial intelligent terminal and control method thereof based on the RFID data acquisition function
CN103738369B (en) Based on the ATS equipment and system of OPC UA technology
CN105306605B (en) A kind of double host server systems
CN104662515A (en) Dynamically erectable computer system
CN107533527A (en) Master/slave management for Redundant process controller module
CN110363118A (en) Behavior monitoring method, apparatus, system and the storage medium of target object
CN208092902U (en) A kind of Intelligent bus type pyrotechnics alarm system
CN105051692A (en) Automated failure handling through isolation
CN110166306A (en) Data communications method and system
CN104467188B (en) A kind of O&M safety control system of transformer station
CN108964977A (en) Node abnormality eliminating method and system, storage medium and electronic equipment
CN109633345A (en) A kind of secondary device on-line monitoring and analytical equipment
CN103744365A (en) Bridging module for communication between room control terminal and upper computer and method thereof
CN206850428U (en) Power grid risk forecasting system, processing system and managing and control system
CN110239575A (en) Multiply two logic control implementations and the systems for taking two based on two
CN102546581A (en) Multimedia intelligent management platform with monitoring recording capability
CN109218096A (en) A kind of SCADA real-time database access system based on master-slave redundancy
CN109308041A (en) A kind of control system, haulage equipment and the production line of display base plate haulage equipment
CN102355370A (en) Method for Ethernet board-level protection, device and system
CN203694490U (en) Firefighting information management system based on Internet of Things

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190823