WO2023206558A1 - 一种地址分配方法及装置 - Google Patents

一种地址分配方法及装置 Download PDF

Info

Publication number
WO2023206558A1
WO2023206558A1 PCT/CN2022/090762 CN2022090762W WO2023206558A1 WO 2023206558 A1 WO2023206558 A1 WO 2023206558A1 CN 2022090762 W CN2022090762 W CN 2022090762W WO 2023206558 A1 WO2023206558 A1 WO 2023206558A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
address
network address
message
type
Prior art date
Application number
PCT/CN2022/090762
Other languages
English (en)
French (fr)
Inventor
王雅莉
张旭东
王键
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2022/090762 priority Critical patent/WO2023206558A1/zh
Publication of WO2023206558A1 publication Critical patent/WO2023206558A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks

Definitions

  • the present application relates to the field of wireless communications, and in particular, to an address allocation method and device.
  • Wireless communication is widely used in smart cars, smart homes, smart terminals, smart manufacturing and other scenarios. Compared with wired communication, it can effectively reduce the length of wire harnesses, reduce the weight of wire harnesses, and reduce the number of connectors.
  • DHCP Dynamic Host Configuration Protocol
  • IP addresses Internet Protocol IP addresses
  • DHCP server the node used to allocate IP addresses
  • IP client The node with the address
  • the multiple DHCP servers also need to confirm whether they are the selected DHCP servers, and the selected DHCP server also needs to A confirmation message is sent to indicate that the DHCP client can use the network address.
  • the interactive process of address allocation is cumbersome and time-consuming, which reduces the efficiency of network address allocation.
  • This application discloses an address allocation method and device, which can realize the allocation of network addresses of specified address types and improve the allocation efficiency of network addresses.
  • this application provides an address allocation method, which method includes: receiving a first message sent by a first node, the first message including a first type identifier, the first type identifier indicating a first address type ;Sending a second message to the first node, the second message including a first network address allocated for the first node or for a service on the first node, the address type of the first network address is the first address type.
  • the first node may be, for example, a user terminal in the vehicle or a component (for example, a single board, a line card or a chip) within the user terminal.
  • the user terminal may be, for example, a mobile phone, a tablet computer, a handheld computer, Desktop computers, headphones, speakers, wearable devices, vehicle-mounted devices, virtual reality devices, augmented reality devices, etc.
  • the second node can be, for example, a telematics BOX (Telematics BOX, T-Box).
  • the first node may be, for example, a home device or a component in a home device.
  • the home device may be, for example, a TV, a sweeping robot, a printer, a projector, a user's mobile phone, a rice cooker, a stereo, a microphone, a wireless router, etc.
  • the second node can be, for example, a gateway, customer premises equipment (CPE), wireless router, user mobile phone, etc.
  • the first node may be, for example, a battery monitoring unit (battery monitoring unit, BMU), and the second node may be, for example, a battery control unit (battery control unit, BCU) or BMU.
  • the network address of the specified address type is provided for the first node or the service on the first node.
  • the interactive process of address allocation is simple and improves the efficiency of the network address. Efficiency of network address allocation.
  • the method is applied to a second node, and the first node and the second node belong to the first communication domain.
  • the method before receiving the first message sent by the first node, the method further includes: receiving an access request sent by the first node; and accessing the first node according to the access request.
  • the first address type is a communication domain address or an IP address.
  • the first address type is an address type to which the first network address expected to be allocated belongs.
  • the first address type is a communication domain address
  • the first network address is a network layer short address, the length of which can be 2 bytes (that is, 16 bits), and can be used for addressing in the corresponding communication system.
  • the communication domain address can be used for addressing within the StarLight communication system. It can be understood that the communication domain address is another address type that is different from the IP address.
  • the length of the first network address may also be 8 bits, 24 bits, or other number of bits, which is not specifically limited here.
  • the address type of the network address to be allocated can be known.
  • the method further includes: obtaining the first network address according to the first address type.
  • the first message also includes the identity of the first node, and obtaining the first network address according to the first address type includes:
  • the first network address is obtained according to a first mapping relationship, which represents the mapping relationship between the identity of the first node, the first network address and the first address type, where , the first mapping relationship belongs to a set of mapping relationships between the identity of the node assigned to the network address, the network address of the node, and the address type of the network address of the node.
  • the identity of the first node is used to identify the first node.
  • the identity of the first node may be Layer 2 Identification (L2ID).
  • the first network address is obtained based on the first mapping relationship, which indicates that the same type of network address has been assigned to the first node in history, and the network address is used as the first network address assigned to the first node. Not only This can avoid the waste of network addresses and avoid the occurrence of address conflicts.
  • the first message also includes the identity of the first node and the identity of the first service on the first node, and the first network address is obtained according to the first address type.
  • the first message also includes the identity of the first node and the identity of the first service on the first node, and the first network address is obtained according to the first address type.
  • a mapping relationship between types wherein the second mapping relationship belongs to a mapping between the identifier of the service assigned to the network address, the network address of the service, the address type of the network address of the service, and the identity of the node where the service is located.
  • the first network address is obtained based on the second mapping relationship, which indicates that the same type of network address has been allocated to the first service on the first node in history, and the network address is used as the third network address allocated to the first service.
  • One network address can not only avoid the waste of network addresses, but also avoid the occurrence of address conflicts.
  • obtaining the first network address according to the first address type includes: allocating the first network address according to the first address type.
  • the second node is a management node in the first communication domain.
  • the second node can directly allocate the first network address to the first node or the first service on the first node.
  • the traditional DHCP address allocation method after a node selects a network address from the network addresses provided by multiple DHCP servers, multiple DHCP servers also need to confirm whether they are the selected DHCP server, and the selected DHCP server A confirmation message must also be sent to indicate that the node can use the address, and the interaction process is cumbersome and time-consuming.
  • the second node directly allocates the first network address, omitting the signaling interaction process in the DHCP confirmation phase, thus shortening the interaction process of address allocation and improving address allocation efficiency.
  • the first message further includes an identification of a first service on the first node, and obtaining the first network address according to the first address type includes: according to the first address type and The identifier of the first service is used to obtain the first network address assigned to the first service.
  • the above implementation manner is implemented to allocate a first network address to the first service on the first node.
  • the method further includes: sending a third message to a Dynamic Host Configuration Protocol DHCP server, where the third message includes the first type identifier, and the third The message also includes one or more of the identity identifier of the first node and the identifier of the first service on the first node; receiving a fourth message sent by the DHCP server, the fourth message including the The first network address is allocated by the DHCP server based on the third message.
  • the second node may also send a third message to multiple DHCP servers, where the third message includes the first type identifier, and the third message further includes the identity identifier of the first node. , one or more of the identifiers of the first service on the first node; receiving a fourth message sent by multiple DHCP servers, and the fourth message corresponding to the DHCP server includes the DHCP server allocating information based on the third message. the first network address; and obtain the first network address according to the fourth message sent by the target DHCP server among the plurality of DHCP servers.
  • the work of the client performing address selection and receiving the confirmation message from the DHCP server is offloaded to the second node.
  • the protocol stack is lightweight and reduces the power consumption of the first node.
  • the target DHCP server may be the DHCP server corresponding to the maximum signal strength, the DHCP server corresponding to the fourth message received earliest by the second node, the DHCP server corresponding to the highest priority, or the second node It is determined based on multiple factors including the detected signal strength, the priority information of the DHCP server and the reception time corresponding to the third message, and is not specifically limited here.
  • the third message includes all information related to the allocation of the first network address in the first message.
  • the first message received by the second node includes the first type identifier and the identity identifier of the first node
  • the third message also includes the first type identifier and the identity identifier of the first node.
  • the first network The address is assigned by the DHCP server to the first node based on the third message.
  • the first message received by the second node includes the first type identifier, the identity identifier of the first node and the identifier of the first service
  • the third message also includes the first type identifier, the identity identifier of the first node and the identifier of the first service.
  • An identifier of a service in this case, the first network address is assigned by the DHCP server to the first service on the first node based on the third message.
  • the third message also includes the same other information related to address allocation.
  • other information related to address allocation also includes at least one of the following unicast address identification information, multicast address identification information, anycast address identification information or quantity identification information. For each information, please refer to the following corresponding information. The relevant description will not be repeated here.
  • the second node sends the third message to the DHCP server, and the second node can be regarded as a forwarding node.
  • the second node does not directly forward or transparently transmit the first message, but implements the first message by sending the third message. Transmission of information related to the allocation of the first network address.
  • the second node when the second node is a management node in the communication domain but the second node does not have the DHCP function, the second node can also request the DHCP server to be the first node or the third node on the first node through a third message.
  • One service allocates the first network address, enriching the application scenarios of address allocation.
  • the method further includes: sending a third message to a third node, where the third message includes the first type of identifier, and the third message further includes the identity identifier of the first node, the One or more of the identifiers of the first service on the first node, the third node is a management node in the first communication domain; receiving the fifth message sent by the third node, the third node The fifth message includes the first network address, and the first network address is allocated by the third node based on the third message.
  • the second node can also request the management node in the communication domain to allocate a first network address to the first node or the first service on the first node through a third message, which enriches the application scenarios of address allocation.
  • the first communication domain includes multiple management nodes
  • the method further includes: sending a third message to the multiple management nodes, the third message including the first type identifier, and the third message
  • the third message also includes one or more of the identity identifier of the first node and the identifier of the first service on the first node; upon receiving the sixth message sent by the multiple management nodes, the management node corresponding
  • the sixth message includes the network address allocated by the management node based on the third message; the first network address is obtained according to the sixth message sent by the target management node among the plurality of management nodes.
  • the target management node may be the management node corresponding to the highest priority, the management node corresponding to the maximum signal strength, the management node corresponding to the earliest received sixth message, or the second node based on It is determined by multiple factors including the priority information of the management node, the detected signal strength, and the reception time of the sixth message, and is not specifically limited here.
  • the second node can request the allocation of the first network address from multiple management nodes in the communication domain through the third message, and select the first network address provided by one management node, which enriches the application scenarios of address allocation.
  • the first address type is an IP address
  • the method further includes: obtaining a historically allocated second network address, where the second network address is used by the first node in the first communication domain.
  • the address type is a network address of a communication domain address; the first network address is obtained according to the IPv6 prefix of the first communication domain and the second network address.
  • the second network address of the communication domain address type historically allocated to the first node is used as the interface identifier of the first node, which is used to construct the local IPv6 address of the first node, which not only saves the consumption of the number of addresses , it can also be determined that the first network address assigned to node 1 is not repeated.
  • the first address type is an IP address
  • the method further includes: allocating a second network address to the first node, and the address type of the second network address is a communication domain address; according to the first The IPv6 prefix of a communication domain and the second network address are used to obtain the first network address.
  • the second node can directly allocate a local IPv6 address to the first node, which enriches the application scenarios of address allocation.
  • the first address type is an IP address
  • the method further includes: sending a third message to a fourth node, the third message including the first type identifier and the identity identifier of the first node.
  • the fourth node is a management node in the first communication domain; receiving a seventh message sent by the fourth node, where the seventh message includes the information allocated by the fourth node based on the third message.
  • a first network address the first network address includes the IPv6 prefix of the first communication domain and a second network address
  • the second network address is an address type used by the first node in the first communication domain Is the network address of the communication domain address.
  • the third message includes all information related to the allocation of the first network address in the first message.
  • the first message received by the second node also includes other information related to the allocation of the first network address, such as unicast address identification information. , multicast address identification information or quantity identification information.
  • the third message in addition to the first type identification and the identity identification of the first node, also includes the same other information as Information related to the allocation of the first network address.
  • the broadcast address identification information, multicast address identification information, and quantity identification information please refer to the description of the corresponding information below, and are not specifically limited here.
  • the second node can request the management node in the communication domain to allocate a local IPv6 address to the first node through the third message, which enriches the application scenarios of address allocation.
  • the first message also includes at least one of the following information:
  • Unicast address identification information used to indicate that the first network address is a unicast address
  • Multicast address identification information used to indicate that the first network address is a multicast address
  • Anycast address identification information used to indicate that the first network address is an anycast address is an anycast address
  • Quantity identification information used to indicate the application quantity of the first network address.
  • the unicast address identification information is optional information in the first message.
  • the unicast address identification information can be represented by flag bits, fields or bits. Taking the flag bit as an example, when the corresponding flag bit is set, it indicates that the first network address is a unicast address.
  • the second node can know that the first node requests a first service allocated to the first node or a first network address of the first node for unicast.
  • the multicast address identification information is optional information in the first message.
  • Multicast address identification information can be represented by flags, fields, or bits.
  • the second node can know that the first node requests a first service allocated to the first node or a first network address allocated to the first node for multicast.
  • the unicast address identification information and the multicast address identification information can be represented separately as described above, or can be represented by a flag bit. For example, when the flag bit takes a first value, it indicates that the first network address is used for unicast; When the flag takes the second value, it indicates that the first network address is used for multicast.
  • Anycast address identification information is optional information in the first message. Through the anycast address identification information, the second node can know that the first node requests the first network address allocated to the first service on the first node for anycast.
  • the first network address may be a unicast address or a multicast address; if the first network address is allocated to the first service on the first node, then the first network address The address can be a unicast address or a multicast address or an anycast address.
  • the above-mentioned unicast address identification information, multicast address identification information and anycast address identification information can be expressed separately, or can be expressed together by a field or flag bit, etc., which are not specifically limited here.
  • the quantity identification information is optional information in the first message.
  • the quantity identification information corresponds to the number of identifiers of the first service in the first message.
  • the number of applications for the first network address is the same as the number of identifiers of the first service.
  • the first service identifiers included in the first message are: AID1, AID2 and AID3, which means that the first message is used to apply for allocating a first network address to each of the three services AID1, AID2 and AID3. , that is, the number of identifiers of the first service in the first message is 3, then the number of applications for the first network address indicated by the quantity identifier information is also 3. It can be seen from this that when the number of identifiers of the first service in the first message is multiple, the first message also includes quantity identifier information. Through the quantity identification information, corresponding network addresses can be allocated to multiple services on the first node.
  • each first service identifier may also have corresponding unicast address identification information, multicast address identification information, or anycast address identification information.
  • the first network addresses corresponding to the identifiers of multiple first services are all used for unicast, multicast, or anycast, they can also be represented by a flag bit.
  • the method further includes: receiving an eighth message sent by the first node, the eighth message including a second type identifier, the second type identifier indicating a second address type, and the second address The type is different from the first address type; sending a ninth message to the first node, the ninth message including a third network address allocated for the first node or for a service on the first node, The address type of the third network address is the second address type.
  • this application provides an address allocation method, applied to a first node.
  • the method includes: sending a first message to a second node, where the first message includes a first type identifier, and the first type identifier Indicate the first address type; receive a second message sent by the second node, the second message including a first network address allocated for the first node or a service on the first node, the first The address type of the network address is the first address type; the first network address is obtained according to the second message.
  • the first node may be, for example, a user terminal in the vehicle or a component (for example, a single board, a line card or a chip) within the user terminal.
  • the user terminal may be, for example, a mobile phone, a tablet computer, a handheld computer, Desktop computers, headphones, speakers, wearable devices, vehicle-mounted devices, virtual reality devices, augmented reality devices, etc.
  • the second node can be, for example, a telematics BOX (Telematics BOX, T-Box).
  • the first node may be, for example, a home device or a component in a home device.
  • the home device may be, for example, a TV, a sweeping robot, a printer, a projector, a user's mobile phone, a rice cooker, a stereo, a microphone, a wireless router, etc.
  • the second node can be, for example, a gateway, customer premises equipment (CPE), wireless router, user mobile phone, etc.
  • the first node may be, for example, a battery monitoring unit (battery monitoring unit, BMU), and the second node may be, for example, a battery control unit (battery control unit, BCU) or BMU.
  • the first node and the second node belong to the first communication domain.
  • the method before sending the first message to the second node, the method further includes: receiving a broadcast message sent by the second node, where the broadcast message includes a service identifier, and the service identifier indicates that the second node The node provides an address allocation service; and sends an access request to the second node to request access to the second node.
  • the second node may be the node corresponding to the maximum signal strength, the node corresponding to the highest priority, the node corresponding to the broadcast message first received by the first node, or the first node based on the detected
  • the signal strength and the time at which the first node receives the broadcast message are determined from at least one of the above nodes, and are not specifically limited here.
  • the first node can discover nodes with address allocation function in time, and determine the only node it has access to, so as to obtain only the assigned network address of the specified address type from this node.
  • the first address type is a communication domain address or an IP address.
  • the first address type is an IP address
  • the first network address is an IPv6 address used locally by the first node
  • the first network address includes the IPv6 prefix of the first communication domain
  • the second network address is a network address whose address type used by the first node in the first communication domain is a communication domain address.
  • the first message further includes an identification of a first service on the first node, and the first network address is assigned to the first service.
  • the first message also includes at least one of the following information:
  • Unicast address identification information used to indicate that the first network address is a unicast address
  • Multicast address identification information used to indicate that the first network address is a multicast address
  • Anycast address identification information used to indicate that the first network address is an anycast address is an anycast address
  • Quantity identification information used to indicate the application quantity of the first network address.
  • the identity of the first node is used to identify the first node.
  • the identity of the first node may be Layer 2 Identification (L2ID).
  • L2ID Layer 2 Identification
  • the method further includes: sending a third message to the second node, the third message including a second type identifier, the second type identifier indicating a second address type, and the second address type being of a different type than the first address; receiving a fourth message sent by the second node, the fourth message including a third network address allocated for the first node or for a service on the first node, The address type of the third network address is the second address type; the third network address is obtained according to the fourth message.
  • the first node can change the address type of the network address, so that the first node can flexibly obtain network addresses of different address types.
  • this application provides an address allocation device, which includes: a receiving unit configured to receive a first message sent by a first node, where the first message includes a first type identifier, and the first type identifier indicating a first address type; a sending unit configured to send a second message to the first node, the second message including a first network address allocated for the first node or for a service on the first node , the address type of the first network address is the first address type.
  • the device and the first node belong to the first communication domain.
  • the receiving unit is further configured to receive an access request sent by the first node; the device further includes a processing unit configured to access the first node according to the access request.
  • the first address type is a communication domain address or an IP address.
  • processing unit is further configured to: obtain the first network address according to the first address type.
  • the first message also includes the identity of the first node
  • the processing unit is specifically configured to: obtain the first network address according to a first mapping relationship, where the first mapping relationship represents The mapping relationship between the identity of the first node, the first network address and the first address type, wherein the first mapping relationship includes the identity of the node assigned to the network address, the node's A collection of mapping relationships between network addresses and address types of the node's network address.
  • the first message also includes the identity of the first node and the identity of the first service on the first node
  • the processing unit is specifically configured to: obtain the information based on the second mapping relationship.
  • the first network address, the second mapping relationship represents the mapping relationship between the identity of the first node, the identity of the first service, the first network address and the first address type, wherein , the second mapping relationship belongs to a set of mapping relationships including the identifier of the service assigned to the network address, the network address of the service, the address type of the network address of the service, and the identity of the node where the service is located.
  • the processing unit is specifically configured to allocate the first network address according to the first address type.
  • the first message also includes an identifier of a first service on the first node, and the processing unit is specifically configured to: obtain according to the first address type and the identifier of the first service. The first network address assigned to the first service.
  • the first address type is an IP address
  • the sending unit is further configured to send a third message to a Dynamic Host Configuration Protocol DHCP server, where the third message includes the first type identifier, and the third message It also includes one or more of the identity identifier of the first node and the identifier of the first service on the first node; a receiving unit, also configured to receive the fourth message sent by the DHCP server, the The fourth message includes the first network address, and the first network address is allocated by the DHCP server based on the third message.
  • the sending unit is further configured to send a third message to a third node, where the third message includes the first type identifier, and the third message further includes the identity identifier of the first node, the third One or more of the identifiers of the first service on a node, the third node being a management node in the first communication domain; a receiving unit further configured to receive the fifth message sent by the third node , the fifth message includes the first network address, and the first network address is allocated by the third node based on the third message.
  • the first communication domain includes multiple management nodes
  • the sending unit is further configured to send a third message to the multiple management nodes, where the third message includes the first type identifier, and the third message
  • the third message also includes one or more of the identity identifier of the first node and the identifier of the first service on the first node
  • the receiving unit is also configured to receive the sixth message sent by the plurality of management nodes.
  • the sixth message corresponding to the management node includes the network address allocated by the management node based on the third message
  • the processing unit is also configured to: obtain, according to the sixth message sent by the target management node among the plurality of management nodes, The first network address.
  • the first address type is an IP address
  • the processing unit is further configured to: obtain a historically allocated second network address, where the second network address is used by the first node within the first communication domain.
  • the address type is a network address of a communication domain address; the first network address is obtained according to the IPv6 prefix of the first communication domain and the second network address.
  • the first address type is an IP address
  • the processing unit is further configured to: allocate a second network address to the first node, and the address type of the second network address is a communication domain address; according to the The IPv6 prefix of the first communication domain and the second network address are used to obtain the first network address.
  • the first address type is an IP address
  • the sending unit is further configured to send a third message to a fourth node, where the third message includes the first type identifier and the identity identifier of the first node.
  • the fourth node is a management node in the first communication domain;
  • the receiving unit is also configured to receive a seventh message sent by the fourth node, where the seventh message includes the fourth node based on the The first network address allocated by the three message, the first network address includes the IPv6 prefix of the first communication domain and the second network address, the second network address is the first node in the first
  • the type of address used within the communication domain is the network address of the communication domain address.
  • the first message also includes at least one of the following information:
  • Unicast address identification information used to indicate that the first network address is a unicast address
  • Multicast address identification information used to indicate that the first network address is a multicast address
  • Anycast address identification information used to indicate that the first network address is an anycast address is an anycast address
  • Quantity identification information used to indicate the application quantity of the first network address.
  • the receiving unit is also configured to receive an eighth message sent by the first node, where the eighth message includes a second type identifier, the second type identifier indicates a second address type, and the second address The type is different from the first address type; the sending unit is further configured to send a ninth message to the first node, where the ninth message includes allocation for the first node or for a service on the first node a third network address, and the address type of the third network address is the second address type.
  • this application provides an address acquisition device, which device includes: a sending unit configured to send a first message to a second node, where the first message includes a first type identifier, and the first type identifier indicates A first address type; a receiving unit configured to receive a second message sent by the second node, where the second message includes a first network address allocated for the first node or a service on the first node, The address type of the first network address is the first address type; the obtaining unit is configured to obtain the first network address according to the second message.
  • the first node and the second node belong to the first communication domain.
  • the receiving unit is also configured to receive a broadcast message sent by the second node, the broadcast message service identifier, and the service identifier indicates that the second node provides an address allocation service; the sending unit is also configured to and sending an access request to the second node to request access to the second node.
  • the first address type is a communication domain address or an IP address.
  • the first address type is an IP address
  • the first network address is an IPv6 address used locally by the first node
  • the first network address includes the IPv6 prefix of the first communication domain
  • the second network address is a network address whose address type used by the first node in the first communication domain is a communication domain address.
  • the first message further includes an identification of a first service on the first node, and the first network address is assigned to the first service.
  • the first message also includes at least one of the following information:
  • Unicast address identification information used to indicate that the first network address is a unicast address
  • Multicast address identification information used to indicate that the first network address is a multicast address
  • Anycast address identification information used to indicate that the first network address is an anycast address is an anycast address
  • Quantity identification information used to indicate the application quantity of the first network address.
  • the sending unit is also configured to send a third message to the second node, where the third message includes a second type identifier, the second type identifier indicates a second address type, and the second address type Different from the first address type;
  • the receiving unit is also configured to receive a fourth message sent by the second node, the fourth message includes allocation for the first node or for a service on the first node a third network address, and the address type of the third network address is the second address type;
  • the obtaining unit is further configured to obtain the third network address according to the fourth message.
  • the present application provides an address allocation device, which includes at least one processor and a communication interface, and the communication interface is used to provide information input and/or output for the at least one processor.
  • the device is used to implement the method in the first aspect or any possible embodiment of the first aspect.
  • the present application provides an address acquisition device, which includes at least one processor and a communication interface, and the communication interface is used to provide information input and/or output for the at least one processor.
  • the device is used to implement the method in the second aspect or any possible embodiment of the second aspect.
  • the present application provides a computer-readable storage medium, including computer instructions.
  • the computer instructions When the computer instructions are executed by a processor, the above-mentioned first aspect or any possible implementation of the first aspect is implemented. method.
  • the present application provides a computer-readable storage medium, including computer instructions.
  • the computer instructions When the computer instructions are executed by a processor, the second aspect or any possible implementation of the second aspect is implemented. method.
  • the present application provides a computer program product that, when executed by a processor, implements the method in the above-mentioned first aspect or any possible embodiment of the first aspect.
  • the computer program product for example, can be a software installation package. If it is necessary to use the method provided by any of the possible designs of the first aspect, the computer program product can be downloaded and executed on the processor. , to implement the method in the first aspect or any possible embodiment of the first aspect.
  • the present application provides a computer program product that, when executed by a processor, implements the method in the above second aspect or any possible embodiment of the second aspect.
  • the computer program product for example, can be a software installation package. If it is necessary to use the method provided by any of the possible designs of the second aspect above, the computer program product can be downloaded and executed on the processor. , to implement the method in the second aspect or any possible embodiment of the second aspect.
  • the present application provides a terminal, which includes a first device or a second device, wherein the first device is the device of the above fourth aspect or any possible implementation of the fourth aspect, or is The device of the above-mentioned sixth aspect; the second device is the device of the above-mentioned third aspect or any possible implementation of the third aspect, or the device of the above-mentioned fifth aspect.
  • Examples of the terminal include but are not limited to: smart home equipment (such as televisions, sweeping robots, smart desk lamps, audio systems, smart lighting systems, electrical appliance control systems, home background music, home theater systems, intercom systems, video surveillance, etc. ), intelligent transportation equipment (such as cars, ships, drones, trains, trucks, trucks, etc.), intelligent manufacturing equipment (such as robots, industrial equipment, intelligent logistics, smart factories, etc.), intelligent terminals (mobile phones, computers, tablets, etc.) , handheld computers, desktops, headsets, speakers, wearable devices, vehicle-mounted devices, virtual reality devices, augmented reality devices, etc.).
  • smart home equipment such as televisions, sweeping robots, smart desk lamps, audio systems, smart lighting systems, electrical appliance control systems, home background music, home theater systems, intercom systems, video surveillance, etc.
  • intelligent transportation equipment such as cars, ships, drones, trains, trucks, trucks, etc.
  • intelligent manufacturing equipment such as robots, industrial equipment, intelligent logistics, smart factories, etc.
  • intelligent terminals mobile phones, computers, tablets,
  • the present application provides a communication system, which includes a first device and a second device, wherein the first device is the device of the above-mentioned fourth aspect or any possible implementation of the fourth aspect, or It is the device of the above-mentioned sixth aspect; the second device is the device of the above-mentioned third aspect or any possible implementation of the third aspect, or it is the device of the above-mentioned fifth aspect.
  • Figure 1 is a schematic diagram of some system architectures provided by embodiments of the present application.
  • Figure 2 is a schematic diagram of a smart home wireless communication scenario provided by an embodiment of the present application.
  • Figure 3 is a flow chart of an address allocation method provided by an embodiment of the present application.
  • Figure 4 is a flow chart of yet another address allocation method provided by an embodiment of the present application.
  • Figure 5 is a flow chart of yet another address allocation method provided by an embodiment of the present application.
  • Figure 6 is a flow chart of yet another address allocation method provided by an embodiment of the present application.
  • Figure 7 is a schematic structural diagram of an address allocation device provided by an embodiment of the present application.
  • Figure 8 is a schematic structural diagram of an address acquisition device provided by an embodiment of the present application.
  • Figure 9 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • Figure 1 exemplarily provides schematic diagrams of three system architectures applicable to embodiments of the present application, such as shown in (a), (b) and (c) in Figure 1.
  • the communication domain includes multiple communication devices.
  • the communication devices have a communication connection relationship (ie, communication link) between them, and the communication devices can exchange information through the communication link.
  • Multiple communication devices include at least one management node and at least one terminal node, where the management node can also be called a grant node (referred to as G node), the terminal node can also be called a terminal node (referred to as T node), and the G node is For sending data scheduling information at the access layer of the communication system (for example, Starlight communication system), the T node is used for receiving the data scheduling information at the access layer of the communication system and sending corresponding data according to the received data scheduling information.
  • G node grant node
  • T node terminal node
  • the G node is For sending data scheduling information at the access layer of the communication system (for example, Starlight communication system)
  • the T node is used for receiving the data scheduling information at the access layer of the communication system and sending corresponding data according to the received data scheduling information.
  • communication domain 1 includes node G and multiple nodes T (for example, T1, T2, ..., Tn), where node G is the access point of each node T respectively, and node G is As a management node in communication domain 1, node G can allocate an IP address to node T.
  • node G acts as a DHCP server to allocate an IP address to node T
  • node G acts as an IP address allocation agent to request the DHCP server to allocate an IP address to node T.
  • the communication domain 1 may be, for example, the StarLight domain in the StarLight communication system.
  • the node G may also allocate a network address of the communication domain address type to the node T to implement the StarLight communication system. Addressing within communication systems.
  • the communication between node G and node T can be two-way unicast or G->T broadcast communication.
  • node G can be a telematics box (Telematics BOX, T-Box), node T can be a user terminal in the car, and the user terminal can be, for example, a mobile phone, a tablet computer, a handheld computer, a desktop computer, Headphones, speakers, wearable devices, vehicle-mounted devices, virtual reality devices, augmented reality devices, etc.
  • T-BOX can also be called a remote vehicle terminal or an Internet of Vehicles communication terminal.
  • T-BOX is generally used as a wireless gateway to provide a remote communication interface for the entire vehicle.
  • T-Box can send collected vehicle data (such as drive motor data of new energy vehicles, vehicle data, battery data, status data, etc.) to the cloud platform, and can also receive control instructions from the cloud platform. forwarded to the vehicle.
  • T-Box can also establish a transmission channel with mobile phone APP through Bluetooth to realize door opening, door locking, window control, air conditioning switch, engine start and stop, etc.
  • FIG. 1 shows a tree-like multi-hop topology.
  • communication domain 2 includes nodes G1, G2, G3, G4 and nodes T1, T2 and T3.
  • node G1 is connected to nodes G2 and G3 respectively, and node G2 is also connected to nodes T1 and G4 respectively.
  • node G3 is also connected to nodes T3 and G4 respectively, and node G4 is also connected to node T2.
  • node G1 is the access point of nodes G2 and G3 respectively
  • node G2 is the access point of nodes T1 and G4 respectively
  • node G3 is the access point of nodes T3 and G4 respectively
  • node G4 is the access point of node T2.
  • Node G1 is the management node in communication domain 2, that is, node G1 has an address allocation function and can allocate network addresses to other nodes in communication domain 2.
  • nodes G2, G3 and G4 have their own network addresses, node G2 , G3 and G4 can have address allocation proxy service function.
  • communication domain 2 includes multiple nodes G (nodes G1, G2, G3, and G4 respectively) and multiple nodes T (nodes T1, T2, and T3 respectively).
  • Node G1 is the communication
  • nodes G2, G3 and G4 are communication nodes with dual identities.
  • node G2 for the communication between node G2 and node T1, node G2 serves as the G node and node T1 serves as the T node; for the communication between node G2 and node G1, the node G1 serves as the G node and the node G2 serves as the T node, like G2 In this way, the communication node with dual identities can be recorded as G2(T).
  • node G has IP capabilities.
  • Node G includes gateway/customer premises equipment (CPE), sub-router, mobile phone and large screen.
  • the management node in the communication domain shown in Figure 2 can be a gateway/ Customer premises equipment (CPE)
  • the node G with dual identities can be a sub-router, a mobile phone and a large screen.
  • the T nodes in Figure 2 include smart lights, air conditioners, printers, microphones and speakers, which include both nodes G that support IP, such as printers, and nodes G that do not support IP, such as smart lights, air conditioners, etc.
  • communication domain 3 includes nodes G1, G2, G3 and nodes T1, T2, T3 and T4.
  • node G1 is connected to nodes G2 and G3 respectively, that is, node G1 is connected to nodes G2 and G3 respectively.
  • access point node G2 is connected to nodes T1 and T2 respectively, that is, node G2 is the access point of nodes T1 and T2 respectively
  • node G3 is connected to nodes T3 and T4 respectively, that is, node G3 is the access point of nodes T3 and T4 respectively. entry point.
  • Node G1 serves as a management node in communication domain 3.
  • Node G1 can provide address allocation services
  • nodes G2 and G3 can provide address allocation proxy services.
  • the communication between node G and node T can be a two-way unicast of T->G(T)->G, or it can be G->G(T)-> T's broadcast communications.
  • node G1 can be the battery control unit (BCU) in the BMS
  • the nodes T1, T2, T3 and T4 can be the battery monitoring unit (battery monitoring unit, BMU).
  • BCU battery control unit
  • T1, T2, T3 and T4 can be the battery monitoring unit (battery monitoring unit, BMU).
  • G2 and G3 may be BMUs with address allocation proxy service functions.
  • Figure 1 is only an exemplary architecture diagram, and it can also be an architecture diagram in other forms, for example, it can also be a tree-like four-layer (or more layer) multi-hop topology.
  • FIG. 1 may also include other functional entities.
  • the method provided by the embodiment of the present application can be applied to the communication system shown in Figure 1.
  • the method provided by the embodiment of the present application can also be applied to other communication systems, which is not limited by the embodiment of the present application.
  • FIG. 3 is a flow chart of an address allocation method provided by an embodiment of the present application. The method includes but is not limited to the following steps:
  • the first node sends a first message to the second node.
  • the first message includes a first type identifier, and the first type identifier indicates the first address type.
  • the second node receives the first message sent by the first node.
  • the first node and the second node belong to the first communication domain.
  • the second node allows the access of the first node based on the access request sent by the first node. That is to say, the second node is the access point of the first node.
  • the first node may be any node T among the nodes T1, T2, ..., Tn, and the second node may be the node G.
  • the first node may be any one of nodes T1, T2, and T3, where the first node is node T1, then the second node is node G2; the first node is node T2, then the second node is node G4; the first node is node T3, then the second node is node G3.
  • the first node when nodes T1, T2 and T3 in (b) of Figure 1 are not connected, the first node may also be node G4, and the second node may be node G2 or G3.
  • the first node when nodes T1, T2, T3 and G4 in (b) of Figure 1 are not connected, the first node may be node G2 or G3, and the second node is node G1.
  • the first node may be any one of nodes T1, T2, T3 and T4, where the first node is T1 or T2, then the second node is node G2; The first node is node T3 or T4, and the second node is node G3.
  • the first node when nodes T1, T2, T3 and T4 in Figure 1(c) are not connected, the first node may be node G2 or G3, and the second node is node G1.
  • the first address type is a communication domain address or an IP address.
  • the first address type is an address type to which the first network address expected to be allocated belongs.
  • the first address type is a communication domain address
  • the first network address is a network layer short address, the length of which can be 2 bytes (that is, 16 bits), and can be used for addressing in the corresponding communication system.
  • the communication domain address can be used for addressing within the StarLight communication system. It can be understood that the communication domain address is another address type that is different from the IP address.
  • the length of the first network address may also be 8 bits, 24 bits, or other number of bits, which is not specifically limited here.
  • the first type identifier may indicate the first address type through bit mapping, binary value, or other methods. For example, when the first type identifier takes a first value, the first address type is a communication domain address; when the first type identifier takes a second value, the first address type is an IP address.
  • the first node before the first node sends the first message to the second node, the first node first performs: determining that the second node is the access point of the first node.
  • determining that the second node is the access point of the first node includes: receiving a broadcast message sent by the second node, the broadcast message including a service identifier, and the service identifier indicates that the second node provides an address allocation service; The second node sends an access request to request access to the second node.
  • determining the second node to be the access point of the first node includes: receiving a broadcast message sent by at least one node, where the broadcast message corresponding to the node includes a service identifier corresponding to the node, and the service identifier corresponding to the node Used to instruct the node to provide address allocation services; select a second node from the above-mentioned at least one node as the access point of the first node according to the preset conditions and the broadcast message sent by the above-mentioned at least one node; send an access point to the second node request to request access to the second node.
  • the preset conditions include at least one of the following conditions:
  • the node corresponding to the earliest received broadcast message is used as the second node;
  • the node corresponding to the maximum signal strength is used as the second node.
  • the first message may be carried on a general management transmission channel, and the general management transmission channel is a communication channel. It can be understood that before the first node obtains the assigned network address, the first node can activate the general management transmission channel by establishing a default bearer to access the second node. In some possible embodiments, the first message can also be carried on other communication channels, which is not specifically limited here.
  • the first message also includes the identity of the first node, and the identity of the first node is used to identify the first node.
  • the identity of the first node may be the Layer 2 Identification (L2ID) of the first node.
  • L2ID Layer 2 Identification
  • the first message does not include the identifier of any service, it means that the first message is used to request to allocate a first network address of the first address type to the first node.
  • the first message also includes an identifier of the first service on the first node, indicating that the first message is used to request allocation of a first network address of the first address type for the first service on the first node.
  • the second node obtains the first network address according to the first address type.
  • the type of the first network address is a first address type.
  • the first network address may be assigned to the first node, or may be assigned to a service (or application) on the first node.
  • the following is a detailed description of the allocation process of the first network address in these two types of situations:
  • Category 1 The first network address is assigned to the first node
  • the first message also includes the identity of the first node.
  • Obtaining the first network address based on the first address type includes: obtaining the address assigned to the first node based on the first address type and the identity of the first node. The first network address of a node.
  • obtaining the first network address according to the first address type and the identity of the first node includes: when the first mapping information includes the first mapping relationship, obtaining the first network address according to the first mapping relationship.
  • the first mapping relationship represents the mapping relationship between the identity of the first node, the first network address and the first address type, where the first mapping information includes the identity of the node assigned to the network address, the network address of the node A collection of mapping relationships between address types and network addresses of nodes.
  • the first mapping information includes the first mapping relationship. This situation indicates that the first node has been assigned a network address of the same type in history. Using the network address of the same type assigned in history as the first network address is not only effective. To avoid waste of network addresses, it can also be determined that the first network address assigned to the first node is not repeated, thus preventing the occurrence of address conflicts.
  • the first mapping information is maintained locally by the second node.
  • the first mapping information can be represented by tables, diagrams, etc.
  • the mapping table may be in the form shown in Table 1.
  • Table 1 shows the mapping relationship between the identity of the node - the address type of the network address - the network address of the node.
  • the value of the address type of the network address is "0" it means that the network address
  • the address type is a communication domain address; when the value of the address type of the network address is "1”, it means that the address type of the network address is an IP address.
  • L2ID&1-0-address 1 it can be seen that the node with the identity identifier L2ID&1 has been assigned address 1 whose address type is the communication domain address.
  • mapping relationship "L2ID&1-1-address 2” The mapping relationship shows that the node with the identity identifier L2ID&1 has been assigned the address type IP address 2 in the past. Based on the mapping relationship "L2ID&3-0-address 3", it can be seen that the node with the identity identifier L2ID&3 has been assigned the address type communication in the past. Address 3 of the domain address.
  • history may assign two types of network addresses to a node (for example, the node with the identity identifier L2ID&1), or may assign one type to a node (for example, the node with the identity identifier L2ID&3). type of network address, or it may be that a node (for example, a node with the identity identifier L2ID&3) has not been assigned any type of network address in history.
  • the first mapping information when the first mapping information does not include the first mapping relationship, it means that the first network address of the first address type has not been assigned to the first node in history.
  • the first network address For specific distribution methods, please refer to the following method A1 and method A2:
  • the second node is the management node in the first communication domain
  • the second node when the second node is a management node in the first communication domain, the second node allocates the first network address to the first node according to the first address type.
  • the first address type may be a communication domain address or an IP address.
  • the first network address when the first address type is an IP address, the first network address may be an IPv4 address or an IPv6 address.
  • the second node when the second node is a management node in the first communication domain and the first address type is an IP address, the second node can send a third message to the DHCP server, and the third message includes the above-mentioned first type identifier. and the identity of the first node; receiving a fourth message sent by the DHCP server, where the fourth message includes the first network address assigned to the first node.
  • the first network address is assigned by the DHCP server to the first node based on the third message.
  • the second node when the second node is a management node in the first communication domain and the first address type is an IP address, if the second node does not have the DHCP function, the second node can request the DHCP server to allocate it to the first node through the third message.
  • the first address type is a first network address of an IP address.
  • the first network address of the first node is allocated by the second node;
  • the first network address of the first node is assigned by the second node (if the second node has a DHCP function), or the first network address of the first node is assigned by A DHCP server (in case the second node does not have DHCP functionality) is assigned by the second node.
  • the first node and the second node may satisfy any of the following conditions:
  • the first node is any node T, and the second node is node G;
  • the first node is node G2 or G3, and the second node is node G1;
  • the first node is node G2 or G3, and the second node is node G1.
  • Method A2 The second node is not a management node in the first communication domain
  • the second node when the second node is not a management node in the first communication domain, the second node sends a third message to the third node.
  • the third message includes the above-mentioned first type identifier and the identity identifier of the first node.
  • the third node is a management node in the first communication domain; receives a fifth message sent by the third node, where the fifth message includes the first network address assigned to the first node. In this case, the first network address is assigned to the first node by the management node based on the third message.
  • the second node When the second node is not a management node in the first communication domain, the second node sends a third message to the multiple management nodes, and the third message includes the above The first type identifier and the identity identifier of the first node; receiving the sixth message sent by the plurality of management nodes, the sixth message corresponding to the management node includes the network address allocated by the management node to the first node based on the third message; from this Select a target management node among multiple management nodes; obtain the first network address according to the sixth message sent by the target management node.
  • the target management node selected by the second node satisfies at least one of the following conditions:
  • the target management node may be the management node with the highest priority, or the management node corresponding to the strongest signal strength, which is not specifically limited here.
  • the second node when there are multiple management nodes in the first communication domain, after the second node selects the target management node, the second node can also broadcast a response message, and the response message is used to indicate that the second node has selected the target management node.
  • the network address provided by the target management node In this way, the target management node that receives the response message can store the mapping relationship between the network address assigned to the first node, the first address type, and the identity of the first node, and other management nodes that receive the response message can know it.
  • the network address provided by itself is not selected by the second node, so that the provided network address can be recycled and the waste of the address can be avoided.
  • the type of the first network address may be a communication domain address or an IP address, which is not specifically limited here.
  • the first address type is an IP address
  • the first network address may be an IPv4 address or an IPv6 address.
  • the second node sends the above-mentioned third message to the management node.
  • the first network address is assigned to the first node by the management node through the second node;
  • the second node can broadcast the above-mentioned third message to the multiple management nodes, and select a network address provided by the management node from the network addresses provided by the multiple management nodes. As the first network address assigned to the first node.
  • the first node and the second node satisfy any of the following conditions:
  • the first node is node T1 or G4, and the second node is node G2;
  • the first node is node G4 or T3, and the second node is node G3;
  • the first node is node T3 or T4, and the second node is node G3.
  • the third node is node G1
  • the third node is node G1.
  • the second node when the first mapping information does not include the above-mentioned first mapping relationship, when the second node obtains the first network address assigned to the first node, the second node may also assign the first node The mapping relationship between the identity identifier, the first address type and the first network address is added to the above-mentioned first mapping information. For example, assuming that the identity of the first node is "L2ID&2" and the first address type is "communication domain address", the second node queries the above-mentioned Table 1 based on the identity of the first node and the first address type and determines that there are no entries in Table 1. There is a first mapping relationship.
  • the second node obtains the first network address assigned to the first node (assumed to be "address 4") through the above-mentioned method A1 or method A2.
  • the second node can be in the above-mentioned Table 1. Add the mapping relationship "L2ID&2-0-address 4".
  • the first network address when the first address type is an IP address, the first network address may also be a local IPv6 address assigned to the first node.
  • the allocation of the first network address may be detailed as follows. Two implementation methods are described:
  • the second node when the first address type is an IP address, the second node obtains a historically allocated second network address, and the second network address is an address type used by the first node in the first communication domain and is a communication domain address.
  • Network address obtain the first network address assigned to the first node according to the IPv6 prefix of the first communication domain and the second network address.
  • the second network address whose address type is the communication domain address that has been historically allocated to the first node is used as the interface identifier of the first node to construct the local IPv6 address of the first node. This not only saves the consumption of the number of addresses, but also It is determined that the first network address assigned to the first node is not repeated, thereby avoiding address conflict.
  • the first node when the address type used by the first node in the first communication domain is the second network address history of the communication domain address that is not allocated, based on whether the second node is a management node in the first communication domain, the first node
  • the allocation of local IPv6 addresses of nodes can be further divided into case 1 and case 2 as follows:
  • the second node When the second node is a management node in the first communication domain, the second node allocates the second network address to the first node, and obtains the second network address assigned to the first node based on the IPv6 prefix and the second network address of the first communication domain. The first network address of the node.
  • the second node sends a third message to the management node in the first communication domain, where the third message includes the above-mentioned first type identifier and the identity identifier of the first node; receiving The seventh message sent by the management node in the first communication domain.
  • the seventh message includes the first network address assigned by the management node based on the third message.
  • the first network address includes the IPv6 prefix of the first communication domain and the IPv6 prefix assigned to the first node.
  • the second network address, the address type of the second network address is a communication domain address. The second node thereby obtains the first network address assigned to the first node. It can be seen from this that the management node in the first communication domain can allocate a local IPv6 address to the first node through the second node, thereby supporting the first node to access the network through a multi-hop wireless link.
  • the third message includes all information related to the allocation of the first network address in the first message.
  • the third message sent by the second node also includes the first type identifier and the identity identifier of the first node.
  • the first message received by the second node also includes other information related to the allocation of the first network address, such as unicast address identification information. , multicast address identification information or quantity identification information.
  • the third message in addition to the first type identification and the identity identification of the first node, also includes the same other information as Information related to the allocation of the first network address.
  • the broadcast address identification information, multicast address identification information, and quantity identification information please refer to the description of the corresponding information below, and are not specifically limited here.
  • the second node sends the third message to the DHCP server or the management node in the first communication domain.
  • the second node can be regarded as a forwarding node, but the second node does not directly forward or transparently transmit the first message. , instead, the information related to the allocation of the first network address in the first message is sent by sending the third message.
  • the second network address whose address type is the communication domain address used by the first node in the first communication domain has been allocated.
  • the first mapping information includes the third mapping relationship
  • Category 2 The first network address is assigned to the service on the first node
  • the first message also includes the identifier of the first service on the first node, and obtaining the first network address according to the first address type includes: obtaining the first network address according to the first address type and the identifier of the first service. The first network address assigned to the first service.
  • obtaining the first network address according to the first address type and the identification of the first service includes: when the second mapping information includes a second mapping relationship, obtaining the first network address according to the second mapping relationship, The second mapping relationship represents the mapping relationship between the identity of the first node, the identity of the first service, the first network address and the first address type, where the second mapping information includes the identity of the service assigned to the network address, A collection of mapping relationships between the network address of the service, the type identifier of the network address of the service, and the identity identifier of the node where the service is located.
  • the second mapping information includes a second mapping relationship. This situation indicates that the first service on the first node has been allocated a network address of the same type in history, and the network address of the same type allocated in history is used as the first network. address, not only can effectively avoid the waste of network addresses, but also can ensure that the first network address assigned to the first service on the first node is not repeated.
  • the second mapping information is maintained locally for the second node.
  • the second mapping information can be represented by tables, diagrams, etc.
  • the second mapping information when expressed as a mapping table, the second mapping information may be expressed in the form shown in Table 2.
  • Table 2 shows the mapping relationship between the identity identifier of the node - the identifier of the service - the address type of the network address - the network address of the service.
  • the address type of the network address When the address type of the network address is "0", Indicates that the address type of the network address is a communication domain address; when the value of the address type of the network address is "1", it indicates that the address type of the network address is an IP address.
  • service AID1 is provided on node L2ID&1 and node L2ID&3, and the corresponding The address types of network addresses are the same, so "address 11" and "address 13" are also the same.
  • Table 2 is only used as an example to reflect the correspondence between the identity of the node, the identification of the service on the node, the network address of the service, and the address type of the network address. In practical applications, this correspondence
  • the text content and storage method can also be in other forms, which are not specifically limited here.
  • Table 2 and the above-mentioned Table 1 can be represented and stored separately as above.
  • the above-mentioned Table 1 and Table 2 can also be merged into one table for representation and storage.
  • the record is The service identifier in the mapping relationship of the network address allocated by the node to a certain address type can be defaulted, and is not specifically limited here.
  • the second mapping information when the second mapping information does not include the above-mentioned second mapping relationship, it means that the first network address of the first address type has not been assigned to the first service on the first node in history.
  • the allocation method of the first network address please refer to the following method B1 and method B2:
  • Method B1 The second node is the management node in the first communication domain
  • the second node When the second node is a management node in the first communication domain, the second node allocates a first network address to the first service according to the first address type and the identifier of the first service.
  • the first address type may be a communication domain address or an IP address.
  • the second node when the second node is a management node in the first communication domain and the first address type is an IP address, the second node can send a third message to the DHCP server, and the third message includes the above-mentioned first type identifier. , the identity identifier of the first node and the identifier of the first service on the first node; receiving an eighth message sent by the DHCP server, where the eighth message includes the first network address assigned to the first service.
  • the first network address is assigned by the DHCP server to the first service on the first node based on the third message.
  • the second node when the second node is a management node in the first communication domain and the first address type is an IP address, if the second node does not have the DHCP function, the second node can request the DHCP server to allocate the first service to the first service through the third message.
  • the first address type is a first network address of an IP address.
  • the first address type is a communication domain address
  • the first network address of the first service is allocated by the second node
  • the first network address of the first service is allocated by the second node, or is allocated by the DHCP server through the second node.
  • Method B2 The second node is not a management node in the first communication domain
  • the second node when the second node is not a management node in the first communication domain, the second node sends a third message to the third node.
  • the third message includes the above-mentioned first type identifier, the identity identifier of the first node and the third message.
  • An identifier of the first service on a node, the third node is a management node in the first communication domain; receiving a ninth message sent by the third node, where the ninth message includes a first network address assigned to the first service.
  • the first network address is assigned by the management node to the first service on the first node based on the third message.
  • the first communication domain includes multiple management nodes
  • the second node is not a management node in the first communication domain
  • the second node sends the third message to the multiple management nodes in the first communication domain
  • the third The message includes the above-mentioned first type identifier, the identity identifier of the first node and the identifier of the first service on the first node; receiving the tenth message sent by the plurality of management nodes, the tenth message corresponding to the management node includes the management node based on
  • the third message is the network address allocated by the first service; a target management node is selected from the plurality of management nodes; and the first network address is obtained according to the tenth message sent by the target management node.
  • the target management node selected by the second node satisfies at least one of the following conditions:
  • the target management node may be the management node with the highest priority, or the management node corresponding to the maximum signal strength, which is not specifically limited here.
  • the type of the first network address may be a communication domain address or an IP address, which is not specifically limited here.
  • the second node when there are multiple management nodes in the first communication domain, after the second node selects the target management node, the second node can also broadcast a response message, and the response message is used to indicate that the second node has selected the target management node.
  • the target management node is the network address provided by the first service.
  • the target management node that receives the response message can store the mapping relationship between the identity of the first service, the network address assigned to the first service, the first address type and the identity of the first node, and receives the response message.
  • Other management nodes can know that the network address they provided has not been selected, so they can recycle the provided network address and avoid the waste of addresses.
  • the second node sends the third message to the management node.
  • the first network address is assigned by the management node to the first node through the second node.
  • the second node can broadcast the third message to the multiple management nodes, and select the network address provided by one management node from the network addresses provided by the multiple management nodes as the network address.
  • the first network address assigned to the first service is assigned to the first service.
  • the third message includes all information related to the allocation of the first network address in the first message.
  • the first message received by the second node includes the first type identifier, the identity identifier of the first node, and the identifier of the first service on the first node
  • the third message sent by the second node also includes the first type identifier. , the identity of the first node and the identity of the first service on the first node.
  • the first message received by the second node also includes other information related to the allocation of the first network address, for example, unicast address identification information, multicast address identification information, anycast address identification information or quantity identification information.
  • the third message also includes the same other information related to the allocation of the first network address.
  • broadcast address identification information, multicast address identification information, anycast address identification information, and quantity identification information please refer to the description of the corresponding information below, and are not specifically limited here.
  • the second node sends the third message to the DHCP server or the management node in the first communication domain.
  • the second node can be regarded as a forwarding node, but the second node does not directly forward or transparently transmit the first message. , instead, the information related to the allocation of the first network address in the first message is sent by sending the third message.
  • the second node when the second mapping information does not include the above-mentioned second mapping relationship, when the second node obtains the first network address allocated for the first service on the first node, the second node also The mapping relationship between the identity of the first node, the identity of the first service, the first address type and the first network address may be added to the above-mentioned second mapping information. For example, assuming that the identity of the first node is "L2ID&1", the identity of the first service is "AID3" and the first address type is "IP address”, the second node is based on the identity of the first node and the identity of the first service. After querying the above-mentioned Table 2 with the first address type, it is determined that there is no second mapping relationship in Table 2.
  • the second node obtains the first network address assigned to the first service through the above-mentioned method B1 or method B2 (assumed to be "Address 14"), the second node can add the mapping relationship "L2ID&1-AID3-1-Address 14" in the above Table 2.
  • the first message also includes at least one of the following information:
  • Unicast address identification information used to indicate that the first network address is a unicast address
  • Multicast address identification information used to indicate that the first network address is a multicast address
  • Anycast address identification information used to indicate that the first network address is an anycast address is an anycast address
  • Quantity identification information used to indicate the application quantity of the first network address.
  • the first network address may be a unicast address or a multicast address; if the first network address is allocated to the first service on the first node, then the first network address The address can be a unicast address or a multicast address or an anycast address.
  • the quantity identification information is optional information in the first message.
  • the quantity identification information may correspond to the number of identifiers of the first service in the first message.
  • the number of applications for the first network address is the same as the number of identifiers of the first service.
  • the first service identifiers included in the first message are: AID1, AID2 and AID3, which means that the first message is used to apply for allocating a first network address to each of the three services AID1, AID2 and AID3. , that is, the number of identifiers of the first service in the first message is 3, then the number of applications for the first network address indicated by the quantity identifier information is also 3.
  • corresponding network addresses can be allocated to multiple services on the first node. For another example, if the first network address is allocated to the first node, in this case, the quantity identification information indicates that the application quantity of the first network address is 1.
  • each identifier of the first service may have corresponding unicast address identification information or multicast address identification information or Anycast address identification information.
  • the first network addresses corresponding to the identifiers of multiple first services are all used for unicast, multicast, or anycast, they can also be represented by a flag bit, which is not specifically limited here.
  • the unicast address identification information is optional information in the first message.
  • the unicast address identification information can be represented by fields, flag bits or bits. Taking the flag bit as an example, when the corresponding flag bit is set, it indicates that the first network address is a unicast address.
  • the second node can know that the first node requests a first service allocated to the first node or a first network address allocated to the first node for unicast.
  • the multicast address identification information is optional information in the first message.
  • Multicast address identification information can be represented by fields, flags or bits.
  • the second node can know that the first node requests a first service allocated to the first node or a first network address allocated to the first node for multicast.
  • the unicast address identification information and the multicast address identification information can be expressed separately as described above.
  • the first message includes unicast address identification information and multicast address identification information, and the first network address is used for unicast, then the unicast address identification information only needs to be set accordingly.
  • the unicast address identification information and the multicast address identification information can also be represented by a flag bit. For example, when the flag bit takes the first value, it indicates that the first network address is used for unicast; When the flag takes the second value, it indicates that the first network address is used for multicast.
  • the anycast address identification information is optional information in the first message.
  • the second node can know that the first node requests the first network address allocated to the first service on the first node for anycast.
  • Multicast address identification information can be represented by fields, flags or bits.
  • the unicast address identification information, multicast address identification information, and anycast address identification information can also be represented by a field or a flag bit, which will not be described again here.
  • At least one of the above-mentioned unicast address identification information, multicast address identification information, anycast address identification information or quantity identification information may specifically include the following situations:
  • the first message includes a first address type, an identity identifier of the first node and unicast address identification information, which indicates a request to allocate a first network address of the first address type to the first node, and the first network address is used for unicast broadcast.
  • the first message includes a first address type, an identity identifier of the first node, and multicast address identification information, which indicates a request to allocate a first network address of the first address type to the first node, and the first network address is used for the group. broadcast.
  • the first message includes a first address type, an identity identifier of the first node, an identifier of the first service, and anycast address identification information, which represents a request to allocate a first address type of the first service to the first service on the first node.
  • network address and the first network address is used for anycast.
  • the first message includes the first address type, the identity identifier of the first node, and the quantity identifier information (which indicates that the application quantity of the first network address is 1).
  • the first network address is used for unicast or Multicast can be the system default.
  • the first message includes an identifier of the first service, an identity identifier of the first node, a first address type, and quantity identification information, wherein the identifier of the first service includes AID1 and AID2 and the quantity identification information indicates the first network address.
  • the number of applications is 2, which indicates a request to allocate a first network address of the first address type to services AID1 and AID2 respectively.
  • the first network address is used for unicast or multicast or anycast can be the system default. of.
  • the first message requests to allocate a first network address of the first address type to the first node, and the first network address is used for unicast.
  • the first message includes unicast address identification information and multicast address identification information, in In this case, the unicast address identification information and the multicast address identification information can be respectively represented by flag bits, wherein the flag bit corresponding to the unicast address identification information is set, but the flag bit corresponding to the multicast address identification information is not set.
  • the first message requests to allocate a first network address of the first address type to services AID1 and AID2 respectively, and the first message also includes unicast address identification information and multicast address identification information.
  • the unicast address identification information corresponds to AID1 and is used to indicate that the first network address allocated to AID1 is used for unicast.
  • the multicast address identification information corresponds to AID2 and is used to indicate that the first network address allocated to AID2 is used for group broadcast.
  • Multicast address identification information and anycast address identification information please refer to the example shown in case (5).
  • the first message requests to allocate a first network address of the first address type to the first node. If the first message includes unicast address identification information and quantity identification information, then the first network address is used for unicast and the quantity identification information Indicates that the number of applications for the first network address is 1.
  • the first message requests to allocate a first network address of the first address type to services AID1 and AID2 respectively. If the first message includes unicast address identification information and quantity identification information, the first network addresses are both used for unicast. broadcast, the quantity identification information indicates that the application quantity for the first network address is 2.
  • Unicast address identification information Unicast address identification information, multicast address identification information and anycast address identification information.
  • unicast address identification information, multicast address identification information and anycast address identification information can be passed through the flag bit (or field or bit), and determine whether the corresponding flag (or field or bit) is set according to the actual application.
  • the first message requests to allocate a first network address of the first address type to the first node.
  • the first message includes unicast address identification information, multicast address identification information and quantity identification information, in this case, unicast
  • the address identification information and the multicast address identification information can be represented by flag bits respectively. It is assumed that the flag bit corresponding to the unicast address identification information is not set, and the flag bit corresponding to the multicast address identification information is set, and the quantity identification information indicates the first network address.
  • the number of applications is 1, and it can be seen that the first network address is used for multicast.
  • the first message requests to allocate a first network address of a first address type to services AID1 and AID2 respectively. If the first message includes unicast address identification information, multicast address identification information and quantity identification information, in this case, assume that the unicast address identification information corresponds to AID1, which is used to indicate that the first network address allocated to AID1 is used for unicast, and the multicast address identification information corresponds to AID2, which is used to indicate the first network address allocated to AID2. For multicast, the quantity identification information indicates that the number of applications for the first network address is 2.
  • Unicast address identification information Unicast address identification information, multicast address identification information, anycast address identification information and quantity identification information.
  • the unicast address identification information, multicast address identification information and anycast address identification information can be passed through respectively.
  • Flag bit or field or bit
  • the network address assigned to the node in history may not be permanently stored in the first mapping information maintained by the second node, and the network address assigned to the service on the node may not be permanently stored in the first mapping information maintained by the second node.
  • the mapping information is permanently saved. For example, if the second node detects that a node has not used the network address for a period of time that reaches a preset threshold, the second node can delete the network address corresponding to the node from the first mapping information; if the second node detects that a certain service has not used If the duration of using the network address reaches the preset threshold, the second node can delete the network address corresponding to the service from the second mapping information.
  • the second node receives an address release request sent by a certain node. In this case, in response to the address release request, the second node may delete the network address corresponding to the node from the first mapping information.
  • S103 The second node sends a second message to the first node, where the second message includes the first network address.
  • the first node receives the second message sent by the second node.
  • the first network address may be assigned to the first node, or may be assigned to the first service on the first node.
  • the first network address is assigned to the first service on the first node; in the first message received by the second node When not including any service identification, the first network address is assigned to the first node.
  • S104 The first node obtains the first network address according to the second message.
  • the first network address is assigned to the first node or the first service on the first node.
  • the type of the first network address is a first address type
  • the first address type is a communication domain address or an IP address.
  • the first network address when the first address type is an IP address, the first network address may be an IPv4 address or an IPv6 address. In some possible embodiments, when the first address type is an IP address, the first network address may also be a local IPv6 address assigned to the first node. In this case, the first network address includes the first communication domain IPv6 prefix and a second network address. The second network address is a network address whose address type is a communication domain address used by the first node in the first communication domain.
  • the first node can also change the address type. Specifically, the first node sends an eleventh message to the second node, the eleventh message includes a second type identifier, the second type identifier indicates a second address type, and the second address type is different from the first address type; receiving the second The twelfth message sent by the node, the twelfth message includes a third network address allocated for the first node or the first service on the first node, and the address type of the third network address is the second address type; according to the twelfth message message to obtain the third network address.
  • the first node may first request the second node to release the first network address of the first address type that has been historically applied for the first node or the first service on the first node.
  • the first node may not perform the action of requesting address release, which is not specifically limited here.
  • the first node can send a release request instruction to the second node, so that the second node can obtain the first network address from the first mapping information. Delete the mapping relationship between the identity of the first node, the first address type and the first network address.
  • the first node Before changing the address type, the first node can send a release request instruction to the second node so that the second node The mapping relationship of the identity identifier of the first node, the identifier of the first service, the first address type and the first network address is deleted from the second mapping information.
  • a newly online first node in the network can uniquely determine the accessed second node with the address allocation service function, and the first node only obtains the assigned network address from the second node.
  • the interactive process of address allocation is simple and helps improve the efficiency of network address allocation.
  • the mapping information maintained locally by the second node can ensure that the network address assigned to the first node or to the service on the first node is not repeated.
  • the first node may also indicate the address type of the network address that is expected to be allocated, such as a communication domain address or an IP address, so that the first node can flexibly obtain different types of network addresses.
  • a local IPv6 address can also be assigned to the first node to support the first node to access the network through a multi-hop wireless link.
  • Figure 4 is a flow chart of yet another address allocation method provided by an embodiment of the present application.
  • the method is applied to a communication system, which at least includes node 1 and node 2, where node 1 is the node that submits the address application and node 2 is the management node.
  • the method includes but is not limited to the following steps:
  • Node 1 selects access node 2 based on the broadcast message sent by node 2.
  • the broadcast message sent by node 2 includes a service identifier, and the service identifier indicates that node 2 provides an address allocation service, that is, node 2 has an address allocation function.
  • node 2 may also be determined by node 1 from at least one node that has sent a broadcast message. In one implementation, node 2 may be determined by node 1 from at least one node based on at least one of the priority information of the node, the detected signal strength, or the reception time of the broadcast message. For example, node 2 may be the node corresponding to the broadcast message first received by node 1, the node corresponding to the maximum signal strength detected by node 1, or the node with the highest priority, which is not specifically limited here.
  • node 1 may choose to access node 2 by establishing a default bearer with node 2 to activate a general management transmission channel, so that node 1 can exchange address application signaling with node 2 through the general management transmission channel, for example, The first message below.
  • the general management transmission channel is a communication channel.
  • node 2 is a management node in the communication domain, and node 2 is also the access point of node 1.
  • node 1 may be any node T among the nodes T1, T2, ..., Tn in (a) of Figure 1, and node 2 is node G in (a) of Figure 1.
  • node 1 may be node G2 or G3 in (b) of Figure 1 above, and node 2 is node G1 in (b) of Figure 1 above.
  • node 1 may be node G2 or G3 in (c) of Figure 1 above, and node 2 is node G1 in (c) of Figure 1 above.
  • Node 1 sends the first message to node 2.
  • the first message includes the identity identifier and the first type identifier of node 1, and the first type identifier indicates the first address type. In this case, if the first message does not include the identifier of any service, it means that the first The message is used to request that node 1 be assigned a first network address.
  • the first address type is a communication domain address or an IP address.
  • the identity of node 1 is used to identify node 1.
  • the identity of node 1 may be the L2ID of node 1.
  • the first message also includes an identifier of the first service on node 1. In this case, it means that the first message is used to request allocation of a first network address for the first service.
  • Node 2 sends the second message to node 1.
  • node 2 before node 2 sends the second message to node 1, node 2 needs to obtain the first network address according to the first address type.
  • the specific process please refer to C11-C13:
  • C11 Determine whether the first message includes the identifier of the first service.
  • first message does not include the identifier of the first service, determine that the first network address is assigned to node 1, and execute C12; if the first message includes the identifier of the first service, determine that the first network address is assigned to node 1. For the first service on node 1, execute C13.
  • C12 Obtain the first network address assigned to node 1 based on the first address type and the identity of node 1.
  • the first network address assigned to node 1 is obtained according to the first mapping relationship.
  • the first mapping relationship represents the mapping relationship between the identity of node 1, the first network address and the first address type, where, The first mapping relationship belongs to a set 1 of mapping relationships including the identity of the node assigned to the network address, the network address of the node, and the address type of the network address of the node. It can be understood that set 1 is the first mapping information in the embodiment of FIG. 3 .
  • node 2 allocates the first network address to node 1 based on the first address type and the identity of node 1. That is to say, when node 1 is not assigned a network address of the first address type in history, node 2 assigns node 1 the first network address. In addition, node 2 may also add the first network address of the first address type assigned to node 1 to the above-mentioned set 1.
  • the first address type may be a communication domain address or an IP address.
  • the second message sent by node 2 to node 1 includes the first network address, wherein the first network address is assigned to node 1 .
  • C13 Obtain the first network address assigned to the first service according to the first address type and the identifier of the first service.
  • the first network address assigned to the first service is obtained according to the second mapping relationship.
  • the second mapping relationship represents the identity of node 1, the identity of the first service, the first network address and the first address type.
  • the second mapping relationship belongs to a set 2 of mapping relationships between the identifier of the service assigned to the network address, the network address of the service, the address type of the network address, and the identity of the node where the service is located. It can be understood that set 2 is the second mapping information in the embodiment of FIG. 3 .
  • node 2 allocates a first network address to the first service according to the first address type and the identifier of the first service. That is to say, when the first service on node 1 has not been assigned a network address of the first address type in history, node 2 assigns the first network address to the first service. In addition, node 2 may also add the first network address of the first address type assigned to the first service on node 1 to the above-mentioned set 2.
  • the first address type may be a communication domain address or an IP address.
  • the second message sent by node 2 to node 1 includes a first network address, wherein the first network address is assigned to the first service on node 1 .
  • node 2 may also send the second message to node 1 through S204 and S205 obtains the first network address:
  • Node 2 sends the third message to the DHCP server.
  • the third message includes the above-mentioned first type identifier and the identity identifier of node 1 to request the DHCP server to allocate a first network address to node 1.
  • the relevant description of the third message in the "First Category: First Network Address Allocation to the First Node" embodiment in S102 of Figure 3 , which will not be described again here.
  • the third message includes the above-mentioned first type identifier, the identity identifier of node 1 and the identifier of the first service on node 1, to request the DHCP server to allocate a first network address to the first service on node 1.
  • the third message reference may be made to the relevant description of the third message in the "Second Category: First Network Address Allocation to Service on the First Node" embodiment in S102 of Figure 3 , which will not be described again here.
  • the type of the first network address is an IP address.
  • the DHCP server allocates the first network address to node 1 based on the first address type and the identity identifier of node 1.
  • the DHCP server allocates the first network address to the first service on node 1 according to the first address type and the identifier of the first service.
  • the DHCP server After the DHCP server obtains the first network address through the above implementation method, it can send the message carrying the first network address to node 2.
  • the DHCP server can also add relevant information of the newly allocated first network address to the local address management information, for example, the identity of node 1, the first address type and the first network address of node 1.
  • relevant information of the newly allocated first network address for example, the identity of node 1, the first address type and the first network address of node 1.
  • the mapping relationship, or the mapping relationship between the identity of the first service, the first network address of the first service, the first address type, and the identity of node 1 is not specifically limited here.
  • node 2 can also send the third message in S204 to multiple DHCP servers; receive address allocation feedback messages sent by multiple DHCP servers, and the address allocation feedback messages corresponding to the DHCP servers include the address allocation feedback messages based on the The first network address assigned by the third message; selecting a target DHCP server from multiple DHCP servers; and obtaining the first network address according to the address allocation feedback message sent by the target DHCP server.
  • node 2 may also broadcast message 1. Message 1 is used to indicate that node 2 has selected the network address provided by the target DHCP server.
  • the target DHCP server that receives message 1 can send a confirmation message to node 2 to indicate that the first network address selected by node 2 can be used, and other unselected DHCP servers that receive message 1 can know that the network address provided by itself is not available. Selected by node 2, so that the provided network address can be recycled and the waste of the address can be avoided.
  • the work of performing address selection and receiving confirmation messages from the DHCP server is offloaded to node 2, which can reduce the burden on node 1 and make the protocol stack on node 1 Lightweight, reducing the power consumption of node 1.
  • the target DHCP server can be the DHCP server corresponding to the maximum signal strength, or the DHCP server corresponding to the earliest address allocation feedback message received by node 2, or the DHCP server corresponding to the highest priority, or it can be the DHCP server corresponding to the address allocation feedback message received by node 2 based on It is determined by multiple factors including the detected signal strength, the priority information of the DHCP server and the reception time corresponding to the address allocation feedback message, and is not specifically limited here.
  • Node 1 obtains the first network address according to the second message.
  • node 1 After node 1 obtains the first network address, it can perform local configuration according to the first network address.
  • the node 1 that applies for the address can determine to discover and access a node 2 with address allocation service, and only receive the allocated first network address from the node 2, which is beneficial to improving the efficiency of the network address. Allocation efficiency can realize the allocation of network addresses in a star single-hop topology scenario.
  • node 1 can also choose to apply for a desired address type and apply for a network address for a specific object (for example, a node or a service on a node), which enriches the application scenarios of address allocation.
  • Figure 5 is a flow chart of yet another address allocation method provided by an embodiment of the present application.
  • the method is applied to a communication system, which includes at least node 1, node 2 and node 3, where node 1 is the node that applies for an address, node 2 is the access point of node 1, and node 3 is the management node.
  • the method includes but is not limited to the following steps:
  • Node 1 selects access node 2 based on the broadcast message sent by node 2.
  • the above-mentioned node 3 is a management node in the first communication domain, and node 1, node 2 and node 3 all belong to the first communication domain.
  • the node 3 may be the node G1, and the node 1 and the node 2 satisfy any one of the following conditions:
  • Node 1 is node T1 or G4, node 2 is node G2;
  • Node 1 is node T2
  • node 2 is node G4
  • Node 1 is node G4 or T3, and node 2 is node G3.
  • the node 3 may be the node G1, and the node 1 and the node 2 satisfy any one of the following conditions:
  • Node 1 is node T1 or T2, node 2 is node G2; or
  • the first node is node T3 or T4, and the second node is node G3.
  • Node 1 sends the first message to node 2.
  • S302 Node 1 sends the first message to node 2.
  • S202 for details of this step, please refer to the relevant description of S202 in the embodiment of FIG. 4 and will not be described again here.
  • Node 2 determines whether the first message includes the identifier of the first service.
  • the first message does not include the identifier of the first service, it means that the first message is used to request the allocation of the first network address for node 1, and execute S304;
  • the first message includes the identifier of the first service, it indicates that the first message is used to request allocation of a first network address for the first service on node 1, and execute S305.
  • S304 Node 2 determines whether the mapping information includes the first mapping relationship.
  • the first mapping relationship represents the mapping relationship between the identity of node 1, the first network address and the first address type.
  • the mapping information is a set of mapping relationships between the identity of the node assigned to the network address, the network address of the node, and the address type of the network address of the node.
  • the mapping information is the first mapping information in the embodiment of FIG. 3 or the set 1 in the embodiment of FIG. 4 .
  • mapping information includes the first mapping relationship
  • the first network address assigned to node 1 can be obtained according to the first mapping relationship.
  • mapping information does not include the first mapping relationship
  • S306 is executed, so that node 3 executes S307.
  • S305 Node 2 determines whether the mapping information includes the second mapping relationship.
  • the second mapping relationship represents the mapping relationship between the identity identifier of node 1, the identifier of the first service, the first network address and the first address type.
  • the mapping information is a set of mapping relationships including the identifier of the service assigned to the network address, the network address of the service, the type identifier of the network address, and the identity identifier of the node where the service is located.
  • the mapping information is the second mapping information in the embodiment of FIG. 3 or the set 2 in the embodiment of FIG. 4 .
  • mapping information includes the second mapping relationship
  • the first network address assigned to the first service can be obtained according to the second mapping relationship.
  • mapping information does not include the second mapping relationship
  • S306 is executed, so that node 3 executes S308.
  • Node 2 sends the third message to node 3.
  • node 3 receives the third message sent by node 2.
  • the third message includes the first type identifier and the identity identifier of node 1, the first type identifier indicates the first address type, and the first message does not include the identifier of any service.
  • the third message reference may be made to the description of the third message in the "First Category: First Network Address Assigned to the First Node" embodiment in S102 of Figure 3 , which will not be described again here.
  • the third message includes the first type identifier, the identity identifier of node 1 and the identifier of the first service on node 1.
  • the third message reference may be made to the description of the third message in the "Second Category: First Network Address Allocation to Service on the First Node" embodiment in S102 of Figure 3 , which will not be described again here.
  • node 2 may also send the first network address in the first message to node 3 through at least one sink node. All information related to the assignment.
  • node 3 includes multiple nodes, which means that there are multiple management nodes in the first communication domain. At this time, node 2 sends the third message to node 3, including: node 1 broadcasts the third message to node 3. information.
  • Node 3 allocates the first network address to node 1 based on the first address type and the identity of node 1.
  • node 3 after node 3 allocates the first network address to node 1, node 3 can also store the mapping relationship between the identity of node 1, the first address type and the first network address to ensure that The assigned network addresses are unique.
  • Node 3 allocates a first network address to the first service based on the first address type and the identifier of the first service.
  • node 3 may also assign the identity of the first service, the first network address, the first address type and the identity of node 1
  • the mapping relationship between identifiers is stored to ensure that the assigned network addresses are non-duplicate.
  • Node 3 sends the first network address to node 2.
  • the first network address may be carried in a message, for example, an address allocation feedback message.
  • node 2 obtains the first network address from node 3. That is to say, when node 2 does not find the above-mentioned first mapping relationship or does not find the above-mentioned second mapping relationship in the locally stored mapping information, node 2 The assigned first network address can be obtained from node 3.
  • node 2 when node 3 includes multiple nodes, before node 2 obtains the first network address from node 3, node 2 can select a target management node from the multiple nodes according to preset rules. , and obtain the first network address provided by the target management node. In addition, after node 2 obtains the first network address, node 2 may also broadcast message 2. Message 2 is used to indicate that node 2 has selected the first network address provided by the target management node. In this way, the target management node that receives message 2 can also send a confirmation message to node 2 to indicate that the first network address selected by node 2 can be used, and other unselected management nodes that receive message 2 can know the network address provided by itself. is not selected by node 2, so that the provided network address can be recycled and the waste of the address can be avoided.
  • the preset rules include but are not limited to the priority exceeding the preset level, the signal strength exceeding the preset threshold, the node corresponding to the earliest received address allocation feedback message, etc.
  • node 3 sending the first network address to node 2 may be: node 3 sends the first network address to node 2 through at least one sink node. website address.
  • Node 2 sends the second message to node 1.
  • the second message includes a first network address, and the first network address is assigned to node 1 .
  • the second message includes a first network address, where the first network address is assigned to the first service on node 1 .
  • the first network address may be obtained by node 2 from local mapping information, or the first network address may be obtained by node 2 from node 3, which is not specifically limited here.
  • Node 1 obtains the first network address according to the second message.
  • the node 1 that applies for the address can determine to discover and access a node 2 with address allocation service, and only receive the allocated first network address from the node 2, which is beneficial to improving the efficiency of the network address. Allocation efficiency can realize the allocation of network addresses in a tree-like multi-hop topology scenario.
  • node 1 can also apply for a desired address type and a network address for a specific object (for example, a node or a service on a node), enriching the application scenarios of address allocation.
  • Figure 6 is a flow chart of yet another address allocation method provided by an embodiment of the present application.
  • the method is applied to a communication system, which includes at least node 1, node 2 and node 3, where node 1 is the node that applies for an address, node 2 is the access point of node 1, and node 3 is the management node.
  • Figure 6 provides a method of allocating a local IPv6 address to a node when the first address type is an IP address. The method includes but is not limited to the following steps:
  • Node 1 selects access node 2 based on the broadcast message sent by node 2. For details of this step, please refer to the relevant description of S301 in the embodiment of FIG. 5 and will not be described again here.
  • Node 1 sends the first message to node 2.
  • the first message includes the identity identifier of node 1 and the first type identifier.
  • the first type identifier indicates the first address type, and the identity identifier of node 1 is used to identify node 1.
  • the first address type is an IP address.
  • Node 2 determines whether the second network address history of the address type used by node 1 in the first communication domain is a communication domain address.
  • S404 and S408 are executed; if node 2 determines that the second network address history has not been allocated, S405-S408 are executed in sequence.
  • node 2 can determine that the address type used by node 1 in the first communication domain is the second network address history of the communication domain address based on locally maintained address allocation information (for example, the first mapping information in the embodiment of Figure 3). Whether it has been assigned. Specifically, when node 2 finds the network address corresponding to the identity of node 1 in the mapping information and the address type of the network address is a communication domain address, it means that the second network address history has been allocated; node 2 does not find it in the mapping information. to the network address corresponding to the identity of node 1, or when node 2 finds the network address corresponding to the identity of node 1 in the mapping information but the address type of the network address is not a communication domain address, it means that the second network address history has not been distribute.
  • locally maintained address allocation information for example, the first mapping information in the embodiment of Figure 3
  • Node 2 obtains the historically allocated second network address, and obtains the first network address based on the second network address and the IPv6 prefix of the first communication domain.
  • the first network address may be assigned directly by node 2.
  • the type of the second network address is a communication domain address.
  • the second network address may be obtained by node 2 from the mapping information.
  • the second network address is the network address corresponding to the mapping relationship between the identity identifier of node 1 and the communication domain address type in the mapping information.
  • the length of the second network address can be 8 bits, 16 bits, 24 bits or other digits, which is not specifically limited here.
  • obtaining the first network address based on the second network address and the IPv6 prefix of the first communication domain includes: embedding the second network address after the IPv6 prefix of the first communication domain to generate the first network address.
  • the second network address of the communication domain address type that has been historically allocated to node 1 is used as the interface identifier of node 1, which is used to construct the local IPv6 address of node 1. This not only saves the consumption of the number of addresses, but also determines the number of addresses allocated to it.
  • the first network address of node 1 is unique.
  • node 2 sends a third message to node 3 to request node 3 to allocate a first network address to node 1 based on the third message, where the third message includes the above-mentioned first type identifier. and the identity of node 1.
  • the third message includes the above-mentioned first type identifier. and the identity of node 1.
  • node 3 receives the third message sent by node 2.
  • node 2 when there is at least one sink node between node 2 and node 3, in this case, node 2 can also send the first message in the first message to node 3 through at least one sink node. All information related to the allocation of network addresses.
  • Node 3 allocates a second network address to node 1, and obtains the first network address based on the second network address and the IPv6 prefix of the first communication domain.
  • Node 3 sends the first network address to node 2.
  • the first network address can be carried in a message.
  • node 2 obtains the first network address from node 3.
  • node 3 sending the first network address to node 2 may be: node 3 sends the first network address to node 2 through at least one sink node. website address.
  • Node 2 sends the second message to node 1.
  • node 1 receives the second message sent by node 2.
  • the second message includes the first network address assigned to node 1 .
  • Node 1 obtains the first network address according to the second message.
  • the node 1 that applies for the address can determine to discover and access a node 2 with address allocation service, and only receive the allocated first network address from the node 2, which is beneficial to improving the efficiency of the network address. Allocation efficiency, supporting the allocation of local IPv6 addresses to nodes through a multi-hop mechanism.
  • node 1 can also apply for a specific type of network address, enriching the application scenarios of address allocation.
  • FIG. 7 is a schematic structural diagram of an address allocation device provided by an embodiment of the present application.
  • the address allocation device 30 includes a receiving unit 310 and a sending unit 312 .
  • the device 30 can be implemented by hardware, software, or a combination of software and hardware.
  • the receiving unit 310 is used to receive the first message sent by the first node, the first message includes a first type identifier, and the first type identifier indicates the first address type; the sending unit 312 is used to send the second message to the first node.
  • the second message includes a first network address allocated for the first node or for a service on the first node, and the address type of the first network address is the first address type.
  • the address allocation device 30 further includes a processing unit (not shown), and the processing unit is configured to obtain the first network address according to the first address type.
  • the address allocation device 30 may be used to implement the method on the second node side described in the embodiment of FIG. 3 .
  • the receiving unit 310 can be used to perform S101
  • the sending unit 312 can be used to perform S103.
  • the processing unit may be used to perform S102 in the embodiment of FIG. 3 .
  • the address allocation device 30 can also be used to implement the method on the node 2 side described in the embodiments of FIG. 4, FIG. 5 and FIG. 6. For the sake of simplicity of the description, details will not be described again here.
  • One or more of the various units in the embodiment shown in FIG. 7 above may be implemented in software, hardware, firmware, or a combination thereof.
  • the software or firmware includes, but is not limited to, computer program instructions or code, and may be executed by a hardware processor.
  • the hardware includes but is not limited to various types of integrated circuits, such as central processing unit (CPU), digital signal processor (DSP), field-programmable gate array (FPGA) Or application-specific integrated circuit (ASIC).
  • FIG. 8 is a schematic structural diagram of an address acquisition device provided by an embodiment of the present application.
  • the address acquisition device 40 includes a sending unit 410 , an acquisition unit 412 and a receiving unit 414 .
  • the address acquisition device 40 can be implemented by hardware, software, or a combination of software and hardware.
  • the sending unit 410 is used to send a first message to the second node, the first message includes a first type identifier, and the first type identifier indicates the first address type; the receiving unit 414 is used to receive the second message sent by the second node.
  • the second message includes a first network address allocated for the first node or for a service on the first node, and the address type of the first network address is the first address type; the obtaining unit 412 is configured to obtain, according to the second message, First network address.
  • the address acquisition device 40 can be used to implement the method on the first node side described in the embodiment of FIG. 3 .
  • the sending unit 410 can be used to perform S101
  • the receiving unit 414 can be used to perform S103
  • the obtaining unit 412 can be used to perform S104.
  • the address acquisition device 40 can also be used to implement the method on the node 1 side described in the embodiments of Figures 4, 5 and 6. For the sake of brevity of the description, details will not be described again here.
  • the software or firmware includes, but is not limited to, computer program instructions or code, and may be executed by a hardware processor.
  • the hardware includes but is not limited to various types of integrated circuits, such as central processing unit (CPU), digital signal processor (DSP), field-programmable gate array (FPGA) Or application-specific integrated circuit (ASIC).
  • Figure 9 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the communication device 50 includes: a processor 501 , a communication interface 502 , a memory 503 and a bus 504 .
  • the processor 501, the memory 503 and the communication interface 502 communicate through the bus 504.
  • the communication device 50 may be the first node that submits the address application in the above embodiment.
  • the first node may be, for example, a user terminal in the vehicle in a vehicle communication scenario.
  • the user terminal may be, for example, a mobile phone, a tablet computer, or a handheld computer. , desktop computers, headsets, speakers, wearable devices, vehicle-mounted devices, virtual reality devices, augmented reality devices, etc.
  • the first node may also be a home device in a smart home scenario, such as a television, a sweeping robot, a printer, a projector, a user's mobile phone, a rice cooker, a stereo, a microphone, a wireless router, etc.
  • the first node may also be a BMU in a battery management system BMS scenario.
  • the first node may also be a component in the above-mentioned user terminal or a component in a home device, where the component may be, for example, a single board, a line card, or a chip.
  • the communication device 50 may be the second node with the address allocation function in the above embodiment.
  • the second node may be, for example, a T-BOX in a vehicle communication scenario or a component within the T-BOX, such as a single board. , line card or chip.
  • the second node may also be a gateway, user terminal equipment CPE, wireless router, user mobile phone, etc. in a smart home scenario.
  • the second node may also be a BCU or BMU in a battery management system BMS scenario, which is not specifically limited here.
  • the bus 504 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one line is used in Figure 8, but it does not mean that there is only one bus or one type of bus.
  • Bus 504 may include a path for transferring information between various components of communication device 50 (eg, memory 503, processor 501, communication interface 502).
  • the processor 501 may include any one or more of a central processing unit (CPU), a microprocessor (MP), or a digital signal processor (DSP).
  • CPU central processing unit
  • MP microprocessor
  • DSP digital signal processor
  • the memory 503 is used to provide storage space, and data such as operating systems and computer programs can be stored in the storage space.
  • the memory 503 may be a random access memory (RAM), an erasable programmable read only memory (EPROM), a read-only memory (ROM), or a portable read-only memory.
  • RAM random access memory
  • EPROM erasable programmable read only memory
  • ROM read-only memory
  • portable read-only memory One or a combination of multiple types of memory (compact disc read memory, CD-ROM), etc.
  • the memory 503 can exist alone or be integrated inside the processor 501 .
  • Communication interface 502 may be used to provide information input or output to processor 501. Or alternatively, the communication interface 502 can be used to receive data sent from the outside and/or send data to the outside. It can be a wired link interface such as an Ethernet cable, or a wireless link (such as Wi-Fi, Bluetooth, general wireless transmission, etc.) interface. Or alternatively, the communication interface 502 may also include a transmitter (such as a radio frequency transmitter, an antenna, etc.), or a receiver coupled to the interface.
  • a transmitter such as a radio frequency transmitter, an antenna, etc.
  • the processor 501 in the communication device 50 is used to read the computer program stored in the memory 503, and is used to execute the aforementioned method, such as the method described in Figure 3, Figure 4, Figure 5 or Figure 6.
  • the communication device 50 may be one or more modules in the execution body that executes the method on the first node side shown in FIG. 3 , and the processor 501 may be used to read a file stored in the memory. or computer programs that perform the following operations:
  • the first network address is obtained.
  • the communication device 50 may be one or more modules in the execution body that executes the method on the second node side shown in FIG. 3 , and the processor 501 may be used to read a file stored in the memory. or computer programs that perform the following operations:
  • the second message is sent to the first node through the sending unit 312.
  • the second message includes a first network address allocated for the first node or for a service on the first node, and the address type of the first network address is the first address type.
  • the embodiment of the present application also provides a communication system.
  • the communication system includes a first device and a second device.
  • the first device may be, for example, the address acquisition device 40 shown in FIG. 8 or the above-mentioned third device as shown in FIG. 9 .
  • the communication device 50 of a node and the second device may be, for example, the address allocation device 30 shown in FIG. 7 or the communication device 50 of the second node shown in FIG. 9 .
  • the first device may be used to perform the first node-side method shown in the embodiment of FIG. 3, and the second device may be used to perform the second node-side method shown in the embodiment of FIG. 3, for example.
  • the communication system can also be used to perform the method shown in Figure 4, Figure 5 or Figure 6 above.
  • storage media include read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), programmable read-only memory (Programmable Read-only Memory, PROM), erasable programmable read-only memory ( Erasable Programmable Read Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM) or other optical disk storage, magnetic disk storage, tape storage, or any other computer-readable medium that can be used to carry or store data.
  • Read-Only Memory Read-Only Memory
  • RAM Random Access Memory
  • PROM Programmable Read-only Memory
  • PROM Programmable Read-only Memory
  • EPROM Erasable Programmable Read Only Memory
  • OTPROM One-time Programmable Read-Only Memory
  • EEPROM Electronically Erasable Programmable Read-Only Memory
  • CD-ROM Compact Disc Read-Only Memory
  • the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product.
  • the computer program product is stored in a storage medium and includes a number of instructions. So that a device (which can be a personal computer, a server, or a network device, a robot, a microcontroller, a chip, a robot, etc.) executes all or part of the steps of the method described in various embodiments of the application.

