CN108446250A - A kind of method communicated between multi -CPU - Google Patents

A kind of method communicated between multi -CPU Download PDF

Info

Publication number
CN108446250A
CN108446250A CN201810200579.4A CN201810200579A CN108446250A CN 108446250 A CN108446250 A CN 108446250A CN 201810200579 A CN201810200579 A CN 201810200579A CN 108446250 A CN108446250 A CN 108446250A
Authority
CN
China
Prior art keywords
communication
cpu
data
real
setting
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
CN201810200579.4A
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 Shen Xing Robot Technology Co Ltd
Original Assignee
Shanghai Shen Xing Robot Technology 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 Shen Xing Robot Technology Co Ltd filed Critical Shanghai Shen Xing Robot Technology Co Ltd
Priority to CN201810200579.4A priority Critical patent/CN108446250A/en
Publication of CN108446250A publication Critical patent/CN108446250A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Abstract

The invention discloses a kind of methods communicated between multi -CPU, include the following steps:S1:Electric signal connects the network communication port between multiple CPU;S2:Check hardware net connection;S3:Confirm that communication setting is correct;S4:Monitor communication data in real time, it is normal for communication if communication data real-time change, if communication data does not have real-time change to enter S5;S5:It checks whether communication setting is correct, jumps to S2 if setting is correct, otherwise jump to S3;CPU judges whether Current communications are normal by the variation of real-time monitoring data, if communication data real-time change, communication is normal, if communication data does not have real-time change, Communications failure to need rechecking, until communicating successfully, without additional hardware cost, the ID of setting hardware address itself and affiliate writes communication program and realizes communication, save hardware cost, simplify hardware configuration, while the debugging task amount of engineer can also be reduced, makes the investigation job simplification of failure.

Description

A kind of method communicated between multi -CPU
Technical field
The present invention relates to communication technique fields between multi -CPU, more specifically, it relates to communicated between a kind of multi -CPU Method.
Background technology
As the degree that the intellectualization of factories requires is higher and higher, the creation data generated in factory's operational process is increasingly It is more, for the production number that timely processing is numerous and jumbled, need to carry out data exchange in factory between multiple data processing equipments.
In the prior art, it needs to be connected with dedicated data circuit switching equipment between multiple data processing equipments to come into line number According to communication, avoid between data processing equipment the disunity due to communications protocol and the error rate due to data be excessively high and nothing Method communicates.
However increase data circuit switching equipment between multiple data processing equipments, additional hardware cost can be increased, make work The intelligentized hardware structure of factory becomes more complicated.
Invention content
The technical issues of technical solution of the present invention is solved is to increase data switch between multiple data processing equipments to set It is standby, additional hardware cost can be increased, the hardware structure of the intellectualization of factories is made to become more complicated.
To achieve the above object, technical solution of the present invention provides a kind of method communicated between multi -CPU, including walks as follows Suddenly:
S1:Electric signal connects the network communication port between multiple CPU;
S2:Check hardware net connection;
S3:Confirm that communication setting is correct;
S4:Monitor communication data in real time, it is normal for communication if communication data real-time change, if communication data does not have real-time change Then enter S5;
S5:It checks whether communication setting is correct, jumps to S2 if setting is correct, otherwise jump to S3.
Through the above technical solutions, after hardware net connection, software setting are correct, CPU passes through real-time monitoring data Variation judge whether Current communications normal, if communication data real-time change, communication is normal, if communication data is not real-time Variation, then Communications failure, needs rechecking, until communicating successfully, by the communication function of CPU itself, is not necessarily to additional hardware Cost, the ID of setting hardware address itself and affiliate write communication program and realize communication, save hardware cost, simplify hard Part structure, while the debugging task amount of engineer can also be reduced, make the investigation job simplification of failure.
Further, further include in step S3:
S31:Communications exchange data block is set in the CPU;
S32:The communications exchange data block is sent to other CPU;
S33:Receive the communications exchange data block of other CPU;
S34:Compare the communications exchange data block that the communications exchange data block being arranged in the CPU is received with it;
S35:If comparison result be it is identical if between multiple CPU communication setting it is correct, if comparison result difference represent it is more Communication setting is abnormal between a CPU.
Through the above technical solutions, by comparing the communications exchange data block on different CPU, to judge multiple CPU Between communication setting it is whether correct, using the communication data block set can reduce confirm setting correct procedure complexity With difficulty.
Further, further include in step S4:
S41:A random CPU generates heartbeat data, and the heartbeat data is transmitted along the communication link of multiple CPU;
S42:Heartbeat data described in multiple CPU detecting real-times;
S43:If multiple CPU can detect the heartbeat data, communication is normal, if there are the CPU not to detect The heartbeat data is measured, then Communications failure.
Through the above technical solutions, participating in whether communication normally judges that heartbeat data can judge using heartbeat data Whether the data communicated between CPU malfunction, that is, exchange, and communicate and fail if occurring exchanging, and need to reconnect, really The correctness of data communication after protecting.
Further, step S42 further includes:
S421:The CPU is detected and the heartbeat data is saved as target data after the heartbeat data;
S422:The CPU continues to detect saves as correction data after the heartbeat data by the heartbeat data;
S423:Compare the target data and the correction data;
S424:If comparing result is identical, communication is represented normally, Communications failure is represented if comparing result is difference.
Through the above technical solutions, detecting the heart while detecting heartbeat data with correction data by comparing target data The correctness of hop count evidence, if heartbeat data is incorrect, the error rate of communication can greatly improve, it is therefore desirable to reconnect, really Protect the correctness of data communication.
Further, step S42 further includes:S425:The target data is updated using the correction data.
Through the above technical solutions, newer effect is to enable heartbeat data ceaselessly self-test, verify on same CPU Heartbeat data whether sustainedly and stably transmit.
Further, step S43 further includes:
S431:If Communications failure, stop communication between multiple CPU, and be simultaneously emitted by error signal.
Through the above technical solutions, stopping communication being avoided that CPU receives the data of mistake and executes wrong action, report Wrong signal then can prompt system and employee's Communications failure, so that system is made corrective action with employee.
Further, electric signal connection is realized in the network communication port between multiple CPU by network cable.
Through the above technical solutions, will produce electromagnetic interference when carrying out data transmission between CPU, carried out using network cable Electric signal connection can avoid data by electromagnetic interference, reduce the packet loss of communication.
The advantageous effect of technical solution of the present invention includes at least:Network cable is first used to realize that the hardware of network connection connects It connects, ensures the connection basis of CPU communications, communications protocol is then arranged according to CPU, Partnership partner and communication modes are set, Software setting is carried out, after software setting is correct, whether just CPU judges Current communications by the variation of real-time monitoring data Often, if communication data real-time change, communication is normal, if communication data does not have real-time change, Communications failure to need to repeat to examine It looks into, until communicating successfully, by the communication function of CPU itself, is not necessarily to additional hardware cost, setting hardware address itself and cooperation The ID of partner writes communication program and realizes communication, save hardware cost, simplifies hardware configuration, while can also reduce engineer's Debugging task amount makes the investigation job simplification of failure.
Description of the drawings
Fig. 1 is the method flow schematic diagram of the embodiment of the present invention;
Fig. 2 is the method flow schematic diagram of S3 of the embodiment of the present invention;
Fig. 3 is the method flow schematic diagram of S4 of the embodiment of the present invention;
Fig. 4 is the method flow schematic diagram of S42 of the embodiment of the present invention.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described.
Embodiment
A kind of method communicated between multi -CPU, based on multiple production equipments containing CPU, as shown in Figure 1, including as follows Step:
Step S1:Electric signal connects the network communication port between multiple CPU.Network communication end of the employee between multiple CPU Mouth passes through network cable and realizes electric signal connection.It will produce electromagnetic interference when carrying out data transmission between CPU, use network cable Data can be avoided by electromagnetic interference into horizontal electrical signal connection, reduce the packet loss of communication.
Step S2:Check hardware net connection.Employee first observes the connection correctness between CPU, then detects adjacent C PU Between whether have electric signal transmission, if can't detect electric signal transmission, represent network cable damage, need replacing new network Cable.
Step S3:Confirm that communication setting is correct.Parameter in CPU in runs software needs employee to set in advance, setting Whether employee needs the parameter checked in runs software correct after good.
As shown in Fig. 2, wherein step S3 further includes step S31, step S32, step S33, step S34 and step S35.
Step S31:Communications exchange data block is set in CPU.The communications exchange data block being arranged in each CPU is identical, And send communications exchange data block according to the outside adjacent C PU of the frequency of setting.
Step S32:Communications exchange data block is sent to other CPU.
Step S33:Receive the communications exchange data block of other CPU.
Step S34:Compare the communications exchange data block that the communications exchange data block being arranged in CPU is received with it.CPU is used Whether the communications exchange data block that built-in comparison program comes communications exchange data block and reception built in comparison is consistent.
Step S35:If comparison result be it is identical if between multiple CPU communication setting it is correct, if comparison result difference generation Communication setting is abnormal between the multiple CPU of table.It is more to judge by comparing the communications exchange data block with reception built in CPU Whether communication setting is correct between a CPU, can be reduced using the communication data block set and confirm answering for setting correct procedure Miscellaneous degree and difficulty.
Step S4:Monitor communication data in real time, it is normal for communication if communication data real-time change, if communication data does not have Real-time change then enters S5.
As shown in figure 3, wherein step S4 further includes step S41, step S42 and step S43.
Step S41:A random CPU generates heartbeat data, and heartbeat data is transmitted along the communication link of multiple CPU.It is different CPU generate heartbeat data be identical, but its generate time be that can improve not necessarily identical, the different time CPU detects the accuracy of determining communication data after heartbeat data.
Step S42:Multiple CPU detecting real-times heartbeat datas.As shown in figure 4, wherein step S42 further include step S421, Step S422, step S423, step S424 and step S425.
Step S421:CPU is detected and heartbeat data is saved as target data after heartbeat data.
Step S422:CPU continues to detect saves as correction data after heartbeat data by heartbeat data.
Step S423:Compare target data and correction data.
Step S424:If comparing result is identical, communication is represented normally, representing communication if comparing result is difference loses It loses.
Step S425:Target data is updated using correction data.Newer effect is to enable heartbeat data ceaselessly Self-test, verifies whether the heartbeat data on same CPU sustainedly and stably transmits.
The correctness of heartbeat data is detected while detecting heartbeat data by comparing target data and correction data, If heartbeat data is incorrect, the error rate of communication can greatly improve, it is therefore desirable to reconnect, it is ensured that data communication it is correct Property.
Return to Fig. 3, step S43:If multiple CPU can detect heartbeat data, communication is normal, if there are CPU not to have Heartbeat data is detected, then Communications failure.Wherein step S43 further includes step S431:If Communications failure, between multiple CPU Stop communication, and is simultaneously emitted by error signal.Stop communication and is avoided that CPU receives the data of mistake and executes the dynamic of mistake Make, error signal then can prompt system and employee's Communications failure, so that system is made corrective action with employee.
Step S5:It checks whether communication setting is correct, jumps to S2 if setting is correct, otherwise jump to S3.
Technical solution of the present invention reduces electromagnetic interference pair by first using network cable to realize that the hardware of network connection connects The influence that communication data generates ensures the stability of the hardware connection of CPU communications, communications protocol, setting then is arranged according to CPU Partnership partner and communication modes carry out software setting, after software setting is correct, CPU passes through real-time monitoring data Change to judge whether Current communications are normal, CPU can be put into heartbeat data in communication data, and participating in communication using heartbeat data is No normal judgement, heartbeat data can judge whether the data communicated between CPU malfunction, that is, exchange, if exchanging It then communicates and fails, need to reconnect, it is ensured that the correctness of later data communication.If communication data is normal and becomes in real time Change, then communication is normal, if communication data does not have real-time change, Communications failure to need rechecking, until communicating successfully.It is logical The communication function of CPU itself is crossed, additional hardware cost is not necessarily to, the ID of setting hardware address itself and affiliate writes communication Program realizes communication, saves hardware cost, simplifies hardware configuration, while can also reduce the debugging task amount of engineer, makes failure Investigation job simplification.
The above is only a preferred embodiment of the present invention, protection scope of the present invention is not limited merely to above-mentioned implementation Example, all technical solutions belonged under thinking of the present invention all belong to the scope of protection of the present invention.It should be pointed out that for the art Those of ordinary skill for, several improvements and modifications without departing from the principles of the present invention, these improvements and modifications It should be regarded as protection scope of the present invention.

Claims (7)

1. a kind of method communicated between multi -CPU, which is characterized in that include the following steps:
S1:Electric signal connects the network communication port between multiple CPU;
S2:Check hardware net connection;
S3:Confirm that communication setting is correct;
S4:Monitor communication data in real time, it is normal for communication if communication data real-time change, if communication data does not have real-time change Then enter S5;
S5:It checks whether communication setting is correct, jumps to S2 if setting is correct, otherwise jump to S3.
2. according to the method described in claim 1, it is characterized in that, further including in step S3:
S31:Communications exchange data block is set in the CPU;
S32:The communications exchange data block is sent to other CPU;
S33:Receive the communications exchange data block of other CPU;
S34:Compare the communications exchange data block that the communications exchange data block being arranged in the CPU is received with it;
S35:If comparison result be it is identical if between multiple CPU communication setting it is correct, if comparison result difference represent it is more Communication setting is abnormal between a CPU.
3. according to the method described in claim 2, it is characterized in that, further including in step S4:
S41:A random CPU generates heartbeat data, and the heartbeat data is transmitted along the communication link of multiple CPU;
S42:Heartbeat data described in multiple CPU detecting real-times;
S43:If multiple CPU can detect the heartbeat data, communication is normal, if there are the CPU not to detect The heartbeat data is measured, then Communications failure.
4. according to the method described in claim 3, it is characterized in that, step S42 further includes:
S421:The CPU is detected and the heartbeat data is saved as target data after the heartbeat data;
S422:The CPU continues to detect saves as correction data after the heartbeat data by the heartbeat data;
S423:Compare the target data and the correction data;
S424:If comparing result is identical, communication is represented normally, Communications failure is represented if comparing result is difference.
5. according to the method described in claim 4, it is characterized in that, step S42 further includes:S425:Use the correction data Update the target data.
6. according to the method described in claim 5, it is characterized in that, step S43 further includes:
S431:If Communications failure, stop communication between multiple CPU, and be simultaneously emitted by error signal.
7. according to the method described in claim 6, it is characterized in that, the network communication port between multiple CPU passes through network electricity Cable realizes electric signal connection.
CN201810200579.4A 2018-03-12 2018-03-12 A kind of method communicated between multi -CPU Pending CN108446250A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810200579.4A CN108446250A (en) 2018-03-12 2018-03-12 A kind of method communicated between multi -CPU

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810200579.4A CN108446250A (en) 2018-03-12 2018-03-12 A kind of method communicated between multi -CPU

Publications (1)

Publication Number Publication Date
CN108446250A true CN108446250A (en) 2018-08-24

Family

ID=63194149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810200579.4A Pending CN108446250A (en) 2018-03-12 2018-03-12 A kind of method communicated between multi -CPU

Country Status (1)

Country Link
CN (1) CN108446250A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111148169A (en) * 2019-12-12 2020-05-12 西安冉科信息技术有限公司 Network switching method based on WiFi
CN111162987A (en) * 2019-11-29 2020-05-15 西安优信机电工程有限公司 Real-time communication method based on multiple objects
WO2022140961A1 (en) * 2020-12-28 2022-07-07 西安大医集团股份有限公司 Method for monitoring communication connection, medical system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020152431A1 (en) * 2001-04-13 2002-10-17 Fleming Roger A. System and method for detecting process and network failures in a distributed system
CN1734997A (en) * 2004-08-11 2006-02-15 华为技术有限公司 Data transmission method
CN101714991A (en) * 2009-10-30 2010-05-26 清华大学 Method for realizing heartbeat mechanism
CN102546233A (en) * 2011-11-28 2012-07-04 中标软件有限公司 Method for realizing serial heartbeat in high-availability cluster
CN205725744U (en) * 2016-04-28 2016-11-23 深圳市莱克威尔科技有限公司 A kind of two heart yearn one-port network transparent transmission equipments

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020152431A1 (en) * 2001-04-13 2002-10-17 Fleming Roger A. System and method for detecting process and network failures in a distributed system
CN1734997A (en) * 2004-08-11 2006-02-15 华为技术有限公司 Data transmission method
CN101714991A (en) * 2009-10-30 2010-05-26 清华大学 Method for realizing heartbeat mechanism
CN102546233A (en) * 2011-11-28 2012-07-04 中标软件有限公司 Method for realizing serial heartbeat in high-availability cluster
CN205725744U (en) * 2016-04-28 2016-11-23 深圳市莱克威尔科技有限公司 A kind of two heart yearn one-port network transparent transmission equipments

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
秦智 等: "《网络系统集成》", 31 August 2017, 西安电子科技大学出版社 *
贡国忠 等: "《计算机网络与系统集成项目化教程》", 31 July 2015, 苏州大学出版社 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111162987A (en) * 2019-11-29 2020-05-15 西安优信机电工程有限公司 Real-time communication method based on multiple objects
CN111148169A (en) * 2019-12-12 2020-05-12 西安冉科信息技术有限公司 Network switching method based on WiFi
WO2022140961A1 (en) * 2020-12-28 2022-07-07 西安大医集团股份有限公司 Method for monitoring communication connection, medical system and storage medium

Similar Documents

Publication Publication Date Title
CN108446250A (en) A kind of method communicated between multi -CPU
CN104242450B (en) Method for monitoring state of wireless module in power distribution system
CN105450469A (en) Method for detecting faults of rapid communication bus in industrial equipment
CN109560993A (en) The method of communication link abnormality detection, device, electronic equipment and network
CN204695087U (en) A kind of DCS controller redundant apparatus
CN105871569A (en) Method and device for automatic detection of OTN network fault node
CN113315572B (en) Detection method and device for optical module physical link, optical module and optical transmission system
US20160217053A1 (en) Interpreting signals received from redundant buses
WO2015196754A1 (en) Method, device and client terminal device for improving reliability of device having plurality of modules
CN104104150A (en) Performance data acquisition method for terminal access equipment of power transmission and distribution communication network
CN103001808A (en) Switch for detecting port faults and achieving method
CN104793601A (en) DCS (distributed control system) controller redundancy device and method
CN106154071A (en) A kind of device and method detecting intelligent electric energy meter RS485 bus failure
KR20200116784A (en) Network Error Detection Method
CN110749046B (en) Air conditioner control method and device, air conditioner and computer readable storage medium
CN105721172B (en) The processing method and master-slave system of communication failure in master-slave system
CN108733523A (en) bus robustness test method and system
CN112711502B (en) Gao Wenkao machine testing method, control end, tooling end and system for iMS-CPU board
CN108319842A (en) Lease purifying drinking appliance unlocking method, system and server
CN113542052A (en) Node fault determination method and device and server
CN105939224A (en) Method and device for solving double-master problem of double-equipment hot standby
CN102291266A (en) Loopback (LB) detection method and device
CN102510523A (en) Socket communication interactive testing method and network television testing system using same
KR100216580B1 (en) Method for managing communication error status between atm exchanger and operation workstation
CN117311136B (en) Dual-computer operation method and device based on interconnection heartbeat monitoring mechanism

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: 20180824