Summary of the invention
The objective of the invention is to overcome weak point of the prior art, a kind of internal memory shared network framework and protocol specification thereof are provided, solved the problem that can not realize Real time data share in the prior art owing to can only realize individual equipment or broadcast mode to carry out the operation of individual data address, high Real time data share, autgmentability is strong, and cost is low.
The embodiment of the invention provides a kind of method of internal memory shared network, comprising:
The data sharing request message of simultaneously Receiving Host transmission of a plurality of standby hosts, described data sharing request message comprises memory table sign, communication instruction and a plurality of data address;
In described a plurality of standby hosts, the standby host corresponding with described data sharing request message sends the data sharing response message to described main frame and all the other standby hosts, so that described main frame and all the other standby hosts are finished described data sharing operation, described data sharing response message comprises memory table sign, communication instruction and a plurality of data address;
A plurality of standby hosts are resolved described data sharing request or response message, and according to described memory table sign, communication instruction and a plurality of data address after the described parsing, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations;
The embodiment of the invention also provides a kind of method of internal memory shared network, comprising:
Main frame sends described data sharing request message to a plurality of standby hosts, and described data sharing request message comprises memory table sign, communication instruction and a plurality of data address;
Main frame receives the data sharing response message that standby host corresponding to described data sharing request message sends, and described data sharing response message comprises memory table sign, communication instruction and a plurality of data address;
Main frame is resolved described data sharing response message, and according to described memory table sign, communication instruction and a plurality of data address after the described parsing, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations, and described data sharing operation comprises access memory table and extended operation;
The embodiment of the invention also provides a kind of device of internal memory shared network, comprising:
Described a plurality of device and main frame form a communication network, and described device comprises:
Receiving element is used for receiving the data sharing request message that described main frame sends, and described data sharing request message comprises memory table sign, communication instruction and a plurality of data address;
Transmitting element is used for the device corresponding with described data sharing request message and sends the data sharing response message to described main frame and all the other devices, and described data sharing response message comprises memory table sign, communication instruction and a plurality of data address;
Resolution unit is used for described data sharing request or response message are resolved;
Operating unit is used for according to described memory table sign, communication instruction and a plurality of data address after the described parsing, and one or more memory tables that this locality is preserved carry out a plurality of data sharing operations;
The embodiment of the invention also provides a kind of device of internal memory shared network, comprising:
Transmitting element is used for sending described data sharing request message to a plurality of standby hosts, and described data sharing request message comprises memory table sign, communication instruction and a plurality of data address;
Receiving element is used for receiving the data sharing response message that standby host corresponding to described data sharing request message sends, and described data sharing response message comprises memory table sign, communication instruction and a plurality of data address;
Resolution unit is used for described data sharing response message is resolved, and according to described memory table sign, communication instruction and a plurality of data address after the described parsing;
Operating unit is used for one or more memory tables that preserve this locality are carried out a plurality of data sharing operations, and described data sharing operation comprises access memory table and extended operation.
The embodiment of the invention also provides a kind of system of internal memory shared network, comprises main frame and a plurality of standby host, wherein,
Described a plurality of standby host, be used for receiving the data sharing request message that described main frame sends, in described a plurality of standby hosts, the standby host corresponding with described data sharing request message sends the data sharing response message to described main frame and all the other standby hosts, described data sharing request or response message comprise the memory table sign, communication instruction and a plurality of data address, described data sharing request or response message are resolved, and according to the described memory table sign after the described parsing, communication instruction and a plurality of data address, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations;
Described main frame, be used for sending described data sharing request message to a plurality of standby hosts, receive the data sharing response message that standby host corresponding to described data sharing request message sends, described data sharing request or response message comprise the memory table sign, communication instruction and a plurality of data address, described data sharing response message is resolved, and according to the described memory table sign after the described parsing, communication instruction and a plurality of data address, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations, and described data sharing operation comprises access memory table and extended operation.The method that provides by the embodiment of the invention, Apparatus and system, the data sharing request message of simultaneously Receiving Host transmission of a plurality of standby hosts, in described a plurality of standby hosts, the standby host corresponding with described data sharing request message sends the data sharing response message to described main frame and all the other standby hosts, described data sharing request or response message are resolved, and according to the described memory table sign after the described parsing, communication instruction and a plurality of data address, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations, solved the problem that can not realize Real time data share in the prior art owing to can only realize individual equipment or broadcast mode to carry out the operation of individual data address, high Real time data share, autgmentability is strong, and cost is low.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those of ordinary skills obtain under the prerequisite of not making creative work belongs to the scope of protection of the invention.
Embodiment one
Fig. 1 is the transverse set rack composition of the embodiment of the invention one, as shown in Figure 1, all be connected to from equipment 1 to n on the half-duplex transmission bus of transceiver, main equipment by this bus and a plurality of from equipment carry out simultaneously, synchronous message transmissions.
Fig. 2 is vertical group-network construction figure of the embodiment of the invention one, when each equipment has at least two half duplex communication interfaces, can realize going here and there the portrait network of bus, realizes the memory table data sharing between each equipment.As shown in Figure 2, can link to each other from equipment with another from equipment, form vertical structure.
Those skilled in the art also are appreciated that, on the basis of Fig. 1 and Fig. 2, can also be in conjunction with the framework of Fig. 1 and Fig. 2, when each equipment has two half-duplex operation interfaces at least, can realize two peacekeeping multidimensional group-network constructions common, the string bus, realize the memory table data sharing between each equipment.
Need to prove that among Fig. 1 and Fig. 2, main frame and standby host all are based on the wired or wireless physical bus of half-duplex of receiving and dispatching conllinear and realize.Main frame can be main equipment again, and standby host can be named from equipment again.
For active and standby machine, each equipment comprises a at least memory table, is all storing in each memory table, comprises this memory table and is identified at interior various types of data.Each equipment all can read and write data in self-contained memory table.And each equipment all can receive and resolve, and according to the character string of designated character format permutation, this character string is referred to as message.Wherein, the message that main frame or main equipment send is called request message, and standby host or the message that sends from equipment are called response message, and response message is divided into: normal response message, exception response message.The exception response message is used for telling main equipment, and the abnormal problem that exists in the request message is used for check trunk and investigation problem, also is used 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, comprises request message and response message, and according to the communication instruction in the message, carries out associative operation.In addition, each, all can according to the response identification of the memory table of accessing, determine whether this request message is responded when receiving request message from equipment.
In the message, endian formats comprises following part:
Start-of-text character: be used for identifying effective message, for example, this initial symbol is comprised of two characters, and order is 0xAA, and the described message of 0x55 is request message, and order is 0x55, and the described message of 0xAA is response message.
The quantity descriptor: be used for describing the quantity of the memory table that will carry out communication and the number of addresses of carrying out communication, for example, specify high 4 of this character to be memory table quantity, low 4 is data address quantity.
The memory table sign is described the district: according to the memory table quantity in the quantity descriptor, deposit the memory table sign of this quantity.
Data address is described the district: according to the data address quantity in the quantity descriptor, deposit data address first address and the data address length of this quantity.
Communication instruction: the operational order that will carry out of describing this message.
Data segment is described the district: according to the description of communication instruction, deposit the quantity of the described data character of communication instruction.
The CRC16 verification: according to the CRC16 standard of appointment, the CRC16 verification about this message of generation.
Fig. 3 is the method flow diagram of the embodiment of the invention one, and as shown in Figure 3, the flow process of internal memory shared network is as follows:
The data sharing request message of simultaneously Receiving Host transmission of S101, a plurality of standby host, described data sharing request message comprises memory table sign, communication instruction and a plurality of data address;
Data sharing represents that namely the data that a plurality of active and standby organizational securities are deposited all are identical.In embodiments of the present invention, reaching the data that a plurality of active and standby organizational securities deposit all is this identical effect, need to be with will be to the increase of data between the active and standby machine, deletion and modification are wanted synchronously, the embodiment of the invention has adopted a main frame to sending instructions under many standby hosts, so that many modes that standby host is all processed the data of this locality preservation.
Before a plurality of standby hosts data sharing message that Receiving Host sends simultaneously, memory table sign, communication instruction and a plurality of data address that main frame is treated operation encapsulate into described data sharing request message, and send described data sharing request message to these a plurality of standby hosts.
S102, in described a plurality of standby hosts, the standby host corresponding with described data sharing request message sends the data sharing response message to described main frame and all the other standby hosts, so that described main frame and all the other standby hosts are finished described data sharing operation, described data sharing response message comprises memory table sign, communication instruction and a plurality of data address;
The data sharing response message comprises normal response message and exception response message, and when described data sharing response message was the exception response message, described main frame was carried out failure detection operations.And if when being the normal response message, then do not carry out above-mentioned failure detection operations.
Need to prove that a plurality of standby hosts can be that wherein one or more standby hosts of main frame appointment send this data sharing response message, other standby host does not send the data sharing response message, and the embodiment of the invention is also unrestricted to this.The one or more standby hosts of appointment send the i.e. standby host corresponding with the data sharing request message of data sharing response messages, this standby host sends the data sharing response message to main frame and all the other standby hosts, and main frame and all the other standby hosts are responsible for receiving and resolving this data sharing response message.And after main frame and all the other standby hosts were received the data sharing response message, if this data sharing response message is the normal response message, then main frame and all the other standby hosts were carried out same data sharing operation.By above-mentioned method, after main frame and all the other standby hosts are received response message, can obtain the data of all accessed memory tables, and in this equipment of being updated to, like this, just can realize data the sharing on each equipment of all memory tables.
S103, described main frame and a plurality of standby host are resolved described data sharing request or response message, and according to described memory table sign, communication instruction and a plurality of data address after the described parsing, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations;
Need to prove to only have after main frame and all the other standby hosts are received this data sharing response message, main frame and standby host be the executing data sharing operation.
The character that comprises communication instruction in each message, this character be used for to be described the effective object of this message and to the operation of this object, so that the scope of message effect mainly is divided into two kinds: access memory table, extended operation.Concrete namely is that the data in the memory table are added, deleted or change operation.
Need to prove that main frame and a plurality of standby host carry out the data sharing operation simultaneously, specifically comprise:
According to the memory table sign, confirm the memory table corresponding with described memory table sign;
According to a plurality of data addresses, confirm the address of data to be operated in memory table corresponding to described memory table sign, and according to described communication instruction described data are carried out the data sharing operation.And the data sharing operation comprises growth data, or changes described data, or deletes described data.
The method that provides by the embodiment of the invention, the data sharing request message of simultaneously Receiving Host transmission of a plurality of standby hosts, in described a plurality of standby hosts, the standby host corresponding with described data sharing request message sends the data sharing response message to described main frame and all the other standby hosts, main frame and a plurality of standby host are resolved described data sharing request or response message, and according to the described memory table sign after the described parsing, communication instruction and a plurality of data address, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations, solved the problem that can not realize Real time data share in the prior art owing to can only realize individual equipment or broadcast mode to carry out the operation of individual data address, high Real time data share, autgmentability is strong, and cost is low.
Embodiment two
Fig. 4 is the method flow diagram of the embodiment of the invention two, and as shown in Figure 4, the method for internal memory shared network is:
S201, main equipment transmission flow;
The user specifies memory table sign, communication instruction, a plurality of data address that will conduct interviews; According to the communication instruction sign of appointment, carry out the communication instruction function, access memory table data; The information needed of extracting is deposited; And to carrying out the message assembling, send message after the assembling.
S202, receive flow process from equipment;
After receiving message, carry out packet parsing from equipment; The information needed of extracting is stored; According to the communication instruction sign of appointment, access memory table data; According to the response identification of this memory table, carry out the response message transmission flow.
S203, from the equipment transmission flow;
After carrying out the communication instruction function, the information needed of extracting is stored; After the storage, carry out message processing module (MPM) and carry out the message assembling, and send message.
S204, main equipment receive flow process.
After receiving message, carry out message processing module (MPM) and carry out packet parsing; The information needed of extracting is stored in the message effective information module; According to the communication instruction sign of appointment, carry out the communication instruction function, access memory table data;
The customization operations of master and slave equipment (for example: transmission custom instruction) or receive flow process all with above 4 identical.Just the object of access no longer is confined to memory table.
For the embodiment of the invention, in the network of main frame and a plurality of standby host composition, the main access object of this network is memory table, and with the mode access memory table data of a plurality of data addresses, and be indifferent to the physical meaning of data, therefore the user can be easily, at random define, add, delete the physical quantity in the memory table, and directly use the access of conventional communication instruction realization memory table physical quantity.And because the structuring degree of this network is high, so the user only need to add, delete the physical quantity of memory table in memory table, and just energy is so that this physical quantity can be accessed.The simultaneous communications instruction can be carried out according to user's self demand the interpolation expansion of communication instruction function.Main frame can carry out the operation of a plurality of data addresses with individual equipment, a plurality of equipment of appointment, the broadcast mode of appointment, thereby has improved the efficient of transfer of data, and realizes the Synchronization Control of the data of a plurality of equipment, a plurality of discontinuous addresses.In addition, this network is when realizing request and response, and other are resolved from the reception that equipment all carries out all messages the network, and the behavior is mainly used in two aspects: network state monitoring and shared drive table data.Network state monitoring can be known operation that main frame carries out certain memory table and the situations such as executing state of this operation.Shared drive table data are this server thought, i.e. all messages of receiving by parsing of equipment, can obtain the data of all accessed memory tables, and in this equipment of being updated to, realize data the sharing on each equipment of all memory tables, further realize many equipment coordination controls.
Embodiment three
Fig. 5 is the installation drawing of embodiment three, and described a plurality of devices and main frame form a communication network, and as shown in Figure 5, this device comprises:
Receiving element 301 is used for the data sharing request message that Receiving Host sends, and described data sharing request message comprises memory table sign, communication instruction and a plurality of data address;
Transmitting element 302, be used for the standby host corresponding with described data sharing request message and send the data sharing response message to described main frame and all the other standby hosts, so that described main frame and all the other standby hosts are finished described data sharing operation, described data sharing response message comprises memory table sign, communication instruction and a plurality of data address;
The data sharing response message comprises normal response message and exception response message, and when described data sharing response message was the exception response message, described main frame was carried out failure detection operations.And if when being the normal response message, then do not carry out above-mentioned failure detection operations.
Resolution unit 303 is used for after receiving element 301 receives this request message described data sharing request or response message being resolved;
Operating unit 304 is used for after resolution unit 303 is resolved, and according to described memory table sign, communication instruction and a plurality of data address after the described parsing, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations.
The character that comprises communication instruction in each message, this character be used for to be described the effective object of this message and to the operation of this object, so that the scope of message effect mainly is divided into two kinds: access memory table, extended operation.Concrete namely is that the data in the memory table are added, deleted or change operation.
Need to prove that operating unit 304 carries out the data sharing operation, specifically comprises:
Operating unit 304 is confirmed the memory table corresponding with described memory table sign according to the memory table sign;
Operating unit 304 is confirmed the address of data to be operated in memory table corresponding to described memory table sign according to a plurality of data addresses, and according to described communication instruction described data is carried out the data sharing operation.And the data sharing operation comprises growth data, or changes described data, or deletes described data.
The device that provides by the embodiment of the invention, the data sharing request message that receiving element 301 Receiving Hosts send, 303 pairs of described data sharing request messages of resolution unit are resolved, the described memory table sign of operating unit 304 after according to described parsing, communication instruction and a plurality of data address, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations, and pass through transmitting element 302 transmission data sharing response messages to main frame and all the other standby hosts, solved the problem that can not realize Real time data share in the prior art owing to can only realize individual equipment or broadcast mode to carry out the operation of individual data address, high Real time data share, autgmentability is strong, and cost is low.
Embodiment four
Fig. 6 is the system construction drawing of the embodiment of the invention four, and as shown in Figure 6, this system comprises main frame and a plurality of standby host, wherein,
Described a plurality of standby host 402, be used for receiving the data sharing request message that described main frame sends, in described a plurality of standby hosts, the standby host corresponding with described data sharing request message sends the data sharing response message to described main frame and all the other standby hosts, so that described main frame and all the other standby hosts are finished described data sharing operation, described data sharing request or response message comprise the memory table sign, communication instruction and a plurality of data address, described data sharing request or response message are resolved, and according to the described memory table sign after the described parsing, communication instruction and a plurality of data address, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations;
Need to prove that a plurality of standby hosts are according to memory table sign, communication instruction and a plurality of data address after resolving, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations, comprising:
According to described memory table sign, a plurality of standby hosts are confirmed the memory table corresponding with described memory table sign;
A plurality of standby hosts are confirmed the address of data to be operated in memory table corresponding to described memory table sign according to described a plurality of data addresses, and according to described communication instruction described data are carried out the data sharing operation.The data sharing operation specifically comprises growth data, or changes described data, or deletes described data.
Described main frame 401, be used for sending described data sharing request message to a plurality of standby hosts, receive the data sharing response message that standby host corresponding to described data sharing request message sends, described data sharing response message comprises memory table sign, communication instruction and a plurality of data address, described data sharing message is resolved, and according to described memory table sign, communication instruction and a plurality of data address after the described parsing, one or more memory tables that this locality is preserved carry out a plurality of data sharing operations, and described data sharing operation comprises access memory table and extended operation.
One of ordinary skill in the art will appreciate that: accompanying drawing is the schematic diagram of an embodiment, and the unit in the accompanying drawing or flow process might not be that enforcement the present invention is necessary.
In several embodiment that the application provides, should be understood that, disclosed system, equipment and method can realize by another way.For example, apparatus embodiments described above only is schematic, for example, the division of described unit, only be that a kind of logic function is divided, during actual the realization other dividing mode can be arranged, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, the shown or coupling each other discussed or direct-coupling or communication connection can be by some interfaces, the indirect coupling of equipment or unit or communication connection can be electrically, machinery or other form.
Described unit as separating component explanation can or can not be physically to separate also, and the parts that show as the unit can be or can not be physical locations also, namely can be positioned at a place, perhaps also can be distributed on a plurality of network element.Can select according to the actual needs wherein some or all of unit to realize the purpose of present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in the processing unit, also can be that the independent physics of unit exists, and also can be integrated in the unit two or more unit.Above-mentioned integrated unit both can adopt the form of hardware to realize, the form that also can adopt hardware to add SFU software functional unit realizes.
The above-mentioned integrated unit of realizing with the form of SFU software functional unit can be stored in the computer read/write memory medium.Above-mentioned SFU software functional unit is stored in the storage medium, comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the part steps of the described method of each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, read-only memory (Read-Only Memory, abbreviation ROM), the various media that can be program code stored such as random access memory (Random Access Memory is called for short RAM), magnetic disc or CD.It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment puts down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.