A kind of internal memory shared network framework and protocol specification thereof
Technical field
The present invention relates to the communications field, be specifically related to a kind of internal memory shared network framework and protocol specification thereof.
Background technology
In robot, industrial control field, flourish along with industrial automation and the communication technology, sets up oneIt is more and more important that the network of high efficient and reliable has become. In Industry Control, industrial computer often need to be established with otherHow standby communicating, therefore, set up a networking flexibility, and autgmentability is strong and can Real time data shareCommunication network is a current research direction.
In prior art, communication network is to send request message by main equipment, the receiving from equipment of appointmentAfter request message, send response message, and other are not processed to request message from equipment, therefore, communicationNetwork can only realize individual equipment or broadcast mode carries out the operation of individual data address, and therefore cannot realizeThe Synchronization Control of the data of multiple equipment, multiple discontinuous addresses. Meanwhile, while communicating between equipment,When one of every increase needs the physical quantity of communication, need to rewrite a Communication processing function about this physical quantity,In the time that the quantity of communication physical quantity of adding is more, while maybe needing to repeat to revise, be pretty troublesome thing, leadCause reduction operating efficiency.
Summary of the invention
The object of the invention is to overcome weak point of the prior art, a kind of internal memory shared network framework is providedAnd protocol specification, solve in prior art and carried out single owing to can only realizing individual equipment or broadcast modeThe operation of data address and can not realize the problem of Real time data share, high Real time data share, autgmentability is strong,Cost is low.
The embodiment of the present invention provides a kind of method of internal memory shared network, comprising:
Multiple standby hosts data sharing request message that Receiving Host sends simultaneously, described data sharing request messageComprise memory table mark, communication instruction and multiple data address;
In described multiple standby hosts, the standby host corresponding with described data sharing request message sends data sharing and ringsAnswer message to described main frame and all the other standby hosts, so that described main frame and all the other standby hosts complete described data sharingOperation, described data sharing response message comprises memory table mark, communication instruction and multiple data address;
Multiple standby hosts resolve described data sharing request or response message, and according to after described parsingDescribed memory table mark, communication instruction and multiple data address, one or more memory tables that this locality is preservedCarry out multiple data sharing operations;
The embodiment of the present invention also provides a kind of method of internal memory shared network, comprising:
Main frame sends described data sharing request message to multiple standby hosts, and described data sharing request message comprisesMemory table mark, communication instruction and multiple data address;
Main frame receives the data sharing response message of the standby host transmission that described data sharing request message is corresponding, instituteState data sharing response message and comprise memory table mark, communication instruction and multiple data address;
Main frame is resolved described data sharing response message, and according to the described memory table after described parsingMark, communication instruction and multiple data address, one or more memory tables that this locality is preserved carry out multiple numbersAccording to sharing operation, described data sharing operation comprises access memory table and extended operation;
The embodiment of the present invention also provides a kind of device of internal memory shared network, comprising:
Described multiple device and main frame form a communication network, and described device comprises:
Receiving element, the data sharing request message sending for receiving described main frame, described data sharing pleaseAsk message to comprise memory table mark, communication instruction and multiple data address;
Transmitting element, sends data sharing response report for the device corresponding with described data sharing request messageLiterary composition is to described main frame and all the other devices, and described data sharing response message comprises memory table mark, communication instructionAnd multiple data addresses;
Resolution unit, for resolving described data sharing request or response message;
Operating unit, for according to described memory table mark, communication instruction and multiple data after described parsingAddress, one or more memory tables that this locality is preserved carry out multiple data sharing operations;
The embodiment of the present invention also provides a kind of device of internal memory shared network, comprising:
Transmitting element, for sending described data sharing request message to multiple standby hosts, described data sharing pleaseAsk message to comprise memory table mark, communication instruction and multiple data address;
Receiving element, rings for the data sharing that receives the standby host transmission that described data sharing request message is correspondingAnswer message, described data sharing response message comprises memory table mark, communication instruction and multiple data address;
Resolution unit, for described data sharing response message is resolved, and according to after described parsingDescribed memory table mark, communication instruction and multiple data address;
Operating unit, carries out multiple data sharing operations for one or more memory tables that this locality is preserved,Described data sharing operation comprises access memory table and extended operation.
The embodiment of the present invention also provides a kind of system of internal memory shared network, comprises main frame and multiple standby host, itsIn,
Described multiple standby host, the data sharing request message sending for receiving described main frame, described manyIn individual standby host, the standby host corresponding with described data sharing request message send data sharing response message to described inMain frame and all the other standby hosts, described data sharing request or response message comprise memory table mark, communication instructionAnd multiple data addresses, described data sharing request or response message are resolved, and according to described parsingAfter described memory table mark, communication instruction and multiple data address, to this locality preserve one or more inDeposit table and carry out multiple data sharing operations;
Described main frame, for sending described data sharing request message to multiple standby hosts, receives described data altogetherEnjoy the data sharing response message of the standby host transmission that request message is corresponding, described data sharing request or response reportLiterary composition comprises memory table mark, communication instruction and multiple data address, and described data sharing response message is carried outResolve, and according to described memory table mark, communication instruction and multiple data address after described parsing, to thisOne or more memory tables that ground is preserved carry out multiple data sharing operations, and described data sharing operation comprises visitAsk memory table and extended operation. The method, the Apparatus and system that provide by the embodiment of the present invention, multiple standby hostsThe data sharing request message that Receiving Host sends simultaneously, in described multiple standby hosts, is total to described dataEnjoy the standby host that request message is corresponding and send data sharing response message to described main frame and all the other standby hosts, to instituteState data sharing request or response message and resolve, and according to the described memory table mark after described parsing,Communication instruction and multiple data address, one or more memory tables that this locality is preserved carry out multiple data sharingsOperation, has solved in prior art and has carried out individual data address owing to can only realizing individual equipment or broadcast modeOperation and can not realize the problem of Real time data share, high Real time data share, autgmentability is strong, cost is low.
Brief description of the drawings
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, required in describing embodiment belowThe accompanying drawing using is briefly described, and apparently, the accompanying drawing in the following describes is of the present invention oneA little embodiment, for those of ordinary skill in the art, are not paying under the prerequisite of creative work, alsoCan obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the transverse set rack composition of the embodiment of the present invention one;
Fig. 2 is longitudinal group-network construction figure of the embodiment of the present invention one;
Fig. 3 is the method flow diagram of the embodiment of the present invention one;
Fig. 4 is the method flow diagram of the embodiment of the present invention two;
Fig. 5 is the method flow diagram of the embodiment of the present invention three;
Fig. 6 is the installation drawing of the embodiment of the present invention four.
Detailed description of the invention
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the present inventionAccompanying drawing in embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention, obviously,Described embodiment is the present invention's part embodiment, instead of whole embodiment. In the present inventionEmbodiment, it is all that those of ordinary skill in the art obtain under the prerequisite of not making creative workOther embodiment, belong to the scope of protection of the invention.
Embodiment mono-
Fig. 1 is the transverse set rack composition of the embodiment of the present invention one, as shown in Figure 1, equal to n from equipment 1Be connected in the half-duplex transmission bus of transceiver, main equipment by this bus and multiple from equipment carry out withTime, synchronous message transmissions.
Fig. 2 is longitudinal group-network construction figure of the embodiment of the present invention one, when each equipment has at least two half-duplexsWhen communication interface, can realize the portrait network of string bus, realize the memory table data sharing between each equipment.As shown in Figure 2, can be connected from equipment with another from equipment, form vertical structure.
Those skilled in the art are also appreciated that on the basis of Fig. 1 and Fig. 2, can also be in conjunction with Fig. 1 andThe framework of Fig. 2, in the time that each equipment has two half-duplex operation interfaces at least, can realize common, string busTwo peacekeeping multidimensional group-network constructions, realize the memory table data sharing between each equipment.
It should be noted that, in Fig. 1 and Fig. 2, main frame and standby host are all that the half-duplex based on transmitting-receiving conllinear hasIn line or radio physical bus, realize. Main frame can be again main equipment, and standby host can be named from equipment again.
For active and standby machine, each equipment comprises at least a memory table, in each memory table, all storing,Comprise this memory table and be identified at interior various types of data. Each equipment all can be at self-contained memory tableIn read and write data. And each equipment all can receive and resolve, according to the word of designated character format permutationSymbol string, this character string is referred to as message. Wherein, the message that main frame or main equipment send is called request message,Standby host or the message sending from equipment are called response message, and response message is divided into: normal response message, abnormalResponse message. Exception response message is used for telling main equipment, the abnormal problem existing in request message, forCheck trunk and investigation problem, also for allowing main equipment carry out further communication debugging.
In addition, each equipment (main frame and standby host) all can receive and resolve all messages in network, bagDraw together request message and response message, and according to the communication instruction in message, carry out associative operation. In addition, everyIndividual from equipment in the time receiving request message, all can be according to the response identification of accessed memory table, determine to beNo this request message is responded.
In message, endian formats, comprises following part:
Start-of-text character: for identifying effective message, for example, this starting character is made up of two characters, suitableOrder is 0xAA, and the described message of 0x55 is request message, and order is 0x55, the described message of 0xAAFor response message.
Quantity descriptor: for describing the quantity of the memory table that will carry out communication and the number of addresses of carrying out communication,For example, specifying high 4 of this character is memory table quantity, and low 4 is data address quantity.
Memory table mark is described district: according to the memory table quantity in quantity descriptor, deposit the memory table of this quantityMark.
Data address is described district: according to the data address quantity in quantity descriptor, deposit the data ground of this quantityLocation first address and data address length.
Communication instruction: the operational order that will carry out of describing this message.
Data segment is described district: according to the description of communication instruction, deposit communication instruction described data characterQuantity.
CRC16 verification: according to the CRC16 standard of specifying, the CRC16 verification about this message of generation.
Fig. 3 is the method flow diagram of the embodiment of the present invention one, as shown in Figure 3, and the flow process of internal memory shared networkAs follows:
S101, multiple standby host data sharing request message that Receiving Host sends simultaneously, described data sharing pleaseAsk message to comprise memory table mark, communication instruction and multiple data address;
Data sharing represents that the data that multiple active and standby organizational securities are deposited are all identical. In embodiments of the present invention,Reaching the data that multiple active and standby organizational securities deposit is all this identical effect, need to by between active and standby machine by logarithmAccording to increase, delete and amendment wants synchronous, the embodiment of the present invention has adopted a main frame to issue many standby hostsInstruction, so that many modes that standby host is all processed the data of this locality preservation.
Before multiple standby hosts data sharing message that Receiving Host sends simultaneously, main frame is treated the internal memory of operationTable mark, communication instruction and multiple data address encapsulate into described data sharing request message, and described in sendingData sharing request message is to the plurality of standby host.
S102, in described multiple standby hosts, the standby host corresponding with described data sharing request message sends dataShare response message to described main frame and all the other standby hosts, so that described main frame and all the other standby hosts complete described numberAccording to sharing operation, described data sharing response message comprises memory table mark, communication instruction and multiple data groundLocation;
Data sharing response message comprises normal response message and exception response message, when described data sharing ringsWhile answering message to be exception response message, described main frame is carried out failure detection operations. And normal response report ifWen Shi, does not carry out above-mentioned failure detection operations.
It should be noted that, multiple standby hosts can be that wherein one or more standby hosts that main frame is specified send this numberAccording to shared response message, other standby host does not send data sharing response message, and the embodiment of the present invention to this alsoUnrestrictedly. The one or more standby hosts of specifying send data sharing response messages with data sharing request messageCorresponding standby host, this standby host sends data sharing response message to main frame and all the other standby hosts, and main frame is standby with all the otherThis data sharing response message is responsible for receiving and is resolved to machine. And receive that at main frame and all the other standby hosts data sharing ringsAnswer after message, if this data sharing response message is normal response message, main frame and all the other standby hosts are heldThe data sharing operation that row is same. By above-mentioned method, when main frame and all the other standby hosts are received after response message,Can obtain the data of all accessed memory tables, and be updated in this equipment, like this, just can realize instituteThere is data the sharing on each equipment of memory table.
S103, described main frame and multiple standby host are resolved described data sharing request or response message, andAccording to described memory table mark, communication instruction and multiple data address after described parsing, this locality is preservedOne or more memory tables carry out multiple data sharing operations;
It should be noted that to only have and receive after this data sharing response message when main frame and all the other standby hosts, main frameWith just executing data sharing operation of standby host.
In each message, comprise the character of communication instruction, this character is for describing the effective object of this message and rightThe operation of this object, makes the scope of message effect mainly be divided into two kinds: access memory table, extended operation.Concrete be that the data in memory table are added, deleted or change operation.
It should be noted that, main frame and multiple standby host carry out data sharing operation simultaneously, specifically comprise:
According to memory table mark, confirm to identify corresponding memory table with described memory table;
According to multiple data addresses, confirm that described memory table identifies data to be operated in corresponding memory tableAddress, and according to described communication instruction, described data are carried out to data sharing operation. And, data sharing operationComprise growth data, or change described data, or delete described data.
The method providing by the embodiment of the present invention, the data sharing that Receiving Host sends simultaneously of multiple standby hosts pleaseAsk message, in described multiple standby hosts, the standby host corresponding with described data sharing request message sends data altogetherEnjoy response message to described main frame and all the other standby hosts, main frame and multiple standby host to described data sharing request orResponse message is resolved, and according to described memory table mark, communication instruction and multiple number after described parsingAccording to address, one or more memory tables that this locality is preserved carry out multiple data sharing operations, have solved existingIn technology, can not realize owing to can only realizing individual equipment or broadcast mode to carry out the operation of individual data addressThe problem of Real time data share, high Real time data share, autgmentability is strong, and cost is low.
Embodiment bis-
Fig. 4 is the method flow diagram of the embodiment of the present invention two, as shown in Figure 4, and the method for internal memory shared networkFor:
S201, main equipment transmission flow;
User specifies memory table mark, communication instruction, multiple data address that will conduct interviews; According to appointmentCommunication instruction mark, carry out communication instruction function, access memory table data; The information needed of extracting is enteredRow is deposited; And to carrying out message assembling, after assembling, send message.
S202, from equipment receive flow process;
When receiving after message, carry out packet parsing from equipment; The information needed of extracting is stored; RootAccording to the communication instruction mark of specifying, access memory table data; According to the response identification of this memory table, ringAnswer message transmission flow.
S203, from equipment transmission flow;
Carrying out after communication instruction function, the information needed of extracting is stored; After storage, carry out reportLiterary composition processing module is carried out message assembling, and sends message.
S204, main equipment receive flow process.
When receiving after message, carry out message processing module (MPM) and carry out packet parsing; The information needed of extracting is depositedBe put in message effective information module; According to the communication instruction mark of specifying, carry out communication instruction function, visitAsk memory table data;
The transmission of the customization operations (for example: custom instruction) of master and slave equipment or reception flow process are all with above 4Point is identical. Just the object of access is no longer confined to memory table.
For the embodiment of the present invention, in the network of main frame and multiple standby host composition, this network mainAccess object is memory table, and with the mode access memory table data of multiple data addresses, and be indifferent to dataPhysical meaning, therefore user can be easily, at random define, add, delete the physical quantity in memory table,And directly use conventional communication instruction to realize the access of memory table physical quantity. And, due to the knot of this networkStructure degree is high, and therefore user only need to add, delete the physical quantity of memory table in memory table, just can makeMust this physical quantity can be accessed. Simultaneous communications instruction can be carried out communication instruction function according to user's self demandInterpolation expansion. Main frame can carry out multiple with individual equipment, multiple equipment of appointment, the broadcast mode of specifyingThe operation of data address, thus the efficiency of transfer of data improved, and realize multiple equipment, multiple discontinuousThe Synchronization Control of the data of address. In addition, this network is in realizing request and response, and other are from equipmentAll carry out the reception of all messages in network and resolve, the behavior is mainly used in two aspects: network state monitoring andShared drive table data. Network state monitoring, can know operation and this operation that main frame carries out certain memory tableThe situation such as executing state. Shared drive table data, are this server thought, and equipment is by resolvingThe all messages that receive, can obtain the data of all accessed memory tables, and are updated in this equipment,Realize data the sharing on each equipment of all memory tables, further realize the control of many equipment coordinations.
Embodiment tri-
Fig. 5 is the installation drawing of embodiment tri-, and described multiple devices and main frame form a communication network, as Fig. 5Shown in, this device comprises:
Receiving element 301, the data sharing request message sending for Receiving Host, described data sharing requestMessage comprises memory table mark, communication instruction and multiple data address;
Transmitting element 302, sends data sharing response for the standby host corresponding with described data sharing request messageMessage is to described main frame and all the other standby hosts, so that described main frame and all the other standby hosts complete described data sharing behaviourDo, described data sharing response message comprises memory table mark, communication instruction and multiple data address;
Data sharing response message comprises normal response message and exception response message, when described data sharing ringsWhile answering message to be exception response message, described main frame is carried out failure detection operations. And normal response report ifWen Shi, does not carry out above-mentioned failure detection operations.
Resolution unit 303, for after receiving element 301 receives this request message, to described data sharingRequest or response message are resolved;
Operating unit 304, for after resolution unit 303 is resolved, according to the described internal memory after described parsingTable mark, communication instruction and multiple data address, one or more memory tables that this locality is preserved carry out multipleData sharing operation.
In each message, comprise the character of communication instruction, this character is for describing the effective object of this message and rightThe operation of this object, makes the scope of message effect mainly be divided into two kinds: access memory table, extended operation.Concrete be that the data in memory table are added, deleted or change operation.
It should be noted that, operating unit 304 carries out data sharing operation, specifically comprises:
Operating unit 304, according to memory table mark, is confirmed to identify corresponding memory table with described memory table;
Operating unit 304 is according to multiple data addresses, confirms that described memory table identifies in corresponding memory table to treatThe address of the data of operation, and according to described communication instruction, described data are carried out to data sharing operation. And,Data sharing operation comprises growth data, or changes described data, or deletes described data.
The device providing by the embodiment of the present invention, the data sharing that receiving element 301 Receiving Hosts send pleaseAsk message, resolution unit 303 is resolved described data sharing request message, operating unit 304 basesDescribed memory table mark, communication instruction and multiple data address after described parsing, that this locality is preservedOr multiple memory tables carry out multiple data sharing operations, and send data sharing response by transmitting element 302Message, to main frame and all the other standby hosts, has solved in prior art owing to can only realizing individual equipment or broadcast modeCarry out the operation of individual data address and can not realize the problem of Real time data share, high Real time data share,Autgmentability is strong, and cost is low.
Embodiment tetra-
Fig. 6 is the system construction drawing of the embodiment of the present invention four, and as shown in Figure 6, this system comprises main frame and manyIndividual standby host, wherein,
Described multiple standby host 402, the data sharing request message sending for receiving described main frame, described manyIn individual standby host, the standby host corresponding with described data sharing request message send data sharing response message to described inMain frame and all the other standby hosts, so that described main frame and all the other standby hosts complete described data sharing operation, described numberComprise memory table mark, communication instruction and multiple data address according to sharing request or response message, to described numberResolve according to sharing request or response message, and according to described memory table mark, communication after described parsingInstruction and multiple data address, one or more memory tables that this locality is preserved carry out multiple data sharing operations;
It should be noted that, multiple standby hosts are according to memory table mark, communication instruction and multiple data after resolvingAddress, one or more memory tables that this locality is preserved carry out multiple data sharing operations, comprising:
According to described memory table mark, multiple standby hosts are confirmed to identify corresponding memory table with described memory table;
Multiple standby hosts are according to described multiple data addresses, confirm that described memory table identifies in corresponding memory table to treatThe address of the data of operation, and according to described communication instruction, described data are carried out to data sharing operation. DataSharing operation specifically comprises growth data, or changes described data, or deletes described data.
Described main frame 401, for sending described data sharing request message to multiple standby hosts, receives described dataThe data sharing response message that the standby host that sharing request message is corresponding sends, described data sharing response message bagDraw together memory table mark, communication instruction and multiple data address, described data sharing message is resolved, andAccording to described memory table mark, communication instruction and multiple data address after described parsing, this locality is preservedOne or more memory tables carry out multiple data sharing operations, and described data sharing operation comprises access memory tableAnd extended operation.
One of ordinary skill in the art will appreciate that: accompanying drawing is the schematic diagram of an embodiment, in accompanying drawingUnit or flow process might not be implement the present invention necessary.
In the several embodiment that provide in the application, should be understood that, disclosed system, equipment andMethod, can realize by another way. For example, apparatus embodiments described above is only shownMeaning property, for example, the division of described unit, is only that a kind of logic function is divided, when actual realizationCan have other dividing mode, for example multiple unit or assembly can in conjunction with or can be integrated into anotherSystem, or some features can ignore, or do not carry out. Another point, each other shown or discussedCoupling direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING of equipment or unit orCommunication connection, can be electrically, machinery or other form.
The described unit as separating component explanation can or can not be also physically to separate, asThe parts that unit shows can be or can not be also physical locations, can be positioned at a place, orPerson also can be distributed on multiple NEs. Can select according to the actual needs part wherein or completePortion realizes unit the object of the present embodiment scheme.
In addition, the each functional unit in each embodiment of the present invention can be integrated in a processing unit,Also can be that the independent physics of unit exists, also can be integrated in a unit in two or more unitIn. Above-mentioned integrated unit both can adopt the form of hardware to realize, and also can adopt hardware to add software functionThe form of unit realizes.
The integrated unit that the above-mentioned form with SFU software functional unit realizes, can be stored in a computer canRead in storage medium. Above-mentioned SFU software functional unit is stored in a storage medium, comprises some instructions useHold to make a computer equipment (can be personal computer, server, or the network equipment etc.)The part steps of method described in each embodiment of row the present invention. And aforesaid storage medium comprises: USB flash disk, moveMoving hard disk, read-only storage (Read-OnlyMemory is called for short ROM), random access memory (RandomAccessMemory, is called for short RAM), the various media that can be program code stored such as magnetic disc or CD.Finally it should be noted that: above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit;Although the present invention is had been described in detail with reference to previous embodiment, those of ordinary skill in the art shouldUnderstand: its technical scheme that still can record aforementioned each embodiment is modified, or to whereinPart technical characterictic is equal to replacement; And these amendments or replacement do not make the basis of appropriate technical solutionMatter departs from the spirit and scope of various embodiments of the present invention technical scheme.