Summary of the invention
The application's is designed to provide a kind of module's address distribution method, system and a kind of modularized equipment and a kind of meter
Calculation machine readable storage medium storing program for executing guarantees that logical address is continuous in module failure.
To achieve the above object, this application provides a kind of module's address distribution methods, are applied to modularized equipment, packet
It includes:
All physical address in wire module are obtained, are that all online module assignments are continuous according to the physical address
Logical address;
When detecting off-line module, set empty for the logical address of the off-line module;
When described when wire module detects that destination logical address is empty, the logical address in wire module is subtracted one;
Wherein, the logical address in wire module and the difference of the destination logical address are one.
It wherein, is all online continuous logical addresses of module assignment according to the physical address, comprising:
All physical address in wire module are sorted from small to large, and according to the ranking results company of distribution from small to large
Continuous logical address.
It wherein, is all online continuous logical addresses of module assignment according to the physical address, comprising:
According to the physical address and each adding in wire module described in the working condition calculating each of wire module
Weight;
All weighted values in wire module are sorted from small to large, and are distributed from small to large continuously according to ranking results
Logical address.
Wherein, it is calculated according to the physical address and each working condition in wire module each described in wire module
Weighted value, comprising:
Each weighted value in wire module is calculated according to weighted value calculation formula;Wherein, the weighted value calculates public
Formula are as follows:
Y=A2×N+A1;
Wherein, Y is the weighted value, A2For the corresponding formula value of the working condition in wire module, A1It is described online
The physical address of module, N are the maximum value of all physical address in wire module.
Wherein, the working condition formula value and the priority of the working condition are positively correlated.
Wherein, the working condition priority includes inverter mode, bypass condition and without output state from high to low.
To achieve the above object, this application provides a kind of module's address distribution systems, are applied to modularized equipment, packet
It includes:
Distribution module, for obtaining all physical address in wire module, according to the physical address be it is all it is described
Wire module distributes continuous logical address;
First setup module, for setting empty for the logical address of the off-line module when detecting off-line module;
Second setup module, for when described when wire module detects that destination logical address is empty, by the online mould
The logical address of block subtracts one;Wherein, the logical address in wire module and the difference of the destination logical address are one.
Wherein, the distribution module includes:
Acquiring unit, for obtaining all physical address in wire module;
Computing unit, it is each described for being calculated according to the physical address and each working condition in wire module
In the weighted value of wire module;
Allocation unit, for all weighted values in wire module to be sorted from small to large, and according to ranking results by
The as low as big continuous logical address of distribution.
To achieve the above object, this application provides a kind of modularized equipments, comprising:
Memory, for storing computer program;
Processor is realized when for executing the computer program such as the step of above-mentioned module's address distribution method.
To achieve the above object, this application provides a kind of computer readable storage medium, the computer-readable storages
It is stored with computer program on medium, such as above-mentioned module's address distribution method is realized when the computer program is executed by processor
The step of.
By above scheme it is found that a kind of module's address distribution method provided by the present application, comprising: obtain all online moulds
The physical address of block is all online continuous logical addresses of module assignment according to the physical address;When detect from
When wire module, set empty for the logical address of the off-line module;Detect that destination logical address is in wire module when described
When empty, the logical address in wire module is subtracted one;Wherein, the logical address in wire module and the target logic
The difference of location is one.
Module's address distribution method provided by the present application, each module detect the previous logical address of own module, work as inspection
It measures when previous logical address is empty and the logical address of itself is subtracted one, subsequent module detects that previous logical address, will for sky
The logical address of itself subtracts one according to this, so far ensure that module's address is continuous.In maintenance, the module of continuation address can be obtained
Information improves maintenance efficiency.Disclosed herein as well is a kind of module's address distribution system and a kind of modularized equipment and one kind
Computer readable storage medium is equally able to achieve above-mentioned technical effect.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
The embodiment of the present application discloses a kind of module's address distribution method, improves the supervisory efficiency of tourist image design.
Referring to Fig. 1, a kind of flow chart of module's address distribution method disclosed in the embodiment of the present application, as shown in Figure 1, packet
It includes:
S101: obtaining all physical address in wire module, is all described in wire module point according to the physical address
With continuous logical address;
The present embodiment is applied to the modularized equipment comprising multiple modules, and executing subject can be the processing of modularized equipment
Device.Before for each module assignment logical address, all physical address in wire module are obtained first.In specific implementation, may be used
Its physical address is determined with the physical location being specifically inserted into according to each module, and the object of each module can also be set by artificial dial-up
Manage address, naturally it is also possible to the physical address of each module is automatically determined by other methods, the present embodiment is without specifically limiting.
It is the continuous physical address of each module assignment according to the physical address after the physical address for determining each module.This
Embodiment does not limit the specific method of salary distribution, can at random be each module continuation address;It can also be according to each module physical address
Size order the sequence of each module logic address is set, i.e., all physical address in wire module are sorted from small to large, and
Distribute continuous logical address from small to large according to ranking results;It can certainly be according to module physical address and working condition
Weighted value determines logical address, will be described in detail in next embodiment.
After for each module assignment logical address, the working condition of each module of processor real-time detection, if detecting mould
There is offline situation in block failure, then enters S102.Do not limit specific detection method herein, it can be every preset time to each
Module sends detection information, can also each module every preset time send heartbeat message etc. to processor.Meanwhile each module is equal
The previous logical address of the real-time detection module then enters S103 when detecting that previous logical address is empty.
S102: when detecting off-line module, set empty for the logical address of the off-line module;
In specific implementation, when module has failure in operation to be exited or repair, then the module is off-line module.When
When detecting off-line module, processor sets empty for the logical address of the off-line module.
S103: when described when wire module detects that destination logical address is empty, by the logical address in wire module
Subtract one;Wherein, the logical address in wire module and the difference of the destination logical address are one.
In specific implementation, the previous logical address of the equal real-time detection module of each module, when detect it is previous logically
When location is empty, the logical address of itself is subtracted one.Subsequent module detect according to this previous logical address for sky, according to this by itself
Logical address subtracts one.So far, it when the discontinuous situation of physical address occurs in each module, can be arranged by the combination of logical address
Sequence, it is ensured that logical address is continuous.
For example, entire modularized equipment is altogether there are four module, physical address is respectively as follows: 1,2, (sky), 4,5, and processor is
This four continuous logical addresses of module assignment are respectively as follows: 1,2, (sky), 3,4.When physical address is 4 (logical addresses 3)
After module failure is offline, processor sets empty for device logical address, at this time the logical address of four modules be respectively as follows: 1,2,
(sky), (sky), 4.Physical address is the module of 5 (logical addresses 4), will in the absence of detecting the module that logical address is 3
The logical address of itself subtracts one, and the logical address of four modules is respectively as follows: 1,2, (sky), (sky), 3 at this time, ensure that module is patrolled
Collect the continuous of address.
The application mention embodiment confession module's address distribution method, each module detect own module it is previous logically
The logical address of itself is subtracted one when detecting that previous logical address is empty by location, and subsequent module detects previous logical address
For sky, the logical address of itself is subtracted one according to this, so far ensure that module's address is continuous.In maintenance, can obtain continuously
The module information of location, improves maintenance efficiency.
A kind of method for distributing logical address provided in this embodiment is described in detail below, specific:
Referring to fig. 2, the flow chart of another module's address distribution method provided by the embodiments of the present application, as shown in Fig. 2, packet
It includes:
S201: it is calculated according to the physical address and each working condition in wire module each described in wire module
Weighted value;
In the present embodiment, logical address is determined according to the weighted value of module physical address and working condition.It specifically can be with
Each weighted value in wire module is calculated according to weighted value calculation formula;Wherein, the weighted value calculation formula are as follows:
Y=A2×N+A1;
Wherein, Y is the weighted value, A2For the corresponding formula value of the working condition in wire module, A1It is described online
The physical address of module, N are the maximum value of all physical address in wire module.
In specific implementation, by calculating Y value, physical address and working condition are be combined with each other, so that working condition is excellent
First grade highest module obtains to obtain the smallest logical address, when working condition is consistent, the smallest module of physical address, and logical address
It is minimum.That is working condition formula value and the priority of the working condition is positively correlated.
The present embodiment does not limit specific working condition and its formula value specifically, and those skilled in the art can root
According to actual conditions flexible setting.For example, working condition priority may include inverter mode, bypass condition and without defeated from high to low
It does well.The formula value of inverter mode can be set to 3, the formula value of bypass condition is set as 2, the formula value of no output
It is set as 1.
S202: all weighted values in wire module are sorted from small to large, and are divided from small to large according to ranking results
With continuous logical address.
In specific implementation, the sequence of each module logic address is set according to the size order of each module weighted value, is each
The continuous logical address of module assignment.
A kind of Application Example of module's address distribution method provided in this embodiment is described below.Specifically, this method
Applied to modularization NCPI (Chinese name: Network Critical Physical Infrastructure, full name in English: NetworkCriticalPhysi
calInfrastructure)。
Step 1: in memory, defining a memory space [D1、D2…Dm], and it is initialized as 0;
Step 2: the weighted value Y of each module is calculated in modules, the weighting scheme provided using a upper embodiment;
Step 3: weighted value being carried out to the information sharing interaction of all modules by communication mode, obtains adding for all modules
Weigh information [Y1、Y2…Ym];
Step 4: each module judges the relationship of this module Y value Yu other module Y values, when the Y value of this module is in system
When maximum value, 1, i.e. D=1 are set by the logical address of this module, is continued by the Y zero setting of this module, and by the Y value of zero setting
Information sharing;
Step 5: all relationships for continuing to judge this module Y value Yu other module Y values in wire module, when the Y value of this module
When for maximum value in system, 2, i.e. D=2 are set by the logical address of this module, equally by the Y zero setting of this module, and will be set
Zero Y value continues information sharing;
Step 6: the rest may be inferred, until all 0, the D values of all module Y values are not 0, successively obtains the ground of modules
Location D;
Step 7: when the address D of other not received modules of a period of time, the module's address for not receiving address being set to
0;
Step 8: it is all wire module detection identify previous address whether vacancy (module of address 0,1 is grasped without this
Make), if vacancy, the logical address of this module is subtracted 1, is successively carried out.
A kind of module's address distribution system provided by the embodiments of the present application is introduced below, a kind of mould described below
Block address distribution system can be cross-referenced with a kind of above-described module's address distribution method.
Referring to Fig. 3, a kind of structure chart of module's address distribution system provided by the embodiments of the present application, as shown in figure 3, packet
It includes:
Distribution module 301 is all described according to the physical address for obtaining all physical address in wire module
The continuous logical address of online module assignment;
First setup module 302, for setting the logical address of the off-line module to when detecting off-line module
It is empty;
Second setup module 303, for when described when wire module detects that destination logical address is empty, will it is described online
The logical address of module subtracts one;Wherein, the logical address in wire module and the difference of the destination logical address are one.
The application mention embodiment confession module's address distribution system, each module detect own module it is previous logically
The logical address of itself is subtracted one when detecting that previous logical address is empty by location, and subsequent module detects previous logical address
For sky, the logical address of itself is subtracted one according to this, so far ensure that module's address is continuous.In maintenance, can obtain continuously
The module information of location, improves maintenance efficiency.
On the basis of the above embodiments, the distribution module 301 is specially to obtain institute as a preferred implementation manner,
There is the physical address in wire module, and all physical address in wire module are sorted from small to large, and is tied according to sequence
Fruit distributes the module of continuous logical address from small to large.
On the basis of the above embodiments, the distribution module 301 includes: as a preferred implementation manner,
Acquiring unit, for obtaining all physical address in wire module;
Computing unit, it is each described for being calculated according to the physical address and each working condition in wire module
In the weighted value of wire module;
Allocation unit, for all weighted values in wire module to be sorted from small to large, and according to ranking results by
The as low as big continuous logical address of distribution.
On the basis of the above embodiments, the computing unit is specially according to weighting as a preferred implementation manner,
It is worth the unit that calculation formula calculates each weighted value in wire module;Wherein, the weighted value calculation formula are as follows:
Y=A2×N+A1;
Wherein, Y is the weighted value, A2For the corresponding formula value of the working condition in wire module, A1It is described online
The physical address of module, N are the maximum value of all physical address in wire module.
On the basis of the above embodiments, the working condition formula value and the work as a preferred implementation manner,
The priority for making state is positively correlated.
On the basis of the above embodiments, the working condition priority is from high to low as a preferred implementation manner,
Including inverter mode, bypass condition and without output state.
Present invention also provides a kind of modularized equipments, referring to fig. 4, a kind of modularized equipment provided by the embodiments of the present application
Structure chart, as shown in Figure 4, comprising:
Memory 100, for storing computer program;
Step provided by above-described embodiment may be implemented in processor 200 when for executing the computer program.
Specifically, memory 100 includes non-volatile memory medium, built-in storage.Non-volatile memory medium storage
There are operating system and computer-readable instruction, which is that the operating system and computer in non-volatile memory medium can
The operation of reading instruction provides environment.Processor 200 provides calculating and control ability for modularized equipment, executes the memory
When the computer program saved in 100, the step of module's address distribution method that any of the above-described embodiment provides may be implemented.
The application mentions the modularized equipment of embodiment confession, and each module detects the previous logical address of own module, works as inspection
It measures when previous logical address is empty and the logical address of itself is subtracted one, subsequent module detects that previous logical address, will for sky
The logical address of itself subtracts one according to this, so far ensure that module's address is continuous.In maintenance, the module of continuation address can be obtained
Information improves maintenance efficiency.
On the basis of the above embodiments, preferably, referring to Fig. 5, the modularized equipment further include:
Input interface 300 is connected with processor 200, for obtaining computer program, parameter and the instruction of external importing,
It saves through the control of processor 200 into memory 100.The input interface 300 can be connected with input unit, and it is manual to receive user
The parameter or instruction of input.The input unit can be the touch layer covered on display screen, be also possible to be arranged in terminal enclosure
Key, trace ball or Trackpad, be also possible to keyboard, Trackpad or mouse etc..
Display unit 400 is connected with processor 200, the data sent for video-stream processor 200.The display unit 400
It can be display screen, liquid crystal display or the electric ink display screen etc. in PC machine.It, can be with specifically, in the present embodiment
Physical address and the logical address etc. of each module are shown by display unit 400.
The network port 500 is connected with processor 200, for being communicatively coupled with external each terminal device.The communication link
The communication technology used by connecing can be cable communicating technology or wireless communication technique, and such as mobile high definition chained technology (MHL) leads to
It is blue with universal serial bus (USB), high-definition media interface (HDMI), adopting wireless fidelity technology (WiFi), Bluetooth Communication Technology, low-power consumption
The tooth communication technology, communication technology based on IEEE802.11s etc..
Present invention also provides a kind of computer readable storage medium, the storage medium may include: USB flash disk, mobile hard disk,
Read-only memory (Read-Only Memory, ROM), random access memory (RandomAccess Memory, RAM), magnetic disk
Or the various media that can store program code such as CD.Computer program, the computer are stored on the storage medium
The step of module's address distribution method that any of the above-described embodiment provides is realized when program is executed by processor.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities
The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment
Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration
?.It should be pointed out that for those skilled in the art, under the premise of not departing from the application principle, also
Can to the application, some improvement and modification can also be carried out, these improvement and modification also fall into the protection scope of the claim of this application
It is interior.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that
A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in the process, method, article or apparatus that includes the element.