A kind of calling system ID distribution methods and device
Technical field
The present invention relates to the communication technology, more particularly to a kind of calling system ID distribution methods and device.
Background technology
As time goes on, medical science and technology is maked rapid progress, the quantity and scale of hospital are also increasing, and calling system is gradually
The essential equipment of medical personnel's workload, raising medical service quality is reduced as a kind of.
Existing calling system mainly includes main frame and the multiple extension sets being connected with main frame, by between main frame and extension set
Communication can realize call function.For most of calling systems, in particular by the calling of RS-485 serial bus standards
For system, to ensure that No. ID of all extension sets differs in communication, because No. ID of extension set determines that extension set sends letter
The sequential of breath, if No. ID of two extension sets is identical, then can produce conflict when sending information, cause main frame not receive letter
Breath.
But, the ID that all extension sets are set when dispatching from the factory in the prior art is identical, therefore, in calling system input
Before use, it is necessary to input new ID for each extension set manually by installation personnel, it is ensured that the ID of each extension set can not be repeated, and be inputted
Journey is complicated, waste time and energy, inefficiency and easily error.
The content of the invention
The present invention provides a kind of calling system ID distribution methods and device, to solve to be each extension set manually in the prior art
ID inefficiencies, the technical problem easily malfunctioned are set.
The present invention provides a kind of calling system ID distribution methods, including:
Receive the debug command of user's input;
The debug command inputted according to the user, performs following debugging steps at least one times:Institute into calling system
There is extension set to send ID Notifications of Changes, so that all extension sets search whether itself had been allocated ID according to the ID Notifications of Changes
Number, and the random generation ID in the case of unassigned No. ID;At least one extension set is received according to No. ID hair generated at random
The sequence number information sent, the sequence number that the sequence number information includes the extension set is identified;Identified according to the sequence number, be institute
State extension set and distribute No. ID.
Further, it is described to distribute No. ID for the extension set, specifically include:
No. ID unassigned set is searched, and one No. ID is chosen in No. ID unassigned set;
ID distribution information is sent to the extension set, the ID distribution information includes No. ID selected and the extension set
Sequence number mark.
Further, after the debug command of the reception user input, in addition to:Receive the debugging ginseng that user sends
Number information, the tuning parameter information includes the total number information of all extension sets in calling system;
Distributed described for the extension set after No. ID, in addition to:Judge whether the number of allocated No. ID is equal to institute
There is the sum of extension set, if so, then stopping performing the debugging step.
Further, after the transmission ID Notifications of Changes to all extension sets, in addition to:
If being not received by the sequence number information of extension set transmission, ID Notifications of Changes are sent to all extension sets again.
Further, if continuous preset times are not received after performing the transmission ID Notifications of Changes to all extension sets
The sequence number information that extension set is sent, then stop performing the debugging step.
Also a kind of calling system ID distributors of the present invention, including:
Receiving module, the debug command for receiving user's input;
Debugging module, for the debug command inputted according to the user, performs following debugging steps at least one times:To exhaling
All extension sets in system are made to send ID Notifications of Changes, so that whether all extension sets search itself according to the ID Notifications of Changes
Through being allocated No. ID, and the random generation ID in the case of unassigned No. ID;At least one extension set is received according to random
The sequence number information of No. ID transmission of generation, the sequence number that the sequence number information includes the extension set is identified;According to the sequence
Row number is identified, and is that the extension set distributes No. ID.
Further, it is described to distribute No. ID for the extension set, specifically include:Unassigned No. ID is searched to gather, and
One No. ID is chosen in No. ID unassigned set;ID distribution information is sent to the extension set, the ID distributes information
Include the sequence number mark of selected No. ID and the extension set.
Further, the receiving module is additionally operable to:After the debug command of the reception user input, user is received
The tuning parameter information of transmission, the tuning parameter information includes the total number information of all extension sets in calling system;
The debugging module is additionally operable to:Distributed described for the extension set after No. ID, judge of allocated No. ID
Whether number is equal to the sum of all extension sets, if so, then stopping performing the debugging step.
Further, the debugging module is additionally operable to:After the transmission ID Notifications of Changes to all extension sets, if not having
The sequence number information of extension set transmission is received, then sends ID Notifications of Changes to all extension sets again.
Further, if continuous preset times are not received after performing the transmission ID Notifications of Changes to all extension sets
The sequence number information that extension set is sent, then stop performing the debugging step.
In calling system ID distribution methods and device that example of the present invention is provided, all extension sets hair of the main frame into calling system
ID Notifications of Changes are sent, and receive sequence number information of at least one extension set according to No. ID transmission generated at random, the sequence number
The sequence number that information includes the extension set is identified, and is identified according to the sequence number, and main frame can be extension set distribution ID, real
The automatic distribution of extension set ID is showed, process is easy, efficiency is higher and does not allow error-prone.
Brief description of the drawings
Fig. 1 is the flow chart for the calling system ID distribution methods that the embodiment of the present invention one is provided;
Fig. 2 is the flow chart for the calling system ID distribution methods that the embodiment of the present invention two is provided;
Host interface during debug command is inputted in the calling system ID distribution methods that Fig. 3 provides for the embodiment of the present invention two
Figure;
Host interface figure in the calling system ID distribution methods that Fig. 4 provides for the embodiment of the present invention two under debugging mode;
Doorway extension set interface in the calling system ID distribution methods that Fig. 5 provides for the embodiment of the present invention two under debugging mode
Figure;
Bed head extension interface in the calling system ID distribution methods that Fig. 6 provides for the embodiment of the present invention two under debugging mode
Figure;
Fig. 7 is the structural representation for the calling system ID distributors that the embodiment of the present invention three is provided.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Embodiment one
The embodiment of the present invention one provides a kind of calling system ID distribution methods.Fig. 1 is exhaling for the offer of the embodiment of the present invention one
It is the flow chart of system identifier distribution method.As shown in figure 1, the calling system ID distribution methods in the present embodiment, can include:
Step 101, the debug command for receiving user's input;
Specifically, the executive agent of each step can be main frame in the calling system ID distribution methods that the present embodiment is provided,
When user needs to carry out ID distribution, debug command can be inputted to main frame, main frame, which is received, enters debugging after debug command
Pattern.
Step 102, the debug command inputted according to the user, perform following debugging steps at least one times:
Step A, all extension sets into calling system send ID Notifications of Changes, so that all extension sets are changed according to the ID
Notify to search and itself whether be allocated No. ID, and the random generation ID in the case of unassigned No. ID.
Specifically, in the calling system can include a main frame and multiple extension sets, one main frame with it is described many
Individual extension set is respectively connected with, and the main frame is received after the debug command of user's input, and ID changes can be sent to all extension sets
Notify, extension set is received after the ID Notifications of Changes that the main frame is sent, and checks whether itself had been allocated No. ID, here institute
That states was allocated No. ID, referred to be allocated by the host No. ID, that is, received No. ID of main frame transmission.
When it is to send ID Notifications of Changes to all extension sets for the first time that main frame performs step A for the first time, all extension sets are all also
It is unassigned to cross No. ID, therefore all extension sets can all generate No. ID at random;Lead to when main frame sends ID changes to all extension sets again
When knowing, some possible extension sets have been allocated that No. ID, and some extension sets do not have also, at this moment, be not previously allocated the extension set of No. ID after
Continuous random generation ID, and the extension set of allocated No. ID can keep silent.
The extension set searches whether itself had been allocated No. ID, can be realized using various ways, for example, in extension set
In can be provided with the register for being used to indicate whether to be allocated No. ID, when the extension set receive main frame be its distribution
ID when, the extension set can update the value of the register, when judging whether itself had been allocated ID, can be with
The register is read, is judged whether to be allocated No. ID according to the value of the register.
Step B, receive sequence number information of at least one extension set according to generate at random No. ID transmission, the sequence number letter
Breath includes the sequence number mark of the extension set.
, can be in this step according to the ID generated at random for generating the extension set of No. ID at random in step
Number itself sequence number mark is sent to main frame.Wherein, the sequence number mark of extension set is that extension set is just set when dispatching from the factory,
Also, the sequence number mark of each extension set is differed.Extension set for judging oneself to be allocated No. ID in step
For, it can not send any information to main frame in this step.
No. ID of extension set determines that extension set sends the sequential of information, and the extension set is according to No. ID transmission sequence generated at random
Number information, can specifically include:According to No. ID determination transmission timing generated at random, sent according to the transmission timing to main frame
The sequence number information.Wherein determine transmission timing according to No. ID and send information according to transmission timing to belong to existing skill
Art, here is omitted.
Because No. ID sequential with sending information of extension set is corresponding, therefore, if the ID phases that two extension sets are generated at random
Together, then the sequential for sending information is also identical, causes that when transmitting Sequence Number information to main frame conflict can be produced, main frame is not received
The sequence number information that the two extension sets are sent.In this step, the sequence number information that main frame can be received, is sent from random raw
Into No. ID extension set that is differed with other extension sets.
Step C, identified according to the sequence number, be that the extension set distributes No. ID.
Main frame can obtain the sequence number mark of the extension set, according to described after the sequence number information of extension set is received
Sequence number is identified, and main frame can realize the communication with the extension set, and No. ID is distributed for the extension set, and No. ID for extension set distribution should
With being that distribute No. ID of other extension sets is differed before, be allocated the extension set of No. ID and keep silence in subsequent process, not to
Main frame sends information, until whole debugging process terminates.
In the present embodiment, debugging step specifically includes step A, step B and step C, and these three sequence of steps are performed, and
It can repeat, i.e., step A can be re-executed after step C, continue to send ID Notifications of Changes to all extension sets, then,
The extension set for being not previously allocated No. ID generates new No. ID at random, and the sequence number mark of itself is sent into main frame according to No. ID,
Main frame is identified further according to the sequence number received, is that extension set distributes No. ID, is so repeated after limited number of time, it is possible to achieve be all
Extension set distributes No. ID, also, No. ID of all extension sets is differed.
In the calling system ID distribution methods that the present embodiment is provided, all extension sets of the main frame into calling system send ID and become
More notify, and receive sequence number information of at least one extension set according to No. ID transmission generated at random, the sequence number information bag
The sequence number mark of the extension set is included, is identified according to the sequence number, main frame can distribute No. ID for the extension set, realize point
The automatic distribution of machine ID, process is easy, efficiency is higher and does not allow error-prone.
On the basis of the technical scheme that above-described embodiment is provided, it is preferred that be the extension set distribution described in step C
No. ID, it can specifically include:
No. ID unassigned set of step C1, lookup, and choose an ID in No. ID unassigned set
Number.
Wherein, it is that No. ID of each extension set distribution can sequentially be chosen, to ensure that No. ID distributed for each extension set is not
Identical.
Step C2, send ID distribution information to the extension set, ID distribution information include selected No. ID and
The sequence number mark of the extension set.
Main frame is all sent when sending ID distribution information to all extension sets, if in the ID distribution information that main frame is sent
The sequence number mark of extension set is carried, extension set can check the sequence number wherein carried after ID distribution information is received and identify whether
It is consistent with the sequence number mark of itself:If consistent, illustrate to be intended for oneself, then extension set distributes No. ID carried in information with ID
It is used as oneself No. ID;If inconsistent, extension set does not make any processing to ID distribution information.
No. ID set unassigned by searching, and one No. ID is chosen in No. ID unassigned set,
The extension set is sent to sequence number mark by selected No. ID, accurately and rapidly an ID can be distributed for the extension set
Number.
On the basis of the technical scheme that above-described embodiment is provided, the execution number of times of the debugging step can be set by user
Fixed, whole debugging process can be terminated by having repeated after the debugging step of preset times, can also be stopped by other methods
The following two kinds method is provided in debugging step, the present embodiment:
Method one, the calling system ID distribution methods, can be with after the debug command of the reception user input
Including:The tuning parameter information that user sends is received, the tuning parameter information includes the sum of all extension sets in calling system
Information;Accordingly, distribute after No. ID, can also include for the extension set described:Judging the number of allocated No. ID is
The no sum equal to all extension sets, if so, then stopping performing the debugging step.
In real work, user can send debug command to the main frame first, and the main frame receives the tune
Enter debugging mode after examination order, then, user can send tuning parameter information, the tuning parameter information to the main frame
In can include the sum of all extension sets;Main frame after step C is performed each time, it can be determined that the allocated No. ID whether with
All extension sets it is total equal:If equal, illustrate No. ID all distributed for whole extension sets, then stop performing the debugging step
Suddenly, debugging process is terminated;If unequal, illustrate that also extension set is not previously allocated No. ID, then return to step A, re-executes one
Secondary debugging step.
Method two, the calling system ID distribution methods, after the transmission ID Notifications of Changes to all extension sets, may be used also
With including:If being not received by the sequence number information of extension set transmission, ID Notifications of Changes are sent to all extension sets again.
If the sequence number information for being not received by extension set transmission described in this method, refers to not receive in preset time
The sequence number information sent to extension set, preset time can be set by the user, it would however also be possible to employ default setting.Performing step
After 101, if main frame does not receive the information that any extension set is sent in preset time, illustrating No. ID that extension set randomly generates all is
Identical, at this moment needs to repeat step A, sends ID Notifications of Changes to all extension sets again.
If continuous preset times do not receive extension set transmission after performing the transmission ID Notifications of Changes to all extension sets
Sequence number information, explanation may all extension sets have been allocated that No. ID, can now stop performing the debugging step.
Specifically, preset times can be set by the user, it would however also be possible to employ default setting, for example, preset times are 3 times, when performing step
The sequence number information of extension set transmission is not received after rapid A in preset time, then step A is performed again, if not having in preset time
Sequence number information is received, then performs step A again, if not receiving sequence number information in preset time, stops execution described
Debugging step, terminates debugging process.
Embodiment two
The embodiment of the present invention two provides a kind of calling system ID distribution methods, and the present embodiment is the skill provided in embodiment one
On the basis of art scheme, a kind of specific embodiment when extension set number is three is given.Fig. 2 is that the embodiment of the present invention two is carried
The flow chart of the calling system ID distribution methods of confession., can be with as shown in Fig. 2 the calling system ID distribution methods in the present embodiment
Including:
Step 201, main frame send ID Notifications of Changes to all extension sets.
In actual application, staff first all installs main frame and extension set, and starts extension set and complete
Part machine, then inputs debug command in main frame, so that main frame enters debugging mode, debug command can be a character string,
For example, * 780#.Main frame during debug command is inputted in the calling system ID distribution methods that Fig. 3 provides for the embodiment of the present invention two
Surface chart.
After input debug command, main frame enters debugging mode, and Fig. 4 is the calling system ID that the embodiment of the present invention two is provided
Host interface figure in distribution method under debugging mode.As shown in figure 4, in host interface figure, " medical care address " is main frame
Sequence number is identified, " medical care:XX is on duty:The XX doorways head of a bed:XX corridors screen:In XX ", XX represents the quantity of all types of extension sets, "
Distribute ID:XX " represents the quantity of the allocated ID extension set, when allocated extension set quantity is equal to actual extension set quantity, table
Bright all extension sets are allocated completion, can now terminate debugging mode.
Extension set in the present embodiment can be bed head extension, doorway extension set etc..Fig. 5 is exhaling for the offer of the embodiment of the present invention two
It is the doorway extension set surface chart under debugging mode in system identifier distribution method.Fig. 6 is the calling system that the embodiment of the present invention two is provided
Bed head extension surface chart in ID distribution methods of uniting under debugging mode.As shown in Figure 5 and Figure 6, " ID:XX in XX " can have three
Plant value:" applying " shows that extension set is applying for No. ID, and " preparing application " shows that extension set is ready for application, XX if specific
Numerical value then represents No. ID applied.
In the present embodiment, all extension sets include extension set first, extension set second and extension set the 3rd.After debugging mode is entered,
Main frame sends ID Notifications of Changes to all extension sets first, and extension set first, extension set second and extension set the 3rd can all receive the ID
Notification of Changes.
Step 202, all extension sets search whether itself had been allocated No. ID according to the ID Notifications of Changes, due to
Extension set one, extension set second and extension set the 3rd were all not previously allocated No. ID, therefore extension set first, extension set second and the 3rd point
Machine random generation ID respectively.
Step 203, all extension sets transmit Sequence Number information, the sequence number information according to No. ID generated at random to main frame
Include the sequence number mark of the extension set.
In the present embodiment, it is assumed that generate at random No. ID of extension set first is differed with other extension sets two, extension set second with
Generate at random No. ID of extension set the 3rd is identical, then main frame can only receive the sequence number information of the transmission of extension set first, it is impossible to connect
Receive the sequence number information that extension set second and extension set the 3rd are sent.
Step 204, main frame send the first ID distribution information to all extension sets, and the first ID distribution information includes described the
The sequence number of extension set one identifies and distributed to No. ID of extension set first.
Extension set first after the first ID distribution information is received, the first ID can be distributed in information the ID that carries as
Oneself No. ID.
Step 205, main frame judge whether the sum of allocated No. ID is equal to the sum of all extension sets, are in judged result
In the case of being not equal to, main frame sends ID Notifications of Changes to all extension sets again.
Step 206, all extension sets search whether itself had been allocated No. ID according to the ID Notifications of Changes, due to
Extension set one had been allocated No. ID, therefore no longer generated new No. ID at random, and was to maintain silence;Extension set second and the 3rd point
Machine was all not previously allocated No. ID, therefore the random generation ID respectively of extension set second and extension set the 3rd.
Step 207, extension set second and extension set the 3rd transmit Sequence Number information according to No. ID generated at random to main frame.
Assuming that generate at random in step 206 No. ID of extension set second and extension set the 3rd and differ, then extension set second and
The sequential that extension set the 3rd sends information is also differed, and main frame can receive the sequence number letter that extension set second and extension set the 3rd are sent
Breath.
Step 208, main frame send the 2nd ID distribution information to all extension sets and the 3rd ID distributes information, the 2nd ID points
Include the sequence number mark of extension set second with information and distribute to No. ID of extension set second, the 3rd ID distribution
Sequence number of the information including extension set the 3rd identifies and distributed to No. ID of extension set the 3rd.
Extension set second after the 2nd ID distribution information is received, the 2nd ID can be distributed in information the ID that carries as
Oneself No. ID;Extension set the 3rd can distribute the 3rd ID No. ID carried in information after the 3rd ID distribution information is received
It is used as oneself No. ID.
Step 209, main frame judge the total equal of total and all extension sets of allocated No. ID, therefore stop debugging step
Suddenly, restart to complete whole debugging process.
In the calling system ID distribution methods that the present embodiment is provided, extension set first of the main frame into calling system, second point
Machine and extension set the 3rd send ID Notifications of Changes, and receive sequence number letter of at least one extension set according to No. ID transmission generated at random
Breath, the sequence number that the sequence number information includes the extension set is identified, and is identified according to the sequence number, and main frame can be described point
Machine distributes No. ID, then sends ID Notifications of Changes to all extension sets again, until the allocated sum of No. ID is equal to all points
The sum of machine, realizes the automatic distribution of extension set ID, process is easy, efficiency is higher and does not allow error-prone.
Embodiment three
The embodiment of the present invention three provides a kind of calling system ID distributors.Fig. 7 is exhaling for the offer of the embodiment of the present invention three
It is the structural representation of system identifier distributor.As shown in fig. 7, the calling system ID distributors in the present embodiment, can be wrapped
Include
Receiving module 701, the debug command for receiving user's input;
Debugging module 702, for the debug command inputted according to the user, performs following debugging steps at least one times:
All extension sets into calling system send ID Notifications of Changes, so that all extension sets search itself according to the ID Notifications of Changes is
It is no to be allocated No. ID, and the random generation ID in the case of unassigned No. ID;Receive at least one extension set according to
The sequence number information of No. ID transmission generated at random, the sequence number that the sequence number information includes the extension set is identified;According to institute
Sequence number mark is stated, is that the extension set distributes No. ID.
Calling system ID distributors in the present embodiment, can be specifically for performing the calling system described in embodiment one
ID distribution methods, its realization principle is similar, and here is omitted.
In the calling system ID distributors that the present embodiment is provided, all extension sets of the main frame into calling system send ID and become
More notify, and receive sequence number information of at least one extension set according to No. ID transmission generated at random, the sequence number information bag
The sequence number mark of the extension set is included, is identified according to the sequence number, main frame can distribute No. ID for the extension set, realize point
The automatic distribution of machine ID, process is easy, efficiency is higher and does not allow error-prone.
On the basis of the technical scheme that above-described embodiment is provided, it is preferred that described to distribute No. ID, tool for the extension set
Body includes:No. ID unassigned set is searched, and one No. ID is chosen in No. ID unassigned set;To described
Extension set sends ID distribution information, and ID distribution information includes selected No. ID and the sequence number of the extension set is identified.
On the basis of the technical scheme that above-described embodiment is provided, it is preferred that the receiving module is additionally operable to:Described
After the debug command for receiving user's input, the tuning parameter information that user sends is received, the tuning parameter information includes exhaling
It is the total number information of all extension sets in system;
The debugging module is additionally operable to:Distributed described for the extension set after No. ID, judge of allocated No. ID
Whether number is equal to the sum of all extension sets, if so, then stopping performing the debugging step.
On the basis of the technical scheme that above-described embodiment is provided, it is preferred that the debugging module is additionally operable to:Described
After sending ID Notifications of Changes to all extension sets, if the sequence number information of extension set transmission is not received by, again to all points
Machine sends ID Notifications of Changes.
On the basis of the technical scheme that above-described embodiment is provided, it is preferred that if continuous preset times perform it is described to
All extension sets do not receive the sequence number information that extension set is sent after sending ID Notifications of Changes, then stop performing the debugging step
Suddenly.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.