Specific implementation mode
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used to limit the present invention.
As shown in fig.1, being one optional application environment schematic diagram of the embodiment of the present invention.
Present invention can apply to include but are not limited to ultraviolet optical-fiber network.In the present embodiment, application environment includes ultraviolet
Optical-fiber network, the ultraviolet optical-fiber network include a source node 1 and at least one from node.
The first situation:Networking request is sent to source node 1
First, new node 30 sends networking request to source node 1, and networking request includes nodal information.Secondly, source node
1 receive networking request when, source node 1 send certification instruct to new node 30.Again, new node 30 sends key identification information
To source node 1.Finally, when source node 1 judges that key identification information is matched with preset-key, new node 30 is established with source node 1
Communication connection, so that be added into ultraviolet optical-fiber network, meanwhile, the nodal information of new node 30 is added to node by source node 1 to be believed
Table is ceased, and the new informational table of nodes is sent to all nodes in ad hoc network.
The second situation:Networking request is sent to from node
First, new node 31 sends networking request to from node 20, and networking request includes nodal information.Secondly, from section
When point 20 receives networking request, through being forwarded to source node 1 from node 21 by networking request.Again, source node 1 receives networking
When request, source node 1 sends certification and instructs to from node 21, through being forwarded to new node 31 from node 20.Again, new node 30 is sent out
Send key identification information extremely from node 20, through being forwarded to source node 1 from node 21 by key identification information.Finally, source node 1 is sentenced
When determining key identification information and being matched with preset-key, new node 31 is communicated to connect with being established from node 20, so that being added to ultraviolet
In optical-fiber network, meanwhile, nodal information is added to informational table of nodes by source node 1.
In the embodiment of the present application, the source node 1 and may include from node, but be not limited only to, can by wired mode or
Person's wireless mode is in communication with each other transmitting terminal 40, control terminal 41, receiving terminal 42 and the memory 43 of connection.Wherein, in memory 43
It is stored with ad hoc network program 44.
Wherein, memory 43 includes at least a type of readable storage medium storing program for executing, and readable storage medium storing program for executing includes flash memory, hard
Disk, multimedia card, card-type memory (for example, SD or DX memories etc.), random access storage device (RAM), static random-access
Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), may be programmed read-only storage at read-only memory (ROM)
Device (PROM), magnetic storage, disk, CD etc..In some embodiments, memory 43 can be source node or from node
Internal storage unit, such as:Source node or hard disk or memory from node.In further embodiments, memory 43 can also
It is source node or the External memory equipment from node, such as:Source node or the plug-in type hard disk being equipped with from node, intelligent storage
Block (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..
Certainly, memory 43 can also be both including source node or from the internal storage unit of node or including its External memory equipment.This
In embodiment, memory 43 is installed on source node or operating system and types of applications software from node, example commonly used in storage
Such as:The program code etc. of ad hoc network program 44.In addition, memory 43 can be also used for temporarily storing and export or will
The Various types of data of output.
Control terminal 41 can be in some embodiments central processing unit (Central Processing Unit, CPU),
Controller, microcontroller, microprocessor or other data processing chips.The control terminal 41 commonly used in control source node or from
The overall operation of node, for example, execute with from node carry out data interaction or communicate it is relevant control and handle etc..This implementation
In example, the program code or processing data that control terminal 41 is used to store in run memory 43, such as:Run ad hoc network program
44 etc..
Transmitting terminal 40 includes but not limited to include:Electric signal is modulated into the modulation unit of optical signal, encryption unit, signal
Gain or amplifying unit.Transmitting terminal 40 is commonly used in needing the information sent to carry out coded modulation by source node or from node,
And launched in the form of optical signal.
Receiving terminal 42 includes but not limited to include:Signal gain or amplifying unit, by optical signal modulation at electric signal
Demodulating unit, decryption unit.Receiving terminal 42 is commonly used in demodulating and decoding source node or the optical signal sent from node
To obtain raw information.
So far, oneself is through describing the application environment of the embodiment of the present invention and the hardware configuration of relevant device and function in detail.
In the following, above application environment and relevant device will be based on, each embodiment of the present invention is proposed.
First, the present invention proposes a kind of ad hoc network method of ultraviolet optical-fiber network.
As shown in fig.3, being the flow diagram of one embodiment of ad hoc network method of the ultraviolet optical-fiber network of the present invention.In this Shen
Please be in embodiment, the execution sequence of the step in flow chart shown in Fig. 3 can change according to different requirements, certain steps
It can be omitted.Specifically, the ad hoc network method of the ultraviolet optical-fiber network includes the following steps:
Step S1, source node of the new node into ad hoc network or sends networking request from node, and networking request includes node
Information.
In the embodiment of the present application, due to, ultraviolet optical attenuation is larger, and transmission range is limited, so, new node communication cover
Lid range is smaller.Therefore, new node can select to ask to source node or to networking is sent from node according to installation position difference
It asks, networking request includes the nodal information of the new node.Specifically, which includes number information and physical address letter
Breath.
Step S2, when new node receives source node or instructed from the certification of node feeding back, new node, which sends key, to be known
Other information sends key identification information to source node to source node or through at least one from node.
In the embodiment of the present application, when new node sends networking to source node asks, source node directly feeds back certification and refers to
It enables to new node, when new node receives certification instruction, new node sends key identification information to source node.
When new node is to from node transmission networking request, instructed from node feeding back certification to new node, new node receives
When being instructed to certification, new node sends key identification information to source node through at least one from node.
Step S3, source node judge whether key identification information matches with preset-key.When key identification information and preset
When cipher key match, step S4 is executed.When key identification information and preset-key mismatch, refusal new node enters ultraviolet light net
In network.
Step S4, new node are established communication connection or new node with source node and are established with the slave node for receiving networking request
Communication connection, to form new ad hoc network.
In the embodiment of the present application, when new node sends networking to source node asks, new node is established logical with source node
Letter connection, to be added in the ultraviolet optical-fiber network.
When new node from node to when sending networking request, new node establishes communication link with the slave node for receiving networking request
It connects, to be added in the ultraviolet optical-fiber network.
Step S5, source node updates informational table of nodes according to nodal information, to obtain new informational table of nodes, and will be new
Informational table of nodes is sent to all nodes in ad hoc network.
In the embodiment of the present application, the nodal information of new node is added in informational table of nodes by source node, new to obtain
Informational table of nodes, meanwhile, new informational table of nodes is sent to all nodes in ad hoc network, the new informational table of nodes packet
Include temporal information.Therefore, in the embodiment of the present application, each node is stored with the informational table of nodes of itself.
The present embodiment new node can both send networking request to source node, can also send networking request to from node,
And then it is small to solve new node communication coverage, it may not be possible to send the problem of networking is asked to source node;Further, newly
Node is required to the verification by source node, and ultraviolet optical-fiber network could be added, to improve the safety of the ultraviolet optical-fiber network
Energy.
As shown in fig.4, being the flow diagram of another embodiment of ad hoc network method of the ultraviolet optical-fiber network of the present invention.At this
Apply in embodiment, the ad hoc network method of the ultraviolet optical-fiber network includes the following steps:
Step S10, source node of the new node into ad hoc network or sends networking request from node, and networking request includes node
Information.
The step is similar with the step S1 that above-described embodiment describes, and therefore, details are not described herein.
Step S11, when new node receives source node or instructed from the certification of node feeding back, new node, which sends key, to be known
Other information sends key identification information to source node to source node or through at least one from node.
The step is similar with the step S2 that above-described embodiment describes, and therefore, details are not described herein.
Step S12, source node judge whether key identification information matches with preset-key.When key identification information and preset
When cipher key match, step S13 is executed.When key identification information and preset-key mismatch, refusal new node enters ultraviolet light
In network.
The step is similar with the step S3 that above-described embodiment describes, and therefore, details are not described herein.
Step S13, new node are established communication connection or new node with source node and are established with the slave node for receiving networking request
Communication connection, to form new ad hoc network.
The step is similar with the step S4 that above-described embodiment describes, and therefore, details are not described herein.
Step S14, source node updates informational table of nodes according to nodal information, to obtain new informational table of nodes, and will be new
Informational table of nodes be sent to all nodes in ad hoc network.Further, which includes temporal information, source
Node is periodically according to the nodal information update informational table of nodes and temporal information of all nodes in ad hoc network.
The step is similar with the step S5 that above-described embodiment describes, and therefore, details are not described herein.
Step S15, source node judge whether the slave node in new ad hoc network is idle.When the slave node in new ad hoc network
When idle, step S16 is executed.
New informational table of nodes is sent to idle slave node by step S16, source node.
In the embodiment of the present application, source node can disposably will when all idle from node in new ad hoc network
New informational table of nodes is sent to all from node.In addition, source node can also work as new ad hoc network in one from node free time
When, new informational table of nodes is sent to the slave node of the free time immediately.
The present embodiment sends new informational table of nodes to from node, avoids from node when detecting from the node free time
New informational table of nodes is sent when busy, the work from node is influenced, to improve the job stability of ultraviolet optical-fiber network.
As shown in fig.5, being the flow diagram of another embodiment of ad hoc network method of the ultraviolet optical-fiber network of the present invention.At this
Apply in embodiment, the ad hoc network method of the ultraviolet optical-fiber network includes the following steps:
Step S20, source node of the new node into ad hoc network or sends networking request from node, and networking request includes node
Information.
The step is similar with the step S1 that above-described embodiment describes, and therefore, details are not described herein.
Step S21, when new node receives source node or instructed from the certification of node feeding back, new node, which sends key, to be known
Other information sends key identification information to source node to source node or through at least one from node.
The step is similar with the step S2 that above-described embodiment describes, and therefore, details are not described herein.
Step S22, source node judge whether key identification information matches with preset-key.When key identification information and preset
When cipher key match, step S23 is executed.When key identification information and preset-key mismatch, refusal new node enters ultraviolet light
In network.
The step is similar with the step S3 that above-described embodiment describes, and therefore, details are not described herein.
Step S23, new node are established communication connection or new node with source node and are established with the slave node for receiving networking request
Communication connection, to form new ad hoc network.
The step is similar with the step S4 that above-described embodiment describes, and therefore, details are not described herein.
Step S24, source node updates informational table of nodes according to nodal information, to obtain new informational table of nodes, and will be new
Informational table of nodes be sent to all nodes in ad hoc network.Further, which includes temporal information, source
Node is periodically according to the nodal information update informational table of nodes and temporal information of all nodes in ad hoc network.
The step is similar with the step S5 that above-described embodiment describes, and therefore, details are not described herein.
Step S25, source node periodically acquire each from the temporal information of the destination node information table of node.
Step S26, source node judge whether the temporal information of destination node information table is new with new informational table of nodes
Temporal information is identical.When the temporal information of destination node information table is with new temporal information difference, step S27 is executed.
Step S27, source node is by the nodal information from node corresponding with destination node information table from new nodal information
It is rejected in table.
The present embodiment can reject the slave node disconnected according to the temporal information of informational table of nodes, improve ultraviolet light
The online confirmation rate from node of network.
As shown in fig.6, being the flow diagram of another embodiment of ad hoc network method of the ultraviolet optical-fiber network of the present invention.At this
Apply in embodiment, the ad hoc network method of the ultraviolet optical-fiber network includes the following steps:
Step S30, source node of the new node into ad hoc network or sends networking request from node, and networking request includes node
Information.
The step is similar with the step S1 that above-described embodiment describes, and therefore, details are not described herein.
Step S31, when new node receives source node or instructed from the certification of node feeding back, new node, which sends key, to be known
Other information sends key identification information to source node to source node or through at least one from node.
The step is similar with the step S2 that above-described embodiment describes, and therefore, details are not described herein.
Step S32, source node judge whether key identification information matches with preset-key.When key identification information and preset
When cipher key match, step S33 is executed.When key identification information and preset-key mismatch, refusal new node enters ultraviolet light
In network.
The step is similar with the step S3 that above-described embodiment describes, and therefore, details are not described herein.
Step S33, new node are established communication connection or new node with source node and are established with the slave node for receiving networking request
Communication connection, to form new ad hoc network.
The step is similar with the step S4 that above-described embodiment describes, and therefore, details are not described herein.
Step S34, source node updates informational table of nodes according to nodal information, to obtain new informational table of nodes, and will be new
Informational table of nodes be sent to all nodes in ad hoc network.
The step is similar with the step S5 that above-described embodiment describes, and therefore, details are not described herein.
Step S35, when disconnect from node to target from node initiate communication request when, target from nodal test itself whether
In new ad hoc network.When target from node not in new ad hoc network when, execute step S36.When target from node new
When in ad hoc network, step S38 is executed.
Step S36, target are from node judges to disconnect from whether node is stored with informational table of nodes and the informational table of nodes
It is no identical as itself informational table of nodes of storage.It is stored with informational table of nodes and node with target from node when disconnecting from node
When information table is identical, step S37 is executed.
In the embodiment of the present application, when target from node not in new ad hoc network when, target is from node to disconnecting from section
Point sends requests verification information and feeds back the first node information table of itself when disconnection receives requests verification information from node
Judge first node information table and itself second when target receives first node information table from node to target from node
Whether the similarity of informational table of nodes reaches preset value, when the similarity of the informational table of nodes of the two reaches preset value, then sentences
Both fixed informational table of nodes is identical.
Step S37 is disconnected from node and target and is established communication connection from node.
In the embodiment of the present application, when disconnecting from node and target from node not in new ad hoc network, the two can be with
Directly establish communication connection.
Step S38, target are from node judges to disconnect from whether node is stored with informational table of nodes and the informational table of nodes
It is no identical as itself informational table of nodes of storage.It is stored with informational table of nodes and node with target from node when disconnecting from node
When information table is identical, step S39 is executed.When disconnection is not stored with informational table of nodes from node or believes from the node of node with target
When breath table differs, step S40 is executed.
In the embodiment of the present application, when target from node in new ad hoc network when, target is from node to disconnecting from node
It sends requests verification information and feeds back the first node information table of itself extremely when disconnection receives requests verification information from node
Target is from node, when target receives first node information table from node, judge the temporal information of first node information table with from
Whether the temporal information of the second node information table of body is identical, when the temporal information of the two is identical, then judges the node of the two
Information table is identical, when the temporal information difference of the two, then judges that the informational table of nodes of the two is different.
Step S39 is disconnected from node and target and is established communication connection from node.
Step S40, target are instructed from node feeding back re-authentication to disconnecting from node.
Step S41, source node be verified again disconnection from the key identification information of node when, disconnect from node and target
It establishes and communicates to connect from node, and will be switched off being updated new informational table of nodes from the nodal information of node.
The present embodiment is when disconnection sends communication request from node to a slave node not in new ad hoc network, the two
Communication connection is directly established, is avoided after node has gone out ultraviolet optical-fiber network, the technology that can not be communicated from node with other disconnections
Problem.In addition, disconnecting from node to when sending communication request with the slave node in ad hoc network, need after being verified again,
It can establish and communicate to connect from node with this, further improve communication security performance.
Secondly, the present invention proposes a kind of self-organizing network system of ultraviolet optical-fiber network.
As shown in fig.7, being the flow diagram of one embodiment of self-organizing network system of the ultraviolet optical-fiber network of the present invention.In this Shen
Please be in embodiment, the self-organizing network system of the ultraviolet optical-fiber network includes source node 40, at least one from node 41 and new node 42.Its
In, new node 42 establishes module 422 including the first sending module 420, the first receiving module 421 and communication connection.From node 41
Including the second receiving module 410 and the second sending module 411.Source node 40 includes third receiving module 400, cipher key match module
401, third sending module 402 and informational table of nodes update module 403.
Wherein, the first sending module 420 sends networking request for the slave node into ad hoc network, and networking request includes
Nodal information.In the embodiment of the present application, due to, ultraviolet optical attenuation is larger, and transmission range is limited, so, new node communication
Coverage area is smaller.Therefore, new node can select to ask to source node or to networking is sent from node according to installation position difference
It asks, networking request includes nodal information.Specifically, which includes number information and physical address information.
Second receiving module 410, the networking request for receiving new node transmission.Second sending module 411, for receiving
When being asked to networking, feedback certification is instructed to new node.First receiving module 421 refers to for receiving the certification sent from node
It enables.First sending module 420, when being additionally operable to receive certification instruction, through it is at least one from node send key identification information to
Source node.When new node is to from node transmission networking request, instructed from node feeding back certification to new node, new node receives
When certification instructs, new node sends key identification information to source node through at least one from node.
Third receiving module 400, for receiving new node through at least one key identification information sent from node.Key
Matching module 401, for judging whether key identification information matches with preset-key.Third sending module 402, for through at least
One sends certification from node and passes through instruction to new node.Communication connection establish module 422, for receive networking request from
Node establishes communication connection, to form new ad hoc network;Informational table of nodes update module 403, for being updated according to nodal information
Informational table of nodes, to obtain new informational table of nodes.In the embodiment of the present application, source node adds the nodal information of new node
Into informational table of nodes, to obtain new informational table of nodes, and new informational table of nodes is sent to all sections in ad hoc network
Point.Further, which includes temporal information, and source node is periodically according to all nodes in ad hoc network
Nodal information updates informational table of nodes and temporal information.
In addition, the first sending module 420, sends networking request, networking request includes for the source node into ad hoc network
Nodal information.Third receiving module 400, the networking request for receiving new node transmission.Third sending module 402, for connecing
When receiving networking request, feedback certification is instructed to new node.First receiving module 421, the certification for receiving source node transmission
Instruction.First sending module 420 when being additionally operable to receive certification instruction, sends key identification information to source node.Communication connection
Module 422 is established, is communicated to connect for being established with source node, to form new ad hoc network;Informational table of nodes update module 403,
For updating informational table of nodes according to nodal information, to obtain new informational table of nodes and be sent to new informational table of nodes certainly
All nodes in networking.Further, which includes temporal information, and source node is periodically according to from group
The nodal information update informational table of nodes and temporal information of all nodes in net.
The present embodiment new node can both send networking request to source node, can also send networking request to from node,
And then it is small to solve new node communication coverage, it may not be possible to send the problem of networking is asked to source node;Further, newly
Node is required to the verification by source node, and ultraviolet optical-fiber network could be added, to improve the safety of the ultraviolet optical-fiber network
Energy.
On the basis of the above embodiments, shown in Figure 8 in other embodiment, source node 40 further includes judgment module
500.Wherein, judgment module 500, for judging whether the slave node in new ad hoc network is idle;Third sending module 403 is used
When the slave node free time in new ad hoc network, new informational table of nodes is sent to idle slave node.
In the embodiment of the present application, source node can disposably will when all idle from node in new ad hoc network
New informational table of nodes is sent to all from node.In addition, source node can also work as new ad hoc network in one from node free time
When, new informational table of nodes is sent to the slave node of the free time immediately.
The present embodiment sends new informational table of nodes to from node, avoids from node when detecting from the node free time
New informational table of nodes is sent when busy, the work from node is influenced, to improve the job stability of ultraviolet optical-fiber network.
On the basis of the above embodiments, shown in Figure 9 in other embodiment, source node 40 further includes periodically obtaining
Modulus block 600 and nodal information reject module 601.
Wherein, periodically acquire module 600, for periodically acquire each from the destination node information table of node when
Between information;Judgment module 500 is additionally operable to judge whether the temporal information of destination node information table is new with new informational table of nodes
Temporal information it is identical;Nodal information rejects module 601, believes with the new time for the temporal information when destination node information table
When ceasing different, the nodal information from node corresponding with destination node information table is rejected from new informational table of nodes.
On the basis of the above embodiments, shown in Figure 10 in other embodiment, target includes detecting mould from node 43
Module 702 and the 4th receiving module 703 and the 4th hair are established in block 700, first node information table matching module 701, communication connection
Send module 704.
Wherein, the 4th receiving module 703, for receiving the communication request for disconnecting and being sent from node.Detection module 700 is used
In detection itself whether in new ad hoc network;First node information table matching module 701, for working as target from node not new
Ad hoc network in when, judge to disconnect from node whether be stored with informational table of nodes and whether the informational table of nodes stores with itself
Informational table of nodes is identical.Communication connection establish module 702, for when disconnect from node be stored with informational table of nodes and with itself
When informational table of nodes is identical, then establishes and communicate to connect from node with disconnection.
First node information table matching module 701, for when target from node in new ad hoc network when, judge disconnect from
Whether node is stored with informational table of nodes and whether the informational table of nodes is identical as itself informational table of nodes of storage;Communication connection
Establish module 702, when disconnect from node be stored with informational table of nodes and it is identical as the informational table of nodes of target from node when, then with
It disconnects establishing from node and communicate to connect.
4th sending module 704, for not being stored with from node informational table of nodes or section with target from node when disconnecting
Point information table is when differing, and feedback re-authentication is instructed to disconnecting from node;Informational table of nodes update module 403, for again
Be verified disconnection from the key identification information of node when, disconnect establishing from node and target from node and communicate to connect, and will break
It opens and new informational table of nodes is updated from the nodal information of node.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that lists described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, depends on the specific application and design constraint of technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
Scope of the present application.
In embodiment provided herein, it should be understood that the self-organizing network system of disclosed ultraviolet optical-fiber network and
Ad hoc network method may be implemented in other ways.For example, the self-organizing network system of ultraviolet optical-fiber network described above is implemented
Example is only schematical, for example, the division of module or unit, only a kind of division of logic function in actual implementation can be with
There is other dividing mode, such as multiple units or component can be combined or can be integrated into another system or some are special
Sign can be ignored, or not execute.Another point, shown or discussed mutual coupling or direct-coupling or communication connection can
Can be electrical, machinery or other forms to be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
The embodiment of the present application also provides a kind of storage mediums, and for storing computer program, it includes for executing sheet
Apply for the program data designed by the above-mentioned ad hoc network method embodiment for ultraviolet optical-fiber network.By executing in the storage medium
The ad hoc network method of ultraviolet optical-fiber network provided by the present application may be implemented in the computer program of storage.
If integrated module/unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can be stored in a computer read/write memory medium.Based on this understanding, the application realizes above-described embodiment side
All or part of flow in method can also instruct relevant hardware to complete by computer program, and computer program can
It is stored in a computer readable storage medium, the computer program is when being executed by processor, it can be achieved that above-mentioned each method
The step of embodiment.Wherein, computer program includes computer program code, and computer program code can be source code shape
Formula, object identification code form, executable file or certain intermediate forms etc..Computer-readable medium may include:Meter can be carried
Any entity or device of calculation machine program code, recording medium, USB flash disk, mobile hard disk, magnetic disc, CD, computer storage, only
Memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electricity is read to carry
Wave signal, telecommunication signal and software distribution medium etc..It should be noted that the content that computer-readable medium includes can root
Increase and decrease appropriate is carried out according to legislation in jurisdiction and the requirement of patent practice, such as in certain jurisdictions, according to vertical
Method and patent practice, computer-readable medium is including being not electric carrier signal and telecommunication signal.
The specific implementation mode of invention is described in detail above, but it is only used as example, the present invention is not intended to limit
With specific embodiments described above.For a person skilled in the art, any equivalent modifications that the invention is carried out
Or substitute also all among scope of the invention, therefore, in the case where not departing from the spirit and principles in the present invention range made by it is impartial
Transformation and modification, improvement etc., all should be contained within the scope of the invention.