CN113242170A - Address allocation method and device - Google Patents

Address allocation method and device Download PDF

Info

Publication number
CN113242170A
CN113242170A CN202110558105.9A CN202110558105A CN113242170A CN 113242170 A CN113242170 A CN 113242170A CN 202110558105 A CN202110558105 A CN 202110558105A CN 113242170 A CN113242170 A CN 113242170A
Authority
CN
China
Prior art keywords
address
slave node
node
master node
identifier
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
Application number
CN202110558105.9A
Other languages
Chinese (zh)
Other versions
CN113242170B (en
Inventor
汪宏生
唐梅宣
沈剑
黄嘉曦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Immotor Technology Co ltd
Original Assignee
Shenzhen Immotor Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Immotor Technology Co ltd filed Critical Shenzhen Immotor Technology Co ltd
Priority to CN202110558105.9A priority Critical patent/CN113242170B/en
Publication of CN113242170A publication Critical patent/CN113242170A/en
Application granted granted Critical
Publication of CN113242170B publication Critical patent/CN113242170B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/627Controller area network [CAN] identifiers

Abstract

The application relates to the field of communication, and provides an address allocation method, which comprises the following steps: a first slave node sending a first address request message to a master node, the first address request message including an identifier of the first slave node; when an allocable address exists, the main node determines a first address from the allocable address according to the identifier of the first slave node, wherein the first address is an address which is uniquely corresponding to the identifier of the first slave node within a preset time length; the master node broadcasts and sends the first address and the identifier of the first slave node, so that the situation that address resources are wasted due to the fact that the master node allocates a plurality of addresses for the same slave node can be avoided.

Description

Address allocation method and device
Technical Field
The present application relates to the field of communications, and in particular, to a method and an apparatus for address allocation.
Background
A Controller Area Network (CAN) is a field bus and is widely used in the fields of industrial automation, ships, medical equipment, industrial equipment, and the like. The CAN realizes real-time and reliable data communication among all nodes in the distributed control system. The CAN comprises a plurality of nodes, and the nodes are connected through a CAN bus, and each node CAN monitor communication on the CAN bus. Each node connected to the CAN bus must have its own address.
In the prior art, a slave node controller generates a group of random numbers through a random number generator, and the group of random numbers form a temporary address of the slave node; the slave node sends an address assignment request to the master node through the temporary address. Because the temporary address of the slave node is not fixed, it is easy to happen that the same slave node sends address allocation requests to the master node at different time by using different temporary addresses, at this time, the master node may misunderstand that the same slave node requesting address allocation twice is sent by different slave nodes, and allocates two different addresses to the same slave node, thereby causing waste of master node address resources.
Therefore, how to avoid the situation that the master node allocates a plurality of addresses to the same slave node to cause waste of address resources is a problem which needs to be solved urgently at present.
Disclosure of Invention
The application provides an address allocation method which can avoid the situation of address resource waste caused by the fact that a main node allocates a plurality of addresses for the same slave node.
In a first aspect, a method for address allocation is provided, including:
a first slave node sending a first address request message to a master node, the first address request message including an identifier of the first slave node;
when an allocable address exists, the main node determines a first address from the allocable address according to the identifier of the first slave node, wherein the first address is an address which is uniquely corresponding to the identifier of the first slave node within a preset time length;
the master node broadcasts and transmits the first address and the identifier of the first slave node.
The application provides an address allocation method, wherein a first slave node sends a first address request message to a master node through an identifier of the first slave node, and the master node allocates an available first address to the first slave node according to the first address request message, so that the first slave node uses the first address to communicate with the master node within a preset time length. If the first slave node is suddenly disconnected and then the address request message containing the identifier of the first slave node is retransmitted within the preset time length, the master node determines the address previously allocated to the first slave node according to the identifier of the first slave node and does not allocate a new address to the first slave node from the new address resource pool, so that the situation that the master node allocates a plurality of addresses to the same slave node within the preset time length to cause waste of address resources is avoided.
Optionally, the determining, by the master node, a first address from the assignable addresses according to the identifier of the first slave node, includes: the master node searches an address allocation record table according to the identifier of the first slave node; when the address allocation record table comprises the identification of the first slave node, the master node determines the first address from the address allocation record table; when the address allocation record table does not include the identification of the first slave node, the master node determines the first address from a new address resource pool.
When the master node allocates an address to the first slave node, the master node searches an address allocation record table to determine whether the first slave node has been allocated with a first address previously, and if the master node has allocated the first address to the first slave node, the master node reallocates the previously allocated first address to the first slave node; if the master node does not allocate the first address to the first slave node, the master node allocates a new address (namely the first address) from the new address resource pool to the first slave node, so that the situation that the master node allocates a plurality of addresses to the same slave node to cause waste of master node address resources is avoided.
Optionally, when there is no allocatable address, the master node broadcasts and transmits address allocation failure indication information and an identifier of the first slave node.
When the first slave node sends the first address request message to the master node, and when the master node does not have an allocable address, the master node sends address allocation failure indication information to the first slave node, so that the situation that the first slave node sends the first address request message for an unlimited number of times to cause waste of communication resources is avoided.
Optionally, a second slave node sends a second address request message to the master node, the second address request message including an identifier of the second slave node; the master node determines a first address from the allocable addresses according to the identifier of the first slave node, wherein the time length for the first slave node to interrupt communication with the master node is greater than or equal to the preset time length; the master node broadcasts and transmits the first address and the identifier of the second slave node.
When the time length of the communication interruption between the first slave node and the master node is longer than or equal to the preset time length, the master node recovers the first address allocated to the first slave node, and at the moment, if the second slave node sends a second address request message to the master node, the master node can allocate the first address to the second slave node, so that the situation that the first slave node still occupies the first address due to the fact that the first slave node does not communicate with the master node for a long time and the address resource of the master node is wasted is avoided.
In a second aspect, an apparatus for address assignment is provided, which includes means for performing any one of the methods of the first aspect.
In a third aspect, a system for address allocation is provided, which includes any one of the apparatuses provided in the second aspect.
In a fourth aspect, a computer readable medium is provided, the computer readable medium having stored thereon program code comprising instructions for performing any of the methods of the first aspect.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic diagram of the distribution of master nodes and slave nodes on a CAN bus according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for address allocation according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating a process of applying for an address from a slave node to a master node according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a master node responding to a slave node according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating an apparatus for address assignment according to an embodiment of the present application;
fig. 6 is a schematic diagram of an apparatus for address allocation according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The present application will now be described in further detail with reference to the accompanying drawings and specific examples.
A Controller Area Network (CAN) is a field bus and is widely used in the fields of industrial automation, ships, medical equipment, industrial equipment, and the like. The CAN realizes real-time and reliable data communication among all nodes in the distributed control system. A plurality of nodes are connected to the CAN bus, as shown in fig. 1, and each node must have a unique address to ensure proper communication between the nodes. In general, a slave node transmits an address assignment request to a master node through a CAN bus to obtain its own unique communication address, but sometimes the master node assigns a plurality of addresses to the same slave node, which results in waste of address resources. Therefore, how to avoid the situation that the master node allocates a plurality of addresses to the same slave node to cause waste of address resources is a problem which needs to be solved urgently at present.
Fig. 2 is a method for address allocation provided in the present application, where the method includes:
s201, a first slave node sends a first address request message to a master node, where the first address request message includes an identifier of the first slave node.
For example, if a slave node wants to access the CAN bus and perform data communication with a master node using the CAN bus, a first slave node needs to send a first address request message to the master node through the CAN bus. Only if the master node assigns a first address to a first slave node CAN the slave node communicate data with the master node via the CAN bus using the first address. For example, the first slave node may send a first address request message to the master node through the CAN bus in a broadcast manner by using a first fixed address, where the first fixed address may be a preset and changeable address, such as 0XFF, and when the master node assigns the first address to the first slave node, the first slave node changes the first fixed address into the first address; the first address request message includes an identifier of the first slave node, a first fixed address, and an address request command, where the identifier of the first slave node may be an ID number of a Micro Control Unit (MCU) of a device (i.e., a slave node), a device factory number, and the like, and the specific content of the identifier of the first slave node is not limited in any way, and the identifier may be any data capable of representing uniqueness of the device; the address request command is a command for the first slave node to acquire a first address to the master node.
Optionally, when the first slave node sends the first address request message to the master node in a broadcast manner through the CAN bus, other slave nodes connected to the CAN bus may also receive the first address request message, and since the other slave nodes do not process the address assignment work, the slave nodes may ignore the first address request message.
S202, when the allocable address exists, the main node determines a first address from the allocable address according to the identifier of the first slave node, wherein the first address is an address uniquely corresponding to the identifier of the first slave node within a preset time length.
S203, the main node broadcasts and sends the first address and the identifier of the first slave node.
Illustratively, when a first slave node sends a first address request message to a master node through a CAN bus in a broadcast manner by using a first fixed address, if an allocable address exists in the master node, the master node searches an address allocation record table according to an identifier of the first slave node, wherein the address allocation record table is used by the master node for recording the currently used address and an identifier of a slave node corresponding to the address, and the address allocation record table is an empty table before the master node allocates no address to any slave node. When the master node receives an address request message sent by a first slave node, the master node first looks up an address allocation record table based on the identifier of the first slave node to determine whether the first slave node first sent the address request or whether the first slave node had previously allocated a first address to it by the master node. When the master node searches the address allocation record table and comprises the identification of the first slave node, the master node determines that the address is previously allocated to the first slave node, and at the moment, the master node finds out the first address previously allocated to the first node from the address allocation record table and gives the first address to the first slave node again; when the master node searches the address allocation record table and does not comprise the identification of the first slave node, the master node determines that the address is not allocated to the first slave node previously, and at the moment, the master node calls the first address from the new address resource pool to the first slave node.
Optionally, when the master node finishes allocating the first address to the first slave node, the master node may send a message of successful address allocation to the first slave node through the CAN bus in a broadcast manner, where the message of successful address allocation includes the first slave node identifier, the successful address allocation indication information, and the first address; all slave nodes on the CAN bus receive the message, and each slave node distinguishes whether the message with successful address allocation is sent to the slave node according to the node identifier in the message with successful address allocation, so that whether the message with successful address allocation needs to be processed is determined; only when the first slave node receives the message that the address allocation sent by the master node to the first slave node is successful, the first slave node modifies the previously set first fixed address into the first address, and then performs data communication with the master node through the first address.
Alternatively, when the time (for example, the time for disconnecting the first slave node from the CAN bus (that is, the time for dropping) is less than the preset time (for example, the preset time is 1 hour) and the first slave node sends the first address request message to the master node again, the master node searches the address allocation record table according to the first address request message (for example, the identifier of the first slave node), and if the address allocation record table already has the identifier of the first slave node and the allocation record of the first address, the master node re-assigns the first address to the first slave node, that is, as long as the time for disconnecting the first slave node from the CAN bus is within the preset time, the first address assigned by the master node to the first slave node is always valid, even if the first slave node re-applies for access for multiple times within the preset time (that is, the first slave node re-applies for address assignment for multiple times to the master node), the master node does not allocate other new addresses except the first address to the first slave node again, so that the situation that address resources are wasted due to the fact that the master node allocates a plurality of addresses to the same slave node within a preset time length is avoided.
Optionally, when the first slave node is disconnected from the CAN bus due to an abnormality, if a time period (for example, a time period for disconnection is 2 hours) during which the first slave node and the master node interrupt communication is greater than or equal to a preset time period (for example, the preset time period is 1 hour), since the master node detects that the first slave node does not communicate for a long time, the master node may withdraw the first address previously allocated to the first slave node; when the first slave node sends the first address request message to the master node again, the master node searches the address allocation record table and does not include the identifier of the first slave node, and at this time, the master node calls the first address from the new address resource pool to the first slave node.
Optionally, when the first slave node is to end communication with the master node and is to be disconnected from the CAN bus, the first slave node may actively send a first address deletion request message to the master node, where the first address deletion request message includes a first address, and an identifier of the first slave node corresponds to a command for address deletion; when the master node receives the first address deletion request message, the master node searches an address allocation record table according to the identifier of the first slave node, finds the address allocation record of the first slave node, and deletes the address allocation record of the first slave node, namely unbinding the identifier of the first slave node and the first address to recover the first address, thereby avoiding the situation that the first slave node still occupies the first address due to long-time non-communication with the master node and the waste of master node address resources; the address allocation record includes an identifier of the first slave node, the first address, and indication information that the address allocation is successful.
Optionally, when the second slave node sends a second address request message to the master node, the second address request message includes an identifier of the second slave node; the master node determines a first address from the allocable addresses according to the identifier of the first slave node, wherein the time length for the first slave node to interrupt communication with the master node is greater than or equal to a preset time length; the master node broadcasts and transmits the first address and the identifier of the second slave node. For example, when the first slave node is about to end communication with the master node and disconnect from the CAN bus, and the duration of the communication interruption between the first slave node and the master node is greater than or equal to the preset duration, the master node will withdraw the first address previously allocated to the first slave node, and at this time, the first address is in an allocable state. When the second slave node transmits the second address request message to the master node through the CAN bus in a broadcast manner using the second fixed address, the master node may assign the first address to the second slave node and transmit a message that the address assignment of the second slave node is successful to the second slave node through the CAN bus in a broadcast manner, the message that the address assignment of the second slave node is successful including the second slave node identifier, the address assignment success indication information, and the first address. When the second slave node receives the message that the address allocation of the second slave node sent by the master node to the second slave node is successful, the second slave node modifies the previously set second fixed address into the first address, and then performs data communication with the master node through the first address. Of course, the master node may also assign other available addresses to the second slave node than the first address. The first fixed address (of the first slave node) and the second fixed address (of the second slave node) may be the same address or different addresses, and the present application does not limit this.
Optionally, when the first slave node sends the first address request message to the master node, if the master node does not have an allocable address, the master node sends address allocation failure indication information and an identifier of the first slave node through the CAN bus in a broadcast manner to notify that the first slave node does not have an available address currently, so as to avoid a situation that the first slave node sends the first address request message indefinitely to cause waste of communication resources. When the master node sends the address assignment failure message to the first slave node, the master node may pack the address assignment failure indication information and the identifier of the first slave node into a data frame, or may implement other data communication forms.
Optionally, when multiple slave nodes send address request messages to the master node at the same time, the master node allocates available addresses to each slave node in sequence according to the sequence of sending address request messages by each slave node. The specific manner in which the master node allocates the available addresses to the plurality of slave nodes is similar to the manner in which the master node allocates the addresses to the first slave node, and is not described herein again.
For ease of understanding, the overall flow steps of a method for address assignment provided herein are illustrated in conjunction with fig. 3 and 4. First, a flow of a slave node applying for a master node to allocate an address in the present application is introduced, and fig. 3 shows a flow of a slave node applying for an address to a master node, which includes the following specific flows:
step 1: the slave node requests to access the CAN bus and performs data communication with the master node. The slave node transmits a Request packet (i.e., a Request packet) including a fixed ID of the slave node (i.e., an identifier of the slave node) and an address acquisition command to the master node through the CAN bus in a broadcast manner using a fixed address (e.g., 0 xFF).
Step 2: after the slave node sends a request packet to the master node, waiting for the response of the master node, and if the master node sends an Acknowledgement (ACK) message to the slave node, indicating that the master node allocates an available address for the slave node; if the master node sends a Negative Acknowledgement (NACK) message to the slave node, it indicates that the master node fails to allocate an available address to the slave node. For example, if the time for the slave node to wait for the master node ACK message exceeds a time threshold (for example, the time threshold is 5s), the slave node retransmits the request packet to the master node; if the time for the slave node to wait for the master node ACK message does not exceed the time threshold, the slave node already receives the ACK message sent by the master node (i.e., the message of successful address assignment). If the slave node receives the message of successful address allocation sent by the master node, the slave node modifies the fixed address into a new address allocated to the slave node by the master node and performs data communication with the master node by the new address; if the slave node receives a NACK message (i.e., a message indicating that address assignment fails) sent by the master node, it indicates that the master node does not have an available address, at this time, the slave node needs to wait for a certain time interval, and then resends the request packet until the master node assigns an available address for itself, and the time interval for which the slave node waits may be set by a user according to a specific application scenario, and the specific content of the time interval is not limited in any way by the present application.
After the slave node sends the address request message to the master node, the master node allocates an available address for the slave node according to the address request message of the slave node. Fig. 4 shows the flow steps of the master node responding to the slave node, and the specific flow steps are as follows:
step 1: the master node monitors whether a Request packet exists on the CAN bus.
Step 2: if the master node detects that a slave node sends a Request packet to the master node through the CAN bus, the master node receives the Request packet sent by the slave node and inquires an address list (namely an address distribution record table) according to the fixed ID (namely the identifier of the slave node) of the slave node. If the master node has an available address, sending an ACK message (namely a message of successful address allocation) to the slave node; and after receiving the ACK message, the slave node modifies the previous fixed address into a new address and performs data communication with the master node by using the new address. If the main node does not have an available address, a NACK message (namely a message of failed address allocation) is sent to the slave node; after receiving the NACK message, the slave node waits for a certain time interval, and then retransmits the request packet until the master node assigns itself to an available communication address.
An example of a method of address assignment provided herein is described above in detail. It is understood that the corresponding apparatus contains hardware structures and/or software modules corresponding to the respective functions for implementing the functions described above. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The present application may perform the division of the functional units for the address assignment device according to the above method examples, for example, each function may be divided into each functional unit, or two or more functions may be integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the units in the present application is schematic, and is only one division of logic functions, and there may be another division manner in actual implementation.
Fig. 5 is a schematic structural diagram of an address assignment device provided in the present application. The apparatus 500 includes a slave node module 501 and a master node module 502.
The slave node module 501 is configured to: a first slave node sends a first address request message to a master node, the first address request message including an identifier of the first slave node.
The master node module 502 is configured to: when an allocable address exists, the main node determines a first address from the allocable address according to the identifier of the first slave node, wherein the first address is an address which is uniquely corresponding to the identifier of the first slave node within a preset time length; and further configured to broadcast, by the master node, the first address and the identifier of the first slave node.
The specific manner in which the apparatus 500 performs the method for address allocation and the resulting beneficial effects can be seen in the related description of the method embodiments.
Fig. 6 shows a schematic device structure diagram of a method for address allocation provided in the present application. The dashed lines in fig. 6 indicate that the unit or the module is optional. The apparatus 600 may be used to implement the methods described in the method embodiments above. The device 600 may be a terminal device or a server or a chip.
The apparatus 600 includes one or more processors 601, and the one or more processors 601 may support the apparatus 600 to implement the method in the method embodiment corresponding to fig. 2. The processor 601 may be a general purpose processor or a special purpose processor. For example, the processor 601 may be a Central Processing Unit (CPU). The CPU may be used to control the apparatus 600, execute software programs, and process data of the software programs. The device 600 may also include a communication unit 605 to enable input (reception) and output (transmission) of signals.
For example, the device 600 may be a chip and the communication unit 605 may be an input and/or output circuit of the chip, or the communication unit 605 may be a communication interface of the chip, which may be an integral part of the terminal device.
Also for example, the device 600 may be a terminal device and the communication unit 605 may be a transceiver of the terminal device, or the communication unit 605 may be a transceiver circuit of the terminal device.
The device 600 may comprise one or more memories 602, on which programs 604 are stored, which programs 604 are executable by the processor 601 to generate instructions 603, so that the processor 601 performs the methods described in the above method embodiments according to the instructions 603. Optionally, the memory 602 may further store data (such as an ID of the chip to be tested). Alternatively, the processor 601 may also read data stored in the memory 602, the data may be stored at the same memory address as the program 604, and the data may be stored at a different memory address from the program 604.
The processor 601 and the memory 602 may be provided separately or integrated together, for example, on a System On Chip (SOC) of the terminal device.
The specific manner in which the processor 601 executes the method for address allocation may be referred to in the description of the method embodiment.
It should be understood that the steps of the above-described method embodiments may be performed by logic circuits in the form of hardware or instructions in the form of software in the processor 601. The processor 601 may be a CPU, a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or other programmable logic device, such as discrete gates, transistor logic, or discrete hardware components.
The application also provides a computer program product which, when executed by the processor 1001, implements the method according to any of the method embodiments of the application.
The computer program product may be stored in the memory 602, for example, as a program 604, and the program 604 is finally converted into an executable object file capable of being executed by the processor 601 through preprocessing, compiling, assembling, linking and the like.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a computer, implements the method of any of the method embodiments of the present application. The computer program may be a high-level language program or an executable object program.
Such as memory 602. The memory 602 may be either volatile memory or nonvolatile memory, or the memory 602 may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), double data rate SDRAM, enhanced SDRAM, SLDRAM, Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes and the generated technical effects of the above-described apparatuses and devices may refer to the corresponding processes and technical effects in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the disclosed system, apparatus and method may be implemented in other ways. For example, some features of the method embodiments described above may be omitted, or not performed. The above-described embodiments of the apparatus are merely exemplary, the division of the unit is only one logical function division, and there may be other division ways in actual implementation, and a plurality of units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the coupling includes electrical, mechanical or other connections.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: it is to be understood that modifications may be made to the above-described embodiments, or equivalents may be substituted for some of the features of the embodiments, and such modifications or substitutions are not to be construed as essential to the spirit and scope of the embodiments of the present invention.

Claims (10)

1. A method of address allocation, the method comprising:
a first slave node sending a first address request message to a master node, the first address request message including an identifier of the first slave node;
when an allocable address exists, the main node determines a first address from the allocable address according to the identifier of the first slave node, wherein the first address is an address which is uniquely corresponding to the identifier of the first slave node within a preset time length;
the master node broadcasts and transmits the first address and the identifier of the first slave node.
2. The method of claim 1, wherein determining, by the master node, a first address from the assignable addresses based on the identifier of the first slave node comprises:
the master node searches an address allocation record table according to the identifier of the first slave node;
when the address allocation record table comprises the identification of the first slave node, the master node determines the first address from the address allocation record table;
when the address allocation record table does not include the identification of the first slave node, the master node determines the first address from a new address resource pool.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
when the assignable address does not exist, the master node broadcasts and transmits address assignment failure indication information and an identifier of the first slave node.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
a second slave node sending a second address request message to the master node, the second address request message including an identifier of the second slave node;
the master node determines a first address from the allocable addresses according to the identifier of the first slave node, wherein the time length for the first slave node to interrupt communication with the master node is greater than or equal to the preset time length;
the master node broadcasts and transmits the first address and the identifier of the second slave node.
5. An address allocation device is characterized by comprising a slave node module and a master node module,
the slave node module is used for a first slave node to send a first address request message to a master node, wherein the first address request message comprises an identifier of the first slave node;
the master node module is used for determining a first address from the allocable addresses according to the identifier of the first slave node when the allocable addresses exist, wherein the first address is an address uniquely corresponding to the identifier of the first slave node within a preset time length; and further configured to broadcast, by the master node, the first address and the identifier of the first slave node.
6. The apparatus of claim 5, wherein the master node determining a first address from the allocable addresses based on the identifier of the first slave node comprises:
the master node searches an address allocation record table according to the identifier of the first slave node;
when the address allocation record table comprises the identification of the first slave node, the master node determines the first address from the address allocation record table;
when the address allocation record table does not include the identification of the first slave node, the master node determines the first address from a new address resource pool.
7. The apparatus of claim 5 or 6, further comprising:
the master node module is further configured to broadcast and send address assignment failure indication information and an identifier of the first slave node when an assignable address does not exist.
8. The apparatus of claim 5 or 6, further comprising:
the slave node module is further configured to send a second address request message to the master node by a second slave node, where the second address request message includes an identifier of the second slave node;
the master node module is further configured to determine a first address from the assignable addresses by the master node according to the identifier of the first slave node, where a duration of time for which the first slave node interrupts communication with the master node is greater than or equal to the preset duration; the master node broadcasts and transmits the first address and the identifier of the second slave node.
9. A system for address assignment, comprising: a device as claimed in any one of claims 5 to 8.
10. A computer-readable storage medium, in which a computer program is stored which, when executed by a processor, causes the processor to carry out the method of any one of claims 1 to 4.
CN202110558105.9A 2021-05-21 2021-05-21 Address allocation method and device Active CN113242170B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110558105.9A CN113242170B (en) 2021-05-21 2021-05-21 Address allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110558105.9A CN113242170B (en) 2021-05-21 2021-05-21 Address allocation method and device

Publications (2)

Publication Number Publication Date
CN113242170A true CN113242170A (en) 2021-08-10
CN113242170B CN113242170B (en) 2023-03-21

Family

ID=77138029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110558105.9A Active CN113242170B (en) 2021-05-21 2021-05-21 Address allocation method and device

Country Status (1)

Country Link
CN (1) CN113242170B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301731A (en) * 2021-12-31 2022-04-08 德力西电气有限公司 Address management method, master device and slave device
CN115842806A (en) * 2023-02-23 2023-03-24 深圳市云天数字能源有限公司 Method and related device for bus to distribute node address

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080310344A1 (en) * 2007-06-15 2008-12-18 Telefonaktiebolaget Lm Ericsson (Publ) Tunnel overhead reduction
CN106060187A (en) * 2016-05-26 2016-10-26 杭州华三通信技术有限公司 Address allocation methods and devices
CN106254571A (en) * 2016-08-05 2016-12-21 杭州华三通信技术有限公司 A kind of client ip address distribution method and device
CN106603735A (en) * 2015-10-19 2017-04-26 华为技术有限公司 Method, device, and system of allocating communication addresses for intelligent instruments
CN106790761A (en) * 2017-01-05 2017-05-31 广州南盾通讯设备有限公司 Host node distribution, the method from node acquisition address, bus address auto-allocation method and device under ModBus buses
CN107786681A (en) * 2016-08-31 2018-03-09 中国电信股份有限公司 Methods, devices and systems for IP address scheduling of resource
CN108881505A (en) * 2018-05-30 2018-11-23 武汉高仕达电气有限公司 A kind of CAN bus node address distribution method and system
CN109936640A (en) * 2017-12-19 2019-06-25 苏州阿特斯阳光电力科技有限公司 From the address distribution method and device of node device
CN111241011A (en) * 2019-12-31 2020-06-05 清华大学 Global address space management method of distributed persistent memory

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080310344A1 (en) * 2007-06-15 2008-12-18 Telefonaktiebolaget Lm Ericsson (Publ) Tunnel overhead reduction
CN106603735A (en) * 2015-10-19 2017-04-26 华为技术有限公司 Method, device, and system of allocating communication addresses for intelligent instruments
CN106060187A (en) * 2016-05-26 2016-10-26 杭州华三通信技术有限公司 Address allocation methods and devices
CN106254571A (en) * 2016-08-05 2016-12-21 杭州华三通信技术有限公司 A kind of client ip address distribution method and device
CN107786681A (en) * 2016-08-31 2018-03-09 中国电信股份有限公司 Methods, devices and systems for IP address scheduling of resource
CN106790761A (en) * 2017-01-05 2017-05-31 广州南盾通讯设备有限公司 Host node distribution, the method from node acquisition address, bus address auto-allocation method and device under ModBus buses
CN109936640A (en) * 2017-12-19 2019-06-25 苏州阿特斯阳光电力科技有限公司 From the address distribution method and device of node device
CN108881505A (en) * 2018-05-30 2018-11-23 武汉高仕达电气有限公司 A kind of CAN bus node address distribution method and system
CN111241011A (en) * 2019-12-31 2020-06-05 清华大学 Global address space management method of distributed persistent memory

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301731A (en) * 2021-12-31 2022-04-08 德力西电气有限公司 Address management method, master device and slave device
CN114301731B (en) * 2021-12-31 2023-12-22 德力西电气有限公司 Address management method, master device and slave device
CN115842806A (en) * 2023-02-23 2023-03-24 深圳市云天数字能源有限公司 Method and related device for bus to distribute node address
CN115842806B (en) * 2023-02-23 2023-04-25 深圳市云天数字能源有限公司 Method for distributing node address by bus and related device

Also Published As

Publication number Publication date
CN113242170B (en) 2023-03-21

Similar Documents

Publication Publication Date Title
JP4054418B2 (en) Resource management method, apparatus, computer system, and distributed resource allocation and deallocation method for distributed garbage collection
CN113242170B (en) Address allocation method and device
US6314114B1 (en) Distributed resource management
JP6636142B2 (en) Scale-out association method and apparatus and system
EP2675113A1 (en) Method for configurating canopen network, method for operating slave device of canopen network and system for controlling plc device using canopen network
CN107682460B (en) Distributed storage cluster data communication method and system
WO2021103646A1 (en) Pod deployment method and device
CN115686875A (en) Method, apparatus and program product for transferring data between multiple processes
CN113886058A (en) Cross-cluster resource scheduling method and device
CN109818977B (en) Access server communication optimization method, access server and communication system
CN109218156B (en) Management method of dynamic connection data
CN109462663B (en) Method for limiting system resource occupation, voice interaction system and storage medium
CN117118951A (en) Method for dynamically distributing addresses of universal slaves of one master and multiple slaves bus
CN111294220B (en) Nginx-based network isolation configuration method and device
EP3723393A1 (en) Method, device and system for transmitting multicast group information
CN113992740B (en) Middleware based on autonomous control and data transmission method
CN113660353B (en) Method, device, equipment and medium for managing Provisioner address based on Bluetooth Mesh
CN112822299B (en) RDMA (remote direct memory Access) -based data transmission method and device and electronic equipment
CN109495462B (en) Dynamic connection data distribution system and data interaction method thereof
CN104580328A (en) Virtual machine migration method, device and system
CN115878309A (en) Resource allocation method, device, processing core, equipment and computer readable medium
WO2018188447A1 (en) Ip address configuration method and device
JP2022545142A (en) Sidelink transmission status feedback method and apparatus
CN111400054A (en) Network plug-in calling method and device, computer storage medium and electronic equipment
WO2021259108A1 (en) Resource allocation method and apparatus, server, and storage medium

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