Summary of the invention
Technical problem to be solved by this invention is not enough and the data sharing of the networking that can be used for intelligent appliance, the remote monitoring of equipment, the Sharing Management of cell data acquisition system, various instrument is provided at above-mentioned prior art, the general intelligent network with general intelligent network nodes that is made of various hardware control unit and software protocol each other thereof.The network of this general intelligent network nodes and composition thereof has under the general intelligent network agreement to be formed one and is made up of various MCU and PC, data-handling capacity and intelligent degree height, use flexibly, the new network that control range is big, and the product of each manufacturer production can exchange information in the network, make the end user bigger, further promote the technology innovation and the raising of information products industry the choice of information products.
The present invention solves the problems of the technologies described above the technical scheme that is adopted:
General intelligent network with general intelligent network nodes, comprise and have at least one through connecting the general intelligent network nodes of medium networking, general intelligent network nodes comprises the hardware control that can control various control units and connect medium, and the technical measures of taking also comprise:
General intelligent network nodes is divided into host node and from node, general intelligent network subnet comprise a host node and some by host node manage from node, can only set up contact by the node host node and other general intelligent network subnet from node, what host node was managed is 2 from the node number
n-2, the span of n is 1 to 24; Can be connected in series mutually with general intelligent network nodes with having host node concurrently between the general intelligent network subnet, and constitute the general intelligent network that includes a plurality of subnets from node diagnostic;
General intelligent network nodes contains physical layer, protocol layer, application-interface layer; Hardware control has special-purpose general intelligent network sign, and protocol layer satisfies a general intelligent network protocol subset at least, and can realize plug-and-play feature according to agreement, and can also utilize in real time, control until the resource of sharing hardware control inside;
The general intelligent network protocol contents has the error correction of order, group address sign, byte stream of version number, general intelligent network sign and identification sets thereof, packet and verification, the structure of communication data packets, minimal network; The more new situation of version number's presentation protocol; The order of packet is used for describing the order and the priority thereof of network communication packet; Group address sign and identification sets thereof are used for determining colony's target of network communication packet, and the routing procedure of record data bag; RS (16,2) the code check error correcting system that standard is adopted in the error correction of byte stream and verification perhaps adopts 16 CRC check; Minimal network is the subclass that the general intelligent network agreement is made to measure for the micro universal intelligent network.
For optimizing technique scheme, the concrete measure of taking also comprises:
One, general intelligent network nodes can constitute a primary subnet separately, and this subnet directly enters the Internet; Maybe can be by entering the Internet behind the subnet by the management of general intelligent network host node; Maybe can enter the Internet by the subnet set after the subnet serial connection;
Subnet can use the wireless base station to realize the point-to-point exchanging visit function of grade separation bridge-type each other;
The general intelligent network nodes physical layer is connected by general intelligent network nodes and the used hardware medium of communication thereof and constitutes, basis as the basic control unit of general intelligent network, this physical layer can satisfy a subclass of its general intelligent network agreement, be bound up by protocol layer between each general intelligent network nodes, upper layer application by satisfying protocol layer in the general intelligent network nodes application-interface layer and the various resource relationship in the general intelligent network, general intelligent network consultative management person provides the general intelligent network operating system of utilizing application-interface layer to set up to the user; General intelligent network operating system has hardware driving, the general intelligent network agreement of application-interface layer, physical layer; Application-interface layer offers the user by the manager of general intelligent network agreement, so that the user need not fully to understand under the situation of all accord, can design the application program of oneself according to the needs of oneself, and by the resource in their the application access general intelligent network; The connected mode that physical layer comprised is independently selected by the user; Hardware driving and general intelligent network thereof sign according to the characteristics of user-selected physical layer, is provided by the manager of general intelligent network agreement.
Two, version number: the version number of general intelligent network represents with 4 byte Version, is respectively from a high position to the low level according to the decimal system:
Type t |
Major version number m |
The inferior n of version number |
Design b |
Production number p |
0-12 (13-41 reservation) |
0-99 |
0-99 |
0-99 |
0-99 |
Type t is used for distinguishing the version subclass:
0. do not have type, UNKNOWN TYPE subclass N (Nuignet)
1. send out version test subclass P (Puignet) in advance
2. subclass T (Truignet) on probation
3. basic minimum system subclass BT (BTuignet)
4. basic General System subclass BN (BNuignet)
5. basic total system subclass B (Buignet)
6. compact minimum system subclass CT (CTuignet)
7. compact General System subclass CN (CNuignet)
8. compact total system subclass C (Cuignet)
9. full minimum system subclass FT (FTuignet)
10. full General System subclass FN (FNuignet)
11. total system F (Fuignet)
12. protocol-specific R (Ruignet)
42. be used to represent version information
Other types value 13-41 is preserved for expansion in the future.
Major version number 0-99 is used for the great renewal of agreement.The inferior 0-99 of version number is used for revising agreement under the compatibility mode forward in identical major version number.Design 0-99 represents the distribution numbering of this release protocol, only is used to improve agreement, and wherein even number designs number expression beta version, and odd number is represented official release.Production number 0-99 represents other software of this version generation, the version number of hardware, is used to distinguish the different product numbering of derived software, hardware, and wherein the even number production number is represented test products, and odd number is represented formal product.Itself does not need production number the UigCP agreement, promptly represents the protocol-specific subclass RuigCP of UigCP such as R0.98.26, and wherein major version number is 0, and inferior version number is 98, and (test) design of protocol number is 26; Promptly represent the pre-version test subclass PuigCP that sends out of UigCP such as P0.99.0.1, wherein major version number is 0, and inferior version number is 99, and (test) design of protocol number is 0, and (formally) derivatives number are 1, by that analogy.
Version=0 represents version number's the unknown (no version number), and Version=0xFFFFFFFF represents to obtain automatically version number (version number of system), and the version number of nominative is as the version number of the outstanding graticule mesh of its control.
Three, general intelligent network agreement: general intelligent network Uignet (Uig, UigCP, UigOS) mainly be made up of minimum general intelligent network Tuignet (Tiny Uignet) and general general intelligent network Nuignet (Normal Uignet) two parts, two parts are all supported is referred to as all-purpose intelligent network Fuignet (Full Uignet):
1.Tuig:TinyUig
2.TuigCP:Tiny?UigCP
3.TuigOS:Tiny?UigOS
4.Nuig:Normal?Uig
5.NuigCP:Normal?UigCP
6.NuigOS:Normal?UigOS
7.Fuig:Full?Uig
8.FuigCP:Full?UigCP
9.FuigOS:Full?UigOS
General intelligent network can specifically be divided into the subclass of various uses, and type comprises respectively from small to large:
1. basic minimum general intelligent network BTuignet (Base Tuignet): BTuig, BTuigCP, BTuigOS
2. basic general general intelligent network BNuignet (Base Nuignet): BNuig, BNuigCP, BNuigOS
3. basic general intelligent network Buignet (Base Uignet): Buig, BuigCP, BuigOS
4. compact minimum general intelligent network CTuignet (Compact Tuignet): CTuig, CTuigCP, CTuigOS
5. compact general general intelligent network CNuignet (Compact Nuignet): CNuig, CNuigCP, CNuigOS
6. compact general intelligent network Cuignet (Compact Uignet): Cuig, CuigCP, CuigOS
7. minimum all-purpose intelligent network FTuignet (FullTuignet): FTuig, FTuigCP, FTuigOS
8. general all-purpose intelligent network FNuignet (Full Nuignet): FNuig, FNuigCP, FNuigOS
9. all-purpose intelligent network Fuignet (Full Fuignet): Fuig, FuigCP, FuigOS
10. general intelligent network Truignet (Trial Uignet) on probation: Truig, TruigCP, TruigOS
General intelligent network Truignet wherein on probation is regardless of size, and is special in freely testing use.The general intelligent network of each subclass must comprise the full content of UigCP respective subset, but allows that it comprises the part protocol contents that exceeds the UigCP respective subset.The type of the version number of each subset is distinguishing.
Mandate about the general intelligent network agreement: various general intelligent network nodes have globally unique general intelligent network identification mark to be established, so the making of any one general intelligent network nodes and operation must obtain general intelligent network agreement mandate (UigCPL).Establish if the used hardware medium of general intelligent network communication also comprise general intelligent network identification mark, so also must obtain the authorization.The identification mark freely test in the general intelligent network use agreement on probation is established, and need not to obtain the authorization, but its identification mark is established and must be limited on probation marking and establish within the scope.
The notion that comprises about the general intelligent network agreement also has:
One is-symbol, the abbreviation title, constant, mark is established and attributes object with the capitalization roman, contain the italic of the data acquisition system object of a plurality of variablees with the capitalization beginning, the italic that single variable begins with small letter or small letter, the subordinate relation between the object represents that with symbol ". " byte is represented with B, the position is represented with b, represent that byte with subscript (0-7) mark, is used B from high-order a to all positions the low level c for metric one from the low level to a high position with D
A...cExpression, a-c represents that a variable can get a to all possible value between the c, and a:c represents that a variable can get a to all possible value between the a+c, and NULL represents not have this parameter.The low byte of a multibyte sign N, low word, low double word and low 8 bytes are designated as N.B, N.W, N.D and N.Q respectively.Byte time-delay t uses the byte floating number to represent, establishes low 4 and is a, and high 4 is e, and the maximum delay time of then allowing is a2
2eMillisecond, the maximum delay that can represent is about 186 days, represents unlimited time-delay during t=0xFF.The position of double word time T m 31 is 1 o'clock, and 30-27 be month, and a position 26-22 be day, and a position 21-17 be hour, and position 16-11 is branch, and a 10-5 is wonderful, and a 4-0 is 1/32 second number; The position 31 of Tm is 0 o'clock, and position 30-0 represents 1/64 second later number of zero hour on January 1 then, represents the unlimited time during Tm=0xFFFFFFFF.
The 2nd, general intelligent network mark is established, and it is as follows that 128 16 byte general intelligent networks marks that are used to distinguish each general intelligent network nodes are established GID:
Integral body is divided into prefix Internet mark and establishes IDI (be divided into leader and establish IDF and IPv4 address) and suffix interface attributes mark and establish two parts of IDP (be divided into type mark establish IDT and azimuth mark is established IDL), when GID only gets its low some byte, clipped is given by its server, and thinks the general intelligent network subnet under its server admin:
In the table: p is the attribute byte that the GID mark is established: bMore=1 represents to also have follow-up subnet GID; The prefix of GID is that the Internet mark is established IDI during bUig=0, then is the sign IDS of Uig subnet during bUig=1; The different identification means of different value decision GID of m; B5Grade=1 represents its last mask byte separated into two parts is become 5 grades of principal and subordinate's addressing systems; When containing back multilayer GID, successively seek respective objects (comprising possible route layer) according to order of transmission; Special provision, GID at most can only follow-up 6 times (total number of plies mostly is 7 most after promptly comprising the route layer); Decide the specific address GID of general intelligent network nodes during bUig=1 fully according to the general intelligent network agreement, and GID during bUig=0) distribute according to the IPv6 mode, the value of the concrete method of salary distribution of the GID of IPv6 mode and m is relevant.
Suppose: as m=1, during b5Grade=0:
Whole mark is established the address as Internet New Deal IPv6 during bUig=0, and it is unified given by international IPr6 standard setter that the GID leader among the prefix header Prefix is known head, and prefix is Uig subnet sign IDS during bUig=1; As the parameter of interface identifier mark establish IDP totally 64 decide the specific address of general intelligent network nodes according to the general intelligent network agreement, follow-up sign is effective, it is as follows that mark is established the each several part implication:
1.bUig=0 the time prefix part form by the IPv4 address among 2 byte GID prefix header Prefix, 2 byte port port and the 4 byte Internet;
2. establish IDP as the parameter mark of general intelligent network, 4 byte IDT establish as the type mark of general intelligent network, 4 byte IDL represent principal and subordinate's general intelligent network structure with 4 grades of addressing systems of acquiescence, top general intelligent network host node is determined by d, its subordinate's secondary general intelligent network host node is determined by c, three grades of general intelligent network host nodes are determined that by b then by a decision, type area and azimuthal bin come together to distinguish the specific address of general intelligent network nodes to the bottom general intelligent network from node;
3. whole mark is established IDL and is got any general intelligent network nodes that 0xFFFFFFFF represents the general intelligent network subnet of sender's general intelligent network host node management and (comprise general intelligent network host node itself, possible two, three grades of general intelligent network host nodes and general intelligent network thereof are from node), the information broadcast that is used for its place general intelligent network subnet, information broadcast in the subnet only is confined to send in message person's the subnet (containing lower floor's subnet) of general intelligent network host node management, also can relays and broadcast netting outer member by its general intelligent network host node;
4. general intelligent network is established from the node mark and is got maximum, and for example a=0xFF represents all nodes (a=1-0xFE) in its a level subnet are broadcasted; Ba=0xFFFF represents all nodes (ba=0x0101-0xFEFE) in its b level subnet (containing a of lower floor level subnet) are broadcasted; The subnet host node must be relayed from its peer network node and the broadcasting of its host node at its lower floor's subnet, can broadcast netting outer member by the relay of its host node;
5. marks at different levels are established a-b and are got zero and establish as the host node mark of this grade subnet, establish from node mark and to get dynamic mark and establish and represented that its actual mark established content by its host node dynamic assignment at 0 o'clock, main joint but establish when getting zero that its mark is established by its higher level master's joint but dynamic assignment at the mark of higher level's subnet, having top mark establishes the host node of IDL=0 and is referred to as the general intelligent network top node, directly manage by the general intelligent network agreement, unless stated otherwise, host node does not all comprise top node;
6. the hard of the software classification of the IDL of address d=0, s=0 and f=0 mark is established as the special-purpose mark of general intelligent network protocol test and is established, and non-general intelligent network protocol test personnel must not use any reservation mark in this scope to establish; The IDL mark of d=c=b=1 is established, the hard mark of software classification, m=1, n=3 (can not directly insert Internet) and the f=1 of s=1 is established as the mark of opening to anyone of freely testing and established, and need not to obtain the agreement mandate;
7. if there is IP simultaneously, so just can represent to insert the Uig subnet of Internet with the IP address, this is a super large network with 64 bit address;
8. when broadcast address is as the general intelligent network address, is referred to as to monitor mark and establishes, have the information that the monitoring node of establishing can receive any node in its subnet of marking of monitoring.
The 3rd, the group address sign: the addressing between the general intelligent network nodes for convenience, to introduce the group address mark of describing with 16 byte Property ID GProp and establish IDG, high 8 bytes are left the extended attribute of bag, and low 8 byte GProp the contents are as follows shown in the table:
In that the general intelligent network subnet is inner when not having high-order mark and establishing, expression independent instruction bag, no password, version number and sequence number the unknown, have limit priority grade=0, response mark boolean state the unknown, must reply at once:
1. the value of position 3-0 adds 1 and represents that respectively the selected byte number of establishing is from low to high marked in simplification
2. whether each masked bits bsID, btID, bRank, btSET, bsSET get that the corresponding follow-up mark of 1 decision is established, whether order or mark establish collection and exist, and establish length when being byte when mark, just have many default parameterss, and mark is established and mark is established collection and can be existed simultaneously
3. respond bAnswer and get 0/1 expression transmission/echo message stream
4.bPQSelf show that entire I DG partly adopts independently PQ verification in the bag, needn't influence the content of other parts in the bag so that can dynamically add the related content of IDG in the routing procedure, accelerate the bag repeating process
5. each bag and the corresponding bag of responding thereof all have different order Rank
6.l should send l byte Rank according to bRank at once after byte Gprop sends and finishes.The byte number of IDG itself can be calculated and mostly is the 0xE104 byte most
7. length l ength represents data division length, and value 0xFFFF represents a maximum length 0x10001 data rather than 0xFFFF data, that is to say and can not represent physical length 0xFFFE and 0x10000
8. skew shift represents the side-play amount of starting position in data flow of data division first byte.
The 4th, simplify target identification: establish length in order to reduce mark as far as possible, all marks are established the low some bytes that can get them under the simplification situation, and given its length (byte number), the part that ignore this moment is dynamically given by its host node, can not be given replace with default value, do not have replacing with 0 of default value, also can distinguish otherwise givenly separately, the mark of this moment is established and is referred to as the position and simplifies mark and establish.The default value of some important contents now will be with 0 replacement, and version in the future may be specified their default value.The default value of port port can not be defined as 77 during dynamic assignment temporarily at host node, and the default value of sn is that 0 expression is invalid, and the default value of m can not be 1 during dynamic assignment at host node.The specific user gives with specific GID mark and establishes (comprising its all the elements and relevant hierarchical information), and Any user must not be used its specific mark to establish and freely test to mark and establish any mark in addition and establish (comprising its all the elements and relevant hierarchical information).When adopt simplifying mark and establish, must guarantee that all marks are located at the length of general intelligent network from node can not be greater than its length in the general intelligent network host node.When the mark of two different lengths is established comparison, regard different marks without exception as and establish.It is inter-related that some marks are established, and their correlation length must be consistent, and relevant part is given regularly also necessary unified given in the simplification mark is established separately.
Four, the general intelligent network hardware control can directly be customized to special chip, or has MCU, the DSP of certain subclass of general intelligent network agreement, the control unit of ARM, PC to combine by several embeddings; This hardware control is got in touch by the application interface and the subscriber equipment of general intelligent network, and application interface is the data I mouth that is added with driving, or the analog electrical signal with certain driving force; Subscriber equipment is a direct controlling object, perhaps another intelligence control system independently; The connection media mode that is used for connecting between the general intelligent network nodes has telephone wire, power line, RS485 circuit and Internet net; Interface mode can independently be chosen as serial ports, perhaps parallel port; Hardware control that general intelligent network uses and the embedded at least general intelligent network protocol subset of connection medium thereof, and have special-purpose general intelligent network sign.
Five, medium connect can be directly and other general intelligent network nodes form network, in transfer of data, can determine reasonable baud rate automatically between each general intelligent network nodes according to actual conditions; Its mode has the transmission of the parallel port of employing, adopts standard UART asynchronous form serial communication, perhaps is embedded into other media delivery;
The general intelligent network special chip that the general intelligent network hardware control is comprised, its functional structure comprise five road application interfaces that connect with subscriber equipment, and the first via connects the verification error correction through output control, media interface, input control, reception buffering; The second the tunnel through data acquisition, increase verification, send buffering and connect output control; Third Road connects the increase verification through return results; The four the tunnel connects data filter; The five the tunnel connects input control.
Bus contention scheme wherein includes:
One is to use the special instruction competition bus, is to send the instruction that bus is used in a request, uses bus after the free time at once in the bus that further detects T16.If a plurality of general intelligent networks are arranged from the node competition bus; the general intelligent network host node can be received the response of tape error information; host node should be replied unusual response at once in case a plurality ofly compete the use bus simultaneously from node, respectively from node can receive this unusual respond or synchronizing signal after detect and compete the use bus again.
Two are to use the hardware arbitration, can judge whether level is consistent with the level that oneself sends on the bus with hardware.Just stop to send data at once in case the discovery level is inconsistent, abandon using bus, and make the mark of bus contention mistake.
The 3rd, increase the arbitrating signals line, can increase a pair of arbitrating signals line, shared this of all general intelligent network nodes carries out bus request and idle-detection to the arbitrating signals line, and arbitrating signals line detected state under idle and busy condition is different.
The 4th, the half-duplex general intelligent network, comprise the general intelligent network host node and carry out signal transmission from the shared a pair of holding wire of all nodes of node, mix again a pair of arbitrating signals line just can constitute one reliably, half-duplex general intelligent network fast.
The 5th, the full duplex general intelligent network, line and general intelligent network host node carry out the signal transmission to all general intelligent networks to received signal at shared a pair of transmission holding wire and from node, all are merely able to signal is sent to host node from node, are relayed by host node then.Mix equally more a pair of arbitrating signals line can constitute one reliably, half-duplex general intelligent network fast.
The 6th, half a full duplex double-mode general-purpose intelligent network, all general intelligent networks connect according to full duplex hardware from node, under the management of general intelligent network host node, the employing high speed electronic switch switches, is two groups of actual short circuits of holding wire one group of shared half-duplex signal line, switches to semiduplex mode; Also can under the host node management, return to full-duplex mode.Can make subnet enter semiduplex mode to the host node application from node, exchange so that carry out high-speed data from node with other.
Six, communication data packets.The node of each general intelligent network subnet can enter Internet by the service host node.Packet P enters the preceding Internet host-host protocol that is added standard by the service host node of Internet, data are isolated packet P by host node according to a verification mode and a verification qp after Internet enters the service host node, and then are transferred on the target device respectively.The main attribute of packet P is described by its first attribute byte P.bh=P.b (0), and each attribute bit is got 1 expression and comprised corresponding attribute, otherwise does not then comprise:
The position |
7 |
6 |
5 |
4 |
3 |
2...0 |
Implication |
bRet |
bMix |
bSrc |
bIDG |
Keep |
The model m of bag |
Wherein bMix represents that packet adopts mixing verification (adopting embedded verification in embedded transmission automatically), bIDG represents that heel group mark establishes IDG, bSrc gets the data that 0/1 expression does not indicate but must hard objectives/source and belongs to target/source, marks such as the IDR sequence number among the IDG and establishes.
At first send primary attribute byte bh in the data flow, send possible IDG then, then send the sign on the right side (low level description) in the various signs of same attribute earlier, the order of transmission of same sign each several part all is from right to left.According to sending order, P does not have following data structure when adding checking data:
Possible data b n (comprising st) |
Possible IDG |
bh |
0-65537B |
? |
1B |
The extended attribute that data division first byte P.bn (0)=P.st is referred to as to wrap wherein.After receiving whole P, can obtain byte number n and the extended attribute P.st of data division P.bn by the byte number of primary attribute bh eliminating other parts, so there is no need the concrete n of appointment in bag.For the ease of the bulk transfer data, the byte arrays that the data flow of bn (except the st) is described with a word subscript is represented, at most from totally 65536 of 0-65535, like this, the byte number of possible data b n (comprising st) mostly is 0x10001 most, n=0xFFFF is used for representing this byte number, so the real bytes number can not be 65535 or 65536.For convenience can P write as P (m) or P (m, st), the P of free of data part P.bn be designated as P (m, NULL).
Communication data packets model m, get 0 expression system data bag, get the packet that 1 expression is connected to each other use, get the packet of 2 expression control general intelligent network nodes, get 3 expression message packets, get 4 or 5 and be preserved for expansion in the future, get 6 expression minimal networks and use dedicated packet, whole network uses model m to get 0 to 5 packet; The work of minimal network and whole network isolates mutually, independent mutually, minimal network does not have group identification IDG, and send with the type of data packet of replying must be corresponding consistent;
When packets need is responded, need to wait for after goal systems is handled and to reply that the stand-by period is relevant by the traffic control mode of the data-handling capacity of goal systems and transmitting system.Can select mode as described below when connecting medium: the one, adopt the parallel port transmission, because length of data package is unit with the byte, so the parallel port transmission must be carried out under 8 bit patterns; The 2nd, be embedded into other media delivery, because length of data package is a unit with the byte, so the smallest transmission unit of the transmission medium that is embedded into must be 8.Because the transmission medium that is embedded into may have the correcting data error mode of oneself, this moment, packet can adopt embedded verification mode to improve the overall transfer speed of packet; The 3rd, employing standard UART asynchronous form serial communication.
Wherein adopt standard UART asynchronous form serial communication to include:
One is communication baud rate, and default baud rate is 4800bps, and minimum baud rate 600bps adopts the binary system send mode, and the minimum baud rate position transmission time is T=1.7ms, and the transmission time of n position is designated as Tn.The bit data stream form is: a start bit is 8 bit data, 1 position of rest, the minimum transfer time that this transmission time T10 of 10 is referred to as to wrap.Considering that maximum should be allowed increases by 1 position of rest again, that is to say that the transmission total time (position of rest that comprises extra increase) of a byte must not be 2.3ms under the 4800bps baud rate greater than T11.Under the situation that 2 position of rests are set, should send all data streams continuously.Allow do not have the equipment of control to begin competition bus in free time of bus after greater than T16.
Two for going 0 to handle, in special provision (be with the byte unit) transmitting data stream, highest order is the number of 1 subsequent byte (low 7) expression, 0 value byte after the 0xFF value byte, highest order is that 0 subsequent byte (low 7) is then represented the number of 0xFF value byte, and is referred to as 0 processing of going of data flow.Notice that all verifications are all carried out in the data flow before going 0 processing, usually said packet or data flow just refer to go 0 to handle data before, and the packet or the data flow of process verification then are referred to as communication data stream.Just adopt when going 0 to handle the own independent transmission of only talented data flow, but data flow is embedded into when transmitting in other data flow, the synchronizing signal and the end mark that no longer need oneself, also no longer need 0 to handle, directly packet is embedded into to transmit in the data flow of needs embedding and gets final product.
Three is end mark, can guarantee not contain in the normal flow 0 value byte after going 0 to handle, and also can not have 0 and 0x80 behind the 0xFF, can be worth byte (0xFF together to 0xFF and follow-up 0 very reliably like this, 0x00) as the end mark of data flow, continuous two end marks are as synchronizing signal, and the end mark of independent no extra position of rest is as the baud rate calibration marker; Normally do not have under the error situation synchronously, the baud rate calibration marker to proper communication without any influence, owing to do not finish, synchronously, not 0 in the normal flow beyond the baud rate calibration marker, can keep the beginning label that flows as special data to 0 value byte (0x00), such as leading CRC check sign.
Four is idle overtime, in the receiving course, and in order to prevent losing of end mark, also can be according to the end of overtime judgment data stream of free time.The actual reception time of a byte only needs T10 more, considers the characteristics of extra possible position of rest and single-chip microcomputer baud rate counting, and the time of overtime end is all T16 mutually with free time in the specified data receiving course.The overtime concluding time is T16 in the general intelligent network nodes, and the overtime concluding time then is 32ms among the PC.
But five is variable baud rate, default baud rate is lower, be to set for taking into account worse communication transmission environment, allow interim increase in the communication process or reduce baud rate, also can use default baud rate at any time, except indivedual particular application, all general intelligent network nodes in same group must use identical baud rate.
Six is bit-order of transmission, since various serial communication protocols for the order of transmission of position and byte differ to, the order of transmission of position does not have influence, for the ease of the data processing special provision: all multibyte datas comprise that various marks are established and all properties all (from right to left) send low byte earlier, bit number (from right to left) is from the byte low level.
The transmission of serial communication and reception line can be shared, must forbid the receiving function of oneself when sending instruction in this case.Form peer-to-peer network when transmission and reception line are shared, otherwise can only form local area network (LAN) by the unified management of general intelligent network host node.
Seven is automatic monitoring baud rate, when receiving the misdata stream that generation can't correct, should ceaselessly send the baud rate calibration marker so that target is carried out the automatic test of baud rate parameter every enough free time time-delay, in time corrects miscommunication.When receiving 2 bags that do not contain end mark and useless (invalid or check errors) continuously when using the standard baud rate, suggestion sends the baud rate calibration marker, so that destination node and execute the correction baud rate; If error accumulation reaches 4 times continuously, default baud rate is used in suggestion instead under many baud rates situation.
Eight is bus contention and since the data sending terminal (general intelligent network host node receiving terminal just) of each general intelligent network nodes directly by line be connected together, so there is bus contention in each node when sending data.Host node can send after receiving end byte allows that its specific node takies the signal of bus, does not have to send at host node and allows under the situation of the signal that takies bus, and each node also can competition use bus behind the idle T16 of further detected bus.
Nine are the order of packet: distinguish the packet between the general intelligent network nodes for convenience, introduce the Sn that sends sequence number, transmitting time and the response time of describing bag with 16 byte order Rank:
About data flow verification error correction:
The one, the PQ verification: per 14 bytes when 14 bytes of less than (perhaps whole bytes) successively add Q check byte q and P check byte p before, and this RS code check can be corrected the byte mistake in the array very effectively.All data streams not only can error detection, can also error correction, but data transmission rate is lower.Nodulo-2 addition still is designated as "+", selects primitive element 00000001 and primitive polynomial x
8+ x
4+ x
3+ x
2+ 1, the corresponded manner of RS sign indicating number and concrete numerical value can have two kinds of the corresponding low levels of a left side corresponding low level in position and right position.For convenience of the data processing of You Gezhong, the corresponding low level in right position of regulation sign indicating number.Data sequence is q before and after sending, p, b (0) ... b (13) is totally 16 bytes, and sequence number is that the RS sign indicating number of i and the sequence number of code value r are designated as r (i) and i (r), and check equations is:
s0=q+p+b(0)+b(1)+…+b(13)=0
s1=q·r(0)+p·r(1)+b(0)·r(2)+…+b(13)·r(15)=0
The equation of being not difficult to obtain check byte p and q is:
q=b(0)·r(1)+b(1)·r(26)+b(2)·r(199)+b(3)·r(76)+b(4)·r(114)+b(5)·r(167)+
b(6)·r(88)+b(7)·r(176)+b(8)·r(96)+b(9)·r(252)+b(10)·r(221)+b(11)·r(103)+
b(12)·r(74)+b(13)·r(200)
p=b(0)·r(25)+b(1)·r(198)+b(2)·r(76)+b(3)·r(103)+b(4)·r(166)+b(5)·r(87)+
b(6)·r(175)+b(7)·r(95)+b(8)·r(251)+b(9)·r(220)+b(10)·r(102)+b(11)·r(74)+
b(12)·r(199)+b(13)·r(8)
The 2nd, CRC check: 2 leading 0x00 represent to adopt 16 CRC check, can only error detection, can not error correction, but data transmission rate is higher.The generator polynomial x that uses in the disk storage of 16 CRC check code data stream employing standards
16+ x
12+ x
5The high position of+1,2 byte check codes is p, and low level is q, and q and p successively are added in after the former data flow.
The 3rd, embedded verification: 16 of fronts or byte are still less formed unique PQ verification group in the packet, and follow-up data does not adopt any method of calibration.Whether this method of calibration can be used for the decision instruction head and exist, and is particularly suitable for being embedded in other data flow that itself have verifying function and transmits, and transmits such as being embedded in the Internet network.
The 4th, mix verification: 16 CRC check are further adopted in embedded verification, use the generator polynomial x that uses in the standard disk storage
16+ x
12+ x
5The high position of+1,2 byte check codes is p, and low level is q, and q and p successively are added in after the former data flow.This method of calibration can be taken into account the error correction of instruction head and the efficient number of transmission simultaneously, and the kernel instruction head of packet has been carried out PQ and twice verification of CRC, is particularly suitable for the Network Transmission of mass data.When embedded transmission, because the data flow that is embedded into generally has the verification means of oneself, mix verification and abandon CRC check automatically, only adopt embedded verification.
Compared with prior art:
The general intelligent network nodes that the present invention adopts is divided into host node and from node, general intelligent network subnet comprise a host node and some by host node manage from node, can only set up contact by the node host node and other general intelligent network subnet from node, what host node was managed is 2 from the node number
n-2, the span of n is 1 to 24; Can be connected in series mutually with general intelligent network nodes with having host node concurrently between the general intelligent network subnet, and constitute the general intelligent network that includes a plurality of subnets from node diagnostic;
General intelligent network nodes contains physical layer, protocol layer, application-interface layer; The embedded at least general intelligent network protocol subset of hardware control, and have special-purpose general intelligent network sign, and can realize plug-and-play feature according to agreement, and can also utilize in real time, control until shared its inner resource;
The general intelligent network protocol contents has the error correction of order, group address sign, byte stream of version number, general intelligent network sign and identification sets thereof, packet and verification, the structure of communication data packets, minimal network; The more new situation of version number's presentation protocol; The order of packet is used for describing the order and the priority thereof of network communication packet; The group address sign is used for determining colony's target of network communication packet, and the routing procedure of record data bag; RS (16,2) the code check error correcting system that standard is adopted in the error correction of byte stream and verification perhaps adopts 16 CRC check.The present invention can be used for the data sharing of the networking of intelligent appliance, the remote monitoring of equipment, the Sharing Management of cell data acquisition system, various instrument, general intelligent network nodes that is made of various hardware control unit and software protocol each other thereof and the network of forming thereof.The network of this general intelligent network nodes and composition thereof can be formed one and be made up of various MCU and PC under the general intelligent network agreement, data-handling capacity and intelligent degree height, use flexibly, control range big new network, and the product of each manufacturer production can exchange information in the network, make the end user bigger, further promote the technology innovation and the raising of information products industry the choice of information products.