Abstract

涉及一种地址分配方法,该方法包括:接收提出地址申请的节点发送的第一消息,第一消息包括第一类型标识,第一类型标识指示第一地址类型;向该节点发送第二消息,第二消息包括为该第一节点或者为该节点上的服务分配的第一网络地址,第一网络地址的地址类型为第一地址类型。实施本申请,能够实现指定的地址类型的网络地址的分配,以及提高网络地址的分配效率。

Description

一种地址分配方法及装置 技术领域
本申请涉及无线通信领域,尤其涉及一种地址分配方法及装置。
背景技术
无线通信广泛应用于智能汽车、智能家居、智能终端、智能制造等场景,相较于有线通信,能有效降低线束长度、减轻线束重量、减少连接器的数量。
一般地,常采用动态主机配置协议(Dynamic Host Configuration Protocol,DHCP)为网络中的节点动态分配用于通信的网际协议IP地址,其中,用于分配IP地址的节点称作DHCP服务器,需要获取IP地址的节点称作DHCP客户端。
采用DHCP地址分配方式,DHCP客户端从多个DHCP服务器提供的网络地址中选择了一个网络地址后,多个DHCP服务器还要确认自身是否为被选中的DHCP服务器,且被选中的DHCP服务器还要发送确认消息以指示该DHCP客户端可以使用该网络地址,地址分配的交互流程繁琐、耗时,降低了网络地址的分配效率。
发明内容
本申请公开了一种地址分配方法及装置,能够实现指定的地址类型的网络地址的分配,以及提高网络地址的分配效率。
第一方面,本申请提供了一种地址分配方法,该方法包括:接收第一节点发送的第一消息,所述第一消息包括第一类型标识,所述第一类型标识指示第一地址类型;向所述第一节点发送第二消息,所述第二消息包括为所述第一节点或者为所述第一节点上的服务分配的第一网络地址,所述第一网络地址的地址类型为所述第一地址类型。
该方法可以应用于车载通信、智能家居、电池管理系统(battery management system,BMS)等场景中。其中,在车载通信场景中,第一节点例如可以是车内的用户终端或者用户终端内的组件(例如,单板、线卡或者芯片),用户终端例如可以是手机、平板电脑、掌上电脑、台式机、耳机、音响、穿戴设备、车载设备、虚拟现实设备、增强现实设备等,第二节点例如可以是远程通信箱(Telematics BOX,T-Box)。在智能家居场景中,第一节点例如可以是家居设备或者家居设备中的组件,家居设备例如可以是电视、扫地机器人、打印机、投影仪、用户手机、电饭煲、音响、麦克风、无线路由器等,第二节点例如可以是网关、客户终端设备(customer premises equipment,CPE)、无线路由器、用户手机等。在BMS场景中,第一节点例如可以是电池监控单元(battery monitoring unit,BMU),第二节点例如可以是电池控制单元(battery control unit,BCU)或BMU。
上述方法中,基于第一消息携带的指示第一地址类型的第一类型标识,实现为第一节点或者第一节点上的服务提供指定地址类型的网络地址,地址分配的交互流程简单,提高了网络地址的分配效率。
可选地,该方法应用于第二节点,所述第一节点和所述第二节点属于第一通信域。
示例性地,所述接收第一节点发送的第一消息之前,该方法还包括:接收所述第一节点发送的接入请求;根据所述接入请求,接入所述第一节点。
可选地,所述第一地址类型为通信域地址或IP地址。
其中,第一地址类型为期望分配到的第一网络地址所属的地址类型。当第一地址类型为通信域地址时,第一网络地址是一种网络层短地址,其长度可以是2个字节(即16比特),可以用于在相应的通信系统寻址。例如,对于星闪通信技术,通信域地址可以用于在星闪通信系统内寻址。可以理解,通信域地址是区别于IP地址的另一种地址类型。
一种实现方式中,在第一地址类型为通信域地址时,第一网络地址的长度也可以是8比特bit、24比特或其他比特数,在此不作具体限定。
实施上述实现方式,基于第一地址类型,可以知晓待分配的网络地址的地址类型。
可选地,所述方法还包括:根据所述第一地址类型,获得所述第一网络地址。
实施上述实现方式,通过第一地址类型,实现第一网络地址的准确分配。
可选地,所述第一消息还包括所述第一节点的身份标识,所述根据所述第一地址类型,获得所述第一网络地址,包括:
根据第一映射关系,获得所述第一网络地址,所述第一映射关系表征所述第一节点的身份标识、所述第一网络地址与所述第一地址类型之间的映射关系,其中,所述第一映射关系属于包括分配到网络地址的节点的身份标识、节点的网络地址和节点的网络地址的地址类型之间的映射关系的集合。
其中,第一节点的身份标识用于标识第一节点。例如,第一节点的身份标识可以是层二标识(Layer 2 Identification,L2ID)。
实施上述实现方式,基于第一映射关系获取第一网络地址,其说明历史已为第一节点分配过同种类型的网络地址,将该网络地址作为分配给第一节点的第一网络地址,不仅可以避免网络地址的浪费,还可以避免地址冲突的发生。
可选地,所述第一消息还包括所述第一节点的身份标识和所述第一节点上的第一服务的标识,所述根据所述第一地址类型,获得所述第一网络地址,包括:
根据第二映射关系,获得所述第一网络地址,所述第二映射关系表征所述第一节点的身份标识、所述第一服务的标识、所述第一网络地址与所述第一地址类型之间的映射关系,其中,所述第二映射关系属于包括分配到网络地址的服务的标识、服务的网络地址、服务的网络地址的地址类型和服务所在的节点的身份标识之间的映射关系的集合。
实施上述实现方式,基于第二映射关系获取第一网络地址,其说明历史已为第一节点上的第一服务分配过同种类型的网络地址,将该网络地址作为分配给第一服务的第一网络地址,不仅可以避免网络地址的浪费,还可以避免地址冲突的发生。
可选地,所述根据所述第一地址类型,获得所述第一网络地址,包括:根据所述第一地址类型,分配所述第一网络地址。
这里,第二节点为第一通信域内的管理节点。
也就是说第二节点可以直接为第一节点或第一节点上的第一服务分配第一网络地址。而传统DHCP这种地址分配方式中,节点从多个DHCP服务器提供的网络地址中选择了一个网络地址后,多个DHCP服务器还要确认自身是否为被选中的DHCP服务器,且被选中的DHCP服务器还要发送确认消息以指示该节点可以使用该地址,交互流程繁琐、耗时。相较于传统 DHCP地址分配方式,由第二节点直接分配第一网络地址,省略了DHCP确认阶段的信令交互流程,从而缩短了地址分配的交互流程,提高了地址的分配效率。
可选地,所述第一消息还包括所述第一节点上的第一服务的标识,根据所述第一地址类型,获得所述第一网络地址,包括:根据所述第一地址类型和所述第一服务的标识,获得为所述第一服务分配的所述第一网络地址。
实施上述实现方式,实现为第一节点上的第一服务分配第一网络地址。
可选地,所述第一地址类型为IP地址时,所述方法还包括:向动态主机配置协议DHCP服务器发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项;接收所述DHCP服务器发送的第四消息,所述第四消息包括所述第一网络地址,所述第一网络地址为所述DHCP服务器基于所述第三消息分配的。
另一种实现方式中,第二节点也可以向多个DHCP服务器发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项;接收多个DHCP服务器发送的第四消息,DHCP服务器对应的第四消息包括该DHCP服务器基于所述第三消息分配的第一网络地址;根据所述多个DHCP服务器中的目标DHCP服务器发送的第四消息,获得第一网络地址。在此情况下,相较于传统DHCP地址分配方式,将客户端执行地址选择以及接收来自DHCP服务器的确认消息的工作卸载到了第二节点,如此可以减轻第一节点的负担,使得第一节点上的协议栈轻量化,降低第一节点的功耗。其中,目标DHCP服务器可以是最大信号强度对应的DHCP服务器,也可以是第二节点最早接收到的第四消息对应的DHCP服务器,也可以是最高优先级对应的DHCP服务器,还可以是第二节点基于检测到的信号强度、DHCP服务器的优先级信息和第三消息对应的接收时刻中的多项因素确定的,在此不作具体限定。
一种实现方式中,上述第三消息包括第一消息中与第一网络地址的分配相关的全部信息。
例如,第二节点接收到的第一消息包括第一类型标识和第一节点的身份标识,则第三消息也包括第一类型标识和第一节点的身份标识,在此情况下,第一网络地址为DHCP服务器基于第三消息分配给第一节点。
又例如,第二节点接收到的第一消息包括第一类型标识、第一节点的身份标识和第一服务的标识,则第三消息也包括第一类型标识、第一节点的身份标识和第一服务的标识,在此情况下,第一网络地址为DHCP服务器基于第三消息分配给第一节点上的第一服务。
进一步地,第二节点接收到的第一消息还包括其他与地址分配相关的信息时,第三消息也还包括相同的其他与地址分配相关的信息。例如,其他与地址分配相关的信息还包括下述单播地址标识信息、组播地址标识信息、任播地址标识信息或数量标识信息中的至少一项,各信息具体可参考下述相应信息的相关叙述,在此不再赘述。
可以理解,上述第二节点向DHCP服务器发送第三消息,第二节点可以看作是转发节点,但第二节点不是直接转发或者透传第一消息,而是通过发送第三消息实现第一消息中与第一网络地址的分配相关的信息的发送。
实施上述实现方式,在第二节点为通信域内的管理节点但第二节点不具有DHCP功能的情况下,第二节点还可以通过第三消息请求DHCP服务器为第一节点或第一节点上的第一服务分配第一网络地址,丰富了地址分配的应用场景。
可选地,所述方法还包括:向第三节点发送第三消息,所述第三消息包括所述第一类型的标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项,所述第三节点为所述第一通信域内的管理节点;接收所述第三节点发送的第五消息,所述第五消息包括所述第一网络地址,所述第一网络地址为所述第三节点基于所述第三消息分配的。
其中,第三消息具体可参考上述第三消息的相关描述,在此不再赘述。
实施上述实现方式,第二节点还可以通过第三消息请求通信域内的管理节点为第一节点或第一节点上的第一服务分配第一网络地址,丰富了地址分配的应用场景。
可选地,所述第一通信域内包括多个管理节点,所述方法还包括:向所述多个管理节点发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项;接收所述多个管理节点发送的第六消息,管理节点对应的第六消息包括所述管理节点基于所述第三消息分配的网络地址;根据所述多个管理节点中的目标管理节点发送的第六消息,获得所述第一网络地址。
其中,第三消息具体可参考上述第三消息的相关描述,在此不再赘述。
示例性地,目标管理节点可以是最高优先级对应的管理节点,也可以是最大信号强度对应的管理节点,也可以是最早接收到的第六消息对应的管理节点,还可以是第二节点基于管理节点的优先级信息、检测到的信号强度、第六消息的接收时刻中的多项因素确定的,在此不作具体限定。
实施上述实现方式,第二节点可以通过第三消息向通信域内的多个管理节点请求分配第一网络地址,并从中选择一个管理节点提供的第一网络地址,丰富了地址分配的应用场景。
可选地,所述第一地址类型为IP地址,所述方法还包括:获取历史分配的第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址;根据所述第一通信域的IPv6前缀和所述第二网络地址,获得所述第一网络地址。
实施上述实现方式,将历史为第一节点分配的类型为通信域地址的第二网络地址作为第一节点的接口标识,其用于构建第一节点的本地IPv6地址,不仅可以节省地址数量的消耗,还可以确定分配给节点1的第一网络地址是不重复的。
可选地,所述第一地址类型为IP地址,所述方法还包括:为所述第一节点分配第二网络地址,所述第二网络地址的地址类型为通信域地址;根据所述第一通信域的IPv6前缀和所述第二网络地址,获得所述第一网络地址。
实施上述实现方式,第二节点可以直接为第一节点分配本地IPv6地址,丰富了地址分配的应用场景。
可选地,所述第一地址类型为IP地址,所述方法还包括:向第四节点发送第三消息,所述第三消息包括所述第一类型标识和所述第一节点的身份标识,所述第四节点为所述第一通信域内的管理节点;接收所述第四节点发送的第七消息,所述第七消息包括所述第四节点基于所述第三消息分配的所述第一网络地址,所述第一网络地址包括所述第一通信域的IPv6前缀和第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址。
一种实现方式中,第三消息包括第一消息中与第一网络地址的分配相关的全部信息。
例如,第二节点接收到的第一消息除了包括第一类型标识和第一节点的身份标识外,第 一消息还包括其他与第一网络地址的分配相关的信息,例如,单播地址标识信息、组播地址标识信息或数量标识信息中的一项或多项,在此情况下,第三消息除了包括第一类型标识和第一节点的身份标识外,第三消息还包括相同的其他与第一网络地址的分配相关的信息。有关播地址标识信息、组播地址标识信息、数量标识信息的描述具体可参考下述相应信息的叙述,在此不作具体限定。
实施上述实现方式,第二节点可以通过第三消息请求通信域内的管理节点为第一节点分配本地IPv6地址,丰富了地址分配的应用场景。
可选地,所述第一消息还包括下述信息中的至少一项:
单播地址标识信息,用于指示所述第一网络地址为单播地址;
组播地址标识信息,用于指示所述第一网络地址为组播地址;
任播地址标识信息,用于指示所述第一网络地址为任播地址;或
数量标识信息,用于指示所述第一网络地址的申请数量。
单播地址标识信息是第一消息中的一种可选信息。单播地址标识信息可以通过标志位、字段或者比特位表示,以标志位为例,当相应的标志位置位时,指示第一网络地址为单播地址。通过单播地址标识信息,第二节点可以知晓第一节点请求分配给第一节点上的第一服务或者第一节点的第一网络地址用于单播。
组播地址标识信息是第一消息中的一种可选信息。组播地址标识信息可以通过标志位、字段、或者比特位表示。通过组播地址标识信息,第二节点可以知晓第一节点请求分配给第一节点上的第一服务或者分配给第一节点的第一网络地址用于组播。
这里,单播地址标识信息和组播地址标识信息可以如上述分开单独表示,也可以通过一个标志位表示,例如,当该标志位取第一值时,表示第一网络地址用于单播;当该标志位取第二值时,表示第一网络地址用于组播。
任播地址标识信息是第一消息中的一种可选信息。通过任播地址标识信息,第二节点可以知晓第一节点请求分配给第一节点上的第一服务的第一网络地址用于任播。
其中,若第一网络地址是分配给第一节点,则第一网络地址可以是单播地址或组播地址;若第一网络地址是分配给第一节点上的第一服务,则第一网络地址可以是单播地址或者组播地址或者任播地址(anycast address)。
示例性地,上述单播地址标识信息、组播地址标识信息和任播地址标识信息可以分开单独表示,也可以共同通过一个字段或标志位等方式表示,在此不作具体限定。
数量标识信息为第一消息中的一种可选信息。其中,数量标识信息与第一消息中第一服务的标识的数量对应,具体地,第一网络地址的申请数量与第一服务的标识的数量相同。例如,第一消息包括的第一服务的标识有:AID1、AID2和AID3,意味着第一消息用于申请为AID1、AID2和AID3这三个服务中的每个服务分别分配一个第一网络地址,即第一消息中第一服务的标识的数量为3,则数量标识信息指示的第一网络地址的申请数量也为3。由此可以看出,在第一消息中第一服务的标识的数量为多个的情况下,第一消息还包括数量标识信息。通过数量标识信息,可实现为第一节点上的多个服务分配相应的网络地址。
当第一消息中第一服务的标识的数量为多个的情况下,每个第一服务的标识也可以有对应的单播地址标识信息或组播地址标识信息或任播地址标识信息。在一些可能的实施例中,当多个第一服务的标识对应的第一网络地址均用于单播或者组播或者任播时,也可以通过一 个标志位表示。
可选地,所述方法还包括:接收所述第一节点发送的第八消息,所述第八消息包括第二类型标识,所述第二类型标识指示第二地址类型,所述第二地址类型与所述第一地址类型不同;向所述第一节点发送第九消息,所述第九消息包括为所述第一节点或者为所述第一节点上的服务分配的第三网络地址,所述第三网络地址的地址类型为所述第二地址类型。
实施上述实现方式,可以实现为第一节点或者第一节点上的服务分配不同地址类型的网络地址。
第二方面,本申请提供了一种地址分配方法,应用于第一节点,该方法包括:向第二节点发送第一消息,所述第一消息包括第一类型标识,所述第一类型标识指示第一地址类型;接收所述第二节点发送的第二消息,所述第二消息包括为所述第一节点或者所述第一节点上的服务分配的第一网络地址,所述第一网络地址的地址类型为所述第一地址类型;根据所述第二消息,获得所述第一网络地址。
该方法可以应用于车载通信、智能家居、电池管理系统(battery management system,BMS)等场景中。其中,在车载通信场景中,第一节点例如可以是车内的用户终端或者用户终端内的组件(例如,单板、线卡或者芯片),用户终端例如可以是手机、平板电脑、掌上电脑、台式机、耳机、音响、穿戴设备、车载设备、虚拟现实设备、增强现实设备等,第二节点例如可以是远程通信箱(Telematics BOX,T-Box)。在智能家居场景中,第一节点例如可以是家居设备或者家居设备中的组件,家居设备例如可以是电视、扫地机器人、打印机、投影仪、用户手机、电饭煲、音响、麦克风、无线路由器等,第二节点例如可以是网关、客户终端设备(customer premises equipment,CPE)、无线路由器、用户手机等。在BMS场景中,第一节点例如可以是电池监控单元(battery monitoring unit,BMU),第二节点例如可以是电池控制单元(battery control unit,BCU)或BMU。
实施上述实现方式,通过第一消息携带的第一类型标识来指定地址类型,并只从自身接入的第二节点处获取为第一节点或者第一节点上的服务分配的指定地址类型的网络地址,地址分配的交互流程简单,有利于提高网络地址的分配效率。
可选地,所述第一节点和所述第二节点属于第一通信域。
示例性地,所述向第二节点发送第一消息之前,所述方法还包括:接收所述第二节点发送的广播消息,所述广播消息包括服务标识,所述服务标识指示所述第二节点提供地址分配服务;向所述第二节点发送接入请求,以请求接入所述第二节点。
另一种实现方式中,在向第二节点发送第一消息之前,可以执行:接收至少一个节点发送的广播消息,节点对应的广播消息包括该节点对应的服务标识,节点对应的服务标识用于指示该节点提供地址分配服务;根据上述至少一个节点发送的广播消息,从上述至少一个节点中选择第二节点作为第一节点的接入点;向第二节点发送接入请求,以请求接入第二节点。
进一步地,第二节点可以是最大信号强度对应的节点,可以是最高优先级对应的节点,也可以是第一节点最先接收到的广播消息对应的节点,还可以是第一节点基于检测到的信号强度和第一节点接收到广播消息的时刻中的多项因素从上述至少一个节点中确定的,在此不作具体限定。
实施上述实现方式,第一节点可以及时发现具有地址分配功能的节点,并且确定自己唯一接入的一个节点,实现只从该节点处获取分配的指定地址类型的网络地址。
可选地,所述第一地址类型为通信域地址或IP地址。
有关第一地址类型的叙述具体可参考第一方面中第一地址类型的相关叙述,在此不再赘述。
可选地,所述第一地址类型为IP地址,所述第一网络地址为所述第一节点在本地使用的IPv6地址,所述第一网络地址包括所述第一通信域的IPv6前缀和第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址。
实施上述实现方式,实现为第一节点分配本地IPv6地址,将第一节点在第一通信域内使用的地址类型为通信域地址的网络地址作为第一节点的接口标识,其用于构建第一节点的本地IPv6地址,可以节省地址数量的消耗。
可选地,所述第一消息还包括所述第一节点上的第一服务的标识,所述第一网络地址分配给所述第一服务。
实施上述实现方式,可以实现为第一节点上的服务申请指定地址类型的网络地址,丰富了地址分配的应用场景。
可选地,所述第一消息还包括下述信息中的至少一项:
所述第一节点的身份标识;
单播地址标识信息,用于指示所述第一网络地址为单播地址;
组播地址标识信息,用于指示所述第一网络地址为组播地址;
任播地址标识信息,用于指示所述第一网络地址为任播地址;或
数量标识信息,用于指示所述第一网络地址的申请数量。
第一节点的身份标识用于标识第一节点。例如,第一节点的身份标识可以是层二标识(Layer 2 Identification,L2ID)。有关第一消息中各个信息的说明具体可参考第一方面中对第一消息中相应信息的相关叙述,在此不再赘述。
可选地,所述方法还包括:向所述第二节点发送第三消息,所述第三消息包括第二类型标识,所述第二类型标识指示第二地址类型,所述第二地址类型与所述第一地址类型不同;接收所述第二节点发送的第四消息,所述第四消息包括为所述第一节点或者为所述第一节点上的服务分配的第三网络地址,所述第三网络地址的地址类型为所述第二地址类型;根据所述第四消息,获得所述第三网络地址。
实施上述实现方式,第一节点可以实现网络地址的地址类型的变更,使得第一节点可以灵活地获取不同地址类型的网络地址。
第三方面,本申请提供了一种地址分配装置,该装置包括:接收单元,用于接收第一节点发送的第一消息,所述第一消息包括第一类型标识,所述第一类型标识指示第一地址类型;发送单元,用于向所述第一节点发送第二消息,所述第二消息包括为所述第一节点或者为所述第一节点上的服务分配的第一网络地址,所述第一网络地址的地址类型为所述第一地址类型。
可选地,所述装置与所述第一节点属于第一通信域。
一种实现方式中,接收单元还用于接收所述第一节点发送的接入请求;该装置还包括处理单元,用于根据所述接入请求,接入所述第一节点。
可选地,所述第一地址类型为通信域地址或IP地址。
可选地,所述处理单元,还用于:根据第一地址类型,获得所述第一网络地址。
可选地,所述第一消息还包括所述第一节点的身份标识,所述处理单元,具体用于:根据第一映射关系,获得所述第一网络地址,所述第一映射关系表征所述第一节点的身份标识、所述第一网络地址与所述第一地址类型之间的映射关系,其中,所述第一映射关系属于包括分配到网络地址的节点的身份标识、节点的网络地址和节点的网络地址的地址类型之间的映射关系的集合。
可选地,所述第一消息还包括所述第一节点的身份标识和所述第一节点上的第一服务的标识,所述处理单元,具体用于:根据第二映射关系,获得所述第一网络地址,所述第二映射关系表征所述第一节点的身份标识、所述第一服务的标识、所述第一网络地址与所述第一地址类型之间的映射关系,其中,所述第二映射关系属于包括分配到网络地址的服务的标识、服务的网络地址、服务的网络地址的地址类型和服务所在的节点的身份标识之间的映射关系的集合。
可选地,所述处理单元,具体用于:根据所述第一地址类型,分配所述第一网络地址。
可选地,所述第一消息还包括所述第一节点上的第一服务的标识,所述处理单元,具体用于:根据所述第一地址类型和所述第一服务的标识,获得为所述第一服务分配的所述第一网络地址。
可选地,所述第一地址类型为IP地址,发送单元,还用于向动态主机配置协议DHCP服务器发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项;接收单元,还用于接收所述DHCP服务器发送的第四消息,所述第四消息包括所述第一网络地址,所述第一网络地址为所述DHCP服务器基于所述第三消息分配的。
可选地,发送单元还用于向第三节点发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项,所述第三节点为所述第一通信域内的管理节点;接收单元,还用于接收所述第三节点发送的第五消息,所述第五消息包括所述第一网络地址,所述第一网络地址为所述第三节点基于所述第三消息分配的。
可选地,所述第一通信域内包括多个管理节点,发送单元,还用于向所述多个管理节点发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项;接收单元,还用于接收所述多个管理节点发送的第六消息,管理节点对应的第六消息包括所述管理节点基于所述第三消息分配的网络地址;处理单元还用于:根据所述多个管理节点中的目标管理节点发送的第六消息,获得所述第一网络地址。
可选地,所述第一地址类型为IP地址,处理单元,还用于:获取历史分配的第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址;根据所述第一通信域的IPv6前缀和所述第二网络地址,获得所述第一网络地址。
可选地,所述第一地址类型为IP地址,处理单元,还用于:为所述第一节点分配第二网络地址,所述第二网络地址的地址类型为通信域地址;根据所述第一通信域的IPv6前缀和所述第二网络地址,获得所述第一网络地址。
可选地,所述第一地址类型为IP地址,发送单元,还用于向第四节点发送第三消息,所述第三消息包括所述第一类型标识和所述第一节点的身份标识,所述第四节点为所述第一通 信域内的管理节点;接收单元,还用于接收所述第四节点发送的第七消息,所述第七消息包括所述第四节点基于所述第三消息分配的所述第一网络地址,所述第一网络地址包括所述第一通信域的IPv6前缀和第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址。
可选地,所述第一消息还包括下述信息中的至少一项:
单播地址标识信息,用于指示所述第一网络地址为单播地址;
组播地址标识信息,用于指示所述第一网络地址为组播地址;
任播地址标识信息,用于指示所述第一网络地址为任播地址;或
数量标识信息,用于指示所述第一网络地址的申请数量。
可选地,接收单元,还用于接收所述第一节点发送的第八消息,所述第八消息包括第二类型标识,所述第二类型标识指示第二地址类型,所述第二地址类型与所述第一地址类型不同;发送单元,还用于向所述第一节点发送第九消息,所述第九消息包括为所述第一节点或者为所述第一节点上的服务分配的第三网络地址,所述第三网络地址的地址类型为所述第二地址类型。
第四方面,本申请提供了一种地址获取装置,该装置包括:发送单元,用于向第二节点发送第一消息,所述第一消息包括第一类型标识,所述第一类型标识指示第一地址类型;接收单元,用于接收所述第二节点发送的第二消息,所述第二消息包括为所述第一节点或者所述第一节点上的服务分配的第一网络地址,所述第一网络地址的地址类型为所述第一地址类型;获取单元,用于根据所述第二消息,获得所述第一网络地址。
可选地,所述第一节点和所述第二节点属于第一通信域。
一种实现方式中,接收单元,还用于接收所述第二节点发送的广播消息,所述广播消息服务标识,所述服务标识指示所述第二节点提供地址分配服务;发送单元,还用于向所述第二节点发送接入请求,以请求接入所述第二节点。
可选地,所述第一地址类型为通信域地址或IP地址。
可选地,所述第一地址类型为IP地址,所述第一网络地址为所述第一节点在本地使用的IPv6地址,所述第一网络地址包括所述第一通信域的IPv6前缀和第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址。
可选地,所述第一消息还包括所述第一节点上的第一服务的标识,所述第一网络地址分配给所述第一服务。
可选地,所述第一消息还包括下述信息中的至少一项:
所述第一节点的身份标识;
单播地址标识信息,用于指示所述第一网络地址为单播地址;
组播地址标识信息,用于指示所述第一网络地址为组播地址;
任播地址标识信息,用于指示所述第一网络地址为任播地址;或
数量标识信息,用于指示所述第一网络地址的申请数量。
可选地,发送单元,还用于向所述第二节点发送第三消息,所述第三消息包括第二类型标识,所述第二类型标识指示第二地址类型,所述第二地址类型与所述第一地址类型不同;接收单元,还用于接收所述第二节点发送的第四消息,所述第四消息包括为所述第一节点或者为所述第一节点上的服务分配的第三网络地址,所述第三网络地址的地址类型为所述第二 地址类型;获取单元,还用于根据所述第四消息,获得所述第三网络地址。
第五方面,本申请提供了一种地址分配装置,该装置包含至少一个处理器以及通信接口,所述通信接口用于为所述至少一个处理器提供信息输入和/或输出。该装置用于实现第一方面或者第一方面任一可能的实施例中的所述方法。
第六方面,本申请提供了一种地址获取装置,该装置包含至少一个处理器以及通信接口,所述通信接口用于为所述至少一个处理器提供信息输入和/或输出。该装置用于实现第二方面或者第二方面任一可能的实施例中的所述方法。
第七方面,本申请提供了一种计算机可读存储介质,包括计算机指令,当所述计算机指令在被处理器运行时,实现上述第一方面或者第一方面的任一可能的实现方式中的方法。
第八方面,本申请提供了一种计算机可读存储介质,包括计算机指令,当所述计算机指令在被处理器运行时,实现上述第二方面或者第二方面的任一可能的实现方式中的方法。
第九方面,本申请提供了一种计算机程序产品,当该计算机程序产品被处理器执行时,实现上述第一方面或者第一方面的任一可能的实施例中的所述方法。该计算机程序产品,例如可以为一个软件安装包,在需要使用上述第一方面的任一种可能的设计提供的方法的情况下,可以下载该计算机程序产品并在处理器上执行该计算机程序产品,以实现第一方面或者第一方面的任一可能的实施例中的所述方法。
第十方面,本申请提供了一种计算机程序产品,当该计算机程序产品被处理器执行时,实现上述第二方面或者第二方面的任一可能的实施例中的所述方法。该计算机程序产品,例如可以为一个软件安装包,在需要使用上述第二方面的任一种可能的设计提供的方法的情况下,可以下载该计算机程序产品并在处理器上执行该计算机程序产品,以实现第二方面或者第二方面的任一可能的实施例中的所述方法。
第十一方面,本申请提供了一种终端,该终端包括第一装置或第二装置,其中,第一装置为上述第四方面或第四方面的任一可能的实现方式的装置,或者为上述第六方面的装置;第二装置为上述第三方面或第三方面的任一可能的实现方式的装置,或者为上述第五方面的装置。
其中,该终端的举例包括但不限于:智能家居设备(诸如电视、扫地机器人、智能台灯、音响系统、智能照明系统、电器控制系统、家庭背景音乐、家庭影院系统、对讲系统、视频监控等)、智能运输设备(诸如汽车、轮船、无人机、火车、货车、卡车等)、智能制造设备(诸如机器人、工业设备、智能物流、智能工厂等)、智能终端(手机、计算机、平板电脑、掌上电脑、台式机、耳机、音响、穿戴设备、车载设备、虚拟现实设备、增强现实设备等)。
第十二方面,本申请提供了一种通信系统,该系统包括第一装置和第二装置,其中,第一装置为上述第四方面或第四方面的任一可能的实现方式的装置,或者为上述第六方面的装置;第二装置为上述第三方面或第三方面的任一可能的实现方式的装置,或者为上述第五方面的装置。
附图说明
图1是本申请实施例提供的一些系统架构的示意图;
图2是本申请实施例提供的一种智能家居无线通信场景示意图;
图3是本申请实施例提供的一种地址分配方法的流程图;
图4是本申请实施例提供的又一种地址分配方法的流程图;
图5是本申请实施例提供的又一种地址分配方法的流程图;
图6是本申请实施例提供的又一种地址分配方法的流程图;
图7是本申请实施例提供的一种地址分配装置的结构示意图;
图8是本申请实施例提供的一种地址获取装置的结构示意图;
图9是本申请实施例提供的一种通信装置的结构示意图。
具体实施方式
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。本申请中的说明书和权利要求书中采用诸如“第一”、“第二”的前缀词,仅仅为了区分不同的描述对象,对被描述对象的位置、顺序、优先级、数量或内容等没有任何限定作用。本申请实施例中对用于区分描述对象的前缀词的使用不构成对所描述对象的限制,对所描述对象的陈述参见权利要求或实施例中上下文的描述,不应因为使用这种前缀词而构成多余的限制。
需要说明的是,本申请实施例中采用诸如“a1、a2、……或an中的至少一项(或至少一个)”等的描述方式,包括了a1、a2、……和an中任意一个单独存在的情况,也包括了a1、a2、……和an中任意多个的任意组合情况,每种情况可以单独存在。例如,“a、b或c中的至少一项”的描述方式,包括了单独a、单独b、单独c、a和b组合、a和c组合、b和c组合,或abc三者组合的情况。
下面将结合附图,对本申请实施例中的技术方案进行描述。
参见图1,图1示例性地给出了三种本申请实施例适用的系统架构的示意图,例如图1中的(a)、(b)和(c)所示。
通信域包括多个通信设备,通信设备之间具有通信连接关系(即通信链路),且通信设备之间可以通过通信链路进行信息交互。多个通信设备包括至少一个管理节点和至少一个终端节点,其中,管理节点也可以称为grant node(简称为G节点),终端节点也可以称为terminal node(简称为T节点),G节点用于在通信系统(例如,星闪通信系统)接入层发送数据调度信息,T节点用于在通信系统接入层接收数据调度信息并根据接收到的数据调度信息发送相应地数据。
图1的(a)示出了一种星型单跳拓扑结构。在图1的(a)中,通信域1包括节点G和多个节点T(例如,T1、T2、…、Tn),其中,节点G分别为每个节点T的接入点,节点G为通信域1内的管理节点,节点G可以为节点T分配IP地址,例如,节点G作为DHCP服务器为节点T分配,或者,节点G作为IP地址分配代理以请求DHCP服务器为节点T分配。在一些可能的实施例中,通信域1例如可以是星闪通信系统中的星闪域,在此情况下,节点G还可以为节点T分配通信域地址类型的网络地址,以实现在星闪通信系统内的寻址。在图1的(a)中,节点G与节点T之间的通信可以是双向单播,也可以G->T的广播通信。
可选地,图1的(a)所示架构适用于车载通信场景。例如,在车载通信场景中,节点G可以是远程通信箱(Telematics BOX,T-Box),节点T可以是车内的用户终端,用户终端例如可以是手机、平板电脑、掌上电脑、台式机、耳机、音响、穿戴设备、车载设备、虚拟现实设备、增强现实设备等。T-BOX也可以称作远程车载终端或车联网通讯终端。T-BOX一般作为无线网关,为整车提供远程通讯接口,提供了包括行车数据采集、行驶轨迹记录、车辆 故障监控、车辆远程查询和控制、驾驶行为分析、无线热点分享等服务。例如,T-Box能把采集到的车辆数据(如新能源汽车的驱动电机数据、整车数据、电池数据、状态数据等等)发送给云平台,也能将从云平台接收到的控制指令转发给车辆。T-Box还可以通过蓝牙与手机APP建立传输通道,实现开门、锁门、车窗控制、空调开关、发动机启停等控制。
图1的(b)示出了一种树状多跳拓扑结构。在图1的(b)中,通信域2包括节点G1、G2、G3、G4以及节点T1、T2和T3,其中,节点G1分别与节点G2、G3连接,节点G2还分别与节点T1、G4连接,节点G3还分别与节点T3、G4连接,节点G4还与节点T2连接。可以看出,节点G1分别与节点G2、G3的接入点,节点G2分别为节点T1、G4的接入点,节点G3分别为节点T3、G4的接入点,节点G4为节点T2的接入点。节点G1为通信域2内的管理节点,即节点G1具有地址分配功能,可以为通信域2内的其他节点分配网络地址,在节点G2、G3和G4具有自身的网络地址的情况下,节点G2、G3和G4可以具有地址分配代理服务功能。
可以理解,在此通信场景中,通信域2内包括多个节点G(分别为节点G1、G2、G3、G4)和多个节点T(分别为节点T1、T2和T3),节点G1为通信域2内的管理节点,节点G2、G3和G4为具有双身份的通信节点。以节点G2为例,对于节点G2与节点T1的通信,节点G2作为G节点而节点T1作为T节点;对于节点G2与节点G1的通信,节点G1作为G节点而节点G2作为T节点,像G2这样存在双身份的通信节点可以记作G2(T)。
可选地,图1的(b)所示架构适用于智能家居场景。参见图2,图2是本申请实施例提供的一种智能家居无线通信场景示意图。在图2中,节点G具有IP能力,节点G包网关/客户终端设备(customer premises equipment,CPE)、子路由器、手机和大屏,其中,图2所示通信域内的管理节点可以是网关/客户终端设备(customer premises equipment,CPE),具有双身份的节点G可以是子路由器、手机和大屏。图2中的T节点包括智能灯、空调、打印机、麦克风和音箱,其中,既包括支持IP的节点G,例如,打印机,也包括不支持IP的节点G,例如,智能灯、空调等。
图1的(c)示出了一种树状三层多跳拓扑结构。在图1的(c)中,通信域3包括节点G1、G2、G3以及节点T1、T2、T3和T4,其中,节点G1分别与节点G2、G3连接,即节点G1分别为节点G2、G3的接入点,节点G2分别为节点T1、T2连接,即节点G2分别为节点T1、T2的接入点,节点G3分别与节点T3、T4连接,即节点G3分别为节点T3、T4的接入点。节点G1作为通信域3内的管理节点,节点G1可以提供地址分配服务,节点G2、G3可以提供地址分配代理服务。在图1的(b)和(c)中,节点G与节点T之间的通信可以是T->G(T)->G的双向单播,也可以G->G(T)->T的广播通信。
可选地,图1的(c)所示架构适用于电池管理系统(battery management system,BMS)。例如,图1的(c)中,节点G1可以是BMS中的电池控制单元(battery control unit,BCU),节点T1、T2、T3和T4可以是电池监控单元(battery monitoring unit,BMU),节点G2、G3可以是具有地址分配代理服务功能的BMU。
需要说明的是,图1仅为示例性架构图,还可以是其他形式的架构图,例如,还可以是树状四层(或者更多层的)多跳拓扑结构。虽然图1未示出,但除图1所示的功能实体外,图1还可以包括其他功能实体。另外,本申请实施例提供的方法可以应用于图1所示的通信系统,当然本申请实施例提供的方法也可以适用其他通信系统,本申请实施例对此不予限制。
参见图3,图3是本申请实施例提供的一种地址分配方法的流程图。该方法包括但不限于以下步骤:
S101:第一节点向第二节点发送第一消息,第一消息包括第一类型标识,第一类型标识指示第一地址类型。
相应地,第二节点接收第一节点发送的第一消息。
其中,第一节点和第二节点属于第一通信域。第二节点是基于第一节点发送的接入请求允许第一节点的接入,也就是说,第二节点为第一节点的接入点。
示例性地,在图1的(a)中,第一节点可以是节点T1、T2、…、Tn中的任一节点T,第二节点可以是节点G。
示例性地,在图1的(b)中,第一节点可以是节点T1、T2和T3中的任一者,其中,第一节点为节点T1,则第二节点为节点G2;第一节点为节点T2,则第二节点为节点G4;第一节点为节点T3,则第二节点为节点G3。在一些可能的实施例中,在图1的(b)中的节点T1、T2和T3未接入时,第一节点还可以是节点G4,则第二节点可以是节点G2或G3。在一些可能的实施例中,在图1的(b)中的节点T1、T2、T3和G4未接入时,第一节点可以是节点G2或G3,则第二节点为节点G1。
示例性地,在图1的(c)中,第一节点可以是节点T1、T2、T3和T4中的任一者,其中,第一节点为T1或T2,则第二节点为节点G2;第一节点为节点T3或T4,则第二节点为节点G3。在一些可能的实施例中,在图1的(c)中的节点T1、T2、T3和T4未接入时,第一节点可以是节点G2或G3,则第二节点为节点G1。
在本申请实施例中,第一地址类型为通信域地址或IP地址。
其中,第一地址类型为期望分配到的第一网络地址所属的地址类型。当第一地址类型为通信域地址时,第一网络地址是一种网络层短地址,其长度可以是2个字节(即16比特),可以用于在相应的通信系统寻址。例如,对于星闪通信技术,通信域地址可以用于在星闪通信系统内寻址。可以理解,通信域地址是区别于IP地址的另一种地址类型。
在一些可能的实施例中,在第一地址类型为通信域地址时,第一网络地址的长度也可以是8比特bit、24比特或其他比特数,在此不作具体限定。
示例性地,第一类型标识可以通过比特映射、二进制取值或其他方式来指示第一地址类型。例如,在第一类型标识取第一值的情况下,第一地址类型为通信域地址;在第一类型标识取第二值的情况下,第一地址类型为IP地址。
可选地,在一些可能的实施例中,第一节点向第二节点发送第一消息之前,第一节点先执行:确定第二节点为第一节点的接入点。
在一种实现方式中,确定第二节点为第一节点的接入点,包括:接收第二节点发送的广播消息,该广播消息包括服务标识,服务标识指示第二节点提供地址分配服务;向第二节点发送接入请求,以请求接入第二节点。
在另一种实现方式中,确定第二节点为第一节点的接入点,包括:接收至少一个节点发送的广播消息,节点对应的广播消息包括该节点对应的服务标识,节点对应的服务标识用于指示该节点提供地址分配服务;根据预设条件和上述至少一个节点发送的广播消息,从上述至少一个节点中选择第二节点作为第一节点的接入点;向第二节点发送接入请求,以请求接 入第二节点。
其中,预设条件包括下述条件中的至少一项:
(1)最早接收到的广播消息对应的节点作为第二节点;
(2)最大信号强度对应的节点作为第二节点;或
(3)具有最高优先级的节点作为第二节点。
示例性地,第一消息可以承载于通用管理传输通道,通用管理传输通道是一条通信信道。可以理解,在第一节点未获取到分配的网络地址之前,第一节点可以通过建立默认承载激活通用管理传输通道实现接入第二节点。在一些可能的实施例中,第一消息也可以承载于其他通信信道,在此不作具体限定。
在本申请实施例中,第一消息还包括第一节点的身份标识,第一节点的身份标识用于标识第一节点。例如,第一节点的身份标识可以是第一节点的层二标识(Layer 2 Identification,L2ID)。在此情况下,若第一消息不包括任何服务的标识,说明第一消息用于请求为第一节点分配第一地址类型的第一网络地址。
在一些可能的实施例中,第一消息还包括第一节点上第一服务的标识,说明第一消息用于请求为第一节点上的第一服务分配第一地址类型的第一网络地址。
S102:第二节点根据第一地址类型,获得第一网络地址。
其中,第一网络地址的类型为第一地址类型。
在本申请实施例中,第一网络地址可以是分配给第一节点,也可以是分配给第一节点上的服务(或称为应用)。下面具体说明这两类情况下,第一网络地址的分配过程:
第一类:第一网络地址分配给第一节点
在本申请实施例中,第一消息还包括第一节点的身份标识,根据第一地址类型,获得第一网络地址,包括:根据第一地址类型和第一节点的身份标识,获得分配给第一节点的第一网络地址。
一具体实施中,根据第一地址类型和第一节点的身份标识,获得第一网络地址,包括:在第一映射信息包括第一映射关系的情况下,根据第一映射关系获取第一网络地址,第一映射关系表征第一节点的身份标识、第一网络地址与第一地址类型之间的映射关系,其中,第一映射信息为包括分配到网络地址的节点的身份标识、节点的网络地址和节点的网络地址的地址类型之间的映射关系的集合。
可以理解,第一映射信息包括第一映射关系,此情况说明历史已为第一节点分配过同种类型的网络地址,使用历史分配的同种类型的网络地址作为第一网络地址,不仅可以有效避免网络地址的浪费,还可以确定分配给第一节点的第一网络地址是不重复的,防止了地址冲突的发生。
第一映射信息为第二节点在本地维护的。其中,第一映射信息可以通过表、图等方式进行表示。
示例性地,当第一映射信息表示为映射表时,映射表可以是表1所示形式。具体地,表1示出了节点的身份标识-网络地址的地址类型-节点的网络地址三者之间的映射关系,其中,网络地址的地址类型取值为“0”时,表示网络地址的地址类型为通信域地址;网络地址的地址类型取值为“1”时,表示网络地址的地址类型为IP地址。在表1中,基于“L2ID&1-0-地址1”这条映射关系可知历史为身份标识为L2ID&1的节点分配过地址类型为通信域地址 的地址1,基于“L2ID&1-1-地址2”这条映射关系可知历史为身份标识为L2ID&1的节点分配过地址类型为IP地址的地址2,基于“L2ID&3-0-地址3”这条映射关系可知历史为身份标识为L2ID&3的节点分配过地址类型为通信域地址的地址3。
基于表1可以看出,历史可能为某节点(例如,身份标识为L2ID&1的节点)分配了两种类型的网络地址,也可能为某节点(例如,身份标识为L2ID&3的节点)分配了一种类型的网络地址,也可能历史未给某节点(例如,身份标识为L2ID&3的节点)分配过任何类型的网络地址。
表1
Figure PCTCN2022090762-appb-000001
可以理解,上述表1仅作为一个示例,以体现节点的身份标识、网络地址的地址类型以及节点的网络地址三者之间的对应关系,在实际应用中,该对应关系的文字内容和存储方式还可以是其他形式,在此不作具体限定。
基于表1具体说明第二节点查找第一映射信息为第一节点分配第一网络地址的过程:假设第一节点的身份标识为“L2ID&1”且第一类型标识取值“1”(相当于第一地址类型为“通信域地址”),从表1查找到存在“L2ID&1-1-地址2”这一映射关系,则将地址2作为分配给第一节点的第一网络地址。
在本申请实施例中,当第一映射信息不包括第一映射关系的情况下,说明历史未给第一节点分配过第一地址类型的第一网络地址,在此情况下,第一网络地址的分配方式具体可参考下述方式A1和方式A2:
方式A1:第二节点为第一通信域内的管理节点
一种实现方式中,在第二节点为第一通信域内的管理节点时,第二节点根据第一地址类型,为第一节点分配第一网络地址。其中,第一地址类型可以是通信域地址或IP地址。示例性地,当第一地址类型为IP地址时,第一网络地址具体可以是IPv4地址或IPv6地址。
在一些可能的实施例中,第二节点为第一通信域内的管理节点且第一地址类型为IP地址时,第二节点可以向DHCP服务器发送第三消息,第三消息包括上述第一类型标识和第一节点的身份标识;接收该DHCP服务器发送的第四消息,第四消息包括分配给第一节点的第一网络地址。在此情况下,第一网络地址为DHCP服务器基于第三消息分配给第一节点。也就是说,第二节点为第一通信域内的管理节点且第一地址类型为IP地址时,若第二节点不具有DHCP功能,第二节点可以通过第三消息请求DHCP服务器为第一节点分配第一地址类型为IP地址的第一网络地址。
可以看出,在第二节点为第一通信域内的管理节点的情况下:
(1)当第一地址类型为通信域地址时,第一节点的第一网络地址由第二节点分配;
(2)当第一地址类型为IP地址时,第一节点的第一网络地址由第二节点(在第二节点具有DHCP功能的情况下)分配,或者,第一节点的第一网络地址由DHCP服务器(在第二 节点不具有DHCP功能的情况下)通过第二节点分配。
示例性地,对照图1,第一节点和第二节点可以满足下述任一情况:
(1)在图1的(a)中,第一节点为任一节点T,第二节点为节点G;
(2)在图1的(b)中,第一节点为节点G2或G3,第二节点为节点G1;和
(3)在图1的(c)中,第一节点为节点G2或G3,第二节点为节点G1。
方式A2:第二节点不是第一通信域内的管理节点
一种实现方式中,在第二节点不是第一通信域内的管理节点时,第二节点向第三节点发送第三消息,第三消息包括上述第一类型标识和第一节点的身份标识,第三节点为第一通信域内的管理节点;接收第三节点发送的第五消息,第五消息包括分配给第一节点的第一网络地址。在此情况下,第一网络地址为管理节点基于第三消息分配给第一节点。
另一种实现方式中,第一通信域内有多个管理节点,在第二节点不是第一通信域内的管理节点时,第二节点向这多个管理节点发送第三消息,第三消息包括上述第一类型标识和第一节点的身份标识;接收这多个管理节点发送的第六消息,管理节点对应的第六消息包括该管理节点基于第三消息为第一节点分配的网络地址;从这多个管理节点中选择目标管理节点;根据目标管理节点发送的第六消息,获得第一网络地址。
示例性地,第二节点选择的目标管理节点满足下述条件中的至少一项:
(1)优先级超过预设等级的管理节点;
(2)第二节点最早接收到的第六消息对应的管理节点;或
(3)信号强度超过预设阈值的管理节点。
例如,目标管理节点可以是具有最高优先级的管理节点,也可以是最强信号强度对应的管理节点,在此不作具体限定。
在一些可能的实施例中,在第一通信域内有多个管理节点的情况下,第二节点选择目标管理节点后,第二节点还可以广播响应消息,响应消息用于指示第二节点选择了目标管理节点提供的网络地址。如此,接收到响应消息的目标管理节点可以将为第一节点分配的网络地址、第一地址类型与第一节点的身份标识之间的映射关系进行存储,接收到响应消息的其他管理节点可以知晓自身提供的网络地址未被第二节点选择,从而可以回收提供的网络地址,避免了地址的浪费。
上述两种实现方式中,第一网络地址的类型可以是通信域地址,也可以是IP地址,在此不作具体限定。示例性地,当第一地址类型为IP地址时,第一网络地址具体可以是IPv4地址或IPv6地址。
可以看出,在第二节点不是第一通信域内的管理节点的情况下:
(1)第一通信域内仅有一个管理节点时,第二节点向该管理节点发送上述第三消息,在此情况下,第一网络地址由该管理节点通过第二节点分配给第一节点;
(2)第一通信域内包括多个管理节点时,第二节点可以向这多个管理节点广播上述第三消息,并从这多个管理节点提供的网络地址中选择一个管理节点提供的网络地址作为分配给第一节点的第一网络地址。
示例性地,对照图1,第一节点和第二节点满足下述任一情况:
(1)在图1的(b)中,第一节点为节点T1或G4,第二节点为节点G2;
(2)在图1的(b)中,第一节点为节点T2,第二节点为节点G4;
(3)在图1的(b)中,第一节点为节点G4或T3,第二节点为节点G3;
(4)在图1的(c)中,第一节点为节点T1或T2,第二节点为节点G2;和
(5)在图1的(c)中,第一节点为节点T3或T4,第二节点为节点G3。
在图1的(b)中上述第三节点为节点G1,在图1的(c)中上述第三节点为节点G1。
在一些可能的实施例中,在第一映射信息不包括上述第一映射关系的情况下,当第二节点获得为第一节点分配的第一网络地址时,第二节点还可以将第一节点的身份标识、第一地址类型和第一网络地址三者之间的映射关系添加至上述第一映射信息中。例如,假设第一节点的身份标识为“L2ID&2”且第一地址类型为“通信域地址”,第二节点基于第一节点的身份标识和第一地址类型查询上述表1后确定表1中不存在第一映射关系,在此情况下,第二节点通过上述方式A1或方式A2获得分配给第一节点的第一网络地址(假设为“地址4”),第二节点可以在上述表1中添加“L2ID&2-0-地址4”这条映射关系。
在一些可能的实施例中,当第一地址类型为IP地址时,第一网络地址还可以是为第一节点分配的本地IPv6地址,在此情况下,第一网络地址的分配具体可参考下述两种实现方式:
一种实现方式中,在第一地址类型为IP地址时,第二节点获取历史分配的第二网络地址,第二网络地址为第一节点在第一通信域内使用的地址类型为通信域地址的网络地址;根据第一通信域的IPv6前缀和第二网络地址,获得分配给第一节点的第一网络地址。如此,将历史为第一节点分配的地址类型为通信域地址的第二网络地址作为第一节点的接口标识,用于构建第一节点的本地IPv6地址,不仅可以节省地址数量的消耗,还可以确定分配给第一节点的第一网络地址是不重复的,避免了地址冲突。
另一种实现方式中,当第一节点在第一通信域内使用的地址类型为通信域地址的第二网络地址历史未分配时,基于第二节点是否为第一通信域内的管理节点,第一节点的本地IPv6地址的分配可以进一步分为下述情况1和情况2:
情况1:
在第二节点为第一通信域内的管理节点的情况下,第二节点为第一节点分配该第二网络地址,并根据第一通信域的IPv6前缀和第二网络地址,获得分配给第一节点的第一网络地址。
情况2:
在第二节点不是第一通信域内的管理节点的情况下,第二节点向第一通信域内的管理节点发送第三消息,第三消息包括上述第一类型标识和第一节点的身份标识;接收第一通信域内的管理节点发送的第七消息,第七消息包括该管理节点基于第三消息分配的第一网络地址,第一网络地址包括第一通信域的IPv6前缀和为第一节点分配的第二网络地址,第二网络地址的地址类型为通信域地址。从而第二节点获得分配给第一节点的第一网络地址。由此可以看出,第一通信域内的管理节点可以通过第二节点为第一节点分配本地IPv6地址,实现支持第一节点通过多跳无线链接接入网络。
一种实现方式中,第三消息包括第一消息中与第一网络地址的分配相关的全部信息。
例如,第二节点接收到的第一消息包括第一类型标识和第一节点的身份标识,则第二节点发送的第三消息也包括第一类型标识和第一节点的身份标识。
例如,第二节点接收到的第一消息除了包括第一类型标识和第一节点的身份标识外,第一消息还包括其他与第一网络地址的分配相关的信息,例如,单播地址标识信息、组播地址标识信息或数量标识信息中的一项或多项,在此情况下,第三消息除了包括第一类型标识和 第一节点的身份标识外,第三消息还包括相同的其他与第一网络地址的分配相关的信息。有关播地址标识信息、组播地址标识信息、数量标识信息的描述具体可参考下述相应信息的叙述,在此不作具体限定。
可以理解,上述实施例中,第二节点向DHCP服务器或者第一通信域内的管理节点发送第三消息,第二节点可以看作是转发节点,但第二节点不是直接转发或者透传第一消息,而是通过发送第三消息实现第一消息中与第一网络地址的分配相关的信息的发送。
示例性地,可以根据上述第一映射信息判断第一节点在第一通信域内使用的地址类型为通信域地址的第二网络地址是否已分配,具体地,当第一映射信息包括第三映射关系的情况下,说明第二网络地址历史已分配,其中,第三映射关系表征第一节点的身份标识、第一网络地址与通信域地址这一类型之间的映射关系;当第一映射信息不包括第三映射关系的情况下,说明第二网络地址历史未分配。
第二类:第一网络地址分配给第一节点上的服务
在本申请实施例中,第一消息还包括第一节点上的第一服务的标识,根据第一地址类型,获得第一网络地址,包括:根据第一地址类型和第一服务的标识,获得分配给第一服务的第一网络地址。
一具体实施中,根据第一地址类型和第一服务的标识,获得第一网络地址,包括:在第二映射信息包括第二映射关系的情况下,根据第二映射关系获取第一网络地址,第二映射关系表征第一节点的身份标识、第一服务的标识、第一网络地址与第一地址类型之间的映射关系,其中,第二映射信息为包括分配到网络地址的服务的标识、服务的网络地址、服务的网络地址的类型标识和服务所在的节点的身份标识之间的映射关系的集合。
可以理解,第二映射信息包括第二映射关系,此情况说明历史已为第一节点上的第一服务分配过同种类型的网络地址,使用历史分配的同种类型的网络地址作为第一网络地址,不仅可以有效避免网络地址的浪费,还可以确定分配给第一节点上的第一服务的第一网络地址是不重复的。
第二映射信息为第二节点在本地维护。其中,第二映射信息可以通过表、图等方式进行表示。
示例性地,当第二映射信息表示为映射表时,第二映射信息可以表示为表2所示形式。具体地,表2示出了节点的身份标识-服务的标识-网络地址的地址类型-服务的网络地址四者之间的映射关系,其中,网络地址的地址类型取值为“0”时,表示网络地址的地址类型为通信域地址;网络地址的地址类型取值为“1”时,表示网络地址的地址类型为IP地址。在表2中,基于“L2ID&1-AID1-0-地址1”这条映射关系可知历史为身份标识为L2ID&1的节点上的服务AID1分配过地址类型为通信域地址的地址11,基于“L2ID&1-AID2-1-地址12”这条映射关系可知历史为身份标识为L2ID&1的节点上的服务AID2分配过地址类型为IP地址的地址12,基于“L2ID&3-AID1-0-地址13”这条映射关系可知历史为身份标识为L2ID&3的节点上的服务AID1分配过地址类型为通信域地址的地址13。
基于表2可以看出,同一节点上的不同服务可以有不同地址类型的网络地址,不同节点上的同一服务可以有相同地址类型的网络地址。在一些可能的实施例中,同一节点上的同一服务也可以有两种不同地址类型的网络地址,不同节点上的同一服务的网络地址的地址类型也可以不同,在此不作具体限定。可以理解,不同节点上的不同服务的网络地址不同。不同 节点上的同一服务的网络地址若具有相同的地址类型,则不同节点上的同一服务的网络地址相同,例如,基于表2可知节点L2ID&1和节点L2ID&3上均提供服务AID1,且两者对应的网络地址的地址类型相同,故“地址11”与“地址13”也相同。
表2
Figure PCTCN2022090762-appb-000002
可以理解,上述表2仅作为一个示例,以体现节点的身份标识、节点上服务的标识、服务的网络地址以及网络地址的地址类型四者之间的对应关系,在实际应用中,该对应关系的文字内容和存储方式还可以是其他形式,在此不作具体限定。
可以理解,表2和上述表1可以如上述分开表示和存储,在一些可能的实施例中,上述表1和表2也可以融合为一张表进行表示和存储,在此情况下,记录为节点分配某地址类型的网络地址的映射关系中服务的标识可以缺省,在此不作具体限定。
基于表2具体说明第二节点查找第二映射信息为第一服务分配第一网络地址的过程:假设第一节点的身份标识为“L2ID&1”、第一服务的标识为“AID2”以及第一类型标识取值“1”(相当于第一地址类型为“IP地址”),从表2查找到存在“L2ID&1-AID2-1-地址12”这一映射关系,则将地址12作为分配给第一节点上的第一服务的第一网络地址。
在本申请实施例中,当第二映射信息不包括上述第二映射关系时,说明历史未给第一节点上的第一服务分配过第一地址类型的第一网络地址,在此情况下,第一网络地址的分配方式具体参考下述方式B1和方式B2:
方式B1:第二节点为第一通信域内的管理节点
在第二节点为第一通信域内的管理节点时,第二节点根据第一地址类型和第一服务的标识,为第一服务分配第一网络地址。其中,第一地址类型可以是通信域地址或IP地址。
在一些可能的实施例中,第二节点为第一通信域内的管理节点且第一地址类型为IP地址时,第二节点可以向DHCP服务器发送第三消息,第三消息包括上述第一类型标识、第一节点的身份标识和第一节点上的第一服务的标识;接收该DHCP服务器发送的第八消息,第八消息包括分配给第一服务的第一网络地址。在此情况下,第一网络地址为DHCP服务器基于第三消息分配给第一节点上的第一服务。也就是说,第二节点为第一通信域内的管理节点且第一地址类型为IP地址时,若第二节点不具有DHCP功能,第二节点可以通过第三消息请求DHCP服务器为第一服务分配第一地址类型为IP地址的第一网络地址。
可以看出,在第二节点为第一通信域内的管理节点的情况下:
(1)当第一地址类型为通信域地址时,第一服务的第一网络地址由第二节点分配;
(2)当第一地址类型为IP地址时,第一服务的第一网络地址由第二节点分配,或者由DHCP服务器通过第二节点分配。
方式B2:第二节点不是第一通信域内的管理节点
一种实现方式中,在第二节点不是第一通信域内的管理节点时,第二节点向第三节点发 送第三消息,第三消息包括上述第一类型标识、第一节点的身份标识和第一节点上的第一服务的标识,第三节点为第一通信域内的管理节点;接收第三节点发送的第九消息,第九消息包括分配给第一服务的第一网络地址。在此情况下,第一网络地址为该管理节点基于第三消息分配给第一节点上的第一服务。
另一种实现方式中,第一通信域内包括多个管理节点,第二节点不是第一通信域内的管理节点,第二节点向第一通信域内的这多个管理节点发送第三消息,第三消息包括上述第一类型标识、第一节点的身份标识和第一节点上的第一服务的标识;接收这多个管理节点发送的第十消息,管理节点对应的第十消息包括该管理节点基于第三消息为第一服务分配的网络地址;从这多个管理节点中选择目标管理节点;根据目标管理节点发送的第十消息,获得第一网络地址。
示例性地,第二节点选择的目标管理节点满足下述条件中的至少一项:
(1)优先级超过预设等级的管理节点;
(2)第二节点最早接收到的第十消息对应的管理节点;或
(3)信号强度超过预设阈值的管理节点。
例如,目标管理节点可以是具有最高优先级的管理节点,也可以是最大信号强度对应的管理节点,在此不作具体限定。
上述两种实现方式中,第一网络地址的类型可以是通信域地址,也可以是IP地址,在此不作具体限定。
在一些可能的实施例中,在第一通信域内有多个管理节点的情况下,第二节点选择目标管理节点后,第二节点还可以广播响应消息,响应消息用于指示第二节点选择了目标管理节点为第一服务提供的网络地址。如此,接收到响应消息的目标管理节点可以将第一服务的标识、为第一服务分配的网络地址、第一地址类型与第一节点的身份标识之间的映射关系进行存储,接收到响应消息的其他管理节点可以知晓自身提供的网络地址未被选择,从而可以回收提供的网络地址,避免了地址的浪费。
可以看出,在第二节点不是第一通信域内的管理节点的情况下:
(1)第一通信域内仅有一个管理节点时,第二节点向该管理节点发送第三消息,在此情况下,第一网络地址由该管理节点通过第二节点分配给第一节点上的第一服务;
(2)第一通信域内包括多个管理节点时,第二节点可以向这多个管理节点广播第三消息,并从这多个管理节点提供的网络地址中选择一个管理节点提供的网络地址作为分配给第一服务的第一网络地址。
一种实现方式中,第三消息包括第一消息中与第一网络地址的分配相关的全部信息。
例如,第二节点接收到的第一消息包括第一类型标识、第一节点的身份标识和第一节点上的第一服务的标识,则第二节点发送的第三消息也包括第一类型标识、第一节点的身份标识和第一节点上的第一服务的标识。
进一步地,第二节点接收到的第一消息还包括其他与第一网络地址的分配相关的信息,例如,单播地址标识信息、组播地址标识信息、任播地址标识信息或数量标识信息中的一项或多项,在此情况下,第三消息也还包括相同的其他与第一网络地址的分配相关的信息。有关播地址标识信息、组播地址标识信息、任播地址标识信息、数量标识信息的描述具体可参考下述相应信息的叙述,在此不作具体限定。
可以理解,上述实施例中,第二节点向DHCP服务器或者第一通信域内的管理节点发送第三消息,第二节点可以看作是转发节点,但第二节点不是直接转发或者透传第一消息,而是通过发送第三消息实现第一消息中与第一网络地址的分配相关的信息的发送。
在一些可能的实施例中,在第二映射信息不包括上述第二映射关系的情况下,当第二节点获得为第一节点上的第一服务分配的第一网络地址时,第二节点还可以将第一节点的身份标识、第一服务的标识、第一地址类型和第一网络地址四者之间的映射关系添加至上述第二映射信息中。例如,假设第一节点的身份标识为“L2ID&1”、第一服务的标识为“AID3”且第一地址类型为“IP地址”,第二节点基于第一节点的身份标识、第一服务的标识与第一地址类型查询上述表2后确定表2中不存在第二映射关系,在此情况下,第二节点通过上述方式B1或方式B2获得分配给第一服务的第一网络地址(假设为“地址14”),第二节点可以在上述表2中添加“L2ID&1-AID3-1-地址14”这条映射关系。
在一些可能的实施例中,第一消息还包括下述信息中的至少一项:
单播地址标识信息,用于指示第一网络地址为单播地址;
组播地址标识信息,用于指示第一网络地址为组播地址;
任播地址标识信息,用于指示第一网络地址为任播地址;或
数量标识信息,用于指示第一网络地址的申请数量。
其中,若第一网络地址是分配给第一节点,则第一网络地址可以是单播地址或组播地址;若第一网络地址是分配给第一节点上的第一服务,则第一网络地址可以是单播地址或者组播地址或者任播地址(anycast address)。
一具体实施中,数量标识信息为第一消息中的一种可选信息。例如,数量标识信息可以与第一消息中第一服务的标识的数量对应,具体地,第一网络地址的申请数量与第一服务的标识的数量相同。例如,第一消息包括的第一服务的标识有:AID1、AID2和AID3,意味着第一消息用于申请为AID1、AID2和AID3这三个服务中的每个服务分别分配一个第一网络地址,即第一消息中第一服务的标识的数量为3,则数量标识信息指示的第一网络地址的申请数量也为3。通过数量标识信息,可实现为第一节点上的多个服务分配相应的网络地址。又例如,若第一网络地址是分配给第一节点,在此情况下,数量标识信息指示第一网络地址的申请数量为1。
在一些可能的实施例中,当第一消息中第一服务的标识的数量为多个的情况下,每个第一服务的标识可以有对应的单播地址标识信息或组播地址标识信息或任播地址标识信息。在一些可能的实施例中,当多个第一服务的标识对应的第一网络地址均用于单播或者组播或者任播时,也可以通过一个标志位表示,在此不作具体限定。
一具体实施中,单播地址标识信息是第一消息中的一种可选信息。单播地址标识信息可以通过字段、标志位或者比特位表示,以标志位为例,当相应的标志位置位时,指示第一网络地址为单播地址。通过单播地址标识信息,第二节点可以知晓第一节点请求分配给第一节点上的第一服务或者分配给第一节点的第一网络地址用于单播。
一具体实施中,组播地址标识信息是第一消息中的一种可选信息。组播地址标识信息可以通过字段、标志位或者比特位表示。通过组播地址标识信息,第二节点可以知晓第一节点请求分配给第一节点上的第一服务或者分配给第一节点的第一网络地址用于组播。
可以看出,单播地址标识信息和组播地址标识信息可以如上述分开单独表示。在此情况 下,若第一消息包括单播地址标识信息和组播地址标识信息,而第一网络地址用于单播,则只需将单播地址标识信息执行相应地置位操作即可。
在一些可能的实施例中,单播地址标识信息和组播地址标识信息也可以通过一个标志位表示,例如,当该标志位取第一值时,表示第一网络地址用于单播;当该标志位取第二值时,表示第一网络地址用于组播。
一具体实施中,任播地址标识信息是第一消息中的一种可选信息。通过任播地址标识信息,第二节点可以知晓第一节点请求分配给第一节点上的第一服务的第一网络地址用于任播。组播地址标识信息可以通过字段、标志位或者比特位表示。在一些可能的实施例中,单播地址标识信息、组播地址标识信息和任播地址标识信息也可以通过一个字段或者标志位等方式表示,在此不再赘述。
其中,上述单播地址标识信息、组播地址标识信息、任播地址标识信息或数量标识信息中的至少一项可具体包括下述情况:
(1)单播地址标识信息
例如,第一消息包括第一地址类型、第一节点的身份标识和单播地址标识信息,其表示请求为第一节点分配第一地址类型的第一网络地址,且第一网络地址用于单播。
(2)组播地址标识信息
例如,第一消息包括第一地址类型、第一节点的身份标识和组播地址标识信息,其表示请求为第一节点分配第一地址类型的第一网络地址,且第一网络地址用于组播。
(3)任播地址标识信息
例如,第一消息包括第一地址类型、第一节点的身份标识、第一服务的标识和任播地址标识信息,其表示请求为第一节点上的第一服务分配第一地址类型的第一网络地址,且第一网络地址用于任播。
(4)数量标识信息
例如,第一消息包括第一地址类型、第一节点的身份标识和数量标识信息(其指示第一网络地址的申请数量为1),在此情况下,第一网络地址是用于单播或组播可以是系统默认的。
又例如,第一消息包括第一服务的标识、第一节点的身份标识、第一地址类型和数量标识信息,其中,第一服务的标识包括AID1和AID2且数量标识信息指示第一网络地址的申请数量为2,其表示请求分别为服务AID1和AID2分配一个第一地址类型的第一网络地址,在此情况下,第一网络地址是用于单播或组播或任播可以是系统默认的。
(5)单播地址标识信息和组播地址标识信息
例如,假设第一消息请求为第一节点分配第一地址类型的第一网络地址,且第一网络地址用于单播,若第一消息包括单播地址标识信息和组播地址标识信息,在此情况下,单播地址标识信息和组播地址标识信息可以分别通过标志位表示,其中,单播地址标识信息对应的标志位置位,而组播地址标识信息对应的标志位未置位。
又例如,假设第一消息请求分别为服务AID1和AID2分配一个第一地址类型的第一网络地址,且第一消息还包括单播地址标识信息和组播地址标识信息,在此情况下,假设单播地址标识信息与AID1对应,其用于指示分配给AID1的第一网络地址用于单播,组播地址标识信息与AID2对应,其用于指示分配给AID2的第一网络地址用于组播。
(6)单播地址标识信息和任播地址标识信息,此情况具体可参考情况(5)所示的例子。
(7)组播地址标识信息和任播地址标识信息,此情况具体可参考情况(5)所示的例子。
(8)单播地址标识信息和数量标识信息
例如,假设第一消息请求为第一节点分配第一地址类型的第一网络地址,若第一消息包括单播地址标识信息和数量标识信息,则第一网络地址用于单播,数量标识信息指示第一网络地址的申请数量为1。
又例如,假设第一消息请求分别为服务AID1和AID2分配一个第一地址类型的第一网络地址,若第一消息包括单播地址标识信息和数量标识信息,则第一网络地址均用于单播,数量标识信息指示第一网络地址的申请数量为2。
(9)组播地址标识信息和数量标识信息,此情况具体可参考情况(8)所示的例子。
(10)任播地址标识信息和数量标识信息,此情况具体可参考情况(8)所示的例子。
(11)单播地址标识信息、组播地址标识信息和任播地址标识信息,在此情况下,单播地址标识信息、组播地址标识信息和任播地址标识信息可以分别通过标志位(或字段或比特位)来表示,根据实际应用确定对应的标志位(或字段或比特位)是否被置位。
(12)单播地址标识信息、组播地址标识信息和数量标识信息
例如,假设第一消息请求为第一节点分配第一地址类型的第一网络地址,若第一消息包括单播地址标识信息、组播地址标识信息和数量标识信息,在此情况下,单播地址标识信息和组播地址标识信息可以分别通过标志位表示,假设单播地址标识信息对应的标志位未置位,而组播地址标识信息对应的标志位置位,数量标识信息指示第一网络地址的申请数量为1,可以看出第一网络地址用于组播。
又例如,假设第一消息请求分别为服务AID1和AID2分配一个第一地址类型的第一网络地址,若第一消息包括单播地址标识信息、组播地址标识信息和数量标识信息,在此情况下,假设单播地址标识信息与AID1对应,其用于指示分配给AID1的第一网络地址用于单播,组播地址标识信息与AID2对应,其用于指示分配给AID2的第一网络地址用于组播,则数量标识信息指示第一网络地址的申请数量为2。
(13)单播地址标识信息、任播地址标识信息和数量标识信息,此情况具体可参考情况(12)所示的例子。
(14)组播地址标识信息、任播地址标识信息和数量标识信息,此情况具体可参考情况(12)所示的例子。
(15)单播地址标识信息、组播地址标识信息、任播地址标识信息和数量标识信息,在此情况下,单播地址标识信息、组播地址标识信息和任播地址标识信息可以分别通过标志位(或字段或比特位)来表示,根据实际应用确定对应的标志位(或字段或比特位)是否被置位。
在一些可能的实施例中,历史为节点分配的网络地址可能不会在上述第二节点维护的第一映射信息中永久保存,历史为节点上的服务分配的网络地址可能不会在上述第二映射信息中永久保存。例如,若第二节点检测到某节点未使用该网络地址的时长达到预设阈值,则第二节点可以从第一映射信息中删除该节点对应的网络地址;若第二节点检测到某服务未使用该网络地址的时长达到预设阈值,则第二节点可以从第二映射信息中删除该服务对应的网络地址。又例如,第二节点接收到某节点发送的地址释放请求,在此情况下,响应于该地址释放请求,第二节可以从第一映射信息中删除该节点对应的网络地址。
S103:第二节点向第一节点发送第二消息,第二消息包括第一网络地址。
相应地,第一节点接收第二节点发送的第二消息。
在本申请实施例中,第一网络地址可以是分配给第一节点,也可以是分配给第一节点上的第一服务。
具体地,在第二节点接收到的第一消息中包括第一节点的服务标识时,第一网络地址是分配给第一节点上的第一服务;在第二节点接收到的第一消息中不包括任何服务的标识时,第一网络地址是分配给第一节点。
S104:第一节点根据第二消息,获得第一网络地址。
在本申请实施中,第一网络地址分配给第一节点或者第一节点上的第一服务。
其中,第一网络地址的类型为第一地址类型,第一地址类型为通信域地址或IP地址。
示例性地,在第一地址类型为IP地址时,第一网络地址可以是IPv4地址或IPv6地址。在一些可能的实施例中,在第一地址类型为IP地址时,第一网络地址也可以是为第一节点分配的本地IPv6地址,在此情况下,第一网络地址包括第一通信域的IPv6前缀和第二网络地址,第二网络地址为第一节点在第一通信域内使用的地址类型为通信域地址的网络地址。
在一些可能的实施例中,第一节点还可以变更地址类型。具体地,第一节点向第二节点发送第十一消息,第十一消息包括第二类型标识,第二类型标识指示第二地址类型,第二地址类型与第一地址类型不同;接收第二节点发送的第十二消息,第十二消息包括为第一节点或第一节点上的第一服务分配的第三网络地址,第三网络地址的地址类型为第二地址类型;根据第十二消息,获得第三网络地址。
进一步可选地,第一节点在提出变更地址类型之前,可以先请求第二节点释放历史为第一节点或第一节点上的第一服务申请的第一地址类型的第一网络地址。在一些可能的实施例中,第一节点也可以不执行请求地址释放这一动作,在此不作具体限定。
例如,假设历史为第一节点申请了第一地址类型的第一网络地址,在变更地址类型前,第一节点可以向第二节点发送释放请求指令,以使第二节点从第一映射信息中删除第一节点的身份标识、第一地址类型和第一网络地址这条映射关系。
又例如,假设历史为第一节点上的第一服务申请了第一地址类型的第一网络地址,在变更地址类型前,第一节点可以向第二节点发送释放请求指令,以使第二节点从第二映射信息中删除第一节点的身份标识、第一服务的标识、第一地址类型和第一网络地址这条映射关系。
可以看到,实施本申请实施例,网络中新上线的第一节点可以唯一确定接入的具有地址分配服务功能的第二节点,且第一节点只从第二节点处获取分配的网络地址,地址分配的交互流程简单,有利于提高网络地址的分配效率。且第二节点本地维护的映射信息,能够保证为第一节点或者为第一节点上的服务分配的网络地址是不重复的。另外,第一节点还可以指示期望分配到的网络地址的地址类型,例如通信域地址或IP地址,使得第一节点可以灵活地获取不同类型的网络地址。除此之外,还可以为第一节点分配本地IPv6地址,实现支持第一节点通过多跳无线链接接入网络。
参见图4,图4是本申请实施例提供的又一种地址分配方法的流程图。该方法应用于通信系统,该通信系统至少包括节点1和节点2,其中,节点1为提出地址申请的节点,节点2为管理节点。该方法包括但不限于以下步骤:
S201:节点1基于节点2发送的广播消息选择接入节点2。
其中,节点2发送的广播消息包括服务标识,服务标识指示节点2提供地址分配服务,即节点2具有地址分配功能。
在一些可能的实施例中,节点2也可以是节点1从发送了广播消息的至少一个节点中确定的。一种实现方式中,节点2可以是节点1根据节点的优先级信息、检测到的信号强度、或广播消息的接收时刻中的至少一项从至少一个节点中确定的。例如,节点2可以是节点1最先接收到的广播消息对应的节点,也可以节点1检测到的最大信号强度对应的节点,还可以是具有最高优先级的节点,在此不作具体限定。
示例性地,节点1选择接入节点2可以是:节点1与节点2建立默认承载以激活通用管理传输通道,使得节点1可以通过该通用管理传输通道与节点2交互地址申请信令,例如,下述中的第一消息。其中,通用管理传输通道是一条通信信道。
在本申请实施例中,节点2为通信域内的管理节点,且节点2也是节点1的接入点。
示例性地,节点1可以是上述图1的(a)中节点T1、T2、…、Tn中的任一节点T,节点2为图1的(a)中的节点G。
示例性地,节点1可以是上述图1的(b)中节点G2或G3,节点2为上述图1的(b)中节点G1。
示例性地,节点1可以是上述图1的(c)中节点G2或G3,节点2为上述图1的(c)中节点G1。
S202:节点1向节点2发送第一消息。
一种实现方式中,第一消息包括节点1的身份标识和第一类型标识,第一类型标识指示第一地址类型,在此情况下,若第一消息不包括任何服务的标识,表示第一消息用于请求为节点1分配第一网络地址。
其中,第一地址类型为通信域地址或IP地址。
节点1的身份标识用于标识节点1。例如,节点1的身份标识可以是节点1的L2ID。
另一种实现方式中,第一消息还包括节点1上的第一服务的标识,在此情况下,表示第一消息用于请求为第一服务分配第一网络地址。
S203:节点2向节点1发送第二消息。
在本申请实施例中,节点2向节点1发送第二消息之前,节点2需先根据第一地址类型获得第一网络地址,具体过程可参考C11-C13:
C11:判断第一消息是否包括第一服务的标识。
在第一消息不包括第一服务的标识的情况下,确定第一网络地址是分配给节点1,执行C12;在第一消息包括第一服务的标识的情况下,确定第一网络地址是分配给节点1上的第一服务,执行C13。
C12:根据第一地址类型和节点1的身份标识,获得分配给节点1的第一网络地址。
一具体实施中,根据第一映射关系,获得分配给节点1的第一网络地址,第一映射关系表征节点1的身份标识、第一网络地址与第一地址类型之间的映射关系,其中,第一映射关系属于包括分配到网络地址的节点的身份标识、节点的网络地址和节点的网络地址的地址类型之间的映射关系的集合1。可以理解,集合1即为图3实施例中的第一映射信息。
另一具体实施中,节点2根据第一地址类型和节点1的身份标识,为节点1分配第一网 络地址。也就是说,在历史未给节点1分配第一地址类型的网络地址时,由节点2为节点1分配第一网络地址。另外,节点2还可以将分配给节点1的第一地址类型的第一网络地址添加至上述集合1中。
其中,第一地址类型可以是通信域地址或IP地址。
在此情况下,节点2向节点1发送的第二消息包括第一网络地址,其中,第一网络地址是分配给节点1。
C13:根据第一地址类型和第一服务的标识,获得分配给第一服务的第一网络地址。
一具体实施中,根据第二映射关系,获得分配给第一服务的第一网络地址,第二映射关系表征节点1的身份标识、第一服务的标识、第一网络地址和第一地址类型之间的映射关系,其中,第二映射关系属于包括分配到网络地址的服务的标识、服务的网络地址、网络地址的地址类型以及服务所在的节点的身份标识之间的映射关系的集合2。可以理解,可以理解,集合2即为图3实施例中的第二映射信息。
另一具体实施中,节点2根据第一地址类型和第一服务的标识,为第一服务分配第一网络地址。也就是说,在历史未给节点1上的第一服务分配第一地址类型的网络地址时,由节点2为第一服务分配第一网络地址。另外,节点2还可以将分配给节点1上第一服务的第一地址类型的第一网络地址添加至上述集合2中。
其中,第一地址类型可以是通信域地址或IP地址。
在此情况下,节点2向节点1发送的第二消息包括第一网络地址,其中,第一网络地址是分配给节点1上的第一服务。
可选地,在一些可能的实施例中,在第一地址类型为IP地址的情况下,在节点2不具有DHCP功能时,节点2在向节点1发送第二消息之前,还可以通过S204和S205获得第一网络地址:
S204:节点2向DHCP服务器发送第三消息。
一种实现方式中,第三消息包括上述第一类型标识和节点1的身份标识,以请求DHCP服务器为节点1分配第一网络地址。在此情况下,第三消息具体可参考图3的S102中“第一类:第一网络地址分配给第一节点”实施例中第三消息的相关描述,在此不再赘述。
另一种实现方式中,第三消息包括上述第一类型标识、节点1的身份标识和节点1上的第一服务的标识,以请求DHCP服务器为节点1上的第一服务分配第一网络地址。在此情况下,第三消息具体可参考图3的S102中“第二类:第一网络地址分配给第一节点上的服务”实施例中第三消息的相关描述,在此不再赘述。
其中,第一网络地址的类型为IP地址。
S205:DHCP服务器向节点2发送第一网络地址。
一种实现方式中,在第一消息不包括第一服务的标识的情况下,DHCP服务器根据第一地址类型和节点1的身份标识,为节点1分配第一网络地址。
另一种实现方式中,在第一消息包括第一服务的标识的情况下,DHCP服务器根据第一地址类型和第一服务的标识,为节点1上的第一服务分配第一网络地址。
在DHCP服务器通过上述实现方式获得第一网络地址后,可以将携带了第一网络地址的消息发送给节点2。
另外,DHCP服务器还可以在本地的地址管理信息中添加新分配的第一网络地址的相关 信息,例如,节点1的身份标识、第一地址类型和节点1的第一网络地址三者之间的映射关系,或者,第一服务的标识、第一服务的第一网络地址、第一地址类型和节点1的身份标识四者之间的映射关系,在此不作具体限定。
在一些可能的实施例中,节点2还可以向多个DHCP服务器发送S204中的第三消息;接收多个DHCP服务器发送的地址分配反馈消息,DHCP服务器对应的地址分配反馈消息包括该DHCP服务器基于第三消息分配的第一网络地址;从多个DHCP服务器中选择目标DHCP服务器;根据目标DHCP服务器发送的地址分配反馈消息,获得第一网络地址。另外,节点2在获得第一网络地址后,节点2还可以广播消息1,消息1用于指示节点2选择了目标DHCP服务器提供的网络地址。如此,接收到消息1的目标DHCP服务器可以向节点2发送确认消息以指示节点2选择的第一网络地址可以使用,接收到消息1的其他未被选择的DHCP服务器可以知晓自身提供的网络地址未被节点2选择,从而可以回收提供的网络地址,避免了地址的浪费。
在此情况下,相较于传统DHCP地址分配方式,将客户端执行地址选择以及接收来自DHCP服务器的确认消息的工作卸载到了节点2,如此可以减轻节点1的负担,使得节点1上的协议栈轻量化,降低了节点1的功耗。
其中,目标DHCP服务器可以是最大信号强度对应的DHCP服务器,也可以是节点2最早接收到的地址分配反馈消息对应的DHCP服务器,也可以是最高优先级对应的DHCP服务器,还可以是点2基于检测到的信号强度、DHCP服务器的优先级信息和地址分配反馈消息对应的接收时刻中的多项因素确定的,在此不作具体限定。
S206:节点1根据第二消息,获得第一网络地址。
节点1获得第一网络地址后,可以根据第一网络地址进行本地配置。
可以看到,实施本申请实施例,提出地址申请的节点1可确定发现和接入一个具备地址分配服务的节点2,且只从节点2接收分配的第一网络地址,有利于提高网络地址的分配效率,可以实现星型单跳拓扑场景下网络地址的分配。另外,节点1还可以选择申请期望的地址类型以及为特定对象(例如,节点或节点上的服务)申请网络地址,丰富了地址分配的应用场景。
参见图5,图5是本申请实施例提供的又一种地址分配方法的流程图。该方法应用于通信系统,该通信系统至少包括节点1、节点2和节点3,其中,节点1为提出地址申请的节点,节点2为节点1的接入点,节点3为管理节点。该方法包括但不限于以下步骤:
S301:节点1基于节点2发送的广播消息选择接入节点2。
节点1接入节点2的过程具体可参考图4实施例中的S201的相关叙述,在此不再赘述。
在本申请实施例中,上述节点3为第一通信域内的管理节点,节点1、节点2和节点3均属于第一通信域。
示例性地,对照上述图1的(b),上述节点3可以是节点G1,节点1和节点2满足下述情况中的任意一种:
(1)节点1为节点T1或G4,节点2为节点G2;
(2)节点1为节点T2,节点2为节点G4;和
(3)节点1为节点G4或T3,节点2为节点G3。
示例性地,对照上述图1的(c),上述节点3可以是节点G1,节点1和节点2满足下述情况中的任意一种:
(1)节点1为节点T1或T2,节点2为节点G2;或
(2)第一节点为节点T3或T4,第二节点为节点G3。
S302:节点1向节点2发送第一消息。此步骤具体可参考图4实施例中的S202的相关叙述,在此不再赘述。
S303:节点2判断第一消息是否包括第一服务的标识。
在第一消息不包括第一服务的标识的情况下,表示第一消息用于请求为节点1分配第一网络地址,执行S304;
在第一消息包括第一服务的标识的情况下,表示第一消息用于请求为节点1上的第一服务分配第一网络地址,执行S305。
S304:节点2判断映射信息是否包括第一映射关系。
其中,第一映射关系表征节点1的身份标识、第一网络地址与第一地址类型之间的映射关系。
在此情况下,映射信息为包括分配到网络地址的节点的身份标识、节点的网络地址和节点的网络地址的地址类型之间的映射关系的集合。在此情况下,映射信息即为图3实施例中的第一映射信息或者图4实施例中的集合1。
在映射信息包括第一映射关系时,可以根据第一映射关系获得分配给节点1的第一网络地址。
在映射信息不包括第一映射关系时,执行S306,以使节点3执行S307。
S305:节点2判断映射信息是否包括第二映射关系。
其中,第二映射关系表征节点1的身份标识、第一服务的标识、第一网络地址与第一地址类型之间的映射关系。在此情况下,映射信息为包括分配到网络地址的服务的标识、服务的网络地址、网络地址的类型标识以及服务所在的节点的身份标识之间的映射关系的集合。在此情况下,映射信息即为图3实施例中的第二映射信息或者图4实施例中的集合2。
在映射信息包括第二映射关系时,可以根据第二映射关系获得分配给第一服务的第一网络地址。
在映射信息不包括第二映射关系时,执行S306,以使节点3执行S308。
S306:节点2向节点3发送第三消息。
相应地,节点3接收节点2发送的第三消息。
一具体实施中,与上述S304对应,第三消息包括第一类型标识和节点1的身份标识,第一类型标识指示第一地址类型,且第一消息不包括任何服务的标识。在此情况下,第三消息具体可参考图3的S102中“第一类:第一网络地址分配给第一节点”实施例中有关第三消息的描述,在此不再赘述。
另一具体实施中,与上述S305对应,第三消息包括第一类型标识、节点1的身份标识和节点1上的第一服务的标识。在此情况下,第三消息具体可参考图3的S102中“第二类:第一网络地址分配给第一节点上的服务”实施例中有关第三消息的描述,在此不再赘述。
在一些可能的实施例中,节点2与节点3之间可能存在至少一个汇聚节点,在此情况下,节点2还可以通过至少一个汇聚节点向节点3发送第一消息中与第一网络地址的分配相关的 全部信息。
在一些可能的实施例中,节点3包括多个节点,意味着第一通信域内有多个管理节点,此时,节点2向节点3发送第三消息,包括:节点1向节点3广播第三消息。
S307:节点3根据第一地址类型和节点1的身份标识,为节点1分配第一网络地址。
在一些可能的实施例中,节点3为节点1分配第一网络地址后,节点3还可以将节点1的身份标识、第一地址类型和第一网络地址之间的映射关系进行存储,以确保分配的网络地址是不重复的。
S308:节点3根据第一地址类型和第一服务的标识,为第一服务分配第一网络地址。
在一些可能的实施例中,节点3为节点1上的第一服务分配第一网络地址后,节点3还可以将第一服务的标识、第一网络地址、第一地址类型和节点1的身份标识之间的映射关系进行存储,以确保分配的网络地址是不重复的。
S309:节点3向节点2发送第一网络地址。
其中,第一网络地址可以承载于一条消息中,例如,地址分配反馈消息。
相应地,节点2从节点3处获取第一网络地址,也就是说,在节点2在本地存储的映射信息中未查找到上述第一映射关系或者未查找到上述第二映射关系时,节点2可以从节点3处获取分配的第一网络地址。
在一些可能的实施例中,在节点3包括多个节点的情况下,节点2从节点3处获取第一网络地址之前,节点2可以根据预设规则从这多个节点中选择一个目标管理节点,并获取该目标管理节点提供的第一网络地址。另外,节点2在获得第一网络地址后,节点2还可以广播消息2,消息2用于指示节点2选择了目标管理节点提供的第一网络地址。如此,接收到消息2的目标管理节点还可以向节点2发送确认消息以指示节点2选择的第一网络地址可以使用,接收到消息2的其他未被选择的管理节点可以知晓自身提供的网络地址未被节点2选择,从而可以回收提供的网络地址,避免了地址的浪费。
其中,预设规则包括但不限于优先级超过预设等级、信号强度超过预设阈值、最早接收到的地址分配反馈消息对应的节点等。该实施例也可以参考图3实施例中选择目标管理节点的相关叙述,在此不再赘述。
在一些可能的实施例,在节点3与节点2之间存在至少一个汇聚节点的情况下,节点3向节点2发送第一网络地址可以是:节点3通过至少一个汇聚节点向节点2发送第一网络地址。
S310:节点2向节点1发送第二消息。
一具体实施中,第二消息包括第一网络地址,且第一网络地址是分配给节点1。
另一具体实施中,第二消息包括第一网络地址,其中,第一网络地址是分配给节点1上的第一服务。
可以理解,基于上述S304-S309可知,第一网络地址可以是节点2从本地的映射信息中获取,或者,第一网络地址可以是节点2从节点3处获取,在此不作具体限定。
S311:节点1根据第二消息,获得第一网络地址。
可以看到,实施本申请实施例,提出地址申请的节点1可确定发现和接入一个具备地址分配服务的节点2,且只从节点2接收分配的第一网络地址,有利于提高网络地址的分配效率,可以实现树状多跳拓扑场景下网络地址的分配。另外,节点1还可以申请期望的地址类 型以及为特定对象(例如,节点或节点上的服务)申请网络地址的网络地址,丰富了地址分配的应用场景。
参见图6,图6是本申请实施例提供的又一种地址分配方法的流程图。该方法应用于通信系统,该通信系统至少包括节点1、节点2和节点3,其中,节点1为提出地址申请的节点,节点2为节点1的接入点,节点3为管理节点。与图5实施例的不同之处在于,图6针对第一地址类型为IP地址时,提供一种为节点分配本地IPv6地址的方法。该方法包括但不限于以下步骤:
S401:节点1基于节点2发送的广播消息选择接入节点2。此步骤具体可参考图5实施例中S301的相关叙述,在此不再赘述。
S402:节点1向节点2发送第一消息。
其中,第一消息包括节点1的身份标识和第一类型标识,第一类型标识指示第一地址类型,节点1的身份标识用于标识节点1。
在本申请实施例中,第一地址类型为IP地址。
S403:节点2判断节点1在第一通信域内使用的地址类型为通信域地址的第二网络地址历史是否已分配。
具体地,节点2确定第二网络地址历史已分配的情况下,执行S404和S408;节点2确定第二网络地址历史未分配的情况下,依次执行S405-S408。
示例性地,节点2可以根据本地维护的地址分配信息(例如,图3实施例中的第一映射信息)判断节点1在第一通信域内使用的地址类型为通信域地址的第二网络地址历史是否已分配。具体地,节点2在映射信息中查找到节点1的身份标识对应的网络地址且该网络地址的地址类型为通信域地址时,说明第二网络地址历史已分配;节点2在映射信息中未查找到节点1的身份标识对应的网络地址,或者,节点2在映射信息中查找到节点1的身份标识对应的网络地址但该网络地址的地址类型不是通信域地址时,说明第二网络地址历史未分配。
S404:节点2获取历史分配的第二网络地址,并根据第二网络地址和第一通信域的IPv6前缀,获得第一网络地址。
也就是说,在第二网络地址历史已分配的情况下,第一网络地址可由节点2直接分配。
其中,第二网络地址的类型为通信域地址。第二网络地址可以是节点2从映射信息中获取。第二网络地址为映射信息中节点1的身份标识与通信域地址类型之间的映射关系对应的网络地址。
一种实现方式中,第二网络地址的长度可以8bit、16bit、24bit或其他位数,在此不作具体限定。
一具体实施中,根据第二网络地址和第一通信域的IPv6前缀,获得第一网络地址,包括:将第二网络地址嵌入至第一通信域的IPv6前缀之后,以生成第一网络地址。
如此,将历史为节点1分配的类型为通信域地址的第二网络地址作为节点1的接口标识,其用于构建节点1的本地IPv6地址,不仅可以节省地址数量的消耗,还可以确定分配给节点1的第一网络地址是不重复的。
S405:节点2向节点3发送第三消息。
在第二网络地址历史未分配的情况下,节点2向节点3发送第三消息,以请求节点3基 于第三消息为节点1分配第一网络地址,其中,第三消息包括上述第一类型标识和节点1的身份标识。第三消息具体可参考图3的S102中“第一类:第一网络地址分配给第一节点”实施例中第三消息的相关描述,在此不再赘述。
相应地,节点3接收节点2发送的第三消息。
在一些可能的实施例中,当节点2与节点3之间存在至少一个汇聚节点的情况下,在此情况下,节点2还可以通过至少一个汇聚节点向节点3发送第一消息中与第一网络地址的分配相关的全部信息。
S406:节点3为节点1分配第二网络地址,并根据第二网络地址和第一通信域的IPv6前缀,获得第一网络地址。
S407:节点3向节点2发送第一网络地址。
其中,第一网络地址可以承载于一条消息中。
相应地,节点2从节点3处获取第一网络地址。
在一些可能的实施例,在节点3与节点2之间存在至少一个汇聚节点的情况下,节点3向节点2发送第一网络地址可以是:节点3通过至少一个汇聚节点向节点2发送第一网络地址。
S408:节点2向节点1发送第二消息。
相应地,节点1接收节点2发送的第二消息。
其中,第二消息包括分配给节点1的第一网络地址。
S409:节点1根据第二消息,获得第一网络地址。
可以看到,实施本申请实施例,提出地址申请的节点1可确定发现和接入一个具备地址分配服务的节点2,且只从节点2接收分配的第一网络地址,有利于提高网络地址的分配效率,支持通过多跳机制为节点分配本地IPv6地址。另外,节点1还可以申请特定类型的网络地址,丰富了地址分配的应用场景。
参见图7,图7是本申请实施例提供的一种地址分配装置的结构示意图,地址分配装置30包括接收单元310和发送单元312。该装置30可以通过硬件、软件或者软硬件结合的方式来实现。
其中,接收单元310,用于接收第一节点发送的第一消息,第一消息包括第一类型标识,第一类型标识指示第一地址类型;发送单元312,用于向第一节点发送第二消息,第二消息包括为第一节点或者为第一节点上的服务分配的第一网络地址,第一网络地址的地址类型为第一地址类型。
在一些可能的实施例中,地址分配装置30还包括处理单元(图未示),处理单元用于根据第一地址类型,获得第一网络地址。
该地址分配装置30可用于实现图3实施例所描述的第二节点侧的方法。在图3实施例中,接收单元310可用于执行S101,发送单元312可用于执行S103。可选地,处理单元可用于执行图3实施例中的S102。该地址分配装置30还可用于实现图4、图5和图6实施例所描述的节点2侧的方法,为了说明书的简洁,在此不再赘述。
以上图7所示实施例中的各个单元的一个或多个可以软件、硬件、固件或其结合实现。所述软件或固件包括但不限于计算机程序指令或代码,并可以被硬件处理器所执行。所述硬 件包括但不限于各类集成电路,如中央处理单元(central processing unit,CPU)、数字信号处理器(digital signal processor,DSP)、现场可编程门阵列(field-programmable gate array,FPGA)或专用集成电路(application-specific integrated circuit,ASIC)。
参见图8,图8是本申请实施例提供的一种地址获取装置的结构示意图,地址获取装置40包括发送单元410、获取单元412和接收单元414。该地址获取装置40可以通过硬件、软件或者软硬件结合的方式来实现。
其中,发送单元410,用于向第二节点发送第一消息,第一消息包括第一类型标识,第一类型标识指示第一地址类型;接收单元414,用于接收第二节点发送的第二消息,第二消息包括为第一节点或者为第一节点上的服务分配的第一网络地址,第一网络地址的地址类型为第一地址类型;获取单元412,用于根据第二消息,获得第一网络地址。
该地址获取装置40可用于实现图3实施例所描述的第一节点侧的方法。在图3实施例中,发送单元410可用于执行S101,接收单元414可用于执行S103,获取单元412可用于执行S104。该地址获取装置40还可用于实现图4、图5和图6实施例所描述的节点1侧的方法,为了说明书的简洁,在此不再赘述。
以上图8所示实施例中的各个单元的一个或多个可以软件、硬件、固件或其结合实现。所述软件或固件包括但不限于计算机程序指令或代码,并可以被硬件处理器所执行。所述硬件包括但不限于各类集成电路,如中央处理单元(central processing unit,CPU)、数字信号处理器(digital signal processor,DSP)、现场可编程门阵列(field-programmable gate array,FPGA)或专用集成电路(application-specific integrated circuit,ASIC)。
参见图9,图9是本申请实施例提供的一种通信装置的结构示意图。如图9所示,通信装置50包括:处理器501、通信接口502、存储器503和总线504。处理器501、存储器503和通信接口502之间通过总线504通信。
应理解,本申请不限定通信装置50中的处理器、存储器的个数。
一具体实施中,通信装置50可以是上述实施例中提出地址申请的第一节点,第一节点例如可以是车载通信场景中车内的用户终端,用户终端例如可以是手机、平板电脑、掌上电脑、台式机、耳机、音响、穿戴设备、车载设备、虚拟现实设备、增强现实设备等。第一节点例如也可以是智能家居场景中的家居设备,例如可以是电视、扫地机器人、打印机、投影仪、用户手机、电饭煲、音响、麦克风、无线路由器等。第一节点例如还可以是电池管理系统BMS场景中的BMU。在一些可能的实施例中,第一节点也可以是上述用户终端内的组件或者家居设备内的组件,其中,组件例如可以是单板、线卡或者芯片。
另一具体实施中,通信装置50可以是上述实施例中具有地址分配功能的第二节点,第二节点例如可以是车载通信场景中的T-BOX或者T-BOX内的组件,例如,单板、线卡或者芯片。第二节点例如也可以是智能家居场景中的网关、用户终端设备CPE、无线路由器、用户手机等。第二节点例如还可以是电池管理系统BMS场景中的BCU或BMU,在此不作具体限定。
总线504可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总 线、数据总线、控制总线等。为便于表示,图8中仅用一条线表示,但并不表示仅有一根总线或一种类型的总线。总线504可包括在通信装置50各个部件(例如,存储器503、处理器501、通信接口502)之间传送信息的通路。
处理器501可以包括中央处理器(central processing unit,CPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。
存储器503用于提供存储空间,存储空间中可以存储操作系统和计算机程序等数据。存储器503可以是随机存取存储器(random access memory,RAM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、只读存储器(read-only memory,ROM),或便携式只读存储器(compact disc read memory,CD-ROM)等中的一种或者多种的组合。存储器503可以单独存在,也可以集成于处理器501内部。
通信接口502可用于为处理器501提供信息输入或输出。或者可替换的,该通信接口502可用于接收外部发送的数据和/或向外部发送数据,可以为包括诸如以太网电缆等的有线链路接口,也可以是无线链路(如Wi-Fi、蓝牙、通用无线传输等)接口。或者可替换的,通信接口502还可以包括与接口耦合的发射器(如射频发射器、天线等),或者接收器等。
该通信装置50中的处理器501用于读取存储器503中存储的计算机程序,用于执行前述的方法,例如图3、图4、图5或图6所描述的方法。
在一种可能的设计方式中,通信装置50可为执行图3所示的第一节点侧的方法的执行主体中的一个或多个模块,该处理器501可用于读取存储器中存储的一个或多个计算机程序,用于执行以下操作:
通过发送单元410向第二节点发送第一消息,第一消息包括第一类型标识,第一类型标识指示第一地址类型;
通过接收单元414接收第二节点发送的第二消息,第二消息包括为第一节点或者为第一节点上的服务分配的第一网络地址,第一网络地址的地址类型为第一地址类型;
根据第二消息,获得第一网络地址。
在一种可能的设计方式中,通信装置50可为执行图3所示的第二节点侧的方法的执行主体中的一个或多个模块,该处理器501可用于读取存储器中存储的一个或多个计算机程序,用于执行以下操作:
通过接收单元310接收第一节点发送的第一消息,第一消息包括第一类型标识,第一类型标识指示第一地址类型;
通过发送单元312向第一节点发送第二消息,第二消息包括为第一节点或者为第一节点上的服务分配的第一网络地址,第一网络地址的地址类型为第一地址类型。
本申请实施例还提供了一种通信系统,该通信系统包括第一装置和第二装置,其中,第一装置例如可以是图8所示的地址获取装置40或者图9所示的作为上述第一节点的通信装置50,第二装置例如可以是图7所示的地址分配装置30或者图9所示的作为上述第二节点的通信装置50。第一装置可用于执行上述图3实施例所示的第一节点侧的方法,第二装置例如可用于执行图3实施例所示的第二节点侧的方法。在一些可能的实施例中,该通信系统还可用于执行上述图4、图5或图6所示的方法。
在本文上述的实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。
需要说明的是,本领域普通技术人员可以看到上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质包括只读存储器(Read-Only Memory,ROM)、随机存储器(Random Access Memory,RAM)、可编程只读存储器(Programmable Read-only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、一次可编程只读存储器(One-time Programmable Read-Only Memory,OTPROM)、电子抹除式可复写只读存储(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器、或者能够用于携带或存储数据的计算机可读的任何其他介质。
本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机程序产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是个人计算机,服务器,或者网络设备、机器人、单片机、芯片、机器人等)执行本申请各个实施例所述方法的全部或部分步骤。

Claims (29)

  1. 一种地址分配方法,其特征在于,所述方法包括:
    接收第一节点发送的第一消息,所述第一消息包括第一类型标识,所述第一类型标识指示第一地址类型;
    向所述第一节点发送第二消息,所述第二消息包括为所述第一节点或者为所述第一节点上的服务分配的第一网络地址,所述第一网络地址的地址类型为所述第一地址类型。
  2. 根据权利要求1所述的方法,其特征在于,所述方法应用于第二节点,所述第一节点和所述第二节点属于第一通信域。
  3. 根据权利要求2所述的方法,其特征在于,所述第一地址类型为通信域地址或IP地址。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:
    根据所述第一地址类型,获得所述第一网络地址。
  5. 根据权利要求4所述的方法,其特征在于,所述第一消息还包括所述第一节点的身份标识,所述根据所述第一地址类型,获得所述第一网络地址,包括:
    根据第一映射关系,获得所述第一网络地址,所述第一映射关系表征所述第一节点的身份标识、所述第一网络地址与所述第一地址类型之间的映射关系,
    其中,所述第一映射关系属于包括分配到网络地址的节点的身份标识、节点的网络地址和节点的网络地址的地址类型之间的映射关系的集合。
  6. 根据权利要求4所述的方法,其特征在于,所述第一消息还包括所述第一节点的身份标识和所述第一节点上的第一服务的标识,所述根据所述第一地址类型,获得所述第一网络地址,包括:
    根据第二映射关系,获得所述第一网络地址,所述第二映射关系表征所述第一节点的身份标识、所述第一服务的标识、所述第一网络地址与所述第一地址类型之间的映射关系,
    其中,所述第二映射关系属于包括分配到网络地址的服务的标识、服务的网络地址、服务的网络地址的地址类型和服务所在的节点的身份标识之间的映射关系的集合。
  7. 根据权利要求4所述的方法,其特征在于,所述根据所述第一地址类型,获得所述第一网络地址,包括:
    根据所述第一地址类型,分配所述第一网络地址。
  8. 根据权利要求4所述的方法,其特征在于,所述第一消息还包括所述第一节点上的第一服务的标识,根据所述第一地址类型,获得所述第一网络地址,包括:
    根据所述第一地址类型和所述第一服务的标识,获得为所述第一服务分配的所述第一网络地址。
  9. 根据权利要求3所述的方法,其特征在于,所述第一地址类型为IP地址,所述方法还包括:
    向动态主机配置协议DHCP服务器发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项;
    接收所述DHCP服务器发送的第四消息,所述第四消息包括所述第一网络地址,所述第一网络地址为所述DHCP服务器基于所述第三消息分配的。
  10. 根据权利要求2或3所述的方法,其特征在于,所述方法还包括:
    向第三节点发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项,所述第三节点为所述第一通信域内的管理节点;
    接收所述第三节点发送的第五消息,所述第五消息包括所述第一网络地址,所述第一网络地址为所述第三节点基于所述第三消息分配的。
  11. 根据权利要求2或3所述的方法,其特征在于,所述第一通信域内包括多个管理节点,所述方法还包括:
    向所述多个管理节点发送第三消息,所述第三消息包括所述第一类型标识,所述第三消息还包括所述第一节点的身份标识、所述第一节点上的第一服务的标识中的一项或多项;
    接收所述多个管理节点发送的第六消息,管理节点对应的第六消息包括所述管理节点基于所述第三消息分配的网络地址;
    根据所述多个管理节点中的目标管理节点发送的第六消息,获得所述第一网络地址。
  12. 根据权利要求3所述的方法,其特征在于,所述第一地址类型为IP地址,所述方法还包括:
    获取历史分配的第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址;
    根据所述第一通信域的IPv6前缀和所述第二网络地址,获得所述第一网络地址。
  13. 根据权利要求3所述的方法,其特征在于,所述第一地址类型为IP地址,所述方法还包括:
    为所述第一节点分配第二网络地址,所述第二网络地址的地址类型为通信域地址;
    根据所述第一通信域的IPv6前缀和所述第二网络地址,获得所述第一网络地址。
  14. 根据权利要求3所述的方法,其特征在于,所述第一地址类型为IP地址,所述方法还包括:
    向第四节点发送第三消息,所述第三消息包括所述第一类型标识和所述第一节点的身份标识,所述第四节点为所述第一通信域内的管理节点;
    接收所述第四节点发送的第七消息,所述第七消息包括所述第一网络地址,所述第一网 络地址包括所述第一通信域的IPv6前缀和第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址,所述第一网络地址为所述第四节点基于所述第三消息分配的。
  15. 根据权利要求1-14任一项所述的方法,其特征在于,所述第一消息还包括下述信息中的至少一项:
    单播地址标识信息,用于指示所述第一网络地址为单播地址;
    组播地址标识信息,用于指示所述第一网络地址为组播地址;
    任播地址标识信息,用于指示所述第一网络地址为任播地址;或
    数量标识信息,用于指示所述第一网络地址的申请数量。
  16. 根据权利要求1-15任一项所述的方法,其特征在于,所述方法还包括:
    接收所述第一节点发送的第八消息,所述第八消息包括第二类型标识,所述第二类型标识指示第二地址类型,所述第二地址类型与所述第一地址类型不同;
    向所述第一节点发送第九消息,所述第九消息包括为所述第一节点或者为所述第一节点上的服务分配的第三网络地址,所述第三网络地址的地址类型为所述第二地址类型。
  17. 一种地址分配方法,其特征在于,应用于第一节点,所述方法包括:
    向第二节点发送第一消息,所述第一消息包括第一类型标识,所述第一类型标识指示第一地址类型;
    接收所述第二节点发送的第二消息,所述第二消息包括为所述第一节点或者所述第一节点上的服务分配的第一网络地址,所述第一网络地址的地址类型为所述第一地址类型;
    根据所述第二消息,获得所述第一网络地址。
  18. 根据权利要求17所述的方法,其特征在于,所述第一节点和所述第二节点属于第一通信域。
  19. 根据权利要求17或18所述的方法,其特征在于,所述第一地址类型为通信域地址或IP地址。
  20. 根据权利要求19所述的方法,其特征在于,所述第一地址类型为IP地址,所述第一网络地址为所述第一节点在本地使用的IPv6地址,所述第一网络地址包括所述第一通信域的IPv6前缀和第二网络地址,所述第二网络地址为所述第一节点在所述第一通信域内使用的地址类型为通信域地址的网络地址。
  21. 根据权利要求17-19任一项的方法,其特征在于,所述第一消息还包括所述第一节点上的第一服务的标识,所述第一网络地址分配给所述第一服务。
  22. 根据权利要求17-21任一项所述的方法,其特征在于,所述第一消息还包括下述信息 中的至少一项:
    所述第一节点的身份标识;
    单播地址标识信息,用于指示所述第一网络地址为单播地址;
    组播地址标识信息,用于指示所述第一网络地址为组播地址;
    任播地址标识信息,用于指示所述第一网络地址为任播地址;或
    数量标识信息,用于指示所述第一网络地址的申请数量。
  23. 根据权利要求17-22任一项所述的方法,其特征在于,所述方法还包括:
    向所述第二节点发送第三消息,所述第三消息包括第二类型标识,所述第二类型标识指示第二地址类型,所述第二地址类型与所述第一地址类型不同;
    接收所述第二节点发送的第四消息,所述第四消息包括为所述第一节点或者为所述第一节点上的服务分配的第三网络地址,所述第三网络地址的地址类型为所述第二地址类型;
    根据所述第四消息,获得所述第三网络地址。
  24. 一种地址分配装置,其特征在于,所述装置包括处理单元和通信单元,所述通信装置用于实现权利要求1-16任一项所述的方法。
  25. 一种地址获取装置,其特征在于,所述装置包括处理单元和通信单元,所述通信装置用于实现权利要求17-23任一项所述的方法。
  26. 一种通信装置,其特征在于,所述通信装置包括至少一个处理器和通信接口;
    所述通信接口用于接收和/或发送数据,和/或,所述通信接口用于为所述处理器提供输入和/或输出;
    所述至少一个处理器用于实现权利要求1-16任一项所述的方法,或者,用于实现权利要求17-23任一项所述的方法。
  27. 一种系统,其特征在于,所述系统至少包括第一装置和第二装置,其中,
    所述第一装置包括如权利要求25所述的地址获取装置,
    所述第二装置包括如权利要求24所述的地址分配装置。
  28. 一种终端,其特征在于,所述终端包括如权利要求24-26任一项所述的装置,或者包括如权利要求27所述的系统。
  29. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在至少一个处理器上运行时,实现如权利要求1-16任一项所述的方法,或者,实现如权利要求17-23任一项所述的方法。
PCT/CN2022/090762 2022-04-29 2022-04-29 一种地址分配方法及装置 WO2023206558A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/090762 WO2023206558A1 (zh) 2022-04-29 2022-04-29 一种地址分配方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/090762 WO2023206558A1 (zh) 2022-04-29 2022-04-29 一种地址分配方法及装置

Publications (1)

Publication Number Publication Date
WO2023206558A1 true WO2023206558A1 (zh) 2023-11-02

Family

ID=88517066

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/090762 WO2023206558A1 (zh) 2022-04-29 2022-04-29 一种地址分配方法及装置

Country Status (1)

Country Link
WO (1) WO2023206558A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7337224B1 (en) * 2002-10-24 2008-02-26 Cisco Technology, Inc. Method and apparatus providing policy-based determination of network addresses
CN102870395A (zh) * 2010-02-08 2013-01-09 华为技术有限公司 地址分配方法、装置和系统
CN103746888A (zh) * 2013-12-30 2014-04-23 广东瑞德智能科技股份有限公司 一种智能家居网关与节点组网及退网方法
CN110581902A (zh) * 2019-09-06 2019-12-17 迈普通信技术股份有限公司 一种地址分配方法、系统、dhcp服务器及认证服务器

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7337224B1 (en) * 2002-10-24 2008-02-26 Cisco Technology, Inc. Method and apparatus providing policy-based determination of network addresses
CN102870395A (zh) * 2010-02-08 2013-01-09 华为技术有限公司 地址分配方法、装置和系统
CN103746888A (zh) * 2013-12-30 2014-04-23 广东瑞德智能科技股份有限公司 一种智能家居网关与节点组网及退网方法
CN110581902A (zh) * 2019-09-06 2019-12-17 迈普通信技术股份有限公司 一种地址分配方法、系统、dhcp服务器及认证服务器

Similar Documents

Publication Publication Date Title
US8103784B2 (en) Communication device and communication control method using efficient echonet address determination scheme
US10142182B2 (en) Allocating processing bandwidth at a residential gateway utilizing transmission rules
JP5723456B2 (ja) 結合ネットワークにおける電子デバイスの発見
CN105577736A (zh) 一种电力线载波通讯终端控制装置、系统及方法
KR20170014022A (ko) 서비스를 등록 및 발견하는 방법, 기기, 및 시스템
KR102074916B1 (ko) Rpl 기반 분산 mqtt 브로커 구조
CN102148878A (zh) Ip地址分配方法、系统和设备
CN109561340B (zh) 多媒体服务处理方法、设备、多媒体服务群组及存储介质
WO2011119019A1 (en) Method of communicating signals in 6lowpan network to ipv6 network
CN105245629A (zh) 基于dhcp的主机通信方法及装置
US20160183176A1 (en) Service discovery technique in wireless communication network for forming p2p group
CN107580079A (zh) 一种报文传输方法和装置
US20050255813A1 (en) Electronic appliance
WO2016086659A1 (zh) 一种业务消息的传输方法、装置及系统
US9166884B2 (en) Network location service
CN113498110B (zh) 业务报文传输方法及相关设备
CN105827443A (zh) 网络设备发现方法及装置
CN105897542B (zh) 一种隧道建立方法及视频监控系统
CN101795238A (zh) 网络负载平衡的组网方法、设备及系统
EP3503484A1 (en) Message transmission method, device and network system
WO2023206558A1 (zh) 一种地址分配方法及装置
CN108989173B (zh) 一种报文传输的方法及装置
CN115174310B (zh) Pdn拨号及配置方法、系统、装置、设备及存储介质
CN114615272B (zh) 媒体数据转发服务器调度方法和系统
CN114125725B (zh) 广播消息的发送方法、接收方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22939402

Country of ref document: EP

Kind code of ref document: A1