CN110769078A - Address allocation method and system - Google Patents
Address allocation method and system Download PDFInfo
- Publication number
- CN110769078A CN110769078A CN201910987078.XA CN201910987078A CN110769078A CN 110769078 A CN110769078 A CN 110769078A CN 201910987078 A CN201910987078 A CN 201910987078A CN 110769078 A CN110769078 A CN 110769078A
- Authority
- CN
- China
- Prior art keywords
- address
- time
- slave
- ith
- preset time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses an address allocation method and system, wherein the method can comprise the following steps: the host acquires an ith address from an address set, wherein i is a positive integer; the host polls the multiple slaves for the ith address or not; if the slave machine replies the ith address, adjusting the interval time to be first preset time; if no slave machine replies the ith address, generating interval time according to first preset time; and polling the (i + 1) th addresses from the plurality of slave machines according to the interval time until all addresses in the address set are polled. According to the method, the condition that an error address is generated due to manual dialing can be avoided, the reliability of the system is improved, extra hardware equipment is not needed, the cost is greatly reduced, and meanwhile, the waste of human resources is avoided.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an address allocation method and an address allocation system.
Background
In a bus communication system of smart home devices, a master module is generally set in a bus, each communication device is used as a slave module, communication information sent by the master module can be received by other slave modules on the bus, and each slave module must be assigned a communication address in order to mark the slave module sending or receiving the information.
In the related art, the communication address is usually assigned manually by means of manual dialing, however, the following disadvantages exist in this method: (1) the machine needs to be disassembled to carry out manual dial-up, which causes waste of a large amount of human resources; (2) the same address is easy to generate by manual dialing, so that normal communication cannot be carried out, and the reliability of the system is low; (3) hardware devices such as a dial-up device and the like are additionally required, so that the production cost is greatly increased.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art. Therefore, a first object of the present invention is to provide an address allocation method, in which a host actively allocates a communication address to a communication device group where the host is located, and manual dialing is not required, so that not only is a situation of generating an incorrect address due to manual dialing avoided, and system reliability improved, but also no additional hardware device is required, and cost is greatly reduced, and waste of human resources is avoided.
A second object of the invention is to propose an address allocation system.
A third object of the invention is to propose an electronic device.
A fourth object of the invention is to propose a computer-readable storage medium.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides an address allocation method, including: the host acquires an ith address from an address set, wherein i is a positive integer; the master machine polls a plurality of slave machines whether the ith address has a reply; if the slave machine replies the ith address, adjusting the interval time to be first preset time; if no slave machine replies the ith address, generating the interval time according to the first preset time; and polling the i +1 th addresses from the plurality of slave machines according to the interval time until all addresses in the address set are polled.
According to the address allocation method provided by the embodiment of the invention, the ith address is acquired from the address set through the host, whether the ith address replies is polled to the multiple slaves through the host, the interval time is adjusted to the first preset time when the ith address replies to the slaves, the interval time is generated according to the first preset time when the ith address does not reply to the slaves, and whether the ith +1 address replies to the multiple slaves is polled according to the interval time until all addresses in the address set are polled. Therefore, the communication address is actively distributed to the communication equipment group where the host computer is located without manual dialing, so that the condition of generating an error address due to manual dialing can be avoided, the reliability of the system is improved, extra hardware equipment is not required to be added, the cost is greatly reduced, and the waste of human resources is avoided.
In addition, the address allocation method according to the above embodiment of the present invention may further have the following additional technical features:
according to an embodiment of the present invention, the generating the interval time according to the first preset time includes: recording the number of times that the ith address is not received after being electrified again; and generating the time interval according to the reply times and the first preset time.
According to one embodiment of the invention, the time interval is generated according to the following formula: tgap is the time interval, T11 is the first preset time, N11 is the number of replies, and T13 is the second preset time.
According to an embodiment of the present invention, further comprising: after receiving the polling instruction of the ith address, the slave machine judges whether the slave machine occupies the address or not; if the slave has preempted an address, then reply to the master after a third preset time.
According to an embodiment of the present invention, further comprising: if the slave does not preempt the address, the slave performs address preemption after a fourth preset time.
According to an embodiment of the present invention, the slave performing address preemption after a fourth preset time, including: the slave generates at least one random time; and sending an address preemption request to the host when the random time is reached, and if the host does not receive the address preemption requests of other slave machines before the random time, allocating the ith address to the slave machines.
To achieve the above object, an embodiment of a second aspect of the present invention provides an address allocation system, including: a plurality of slaves; the host is used for acquiring the ith address from the address set, polling the multiple slaves for whether the ith address replies or not, adjusting the interval time to be first preset time when the slaves reply the ith address, generating the interval time according to the first preset time when the slaves do not reply the ith address, polling the multiple slaves for whether the ith +1 address replies or not according to the interval time until all addresses in the address set are polled, wherein i is a positive integer.
According to the address allocation system provided by the embodiment of the invention, the ith address is acquired from the address set through the host, whether the ith address replies is polled to the multiple slaves through the host, the interval time is adjusted to the first preset time when the ith address replies to the slaves, the interval time is generated according to the first preset time when the ith address does not reply to the slaves, and whether the ith +1 address replies to the multiple slaves is polled according to the interval time until all addresses in the address set are polled. Therefore, the communication address is actively distributed to the communication equipment group where the host computer is located without manual dialing, so that the condition of generating an error address due to manual dialing can be avoided, the reliability of the system is improved, extra hardware equipment is not required to be added, the cost is greatly reduced, and the waste of human resources is avoided.
In addition, the address allocation system according to the above embodiment of the present invention may further have the following additional technical features:
according to one embodiment of the invention, the host is configured to: recording the number of times that the ith address is not received after being electrified again; and generating the time interval according to the reply times and the first preset time.
According to one embodiment of the invention, the host generates the time interval according to the following formula: tgap is the time interval, T11 is the first preset time, N11 is the number of replies, and T13 is the second preset time. According to an embodiment of the present invention, the slave is configured to determine whether the slave has preempted an address after receiving the polling instruction of the ith address, and reply to the master after a third preset time when determining that the slave has preempted the address.
According to an embodiment of the present invention, the slave is further configured to perform address preemption after a fourth preset time when determining that an address is not preempted.
According to one embodiment of the invention, the slave is configured to: generating at least one random time; and sending an address preemption request to the master when the random time arrives, wherein if the master does not receive the address preemption requests of other slaves before the random time, the ith address is distributed to the slaves.
To achieve the above object, a third embodiment of the present invention provides an electronic device, including a memory, a processor; wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the address allocation method.
According to the electronic equipment provided by the embodiment of the invention, by executing the address allocation method, the host is used for actively allocating the communication address to the communication equipment group where the host is located, and manual dialing is not needed, so that the condition that an error address is generated due to manual dialing can be avoided, the reliability of a system is improved, additional hardware equipment is not needed, the cost is greatly reduced, and meanwhile, the waste of human resources is avoided.
To achieve the above object, a fourth aspect of the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the address allocation method described above.
According to the computer-readable storage medium of the embodiment of the invention, by executing the address allocation method, the host actively allocates the communication address to the communication equipment group where the host is located without manual dialing, so that the condition of generating an error address due to manual dialing can be avoided, the reliability of the system is improved, additional hardware equipment is not required, the cost is greatly reduced, and the waste of human resources is avoided.
Drawings
FIG. 1 is a flow diagram of an address assignment method according to an embodiment of the invention;
FIG. 2 is a flow diagram of a method of address assignment according to one embodiment of the invention;
FIG. 3 is a block diagram of an address assignment system, according to an embodiment of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
An address allocation method, an address allocation system, an electronic device, and a computer-readable storage medium according to embodiments of the present invention are described below with reference to the accompanying drawings.
Fig. 1 is a flowchart of an address assignment method according to an embodiment of the present invention. As shown in fig. 1, the address allocation method according to an embodiment of the present invention may include the following steps:
s1, the host acquires the ith address from the address set. Wherein i is a positive integer.
The address set can be a set of communication addresses to be allocated to all the slaves by the host, and can be stored in the storage unit in a preselected manner so as to be called when the host allocates the addresses to the slaves.
S2, the master polls the slaves for an ith address reply. Wherein, if yes, step S3 is executed; if not, step S4 is performed.
Specifically, all addresses in the address set may be polled by the host, where after a default interval T12 when the host is powered on (i.e., a first default interval after the host is powered on), the ith address may be obtained from the address set, and a polling instruction may be sent to the multiple slaves according to the current address (i.e., the obtained ith address) to inquire whether the current address is occupied by the slaves.
And S3, if the slave machine replies the ith address, adjusting the interval time to be a first preset time.
If the slave answers the current address, the current address is indicated to be occupied by the slave, at this time, the interval time is reduced from the default interval time T12 to a first preset time T11, and the next address, namely the (i + 1) th address, is inquired after the first preset time T11.
And S4, if no slave machine replies the ith address, generating interval time according to the first preset time.
If no slave replies the current address, the current address is not occupied by the slave, and at this time, the interval time T can be calculated according to the first preset time T11gapAnd inquires the next address after the calculated interval time, i.e., the (i + 1) th address.
How to calculate the interval time according to the first preset T11 time is described in detail below with reference to specific embodiments.
According to one embodiment of the present invention, generating an interval time according to a first preset time includes: recording the number of times of reply that the ith address is not received after the power is re-turned on; and generating a time interval according to the reply times and the first preset time.
According to one embodiment of the invention, the time interval is generated according to the following formula:
tgap is a time interval, T11 is a first preset time, N11 is a number of replies, and T13 is a second preset time.
Specifically, after the master recorded in the call recording unit is powered on again each time, when the slave is polled for the current address (ith address), the number of times of reply N11 from the slave to the current address is not received, and the obtained number of times of reply N11 and the first preset time are substituted into the following formula (i.e., formula (1)) to calculate the time interval:
Tgap=T11+N11*T13, (1),
wherein, Tgap is a time interval, T11 is a first preset time, N11 is a number of replies, and T13 is a second preset time. The maximum value of the time interval Tgap may be the default interval time T12, and the default interval time T12, the first preset time T11, and the second preset time T13 may all be calibrated according to actual conditions.
It can be understood that the larger the calculated time interval Tgap is, the larger the value of the reply time N11 is, that is, the longer the time that the current address is unoccupied is, so that the time that the current address is not occupied can be accurately determined according to the size of the calculated time interval, and whether the current address is occupied by a slave can be determined, so that when the slave is replaced subsequently, the slave of which address is replaced can be rapidly determined, and the address of the replaced slave can be easily compensated.
And S5, polling the i +1 th addresses from the plurality of slaves for replies according to the interval time until all addresses in the address set are polled.
Specifically, after the host is powered on, the host may obtain a current address, that is, an ith address, from the address set after a default interval time T12, send a polling command to the multiple slaves according to the current address to inquire whether the current address is occupied by the slaves, if there is a slave that replies to the current address, turn down the interval time from the default interval time T12 to a first preset time T11, if there is no slave that replies to the current address, call the host recorded in the recording unit to, after each power-up, when polling the current address for the slaves, not receive a reply time N11 for the slave that replies to the current address, generate a time interval Tgap according to the reply time N11 and the first preset time T11, obtain a next address, that is, an i +1 address, from the address set again after the adjusted time interval or the calculated time interval, and send a polling command to the multiple slaves according to the i +1 address, inquiring whether the (i + 1) th address is occupied by the slave machine, and repeatedly executing the steps until all the addresses in the address set are polled.
Therefore, the communication address is actively distributed to the communication equipment group where the host computer is located without manual dialing, so that the condition of generating an error address due to manual dialing can be avoided, the reliability of the system is improved, extra hardware equipment is not required to be added, the cost is greatly reduced, and the waste of human resources is avoided.
It should be noted that, after the master sends a polling command to the slave according to the ith address, the slave also determines that the slave makes a corresponding response according to the received polling command of the ith address. How the slave responds according to the received polling command is described in detail below with reference to specific embodiments.
According to an embodiment of the present invention, as shown in fig. 2, the address allocation method may further include the steps of:
s201, after receiving the polling command of the ith address, the slave judges whether the slave occupies the address or not. If yes, go to step S202; if not, step S203 is executed.
And S202, if the slave preempts the address, replying to the master after a third preset time.
And S203, if the slave does not preempt the address, the slave performs address preemption after the fourth preset time.
Specifically, after receiving the polling command of the ith address, the slave may determine whether it has preempted the address. If the address currently occupied by the slave machine is consistent with the address (ith address) polled by the host machine, the slave machine is judged to preempt the address, otherwise, the slave machine is judged not to preempt the address.
When the address is determined to be preempted, the slave can immediately reply to the host after a third preset time T21 to inform the host that the address is preempted; when it is determined that the address is not preempted, the slave may perform address preemption after a fourth preset time T22. The third preset time T21 and the fourth preset time T22 can be calibrated according to actual conditions, and the fourth preset time T22 is greater than or equal to the third preset time T21.
It is understood that, since the slave immediately replies to the master after the third preset time T21 when preempting the address, when the slave does not preempt the address, it needs to detect whether other slaves have signals to reply to the master before performing the address preemption. If the other slave machines are detected to have signals for replying to the master machine, the current address is preempted by the other slave machines, so that the address does not need to be preempted any more, and the next address can be continuously preempted; if the other slave has no signal of replying to the master, it indicates that the current address is not preempted by other slaves, so the address preemption can be performed after the fourth preset time T22.
According to one embodiment of the present invention, the slave performs address preemption after a fourth preset time, and the method comprises the following steps: the slave generates at least one random time; and sending an address preemption request to the host when the random time is up, and if the host does not receive the address preemption requests of other slaves before the random time, allocating the ith address to the slaves.
Specifically, multiple sets of random numbers may be read and one or more random times may be calculated from the multiple sets of random numbers, for example, random numbers N21, N22, and N23 may be read and three random times may be calculated by the following formulas: t23 ═ N21 × T1;
T24=N22*T1;
T25=N23*T1,
wherein, T23, T24 and T25 may be three random times, N21, N22 and N23 may be three random numbers, and T1 is a fifth preset time.
The slave may send an address preemption request to the master once every random time arrives. In the idle state, the slave machine can also detect whether other slave machines have the information of preempting the address. If the information that other slave machines preempt the address is not detected, the address is not preempted by other slave machines, and at the moment, the ith address can be distributed to the slave machines; if it is detected that other slave machines have the information of preempting the address, it indicates that the address has been preempted by other slave machines, at this time, the slave machines are unsuccessfully preempted, and continue to preempt the next address, that is, when several slave machines preempt an address, if the preemption is unsuccessfully, the next address can be continuously preempted.
Therefore, the polling address of the host is occupied actively, so that the address is automatically allocated to the equipment group, the hardware cost is saved, the installation process is facilitated, and the waste of human resources is avoided. According to the scheme, the slaves can be sequentially powered on after the master is started, and the slaves are arranged according to the power-on sequence of the slaves, so that the numbers of the corresponding master in a room where the slaves are located can be conveniently obtained, and the operation of a user is convenient. And after one machine is damaged, the machine can be automatically judged, so that the code of the damaged machine can be automatically compensated after replacement, and resetting is not needed.
In summary, according to the address allocation method of the embodiment of the present invention, the host acquires the ith address from the address set, polls the multiple slaves for whether the ith address replies or not through the host, and if the slaves reply the ith address, adjusts the interval time to the first preset time, and if the slaves do not reply the ith address, generates the interval time according to the first preset time, and polls the multiple slaves for whether the (i + 1) th address replies or not according to the interval time until all addresses in the address set are polled. Therefore, the communication address is actively distributed to the communication equipment group where the host computer is located without manual dialing, so that the condition of generating an error address due to manual dialing can be avoided, the reliability of the system is improved, extra hardware equipment is not required to be added, the cost is greatly reduced, and the waste of human resources is avoided.
FIG. 3 is a block diagram of an address assignment system, according to an embodiment of the invention. As shown in fig. 3, the address allocating system 1 according to the embodiment of the present invention may include a plurality of slaves 10 (only 2 are shown in the figure) and a master 20.
The master 20 is configured to obtain an ith address from the address set, poll the multiple slaves for whether the ith address replies, adjust the interval time to a first preset time when the slaves reply the ith address, generate the interval time according to the first preset time when the slaves do not reply the ith address, and poll the multiple slaves for whether the (i + 1) th address replies according to the interval time until all addresses in the address set are polled, where i is a positive integer.
According to one embodiment of the invention, host 20 is configured to: recording the number of times of reply that the ith address is not received after the power is re-turned on; and generating a time interval according to the reply times and the first preset time.
According to one embodiment of the invention, host 20 generates the time interval according to the following formula:
tgap is a time interval, T11 is a first preset time, N11 is a number of replies, and T13 is a second preset time.
According to an embodiment of the present invention, the slave 10 is configured to determine whether the slave has preempted the address after receiving the polling instruction of the ith address, and reply to the master after a third preset time when determining that the address has been preempted.
According to an embodiment of the present invention, the slave 10 is further configured to perform address preemption after a fourth preset time when it is determined that the address is not preempted.
According to one embodiment of the invention, the slave is configured to: generating at least one random time; and sending an address preemption request to the host when the random time is reached, wherein if the host does not receive the address preemption requests of other slaves before the random time, the ith address is distributed to the slaves.
It should be noted that, for details not disclosed in the address allocation system according to the embodiment of the present invention, please refer to details disclosed in the address allocation method according to the embodiment of the present invention, and detailed descriptions thereof are omitted here.
According to the address allocation system provided by the embodiment of the invention, the ith address is acquired from the address set through the host, whether the ith address replies is polled to the multiple slaves through the host, the interval time is adjusted to the first preset time when the ith address replies to the slaves, the interval time is generated according to the first preset time when the ith address does not reply to the slaves, and whether the ith +1 address replies to the multiple slaves is polled according to the interval time until all addresses in the address set are polled. Therefore, the communication address is actively distributed to the communication equipment group where the host computer is located without manual dialing, so that the condition of generating an error address due to manual dialing can be avoided, the reliability of the system is improved, extra hardware equipment is not required to be added, the cost is greatly reduced, and the waste of human resources is avoided.
In addition, the invention also provides an electronic device, which comprises a memory and a processor; wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the address allocation method.
According to the electronic equipment provided by the embodiment of the invention, by executing the address allocation method, the host is used for actively allocating the communication address to the communication equipment group where the host is located, and manual dialing is not needed, so that the condition that an error address is generated due to manual dialing can be avoided, the reliability of a system is improved, additional hardware equipment is not needed, the cost is greatly reduced, and meanwhile, the waste of human resources is avoided.
Furthermore, the present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the address assignment method described above.
According to the computer-readable storage medium of the embodiment of the invention, by executing the address allocation method, the host actively allocates the communication address to the communication equipment group where the host is located without manual dialing, so that the condition of generating an error address due to manual dialing can be avoided, the reliability of the system is improved, additional hardware equipment is not required, the cost is greatly reduced, and the waste of human resources is avoided.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In addition, in the description of the present invention, the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element referred to must have a particular orientation, be constructed in a particular orientation, and be operated, and thus, should not be construed as limiting the present invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.
Claims (14)
1. An address allocation method, comprising:
the host acquires an ith address from an address set, wherein i is a positive integer;
the master machine polls a plurality of slave machines whether the ith address has a reply;
if the slave machine replies the ith address, adjusting the interval time to be first preset time;
if no slave machine replies the ith address, generating the interval time according to the first preset time;
and polling the i +1 th addresses from the plurality of slave machines according to the interval time until all addresses in the address set are polled.
2. The address assignment method of claim 1, wherein the generating the interval time according to the first preset time comprises:
recording the number of times that the ith address is not received after being electrified again;
and generating the time interval according to the reply times and the first preset time.
3. The address assignment method of claim 2, wherein the time interval is generated according to the following formula:
tgap is the time interval, T11 is the first preset time, N11 is the number of replies, and T13 is the second preset time.
4. The address allocation method of claim 1, further comprising:
after receiving the polling instruction of the ith address, the slave machine judges whether the slave machine occupies the address or not;
if the slave has preempted an address, then reply to the master after a third preset time.
5. The address allocation method of claim 4, further comprising:
if the slave does not preempt the address, the slave performs address preemption after a fourth preset time.
6. The address allocation method of claim 5, wherein the slave performing address preemption after a fourth preset time, comprising:
the slave generates at least one random time;
and sending an address preemption request to the host when the random time is reached, and if the host does not receive the address preemption requests of other slave machines before the random time, allocating the ith address to the slave machines.
7. An address allocation system, comprising:
a plurality of slaves;
the host is used for acquiring the ith address from the address set, polling the multiple slaves for whether the ith address replies or not, adjusting the interval time to be first preset time when the slaves reply the ith address, generating the interval time according to the first preset time when the slaves do not reply the ith address, polling the multiple slaves for whether the ith +1 address replies or not according to the interval time until all addresses in the address set are polled, wherein i is a positive integer.
8. The address allocation system of claim 7, wherein the host is to:
recording the number of times that the ith address is not received after being electrified again;
and generating the time interval according to the reply times and the first preset time.
9. The address allocation system of claim 8, wherein said host generates said time interval according to the formula:
tgap is the time interval, T11 is the first preset time, N11 is the number of replies, and T13 is the second preset time.
10. The address allocation system of claim 7, wherein the slave is configured to determine whether the slave has preempted an address after receiving the polling command for the ith address, and when determining that the address has been preempted, reply to the master after a third preset time.
11. The address allocation system of claim 10, wherein the slave is further configured to preempt an address after a fourth predetermined time when it is determined that the address is not preempted.
12. The address allocation system of claim 11, wherein the slave is to:
generating at least one random time;
and sending an address preemption request to the master when the random time arrives, wherein if the master does not receive the address preemption requests of other slaves before the random time, the ith address is distributed to the slaves.
13. An electronic device comprising a memory, a processor;
wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for implementing the address allocation method according to any one of claims 1 to 6.
14. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the address allocation method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910987078.XA CN110769078B (en) | 2019-10-17 | 2019-10-17 | Address allocation method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910987078.XA CN110769078B (en) | 2019-10-17 | 2019-10-17 | Address allocation method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110769078A true CN110769078A (en) | 2020-02-07 |
CN110769078B CN110769078B (en) | 2023-04-28 |
Family
ID=69332564
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910987078.XA Active CN110769078B (en) | 2019-10-17 | 2019-10-17 | Address allocation method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110769078B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112235435A (en) * | 2020-10-21 | 2021-01-15 | 递易(上海)智能科技有限公司 | Method and equipment for fast coding |
CN112583680A (en) * | 2020-11-11 | 2021-03-30 | 平高集团储能科技有限公司 | Battery management system and slave machine address automatic calibration method thereof |
CN112765075A (en) * | 2020-12-31 | 2021-05-07 | 超级智慧家(上海)物联网科技有限公司 | One-to-many communication method and system based on serial port |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004084496A1 (en) * | 2003-03-21 | 2004-09-30 | Huawei Technologies Co., Ltd. | A method for implementing gateway dynamic load distribution |
CN101404604A (en) * | 2008-11-03 | 2009-04-08 | 浪潮电子信息产业股份有限公司 | 485 bus type monitoring system and its high extendibility method |
CN102638590A (en) * | 2012-04-26 | 2012-08-15 | 青岛海尔空调电子有限公司 | Method for configuring communication addresses of indoor units, air-conditioning system and air-conditioning indoor unit |
CN105546730A (en) * | 2015-12-23 | 2016-05-04 | 宁波奥克斯电气股份有限公司 | Automatic addressing method of multi-connected air conditioner indoor unit |
CN108521474A (en) * | 2018-03-30 | 2018-09-11 | 青岛海尔空调电子有限公司 | The address challenges method of multiple control system |
CN108833602A (en) * | 2018-05-24 | 2018-11-16 | 湖北文理学院 | A kind of bus address auto-allocation method and system based on component manufacturing variation |
-
2019
- 2019-10-17 CN CN201910987078.XA patent/CN110769078B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004084496A1 (en) * | 2003-03-21 | 2004-09-30 | Huawei Technologies Co., Ltd. | A method for implementing gateway dynamic load distribution |
CN101404604A (en) * | 2008-11-03 | 2009-04-08 | 浪潮电子信息产业股份有限公司 | 485 bus type monitoring system and its high extendibility method |
CN102638590A (en) * | 2012-04-26 | 2012-08-15 | 青岛海尔空调电子有限公司 | Method for configuring communication addresses of indoor units, air-conditioning system and air-conditioning indoor unit |
CN105546730A (en) * | 2015-12-23 | 2016-05-04 | 宁波奥克斯电气股份有限公司 | Automatic addressing method of multi-connected air conditioner indoor unit |
CN108521474A (en) * | 2018-03-30 | 2018-09-11 | 青岛海尔空调电子有限公司 | The address challenges method of multiple control system |
CN108833602A (en) * | 2018-05-24 | 2018-11-16 | 湖北文理学院 | A kind of bus address auto-allocation method and system based on component manufacturing variation |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112235435A (en) * | 2020-10-21 | 2021-01-15 | 递易(上海)智能科技有限公司 | Method and equipment for fast coding |
CN112583680A (en) * | 2020-11-11 | 2021-03-30 | 平高集团储能科技有限公司 | Battery management system and slave machine address automatic calibration method thereof |
CN112583680B (en) * | 2020-11-11 | 2023-08-25 | 平高集团储能科技有限公司 | Battery management system and slave address automatic calibration method thereof |
CN112765075A (en) * | 2020-12-31 | 2021-05-07 | 超级智慧家(上海)物联网科技有限公司 | One-to-many communication method and system based on serial port |
Also Published As
Publication number | Publication date |
---|---|
CN110769078B (en) | 2023-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110769078A (en) | Address allocation method and system | |
TWI446683B (en) | Distributed battery management system and method for distributing identifications thereof | |
EP3037967A1 (en) | Fault-tolerant startup method and apparatus and computer system | |
CN106909081B (en) | Household electrical appliance and expansion platform based on same | |
CN110457342B (en) | Transaction processing method and device | |
EP3745678A1 (en) | Storage system, and method and apparatus for allocating storage resources | |
US20220277914A1 (en) | Circuit Breaker Identification Method and Apparatus, and Device | |
WO2019233203A1 (en) | Domain name parsing method based on multiple available zones, and device | |
CN107172039B (en) | Method, device and system for acquiring protocol key value | |
CN110933192A (en) | Local area network IP address allocation method, device, system and computer equipment | |
CN111741143B (en) | Method and device for on-line distribution of Modbus addresses of electrical measuring instrument | |
CN111698342A (en) | Temperature controller communication address allocation method and system | |
CN116389505A (en) | Networking method based on CAN bus and computer equipment | |
CN111901243B (en) | Service request routing method, scheduler and service platform | |
CN112597474A (en) | Identity determination method, control method and system, storage medium and terminal equipment | |
CN111614701B (en) | Distributed cluster and container state switching method and device | |
CN114116848A (en) | Data identifier generation method and device, computer equipment and storage medium | |
EP4329376A1 (en) | Network access method, network node, electronic device and storage medium | |
JP6856063B2 (en) | Terminal devices, control devices, servers, evaluation methods and programs | |
CN117544596B (en) | Automatic address allocation method for telemetry system, telemetry system and storage medium | |
CN111865631A (en) | Fault information reporting method and device, electronic equipment and readable storage medium | |
CN118101622B (en) | Node address allocation method and device based on CAN communication | |
CN114816724B (en) | Task scheduling method, information processing method, device, equipment and storage medium | |
CN113645478B (en) | Live broadcast push address allocation method and system | |
CN113766039B (en) | Base plate management controller address management method and server system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |