Address allocation method and device
Patent Information
- Application Number
- CN202280094809.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2024-11-26
AI Technical Summary
The existing DHCP address allocation method in wireless communication is cumbersome and time-consuming, which reduces the efficiency of network address allocation.
By receiving the address type identification message sent by the node, the network address of the specified type is obtained directly from the second node or the management node, omitting the signaling interaction process in the DHCP confirmation phase and simplifying the address allocation interaction.
It improves the efficiency of network address allocation, reduces the burden and power consumption of nodes, and ensures the uniqueness and non-repetition of addresses.
Smart Images

Figure CN119032544A_ABST
Abstract
Description
A method and device for allocating address Technical Field
[0001] The present application relates to the field of wireless communications, and in particular to an address allocation method and device. Background Art
[0002] Wireless communication is widely used in scenarios such as smart cars, smart homes, smart terminals, and smart manufacturing. Compared with wired communication, it can effectively reduce the length and weight of wire harnesses and reduce the number of connectors.
[0003] Generally, the Dynamic Host Configuration Protocol (DHCP) is often used to dynamically allocate Internet Protocol (IP) addresses for communication to nodes in a network. The node that allocates IP addresses is called a DHCP server, and the node that needs to obtain an IP address is called a DHCP client.
[0004] When using the DHCP address allocation method, after a DHCP client selects a network address from multiple DHCP servers, the multiple DHCP servers must confirm whether they are the selected DHCP server. The selected DHCP server also sends a confirmation message to indicate that the DHCP client can use the network address. The address allocation interaction process is cumbersome and time-consuming, which reduces the efficiency of network address allocation.
[0005] Summary of the Invention
[0006] The present application discloses an address allocation method and device, which can realize the allocation of network addresses of specified address types and improve the efficiency of network address allocation.
[0007] In a first aspect, the present application provides an address allocation method, the method comprising: 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 being the first address type.
[0008] This method can be applied to scenarios such as in-vehicle communications, smart homes, and battery management systems (BMS). In the in-vehicle communications scenario, the first node can be, for example, a user terminal in the vehicle or a component in the user terminal (e.g., a single board, line card, or chip). The user terminal can be, for example, a mobile phone, tablet computer, PDA, desktop computer, headset, speaker, wearable device, in-vehicle device, virtual reality device, augmented reality device, etc. The second node can be, for example, a telematics box (T-Box). In the smart home scenario, the first node can be, for example, a household appliance or a component in the household appliance. The household appliance can be, for example, a TV, robot vacuum, printer, projector, user mobile phone, rice cooker, speaker, microphone, wireless router, etc. The second node can be, for example, a gateway, customer premises equipment (CPE), a wireless router, user mobile phone, etc. In the BMS scenario, the first node can be, for example, a battery monitoring unit (BMU), and the second node can be, for example, a battery control unit (BCU) or BMU.
[0009] In the above method, based on the first type identifier indicating the first address type carried by the first message, a 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 the efficiency of network address allocation is improved.
[0010] Optionally, the method is applied to the second node, and the first node and the second node belong to a first communication domain.
[0011] Exemplarily, 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.
[0012] Optionally, the first address type is a communication domain address or an IP address.
[0013] Among them, the first address type is the address type to which the first network address expected to be allocated belongs. When 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 (i.e., 16 bits), which can be used for addressing in the corresponding communication system. For example, for Star Flash communication technology, the communication domain address can be used for addressing within the Star Flash communication system. It can be understood that the communication domain address is another address type different from the IP address.
[0014] In one implementation, when the first address type is a communication domain address, the length of the first network address may also be 8 bits, 24 bits, or another number of bits, which is not specifically limited herein.
[0015] By implementing the above implementation, based on the first address type, the address type of the network address to be allocated can be known.
[0016] Optionally, the method further includes: obtaining the first network address according to the first address type.
[0017] By implementing the above implementation method, accurate allocation of the first network address is achieved through the first address type.
[0018] Optionally, the first message further includes an identity of the first node, and obtaining the first network address according to the first address type includes:
[0019] According to a first mapping relationship, the first network address is obtained, where the first mapping relationship represents a mapping relationship between the identity of the first node, the first network address and the first address type, wherein the first mapping relationship belongs to a set 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.
[0020] The identity of the first node is used to identify the first node. For example, the identity of the first node may be a layer 2 identification (L2ID).
[0021] By implementing the above implementation method, a 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 the past. Using this network address as the first network address assigned to the first node can not only avoid waste of network addresses, but also avoid address conflicts.
[0022] Optionally, the first message further includes an identity of the first node and an identifier of a first service on the first node, and obtaining the first network address according to the first address type includes:
[0023] According to the second mapping relationship, the first network address is obtained, and 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 identity 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.
[0024] By implementing the above implementation method, the first network address is obtained based on the second mapping relationship, which indicates that the same type of network address has been assigned to the first service on the first node in history. Using this network address as the first network address assigned to the first service can not only avoid waste of network addresses, but also avoid the occurrence of address conflicts.
[0025] Optionally, obtaining the first network address according to the first address type includes: allocating the first network address according to the first address type.
[0026] Here, the second node is a management node in the first communication domain.
[0027] In other words, the second node can directly allocate the first network address to the first node or the first service on the first node. In traditional DHCP address allocation, after a node selects a network address from among the network addresses provided by multiple DHCP servers, the multiple DHCP servers must confirm whether they are the selected DHCP server, and the selected DHCP server must also send a confirmation message to indicate that the node can use the address. This interaction process is cumbersome and time-consuming. Compared to traditional DHCP address allocation, the second node directly allocates the first network address, omitting the signaling interaction process in the DHCP confirmation phase. This shortens the address allocation interaction process and improves address allocation efficiency.
[0028] Optionally, the first message also includes an 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 allocated to the first service according to the first address type and the identifier of the first service.
[0029] By implementing the above implementation, a first network address is allocated to the first service on the first node.
[0030] Optionally, when the first address type is an IP address, the method further includes: sending a third message to a Dynamic Host Configuration Protocol DHCP server, the third message including the first type identifier, the third message also including 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 first network address, the first network address being allocated by the DHCP server based on the third message.
[0031] In another implementation, the second node may also send a third message to multiple DHCP servers, the third message including the first type identifier, the third message also including one or more of the identity identifier of the first node and the identifier of the first service on the first node; receive fourth messages sent by multiple DHCP servers, the fourth message corresponding to the DHCP server including the first network address allocated by the DHCP server based on the third message; and obtain the first network address based on the fourth message sent by the target DHCP server among the multiple DHCP servers. In this case, compared to the traditional DHCP address allocation method, the client's work of performing address selection and receiving confirmation messages from the DHCP server is offloaded to the second node, thereby reducing the burden on the first node, making the protocol stack on the first node lighter, and reducing 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 a server determined by the second node based on multiple factors including the detected signal strength, the priority information of the DHCP server, and the time of receipt of the third message, without specific limitation herein.
[0032] In one implementation, the third message includes all information related to the allocation of the first network address in the first message.
[0033] For example, if the first message received by the second node includes the first type identifier and the identity of the first node, the third message also includes the first type identifier and the identity of the first node. In this case, the first network address is allocated to the first node by the DHCP server based on the third message.
[0034] For another example, 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, then the third message also includes the first type identifier, the identity identifier of the first node and the identifier of the first service. In this case, the first network address is the first service on the first node assigned by the DHCP server based on the third message.
[0035] Furthermore, when the first message received by the second node also includes other information related to address allocation, the third message also includes the same other information related to address allocation. For example, the other information related to address allocation may include at least one of the following: unicast address identification information, multicast address identification information, anycast address identification information, or quantity identification information. For details about each of these information, please refer to the description of the corresponding information below and will not be repeated here.
[0036] It can be understood that the above-mentioned second node sends the third message to the DHCP server. 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, it sends the third message to realize the sending of information related to the allocation of the first network address in the first message.
[0037] By implementing the above implementation, when the second node is a management node in the communication domain but the second node does not have a DHCP function, the second node can also request the DHCP server to allocate a first network address to the first node or the first service on the first node through a third message, thereby enriching the application scenarios of address allocation.
[0038] Optionally, the method also includes: sending a third message to a third node, the third message including the first type of identifier, the third message also including one or more of the identity identifier of the first node and the identifier of the first service on the first node, and the third node is a management node within the first communication domain; receiving a fifth message sent by the third node, the fifth message including the first network address, and the first network address is allocated by the third node based on the third message.
[0039] Among them, the specific details of the third message can be referred to the relevant description of the third message above, which will not be repeated here.
[0040] By implementing the above implementation, the second node may also request the management node in the communication domain to allocate the first network address to the first node or the first service on the first node through the third message, thereby enriching the application scenarios of address allocation.
[0041] Optionally, the first communication domain includes multiple management nodes, and 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 also including one or more of the identity identifier of the first node and the identifier of the first service on the first node; receiving a sixth message sent by the multiple management nodes, the sixth message corresponding to the management node including the network address allocated by the management node based on the third message; and obtaining the first network address according to the sixth message sent by the target management node among the multiple management nodes.
[0042] Among them, the specific details of the third message can be referred to the relevant description of the third message above, which will not be repeated here.
[0043] Exemplarily, the target management node can 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 determined based on multiple factors including the priority information of the management node, the detected signal strength, and the time of receipt of the sixth message. No specific limitation is made here.
[0044] By implementing the above implementation, the second node can request allocation of the first network address from multiple management nodes in the communication domain through the third message, and select a first network address provided by one management node, thereby enriching the application scenarios of address allocation.
[0045] Optionally, the first address type is an IP address, and the method further includes: obtaining a second network address allocated historically, the second network address being a network address of a communication domain address type used by the first node in the first communication domain; obtaining the first network address based on the IPv6 prefix of the first communication domain and the second network address.
[0046] By implementing the above implementation method, the second network address of the communication domain address type historically assigned 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. This not only saves the consumption of the number of addresses, but also ensures that the first network address assigned to node 1 is non-repetitive.
[0047] Optionally, the first address type is an IP address, and the method further includes: allocating a second network address to the first node, the address type of the second network address being a communication domain address; and obtaining the first network address based on the IPv6 prefix of the first communication domain and the second network address.
[0048] By implementing the above implementation, the second node can directly allocate a local IPv6 address to the first node, thus enriching the application scenarios of address allocation.
[0049] Optionally, the first address type is an IP address, and 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, and the fourth node is a management node within the first communication domain; receiving a seventh message sent by the fourth node, the seventh message including the first network address allocated by the fourth node based on the third message, the first network address including the IPv6 prefix and the second network address of the first communication domain, and the second network address being a network address of the communication domain address type used by the first node within the first communication domain.
[0050] In one implementation, the third message includes all information related to the allocation of the first network address in the first message.
[0051] For example, the first message received by the second node includes, in addition to the first type identifier and the identity identifier of the first node, other information related to the allocation of the first network address, such as one or more of unicast address identification information, multicast address identification information, or quantity identification information. In this case, in addition to the first type identifier and the identity identifier of the first node, the third message also includes the same other information related to the allocation of the first network address. For a specific description of the unicast 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.
[0052] By implementing the above implementation, 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, thereby enriching the application scenarios of address allocation.
[0053] Optionally, the first message further includes at least one of the following information:
[0054] unicast address identification information, used to indicate that the first network address is a unicast address;
[0055] Multicast address identification information, used to indicate that the first network address is a multicast address;
[0056] Anycast address identification information, used to indicate that the first network address is an anycast address; or
[0057] The quantity identification information is used to indicate the application quantity of the first network address.
[0058] Unicast address identification information is optional information in the first message. Unicast address identification information can be represented by a flag, field, or bit. For example, when a flag is set, it indicates that the first network address is a unicast address. Using the unicast address identification information, the second node can understand that the first node is requesting the first service assigned to the first node or that the first network address of the first node is used for unicast.
[0059] The multicast address identification information is optional information in the first message. The multicast address identification information can be represented by a flag, a field, or a bit. The multicast address identification information allows the second node to know that the first node is requesting the first service assigned to the first node or the first network address assigned to the first node for multicast.
[0060] Here, the unicast address identification information and the multicast address identification information can be separately represented as described above, or they can 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 bit takes the second value, it indicates that the first network address is used for multicast.
[0061] The 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 network address requested by the first node to be allocated to the first service on the first node is used for anycast.
[0062] If the first network address is assigned to the first node, the first network address may be a unicast address or a multicast address; if the first network address is assigned to the first service on the first node, the first network address may be a unicast address, a multicast address, or an anycast address.
[0063] For example, the unicast address identification information, multicast address identification information, and anycast address identification information may be separately represented, or may be collectively represented through a field or a flag bit, etc., which is not specifically limited here.
[0064] The quantity identification information is an optional information in the first message. The quantity identification information corresponds to the number of identifiers of the first service in the first message. Specifically, the number of applications for the first network address is the same as the number of identifiers of the first service. For example, the identifiers of the first service included in the first message are: AID1, AID2 and AID3, which means that the first message is used to apply for a first network address to be allocated 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, and the number of applications for the first network address indicated by the quantity identification 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 identification information. Through the quantity identification information, it is possible to allocate corresponding network addresses to multiple services on the first node.
[0065] When there are multiple first service identifiers in the first message, each first service identifier may also have corresponding unicast address identifier information, multicast address identifier information, or anycast address identifier information. In some possible embodiments, when the first network addresses corresponding to multiple first service identifiers are all used for unicast, multicast, or anycast, this may also be indicated by a flag bit.
[0066] Optionally, the method also 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 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 to the first node or to a service on the first node, and the address type of the third network address is the second address type.
[0067] By implementing the above implementation, network addresses of different address types can be allocated to the first node or the service on the first node.
[0068] In second aspect, the present application provides an address allocation method, applied to a first node, the method comprising: sending a first message to a second node, the first message including a first type identifier, the first type identifier indicating a first address type; receiving a second message sent by the second node, the second message including a first network address allocated to the first node or a service on the first node, the address type of the first network address being the first address type; obtaining the first network address according to the second message.
[0069] This method can be applied to scenarios such as in-vehicle communications, smart homes, and battery management systems (BMS). In the in-vehicle communications scenario, the first node can be, for example, a user terminal in the vehicle or a component in the user terminal (e.g., a single board, line card, or chip). The user terminal can be, for example, a mobile phone, tablet computer, PDA, desktop computer, headset, speaker, wearable device, in-vehicle device, virtual reality device, augmented reality device, etc. The second node can be, for example, a telematics box (T-Box). In the smart home scenario, the first node can be, for example, a household appliance or a component in the household appliance. The household appliance can be, for example, a TV, robot vacuum, printer, projector, user mobile phone, rice cooker, speaker, microphone, wireless router, etc. The second node can be, for example, a gateway, customer premises equipment (CPE), a wireless router, user mobile phone, etc. In the BMS scenario, the first node can be, for example, a battery monitoring unit (BMU), and the second node can be, for example, a battery control unit (BCU) or BMU.
[0070] By implementing the above-mentioned implementation method, the address type is specified by the first type identifier carried by the first message, and the network address of the specified address type allocated to the first node or the service on the first node is obtained only from the second node to which it is connected. The interactive process of address allocation is simple, which is conducive to improving the efficiency of network address allocation.
[0071] Optionally, the first node and the second node belong to a first communication domain.
[0072] Exemplarily, before sending the first message to the second node, the method also includes: receiving a broadcast message sent by the second node, the broadcast message including a service identifier, the service identifier indicating that the second node provides an address allocation service; and sending an access request to the second node to request access to the second node.
[0073] In another implementation, before sending the first message to the second node, the following can be performed: receiving a broadcast message sent by at least one node, the broadcast message corresponding to the node includes a service identifier corresponding to the node, and the service identifier corresponding to the node is used to indicate that the node provides address allocation service; based on the broadcast message sent by the above-mentioned at least one node, selecting a second node from the above-mentioned at least one node as an access point for the first node; and sending an access request to the second node to request access to the second node.
[0074] Furthermore, 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 node determined by the first node from at least one of the above nodes based on multiple factors including the detected signal strength and the moment when the first node receives the broadcast message. No specific limitation is given here.
[0075] By implementing the above implementation, the first node can timely discover the node with the address allocation function and determine the only node it is connected to, so as to obtain the network address of the specified address type allocated only from the node.
[0076] Optionally, the first address type is a communication domain address or an IP address.
[0077] For the description of the first address type, please refer to the relevant description of the first address type in the first aspect, which will not be repeated here.
[0078] Optionally, 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 and the second network address, and the second network address is a network address of the communication domain address type used by the first node in the first communication domain.
[0079] By implementing the above implementation method, a local IPv6 address is allocated to the first node, and the network address of the communication domain address type used by the first node in the first communication domain is used as the interface identifier of the first node, which is used to construct the local IPv6 address of the first node, thereby saving the consumption of the number of addresses.
[0080] Optionally, the first message further includes an identifier of a first service on the first node, and the first network address is allocated to the first service.
[0081] By implementing the above implementation, it is possible to apply for a network address of a specified address type for the service on the first node, thereby enriching the application scenarios of address allocation.
[0082] Optionally, the first message further includes at least one of the following information:
[0083] the identity of the first node;
[0084] unicast address identification information, used to indicate that the first network address is a unicast address;
[0085] Multicast address identification information, used to indicate that the first network address is a multicast address;
[0086] Anycast address identification information, used to indicate that the first network address is an anycast address; or
[0087] The quantity identification information is used to indicate the application quantity of the first network address.
[0088] The identity of the first node is used to identify the first node. For example, the identity of the first node can be a Layer 2 Identification (L2ID). For details about each piece of information in the first message, please refer to the description of the corresponding information in the first message in the first aspect, and will not be repeated here.
[0089] Optionally, the method also 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, the second address type being different from the first address type; 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 being the second address type; and obtaining the third network address according to the fourth message.
[0090] By implementing the above implementation, 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.
[0091] In a third aspect, the present application provides an address allocation device, comprising: a receiving unit for 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; a sending unit for 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 being the first address type.
[0092] Optionally, the device and the first node belong to a first communication domain.
[0093] In one implementation, 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.
[0094] Optionally, the first address type is a communication domain address or an IP address.
[0095] Optionally, the processing unit is further configured to: obtain the first network address according to the first address type.
[0096] Optionally, the first message also includes the identity of the first node, and the processing unit is specifically used to: obtain the first network address according to a 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, wherein the first mapping relationship belongs to a set 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.
[0097] Optionally, the first message also includes the identity of the first node and the identifier of the first service on the first node, and the processing unit is specifically used to: obtain the first network address according to a second mapping relationship, the second mapping relationship represents the mapping relationship between the identity of the first node, the identifier 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.
[0098] Optionally, the processing unit is specifically configured to: allocate the first network address according to the first address type.
[0099] Optionally, the first message further includes an identifier of a first service on the first node, and the processing unit is specifically configured to obtain the first network address allocated to the first service according to the first address type and the identifier of the first service.
[0100] Optionally, the first address type is an IP address, and the sending unit is further used to send a third message to the Dynamic Host Configuration Protocol DHCP server, where the third message includes the first type identifier, and 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 further used to receive a fourth message sent by the DHCP server, where the fourth message includes the first network address, and the first network address is allocated by the DHCP server based on the third message.
[0101] Optionally, the sending unit is also used to send a third message to a third node, the third message including the first type identifier, the third message also including one or more of the identity identifier of the first node and the identifier of the first service on the first node, and the third node is a management node within the first communication domain; the receiving unit is also used to receive a fifth message sent by the third node, the fifth message including the first network address, and the first network address is allocated by the third node based on the third message.
[0102] Optionally, the first communication domain includes multiple management nodes, and the sending unit is further used to send a third message to the multiple management nodes, where the third message includes the first type identifier, and 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 used to receive a sixth message sent by the multiple management nodes, and 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 used to obtain the first network address according to the sixth message sent by the target management node among the multiple management nodes.
[0103] Optionally, the first address type is an IP address, and the processing unit is further used to: obtain a second network address allocated historically, where the second network address is a network address of a communication domain address type used by the first node in the first communication domain; and obtain the first network address based on the IPv6 prefix of the first communication domain and the second network address.
[0104] Optionally, the first address type is an IP address, and the processing unit is further used to: assign a second network address to the first node, the address type of the second network address is a communication domain address; and obtain the first network address based on the IPv6 prefix of the first communication domain and the second network address.
[0105] Optionally, the first address type is an IP address, and the sending unit is further used to send a third message to the fourth node, the third message including the first type identifier and the identity identifier of the first node, and the fourth node is a management node within the first communication domain; the receiving unit is also used to receive a seventh message sent by the fourth node, the seventh message including the first network address allocated by the fourth node based on the third message, the first network address including the IPv6 prefix and the second network address of the first communication domain, and the second network address is a network address of the first node in the first communication domain with an address type of communication domain address.
[0106] Optionally, the first message further includes at least one of the following information:
[0107] unicast address identification information, used to indicate that the first network address is a unicast address;
[0108] Multicast address identification information, used to indicate that the first network address is a multicast address;
[0109] Anycast address identification information, used to indicate that the first network address is an anycast address; or
[0110] The quantity identification information is used to indicate the application quantity of the first network address.
[0111] Optionally, the receiving unit is further used to receive 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 type being different from the first address type; the sending unit is further used to send 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 being the second address type.
[0112] In a fourth aspect, the present application provides an address acquisition device, which includes: a sending unit for sending a first message to a second node, the first message including a first type identifier, the first type identifier indicating a first address type; a receiving unit for receiving a second message sent by the second node, the second message including a first network address allocated to the first node or a service on the first node, the address type of the first network address being the first address type; and an acquisition unit for obtaining the first network address based on the second message.
[0113] Optionally, the first node and the second node belong to a first communication domain.
[0114] In one implementation, the receiving unit is further used 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 further used to send an access request to the second node to request access to the second node.
[0115] Optionally, the first address type is a communication domain address or an IP address.
[0116] Optionally, 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 and the second network address, and the second network address is a network address of the communication domain address type used by the first node in the first communication domain.
[0117] Optionally, the first message further includes an identifier of a first service on the first node, and the first network address is allocated to the first service.
[0118] Optionally, the first message further includes at least one of the following information:
[0119] the identity of the first node;
[0120] unicast address identification information, used to indicate that the first network address is a unicast address;
[0121] Multicast address identification information, used to indicate that the first network address is a multicast address;
[0122] Anycast address identification information, used to indicate that the first network address is an anycast address; or
[0123] The quantity identification information is used to indicate the application quantity of the first network address.
[0124] Optionally, the sending unit is further used to send a third message to the second node, the third message including a second type identifier, the second type identifier indicating a second address type, the second address type being different from the first address type; the receiving unit is further used to receive 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 being the second address type; the acquiring unit is further used to obtain the third network address according to the fourth message.
[0125] In a fifth aspect, the present application provides an address allocation device, comprising at least one processor and a communication interface, wherein the communication interface is configured to provide information input and / or output to the at least one processor. The device is configured to implement the method of the first aspect or any possible embodiment of the first aspect.
[0126] In a sixth aspect, the present application provides an address acquisition device, comprising at least one processor and a communication interface, wherein the communication interface is configured to provide information input and / or output to the at least one processor. The device is configured to implement the method of the second aspect or any possible embodiment of the second aspect.
[0127] In a seventh aspect, the present application provides a computer-readable storage medium comprising computer instructions, which, when executed by a processor, implement the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0128] In an eighth aspect, the present application provides a computer-readable storage medium comprising computer instructions, which, when executed by a processor, implement the method in the above-mentioned second aspect or any possible implementation of the second aspect.
[0129] In a ninth aspect, the present application provides a computer program product that, when executed by a processor, implements the method described in the first aspect or any possible embodiment of the first aspect. The computer program product, for example, may be a software installation package. When the method provided in any possible design of the first aspect is required, the computer program product may be downloaded and executed on a processor to implement the method described in the first aspect or any possible embodiment of the first aspect.
[0130] In a tenth aspect, the present application provides a computer program product that, when executed by a processor, implements the method described in the second aspect or any possible embodiment of the second aspect. The computer program product, for example, may be a software installation package. When the method provided in any possible design of the second aspect is required, the computer program product may be downloaded and executed on a processor to implement the method described in the second aspect or any possible embodiment of the second aspect.
[0131] In the eleventh aspect, the present application provides a terminal, which includes a first device or a second device, wherein the first device is a device of the fourth aspect or any possible implementation of the fourth aspect, or is a device of the sixth aspect; the second device is a device of the third aspect or any possible implementation of the third aspect, or is a device of the fifth aspect.
[0132] Examples of the terminal include, but are not limited to: smart home devices (such as televisions, sweeping robots, smart desk lamps, audio systems, smart lighting systems, electrical control systems, home background music, home theater systems, intercom systems, video surveillance, etc.), smart transportation equipment (such as cars, ships, drones, trains, vans, trucks, etc.), smart manufacturing equipment (such as robots, industrial equipment, smart logistics, smart factories, etc.), smart terminals (mobile phones, computers, tablets, PDAs, desktops, headphones, audio, wearable devices, vehicle-mounted equipment, virtual reality equipment, augmented reality equipment, etc.).
[0133] In the twelfth aspect, the present application provides a communication system, which includes a first device and a second device, wherein the first device is a device of the fourth aspect or any possible implementation of the fourth aspect, or is a device of the sixth aspect; the second device is a device of the third aspect or any possible implementation of the third aspect, or is a device of the fifth aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0134] FIG1 is a schematic diagram of some system architectures provided by embodiments of the present application;
[0135] FIG2 is a schematic diagram of a smart home wireless communication scenario provided by an embodiment of the present application;
[0136] FIG3 is a flow chart of an address allocation method provided in an embodiment of the present application;
[0137] FIG4 is a flowchart of another address allocation method provided in an embodiment of the present application;
[0138] FIG5 is a flowchart of another address allocation method provided in an embodiment of the present application;
[0139] FIG6 is a flowchart of another address allocation method provided in an embodiment of the present application;
[0140] FIG7 is a schematic structural diagram of an address allocation device provided in an embodiment of the present application;
[0141] FIG8 is a schematic structural diagram of an address acquisition device provided in an embodiment of the present application;
[0142] FIG9 is a schematic structural diagram of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0143] The terms used in the embodiments of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. Prefixes such as "first" and "second" are used in the specification and claims of this application only to distinguish different description objects and do not have any limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes to distinguish description objects in the embodiments of this application does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and no unnecessary limitations should be constituted due to the use of such prefixes.
[0144] It should be noted that the descriptions used in the embodiments of the present application, such as "at least one of a1, a2, ..., or an" include any one of a1, a2, ..., and an existing alone, and any combination of any multiple of a1, a2, ..., and an, each of which can exist alone. For example, the description "at least one of a, b, or c" includes a alone, b alone, c alone, a combination of a and b, a combination of a and c, a combination of b and c, or a combination of a, b, and c.
[0145] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0146] Referring to FIG. 1 , FIG. 1 exemplarily shows schematic diagrams of three system architectures applicable to embodiments of the present application, such as shown in (a), (b) and (c) in FIG. 1 .
[0147] The communication domain includes multiple communication devices, which have a communication connection relationship (i.e., a communication link) between the communication devices, and can exchange information between the communication devices through the communication link. The 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 (abbreviated as G node) and the terminal node can also be called a terminal node (abbreviated as T node). The G node is used to send data scheduling information at the access layer of the communication system (for example, the Star Flash communication system), and the T node is used to receive data scheduling information at the access layer of the communication system and send corresponding data based on the received data scheduling information.
[0148] Figure 1 (a) shows a star-shaped single-hop topology. In Figure 1 (a), the communication domain 1 includes a node G and multiple nodes T (for example, T1, T2, ..., Tn), wherein the node G is the access point of each node T, the node G is the management node in the communication domain 1, and the node G can allocate an IP address to the node T. For example, the node G acts as a DHCP server to allocate an IP address to the node T, or the node G acts as an IP address allocation agent to request the DHCP server to allocate an IP address to the node T. In some possible embodiments, the communication domain 1 can be, for example, the Star Flash domain in the Star Flash communication system. In this case, the node G can also allocate a network address of the communication domain address type to the node T to achieve addressing within the Star Flash communication system. In Figure 1 (a), the communication between the node G and the node T can be a two-way unicast or a broadcast communication of G->T.
[0149] Optionally, the architecture shown in (a) of Figure 1 is applicable to in-vehicle communication scenarios. For example, in an in-vehicle communication scenario, node G can be a telematics box (T-Box), and node T can be a user terminal in the vehicle. The user terminal can be, for example, a mobile phone, tablet computer, PDA, desktop computer, headset, audio, wearable device, in-vehicle device, virtual reality device, augmented reality device, etc. T-BOX can also be called a remote in-vehicle terminal or an Internet of Vehicles communication terminal. T-BOX generally acts as a wireless gateway, providing a remote communication interface for the entire vehicle, and provides services including driving data collection, driving trajectory recording, vehicle fault monitoring, vehicle remote query and control, driving behavior analysis, and wireless hotspot sharing. For example, T-Box can send collected vehicle data (such as new energy vehicle drive motor data, vehicle data, battery data, status data, etc.) to the cloud platform, and can also forward control commands received from the cloud platform to the vehicle. T-Box can also establish a transmission channel with a mobile phone app via Bluetooth to realize controls such as door opening and locking, window control, air conditioning switch, and engine start and stop.
[0150] Figure 1(b) shows a tree-like multi-hop topology. In Figure 1(b), 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. Node G2 is also connected to nodes T1 and G4, respectively. Node G3 is also connected to nodes T3 and G4, respectively. Node G4 is also connected to node T2. It can be seen that node G1 is an access point to nodes G2 and G3, respectively. Node G2 is an access point to nodes T1 and G4, respectively. Node G3 is an access point to nodes T3 and G4, respectively. Node G4 is an access point to node T2. Node G1 is a management node within communication domain 2. That is, node G1 has an address allocation function and can allocate network addresses to other nodes within communication domain 2. If nodes G2, G3, and G4 have their own network addresses, nodes G2, G3, and G4 can have an address allocation proxy service function.
[0151] It can be understood that in this communication scenario, communication domain 2 includes multiple nodes G (respectively, nodes G1, G2, G3, and G4) and multiple nodes T (respectively, nodes T1, T2, and T3). Node G1 is the management node within communication domain 2, and nodes G2, G3, and G4 are communication nodes with dual identities. Taking node G2 as an example, for communication between node G2 and node T1, node G2 acts as a G node and node T1 acts as a T node. For communication between node G2 and node G1, node G1 acts as a G node and node G2 acts as a T node. Communication nodes with dual identities like G2 can be denoted as G2(T).
[0152] Optionally, the architecture shown in (b) of Figure 1 is applicable to smart home scenarios. See Figure 2, which is a schematic diagram of a smart home wireless communication scenario provided by an embodiment of the present application. In Figure 2, node G has IP capabilities, and node G includes gateway / customer premises equipment (CPE), sub-router, mobile phone and large screen, wherein the management node in the communication domain shown in Figure 2 can be a gateway / customer premises equipment (CPE), and the node G with dual identity can be a sub-router, mobile phone and large screen. The T nodes in Figure 2 include smart lights, air conditioners, printers, microphones and speakers, including both node G that supports IP, such as printers, and node G that does not support IP, such as smart lights, air conditioners, etc.
[0153] Figure 1(c) shows a tree-like three-layer multi-hop topology. In Figure 1(c), communication domain 3 includes nodes G1, G2, and G3, as well as nodes T1, T2, T3, and T4. Node G1 is connected to nodes G2 and G3, respectively, meaning that node G1 is the access point for nodes G2 and G3. Node G2 is connected to nodes T1 and T2, meaning that node G2 is the access point for nodes T1 and T2. Node G3 is connected to nodes T3 and T4, meaning that node G3 is the access point for nodes T3 and T4. Node G1 serves as the management node within communication domain 3. Node G1 can provide address allocation services, while nodes G2 and G3 can provide address allocation proxy services. In Figures 1(b) and 1(c), communication between node G and node T can be bidirectional unicast (T->G(T)->G) or broadcast (G->G(T)->T).
[0154] Optionally, the architecture shown in FIG1(c) is applicable to a battery management system (BMS). For example, in FIG1(c), node G1 may be a battery control unit (BCU) in the BMS, nodes T1, T2, T3, and T4 may be battery monitoring units (BMUs), and nodes G2 and G3 may be BMUs with address allocation proxy service functionality.
[0155] It should be noted that Figure 1 is only an exemplary architecture diagram and may also be an architecture diagram in other forms, for example, a tree-like four-layer (or more-layer) multi-hop topology. Although not shown in Figure 1, in addition to the functional entities shown in Figure 1, Figure 1 may also include other functional entities. In addition, the method provided in the embodiment of the present application can be applied to the communication system shown in Figure 1. Of course, the method provided in the embodiment of the present application can also be applied to other communication systems, and the embodiment of the present application is not limited to this.
[0156] See Figure 3, which 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:
[0157] S101: A first node sends a first message to a second node, where the first message includes a first type identifier indicating a first address type.
[0158] Correspondingly, the second node receives the first message sent by the first node.
[0159] The first node and the second node belong to the first communication domain. The second node allows the first node to access based on the access request sent by the first node, that is, the second node is an access point of the first node.
[0160] For example, in FIG1( a ), the first node may be any node T among nodes T1 , T2 , . . . , Tn, and the second node may be node G.
[0161] For example, in FIG1(b), the first node may be any one of nodes T1, T2, and T3, wherein if the first node is node T1, the second node is node G2; if the first node is node T2, the second node is node G4; if the first node is node T3, the second node is node G3. In some possible embodiments, when nodes T1, T2, and T3 in FIG1(b) are not connected, the first node may also be node G4, and the second node may be node G2 or G3. In some possible embodiments, when nodes T1, T2, T3, and G4 in FIG1(b) are not connected, the first node may be node G2 or G3, and the second node may be node G1.
[0162] For example, in FIG1(c), the first node may be any one of nodes T1, T2, T3, and T4. If the first node is T1 or T2, the second node is node G2; if the first node is node T3 or T4, the second node is node G3. In some possible embodiments, when nodes T1, T2, T3, and T4 in FIG1(c) are not connected, the first node may be node G2 or G3, and the second node is node G1.
[0163] In an embodiment of the present application, the first address type is a communication domain address or an IP address.
[0164] Among them, the first address type is the address type to which the first network address expected to be allocated belongs. When 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 (i.e., 16 bits), which can be used for addressing in the corresponding communication system. For example, for Star Flash communication technology, the communication domain address can be used for addressing within the Star Flash communication system. It can be understood that the communication domain address is another address type different from the IP address.
[0165] In some possible embodiments, when the first address type is a communication domain address, the length of the first network address may also be 8 bits, 24 bits, or another number of bits, which is not specifically limited herein.
[0166] Exemplarily, the first type identifier may indicate the first address type through bit mapping, binary value, or other means. 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.
[0167] Optionally, in some possible embodiments, before the first node sends the first message to the second node, the first node first performs: determining that the second node is an access point of the first node.
[0168] In one implementation, 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, the service identifier indicating that the second node provides an address allocation service; and sending an access request to the second node to request access to the second node.
[0169] In another implementation, determining that a second node is an access point for a 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, where the service identifier corresponding to the node is used to indicate that the node provides an address allocation service; selecting a second node from the at least one node as an access point for the first node based on a preset condition and the broadcast message sent by the at least one node; and sending an access request to the second node to request access to the second node.
[0170] The preconditions include at least one of the following conditions:
[0171] (1) The node corresponding to the earliest received broadcast message is the second node;
[0172] (2) The node with the maximum signal strength is used as the second node; or
[0173] (3) The node with the highest priority is selected as the second node.
[0174] For example, the first message can be carried on a universal management transmission channel, which is a communication channel. It is understood that before the first node obtains an assigned network address, the first node can establish a default bearer to activate the universal management transmission channel and thereby access the second node. In some possible embodiments, the first message can also be carried on other communication channels, which are not specifically limited herein.
[0175] In an embodiment of the present application, the first message also includes an identifier of the first node, and the identifier of the first node is used to identify the first node. For example, the identifier of the first node may be a Layer 2 Identification (L2ID) of the first node. In this case, if the first message does not include an identifier of any service, it indicates that the first message is used to request allocation of a first network address of a first address type to the first node.
[0176] In some possible embodiments, the first message further 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 a first address type for the first service on the first node.
[0177] S102: The second node obtains a first network address according to the first address type.
[0178] The type of the first network address is a first address type.
[0179] In the embodiment of the present application, the first network address can be assigned to the first node, or it can be assigned to a service (or application) on the first node. The following describes in detail the allocation process of the first network address in these two cases:
[0180] Category 1: The first network address is assigned to the first node
[0181] In an embodiment of the present application, the first message also includes an identity of the first node, and obtaining the first network address according to the first address type includes: obtaining the first network address assigned to the first node according to the first address type and the identity of the first node.
[0182] In a specific implementation, obtaining a first network address according to a first address type and an identity of a first node includes: when the first mapping information includes a first mapping relationship, obtaining the first network address according to the first mapping relationship, the first mapping relationship representing the mapping relationship between the identity of the first node, the first network address and the first address type, wherein the first mapping information is a set 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.
[0183] It can be understood that the first mapping information includes the first mapping relationship, which indicates that the same type of network address has been assigned to the first node in the history. Using the same type of network address assigned in the history as the first network address can not only effectively avoid the waste of network addresses, but also ensure that the first network address assigned to the first node is non-repetitive, thereby preventing the occurrence of address conflicts.
[0184] The first mapping information is maintained locally by the second node. The first mapping information can be represented by a table, a graph, or the like.
[0185] Exemplarily, when the first mapping information is represented as a mapping table, the mapping table may be in the form shown in Table 1. Specifically, Table 1 shows the mapping relationship between the node's identity identifier, the address type of the network address, and the node's network address, wherein when the address type of the network address takes the value of "0", it indicates that the address type of the network address is a communication domain address; and when the address type of the network address takes the value of "1", it indicates that the address type of the network address is an IP address. In Table 1, based on the mapping relationship "L2ID&1-0-address 1", it can be seen that the node with the identity identifier L2ID&1 has been historically assigned address 1 with an address type of a communication domain address. Based on the mapping relationship "L2ID&1-1-address 2", it can be seen that the node with the identity identifier L2ID&1 has been historically assigned address 2 with an address type of an IP address. 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 historically assigned address 3 with an address type of a communication domain address.
[0186] Based on Table 1, it can be seen that two types of network addresses may have been historically assigned to a certain node (for example, a node with an identity identifier of L2ID&1), one type of network address may have been historically assigned to a certain node (for example, a node with an identity identifier of L2ID&3), or no type of network address may have been historically assigned to a certain node (for example, a node with an identity identifier of L2ID&3).
[0187] Table 1
[0188]
[0189] It can be understood that the above Table 1 is only used as an example to reflect the correspondence between the node identity, the address type of the network address and the network address of the node. In actual applications, the text content and storage method of the correspondence can also be in other forms, which are not specifically limited here.
[0190] Based on Table 1, the process of the second node searching for the first mapping information to assign the first network address to the first node is specifically described: assuming that the identity identifier of the first node is "L2ID&1" and the first type identifier is "1" (equivalent to the first address type being "communication domain address"), a mapping relationship of "L2ID&1-1-address 2" is found in Table 1, and address 2 is used as the first network address assigned to the first node.
[0191] In the embodiment of the present application, 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 historically allocated to the first node. In this case, the allocation method of the first network address can specifically refer to the following method A1 and method A2:
[0192] Method A1: The second node is a management node in the first communication domain
[0193] In one implementation, when the second node is a management node within the first communication domain, the second node allocates a first network address to the first node based on a first address type. The first address type may be a communication domain address or an IP address. Exemplarily, when the first address type is an IP address, the first network address may be an IPv4 address or an IPv6 address.
[0194] In some possible embodiments, when the second node is a management node within the first communication domain and the first address type is an IP address, the second node may send a third message to the DHCP server, the third message including the first type identifier and the identity identifier of the first node; and receive a fourth message from the DHCP server, the fourth message including the first network address assigned to the first node. In this case, the first network address is assigned to the first node by the DHCP server based on the third message. In other words, when the second node is a management node within the first communication domain and the first address type is an IP address, if the second node does not have DHCP functionality, the second node may request the DHCP server to assign the first node a first network address of the first address type being an IP address through a third message.
[0195] It can be seen that when the second node is a management node in the first communication domain:
[0196] (1) When the first address type is a communication domain address, the first network address of the first node is allocated by the second node;
[0197] (2) When the first address type is an IP address, the first network address of the first node is allocated by the second node (when the second node has a DHCP function), or the first network address of the first node is allocated by the DHCP server through the second node (when the second node does not have a DHCP function).
[0198] Exemplarily, referring to FIG1 , the first node and the second node may satisfy any of the following conditions:
[0199] (1) In FIG1(a), the first node is any node T, and the second node is node G;
[0200] (2) In FIG1(b), the first node is node G2 or G3, and the second node is node G1; and
[0201] (3) In FIG1(c), the first node is the node G2 or G3, and the second node is the node G1.
[0202] Method A2: The second node is not a management node in the first communication domain
[0203] In one implementation, when the second node is not a management node within the first communication domain, the second node sends a third message to a third node, the third message including the first type identifier and the identity identifier of the first node, and the third node is a management node within the first communication domain. The third node then receives a fifth message from the third node, the fifth message including 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.
[0204] In another implementation, there are multiple management nodes in the first communication domain. 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, where the third message includes the above-mentioned first type identifier and the identity identifier of the first node; receives a sixth message sent by the multiple management nodes, where the sixth message corresponding to the management node includes the network address assigned by the management node to the first node based on the third message; selects a target management node from the multiple management nodes; and obtains the first network address based on the sixth message sent by the target management node.
[0205] Exemplarily, the target management node selected by the second node satisfies at least one of the following conditions:
[0206] (1) Management nodes whose priority exceeds the preset level;
[0207] (2) the management node corresponding to the sixth message received earliest by the second node; or
[0208] (3) Management nodes whose signal strength exceeds the preset threshold.
[0209] For example, the target management node may be a management node with the highest priority, or may be a management node corresponding to the strongest signal strength, which is not specifically limited here.
[0210] In some possible embodiments, when there are multiple management nodes within the first communication domain, after the second node selects a target management node, the second node may also broadcast a response message indicating that the second node has selected the network address provided by the target management node. In this way, the target management node that receives the response message may store the mapping relationship between the network address allocated to the first node, the first address type, and the identity of the first node. Other management nodes that receive the response message may know that the network address they provided was not selected by the second node and may therefore reclaim the provided network address, thereby avoiding address waste.
[0211] In the above two implementations, the type of the first network address can be a communication domain address or an IP address, which is not specifically limited here. For example, when the first address type is an IP address, the first network address can specifically be an IPv4 address or an IPv6 address.
[0212] It can be seen that when the second node is not a management node in the first communication domain:
[0213] (1) When there is only one management node in the first communication domain, the second node sends the third message to the management node. In this case, the first network address is allocated to the first node by the management node through the second node;
[0214] (2) When the first communication domain includes multiple management nodes, the second node may broadcast the third message to the multiple management nodes and select a network address provided by one management node from the network addresses provided by the multiple management nodes as the first network address allocated to the first node.
[0215] Exemplarily, referring to FIG1 , the first node and the second node satisfy any of the following conditions:
[0216] (1) In FIG1(b), the first node is node T1 or G4, and the second node is node G2;
[0217] (2) In FIG1( b ), the first node is node T2 and the second node is node G4;
[0218] (3) In FIG1( b ), the first node is node G4 or T3 , and the second node is node G3 ;
[0219] (4) In FIG1(c), the first node is node T1 or T2, and the second node is node G2; and
[0220] (5) In FIG1(c), the first node is the node T3 or T4, and the second node is the node G3.
[0221] In FIG1( b ) , the third node is the node G1 , and in FIG1( c ) , the third node is the node G1 .
[0222] In some possible embodiments, 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 add the mapping relationship between the first node's identity, the first address type, and the first network address to the above-mentioned first mapping information. For example, assuming that the first node's identity is "L2ID&2" and the first address type is "communication domain address", the second node queries Table 1 based on the first node's identity and the first address type and determines that the first mapping relationship does not exist in Table 1. In this case, the second node obtains the first network address assigned to the first node (assuming it is "address 4") through the above-mentioned method A1 or method A2, and the second node may add the mapping relationship "L2ID&2-0-address 4" to Table 1.
[0223] In some possible embodiments, when the first address type is an IP address, the first network address may also be a local IPv6 address allocated to the first node. In this case, allocation of the first network address may be specifically implemented in the following two ways:
[0224] In one implementation, when the first address type is an IP address, the second node obtains a historically assigned second network address, which is a network address of the communication domain type used by the first node within the first communication domain. The first network address assigned to the first node is obtained based on the IPv6 prefix of the first communication domain and the second network address. In this way, the second network address of the communication domain type, which was historically assigned 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 reduces the number of addresses consumed but also ensures that the first network address assigned to the first node is unique, thus avoiding address conflicts.
[0225] In another implementation, when a second network address of a communication domain address type used by a first node in a first communication domain has not been historically allocated, allocation of a local IPv6 address of the first node can be further divided into the following cases 1 and 2 based on whether the second node is a management node in the first communication domain:
[0226] Case 1:
[0227] 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 first network address allocated to the first node according to the IPv6 prefix of the first communication domain and the second network address.
[0228] Case 2:
[0229] If the second node is not a management node within the first communication domain, the second node sends a third message to the management node within the first communication domain. The third message includes the first type identifier and the identity identifier of the first node. The second node then receives a seventh message from the management node within 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 second network address assigned to the first node. The address type of the second network address is a communication domain address. Thus, the second node obtains the first network address assigned to the first node. Therefore, it can be seen that the management node within the first communication domain can assign a local IPv6 address to the first node through the second node, thereby supporting the first node to access the network via a multi-hop wireless link.
[0230] In one implementation, the third message includes all information related to the allocation of the first network address in the first message.
[0231] For example, the first message received by the second node includes the first type identifier and the identity identifier of the first node, and the third message sent by the second node also includes the first type identifier and the identity identifier of the first node.
[0232] For example, the first message received by the second node includes, in addition to the first type identifier and the identity identifier of the first node, other information related to the allocation of the first network address, such as one or more of unicast address identification information, multicast address identification information, or quantity identification information. In this case, in addition to the first type identifier and the identity identifier of the first node, the third message also includes the same other information related to the allocation of the first network address. For a specific description of the unicast 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.
[0233] It can be understood that in the above embodiment, 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, it sends the third message to realize the sending of information related to the allocation of the first network address in the first message.
[0234] Exemplarily, it can be determined based on the above-mentioned first mapping information whether the second network address of the communication domain address type used by the first node in the first communication domain has been allocated. Specifically, when the first mapping information includes the third mapping relationship, it means that the second network address has been historically allocated, wherein the third mapping relationship represents the mapping relationship between the identity of the first node, the first network address and the communication domain address type; when the first mapping information does not include the third mapping relationship, it means that the second network address has not been historically allocated.
[0235] Category 2: The first network address is assigned to the service on the first node
[0236] In an embodiment of the present application, the first message also includes an 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 assigned to the first service according to the first address type and the identifier of the first service.
[0237] In a specific implementation, obtaining a first network address based on the first address type and the identifier of the first service includes: when the second mapping information includes a second mapping relationship, obtaining the first network address based on the second mapping relationship, the second mapping relationship represents the mapping relationship between the identity of the first node, the identifier of the first service, the first network address and the first address type, wherein the second 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 of the service and the identity of the node where the service is located.
[0238] It can be understood that the second mapping information includes a second mapping relationship, which indicates that the same type of network address has been historically allocated to the first service on the first node. Using the historically allocated network address of the same type as the first network address can not only effectively avoid the waste of network addresses, but also ensure that the first network address allocated to the first service on the first node is non-repetitive.
[0239] The second mapping information is maintained locally by the second node. The second mapping information can be represented by a table, a graph, or the like.
[0240] Exemplarily, when the second mapping information is represented as a mapping table, the second mapping information can be represented in the form shown in Table 2. Specifically, Table 2 shows the mapping relationship between the node identity identifier - the service identifier - the address type of the network address - the network address of the service, wherein, when the address type of the network address is "0", it indicates that the address type of the network address is a communication domain address; when the address type of the network address is "1", it indicates that the address type of the network address is an IP address. In Table 2, based on the mapping relationship "L2ID&1-AID1-0-Address1", it can be seen that address 11 of the communication domain address type was historically allocated to service AID1 on the node with identity L2ID&1. Based on the mapping relationship "L2ID&1-AID2-1-Address12", it can be seen that address 12 of the IP address type was historically allocated to service AID2 on the node with identity L2ID&1. Based on the mapping relationship "L2ID&3-AID1-0-Address13", it can be seen that address 13 of the communication domain address type was historically allocated to service AID1 on the node with identity L2ID&3.
[0241] Based on Table 2, it can be seen that different services on the same node can have network addresses of different address types, and the same service on different nodes can have network addresses of the same address type. In some possible embodiments, the same service on the same node can also have network addresses of two different address types, and the address types of the network addresses of the same service on different nodes can also be different, which is not specifically limited here. It can be understood that the network addresses of different services on different nodes are different. If the network addresses of the same service on different nodes have the same address type, the network addresses of the same service on different nodes are the same. For example, based on Table 2, it can be seen that the service AID1 is provided on both node L2ID&1 and node L2ID&3, and the address types of the network addresses corresponding to the two are the same, so "address 11" and "address 13" are also the same.
[0242] Table 2
[0243]
[0244] It can be understood that the above Table 2 is only used as an example to reflect the correspondence between the node identity, the identifier of the service on the node, the network address of the service, and the address type of the network address. In actual applications, the text content and storage method of the correspondence can also be in other forms, which are not specifically limited here.
[0245] It can be understood that Table 2 and the above Table 1 can be represented and stored separately as described above. In some possible embodiments, the above Table 1 and Table 2 can also be merged into one table for representation and storage. In this case, the service identifier in the mapping relationship of the network address of a certain address type assigned to the node can be omitted, and no specific limitation is made here.
[0246] Based on Table 2, the process of the second node searching for the second mapping information to allocate the first network address to the first service is specifically described: Assuming that the identity identifier of the first node is "L2ID&1", the identifier of the first service is "AID2", and the first type identifier is "1" (equivalent to the first address type being "IP address"), a mapping relationship of "L2ID&1-AID2-1-address12" is found in Table 2, and address 12 is used as the first network address allocated to the first service on the first node.
[0247] In the embodiment of the present application, 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 historically allocated to the first service on the first node. In this case, the allocation method of the first network address specifically refers to the following method B1 and method B2:
[0248] Mode B1: The second node is a management node in the first communication domain
[0249] 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, wherein the first address type may be a communication domain address or an IP address.
[0250] In some possible embodiments, when the second node is a management node within 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, where 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; and receive an eighth message sent by the DHCP server, where the eighth message includes the first network address assigned to the first service. In this case, the first network address is the first service assigned to the first node by the DHCP server based on the third message. That is, when the second node is a management node within the first communication domain and the first address type is an IP address, if the second node does not have DHCP functionality, the second node can request the DHCP server to assign a first network address of the first address type of an IP address to the first service through a third message.
[0251] It can be seen that when the second node is a management node in the first communication domain:
[0252] (1) When the first address type is a communication domain address, the first network address of the first service is allocated by the second node;
[0253] (2) When the first address type is an IP address, the first network address of the first service is allocated by the second node, or allocated by the DHCP server through the second node.
[0254] Mode B2: The second node is not a management node in the first communication domain
[0255] In one implementation, when the second node is not a management node within the first communication domain, the second node sends a third message to a third node, the third message including the first type identifier, the identity identifier of the first node, and the identifier of the first service on the first node. The third node is a management node within the first communication domain. The third node then receives a ninth message from the third node, the ninth message including the first network address assigned to the first service. In this case, the first network address is the first service assigned to the first node by the management node based on the third message.
[0256] In another implementation, the first communication domain includes multiple management nodes, and 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 in the first communication domain, 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; receives the tenth message sent by the multiple management nodes, and the tenth message corresponding to the management node includes the network address allocated by the management node to the first service based on the third message; selects the target management node from the multiple management nodes; and obtains the first network address according to the tenth message sent by the target management node.
[0257] Exemplarily, the target management node selected by the second node satisfies at least one of the following conditions:
[0258] (1) Management nodes whose priority exceeds the preset level;
[0259] (2) the management node corresponding to the tenth message received earliest by the second node; or
[0260] (3) Management nodes whose signal strength exceeds the preset threshold.
[0261] For example, the target management node may be a management node with the highest priority, or may be a management node corresponding to the maximum signal strength, which is not specifically limited here.
[0262] In the above two implementations, the type of the first network address may be a communication domain address or an IP address, which is not specifically limited here.
[0263] In some possible embodiments, when there are multiple management nodes within the first communication domain, after the second node selects a target management node, the second node may also broadcast a response message indicating that the second node has selected the network address provided by the target management node for the first service. In this way, the target management node that receives the response message may store the mapping relationship between the identifier of the first service, the network address allocated for the first service, the first address type, and the identity identifier of the first node. Other management nodes that receive the response message may be aware that the network address provided by them was not selected, and thus may reclaim the provided network address, thereby avoiding address waste.
[0264] It can be seen that when the second node is not a management node in the first communication domain:
[0265] (1) When there is only one management node in the first communication domain, the second node sends a third message to the management node. In this case, the first network address is allocated by the management node to the first service on the first node through the second node;
[0266] (2) When the first communication domain includes multiple management nodes, the second node may broadcast the third message to the multiple management nodes and select a network address provided by one management node from the network addresses provided by the multiple management nodes as the first network address allocated to the first service.
[0267] In one implementation, the third message includes all information related to the allocation of the first network address in the first message.
[0268] For example, if 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, then the third message sent by the second node also includes the first type identifier, the identity identifier of the first node and the identifier of the first service on the first node.
[0269] Furthermore, the first message received by the second node also includes other information related to the allocation of the first network address, such as one or more of unicast address identification information, multicast address identification information, anycast address identification information, or quantity identification information. In this case, the third message also includes the same other information related to the allocation of the first network address. For a detailed description of the unicast 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.
[0270] It can be understood that in the above embodiment, 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, it sends the third message to realize the sending of information related to the allocation of the first network address in the first message.
[0271] In some possible embodiments, when the second mapping information does not include the above-mentioned second mapping relationship, when the second node obtains the first network address allocated to the first service on the first node, the second node may further add the mapping relationship between the first node's identity, the first service's identifier, the first address type, and the first network address to the above-mentioned second mapping information. For example, assuming that the first node's identity is "L2ID&1", the first service's identifier is "AID3", and the first address type is "IP address", the second node queries Table 2 based on the first node's identity, the first service's identifier, and the first address type, and determines that the second mapping relationship does not exist in Table 2. In this case, the second node obtains the first network address allocated to the first service (assuming it is "address 14") through the above-mentioned method B1 or method B2, and the second node may add the mapping relationship "L2ID&1-AID3-1-address 14" to Table 2.
[0272] In some possible embodiments, the first message further includes at least one of the following information:
[0273] Unicast address identification information, used to indicate that the first network address is a unicast address;
[0274] Multicast address identification information, used to indicate that the first network address is a multicast address;
[0275] Anycast address identification information, used to indicate that the first network address is an anycast address; or
[0276] The quantity identification information is used to indicate the applied quantity of the first network address.
[0277] If the first network address is assigned to the first node, the first network address may be a unicast address or a multicast address; if the first network address is assigned to the first service on the first node, the first network address may be a unicast address, a multicast address, or an anycast address.
[0278] In a specific implementation, the quantity identification information is an optional information in the first message. For example, the quantity identification information may correspond to the number of identifiers of the first service in the first message. Specifically, the number of applications for the first network address is the same as the number of identifiers of the first service. For example, the first message includes identifiers of the first service: AID1, AID2, and AID3, which means that the first message is used to apply for a first network address to be allocated 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, and the number of applications for the first network address indicated by the quantity identification information is also 3. Through the quantity identification information, it is possible to allocate corresponding network addresses 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 number of applications for the first network address is 1.
[0279] In some possible embodiments, when there are multiple first service identifiers in the first message, each first service identifier may have corresponding unicast address identifier information, multicast address identifier information, or anycast address identifier information. In some possible embodiments, when the first network addresses corresponding to multiple first service identifiers are all used for unicast, multicast, or anycast, this may also be indicated by a flag bit, which is not specifically limited here.
[0280] In one specific implementation, the unicast address identification information is optional information in the first message. The unicast address identification information can be represented by a field, a flag, or a bit. For example, when a flag is set, it indicates that the first network address is a unicast address. Using the unicast address identification information, the second node can know that the first node is requesting the first service assigned to the first node or the first network address assigned to the first node for unicast.
[0281] In one specific implementation, the multicast address identification information is optional information in the first message. The multicast address identification information can be represented by a field, a flag, or a bit. Through the multicast address identification information, the second node can know that the first node is requesting the first service assigned to the first node or the first network address assigned to the first node for multicast.
[0282] It can be seen that the unicast address identification information and the multicast address identification information can be separately represented as described above. In this case, if the first message includes the unicast address identification information and the multicast address identification information, and the first network address is used for unicast, then only the unicast address identification information needs to be set accordingly.
[0283] In some possible embodiments, the unicast address identification information and the multicast address identification information may also 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 bit takes a second value, it indicates that the first network address is used for multicast.
[0284] In one specific implementation, the 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 requested the first network address allocated to the first service on the first node for anycast. The multicast address identification information can be represented by a field, a flag, or a bit. In some possible embodiments, the unicast address identification information, the multicast address identification information, and the anycast address identification information can also be represented by a field or a flag, etc., which will not be further described here.
[0285] The at least one of the unicast address identification information, the multicast address identification information, the anycast address identification information, or the quantity identification information may specifically include the following:
[0286] (1) Unicast address identification information
[0287] For example, the first message includes the first address type, the identity 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.
[0288] (2) Multicast address identification information
[0289] For example, the first message includes the first address type, the identity 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 multicast.
[0290] (3) Anycast address identification information
[0291] For example, the first message includes the first address type, the identity of the first node, the identifier of the first service and the anycast address identifier information, which indicates a request to allocate a first network address of the first address type for the first service on the first node, and the first network address is used for anycast.
[0292] (4) Quantity identification information
[0293] For example, the first message includes the first address type, the identity of the first node, and quantity identification information (which indicates that the application quantity of the first network address is 1). In this case, whether the first network address is used for unicast or multicast may be a system default.
[0294] For another example, the first message includes an identifier of a first service, an identifier of a 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 that the number of applications for the first network address is 2, which indicates a request to allocate a first network address of a first address type to services AID1 and AID2 respectively. In this case, whether the first network address is used for unicast, multicast, or anycast can be the system default.
[0295] (5) Unicast address identification information and multicast address identification information
[0296] For example, assuming that the first message requests allocation of a first network address of a first address type to the first node, and the first network address is used for unicast, if the first message includes unicast address identification information and multicast address identification information, in this case, the unicast address identification information and the multicast address identification information can be represented by flag bits respectively, wherein the flag bit corresponding to the unicast address identification information is set, and the flag bit corresponding to the multicast address identification information is not set.
[0297] For another example, assume that a first message requests allocation of a first network address of a first address type to services AID1 and AID2, respectively, and the first message further includes unicast address identification information and multicast address identification information. In this case, assume that the unicast address identification information corresponds to AID1 and is used to indicate that the first network address allocated to AID1 is for unicast, and the multicast address identification information corresponds to AID2 and is used to indicate that the first network address allocated to AID2 is for multicast.
[0298] (6) Unicast address identification information and anycast address identification information. For details, please refer to the example shown in situation (5).
[0299] (7) Multicast address identification information and anycast address identification information. For details, please refer to the example shown in situation (5).
[0300] (8) Unicast address identification information and quantity identification information
[0301] For example, assuming that the first message requests allocation of a first network address of a first address type for a first node, if the first message includes unicast address identification information and quantity identification information, the first network address is used for unicast, and the quantity identification information indicates that the application quantity of the first network address is 1.
[0302] For another example, assume that the first message requests allocation of a first network address of the first address type for services AID1 and AID2 respectively. If the first message includes unicast address identification information and quantity identification information, the first network addresses are all used for unicast, and the quantity identification information indicates that the requested number of first network addresses is 2.
[0303] (9) Multicast address identification information and quantity identification information. For details, please refer to the example shown in situation (8).
[0304] (10) Anycast address identification information and quantity identification information. For details, please refer to the example shown in situation (8).
[0305] (11) Unicast address identification information, multicast address identification information, and anycast address identification information. In this case, the unicast address identification information, multicast address identification information, and anycast address identification information can be represented by flag bits (or fields or bits), respectively. Whether the corresponding flag bits (or fields or bits) are set is determined based on actual applications.
[0306] (12) Unicast address identification information, multicast address identification information, and quantity identification information
[0307] For example, assuming that a first message requests allocation of a first network address of a first address type to a first node, if the first message includes unicast address identification information, multicast address identification information, and quantity identification information, in this case, the unicast address identification information and the multicast address identification information can be represented by flag bits, respectively. Assuming 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, the quantity identification information indicates that the application quantity of the first network address is 1, it can be seen that the first network address is used for multicast.
[0308] For another example, assuming that a first message requests allocation of a first network address of a first address type for 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, assuming that the unicast address identification information corresponds to AID1 and is used to indicate that the first network address allocated to AID1 is for unicast, and the multicast address identification information corresponds to AID2 and is used to indicate that the first network address allocated to AID2 is for multicast, then the quantity identification information indicates that the requested number of first network addresses is 2.
[0309] (13) Unicast address identification information, anycast address identification information and quantity identification information. For details, please refer to the example shown in situation (12).
[0310] (14) Multicast address identification information, anycast address identification information and quantity identification information. For details, please refer to the example shown in situation (12).
[0311] (15) Unicast address identification information, multicast address identification information, anycast address identification information, and quantity identification information. In this case, the unicast address identification information, multicast address identification information, and anycast address identification information can be represented by flag bits (or fields or bits), respectively. Whether the corresponding flag bits (or fields or bits) are set is determined based on actual applications.
[0312] In some possible embodiments, the network address historically assigned to the node may not be permanently stored in the first mapping information maintained by the above-mentioned second node, and the network address historically assigned to the service on the node may not be permanently stored in the above-mentioned second mapping information. For example, if the second node detects that the length of time that a node has not used the network address reaches a preset threshold, the second node may delete the network address corresponding to the node from the first mapping information; if the second node detects that the length of time that a service has not used the network address reaches a preset threshold, the second node may delete the network address corresponding to the service from the second mapping information. For another example, the second node receives an address release request sent by a 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.
[0313] S103: The second node sends a second message to the first node, where the second message includes the first network address.
[0314] Correspondingly, the first node receives the second message sent by the second node.
[0315] In the embodiment of the present application, the first network address may be assigned to the first node, or may be assigned to the first service on the first node.
[0316] Specifically, when the first message received by the second node includes the service identifier of the first node, the first network address is allocated to the first service on the first node; when the first message received by the second node does not include any service identifier, the first network address is allocated to the first node.
[0317] S104: The first node obtains the first network address according to the second message.
[0318] In the implementation of the present application, the first network address is allocated to the first node or the first service on the first node.
[0319] The type of the first network address is a first address type, and the first address type is a communication domain address or an IP address.
[0320] Exemplarily, 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 allocated to the first node. In this case, the first network address includes the IPv6 prefix of the first communication domain and the second network address, where the second network address is a network address of the communication domain address type used by the first node within the first communication domain.
[0321] In some possible embodiments, the first node may also change the address type. Specifically, the first node sends an eleventh message to the second node, the eleventh message including a second type identifier, the second type identifier indicating a second address type, the second address type being different from the first address type; receives a twelfth message from the second node, the twelfth message including a third network address allocated to the first node or the first service on the first node, the address type of the third network address being the second address type; and obtains the third network address based on the twelfth message.
[0322] Further, optionally, before proposing to change the address type, the first node may first request the second node to release the first network address of the first address type that was historically applied for by the first node or the first service on the first node. In some possible embodiments, the first node may not perform the action of requesting the address release, which is not specifically limited herein.
[0323] For example, assuming that a first network address of a first address type has been applied for in the past for 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 can delete the mapping relationship between the first node's identity, the first address type and the first network address from the first mapping information.
[0324] For another example, assuming that a first network address of a first address type has been applied for a first service on a first node in the past, before changing the address type, the first node can send a release request instruction to the second node so that the second node can delete the mapping relationship between the first node's identity, the first service's identity, the first address type, and the first network address from the second mapping information.
[0325] It can be seen that by implementing the embodiment of the present application, the first node newly online in the network can uniquely determine the second node with the address allocation service function that is connected, and the first node only obtains the allocated network address from the second node. The interactive process of address allocation is simple, which is conducive to improving the efficiency of network address allocation. And the mapping information locally maintained by the second node can ensure that the network address allocated to the first node or the service on the first node is not repeated. In addition, the first node can also indicate the address type of the network address 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. In addition, 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.
[0326] See Figure 4, which is a flowchart of another address allocation method provided in an embodiment of the present application. This method is applied to a communication system, which includes at least Node 1 and Node 2, where Node 1 is the node that submits the address request and Node 2 is the management node. This method includes but is not limited to the following steps:
[0327] S201: Node 1 selects access node 2 based on the broadcast message sent by node 2.
[0328] The broadcast message sent by the node 2 includes a service identifier, and the service identifier indicates that the node 2 provides an address allocation service, that is, the node 2 has an address allocation function.
[0329] In some possible embodiments, node 2 may be determined by node 1 from at least one node that sent the broadcast message. In one implementation, node 1 may determine node 2 from at least one node based on at least one of the node's priority information, detected signal strength, or the time the broadcast message was received. For example, node 2 may be the node corresponding to the broadcast message first received by node 1, the node corresponding to the highest signal strength detected by node 1, or the node with the highest priority, without further limitation.
[0330] Exemplarily, node 1 selecting access to node 2 may be: node 1 establishes a default bearer with node 2 to activate a universal management transmission channel, so that node 1 can exchange address request signaling with node 2 via the universal management transmission channel, for example, the first message described below. The universal management transmission channel is a communication channel.
[0331] In the embodiment of the present application, node 2 is a management node in the communication domain, and node 2 is also an access point of node 1.
[0332] Exemplarily, node 1 may be any node T among nodes T1, T2, ..., Tn in FIG1(a) above, and node 2 may be node G in FIG1(a).
[0333] Exemplarily, node 1 may be node G2 or G3 in FIG. 1( b ) above, and node 2 may be node G1 in FIG. 1( b ) above.
[0334] Exemplarily, node 1 may be node G2 or G3 in (c) of FIG. 1 , and node 2 may be node G1 in (c) of FIG. 1 .
[0335] S202: Node 1 sends a first message to node 2.
[0336] In one implementation, the first message includes an identity identifier and a first type identifier of node 1, and the first type identifier indicates a first address type. In this case, if the first message does not include an identifier of any service, it indicates that the first message is used to request allocation of a first network address for node 1.
[0337] The first address type is a communication domain address or an IP address.
[0338] The identity of node 1 is used to identify node 1. For example, the identity of node 1 may be L2ID of node 1.
[0339] In another implementation, the first message further includes an identifier of the first service on node 1 . In this case, it indicates that the first message is used to request allocation of a first network address for the first service.
[0340] S203: Node 2 sends a second message to node 1.
[0341] In the embodiment of the present application, before node 2 sends the second message to node 1, node 2 needs to first obtain the first network address according to the first address type. For the specific process, please refer to C11-C13:
[0342] C11: Determine whether the first message includes the identifier of the first service.
[0343] When the first message does not include the identifier of the first service, it is determined that the first network address is allocated to node 1 and C12 is executed; when the first message includes the identifier of the first service, it is determined that the first network address is allocated to the first service on node 1 and C13 is executed.
[0344] C12: Obtain a first network address allocated to node 1 according to the first address type and the identity identifier of node 1.
[0345] In one specific implementation, a first network address assigned to node 1 is obtained based on a first mapping relationship. The first mapping relationship represents a mapping relationship between the identity of node 1, the first network address, and the first address type. The first mapping relationship belongs to Set 1, which includes 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. It can be understood that Set 1 is the first mapping information in the embodiment of FIG. 3 .
[0346] In another specific implementation, node 2 assigns a first network address to node 1 based on the first address type and the identity of node 1. That is, if node 1 has not been previously assigned a network address of the first address type, node 2 assigns the first network address to node 1. Furthermore, node 2 may also add the first network address of the first address type assigned to node 1 to the aforementioned set 1.
[0347] The first address type may be a communication domain address or an IP address.
[0348] In this case, the second message sent by node 2 to node 1 includes the first network address, wherein the first network address is allocated to node 1.
[0349] C13: Obtain a first network address allocated to the first service according to the first address type and the identifier of the first service.
[0350] In a specific implementation, a first network address assigned to a first service is obtained based on a second mapping relationship. The second mapping relationship represents a mapping relationship between 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 Set 2, which includes mapping relationships between the identity 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 .
[0351] In another specific implementation, node 2 allocates a first network address to the first service based on the first address type and the identifier of the first service. That is, if no network address of the first address type has been historically allocated to the first service on node 1, node 2 allocates the first network address to the first service. Furthermore, node 2 may also add the first network address of the first address type allocated to the first service on node 1 to the aforementioned set 2.
[0352] The first address type may be a communication domain address or an IP address.
[0353] In this case, the second message sent by node 2 to node 1 includes the first network address, wherein the first network address is allocated to the first service on node 1 .
[0354] Optionally, in some possible embodiments, when the first address type is an IP address and node 2 does not have a DHCP function, node 2 may further obtain the first network address through S204 and S205 before sending the second message to node 1:
[0355] S204: Node 2 sends a third message to the DHCP server.
[0356] In one implementation, the third message includes the first type identifier and the identity identifier of node 1, requesting the DHCP server to assign the first network address to node 1. In this case, the third message is specifically described in the embodiment of "First Type: First Network Address Assigned to First Node" in S102 of Figure 3, and is not further described here.
[0357] In another implementation, the third message includes the first type identifier, the identity identifier of node 1, and the identifier of the first service on node 1, requesting the DHCP server to allocate the first network address to the first service on node 1. In this case, the third message is specifically described in the embodiment of "Second type: first network address allocated to service on first node" in S102 of Figure 3, and is not further described here.
[0358] The type of the first network address is an IP address.
[0359] S205: The DHCP server sends the first network address to node 2.
[0360] In one implementation, when the first message does not include the identifier of the first service, the DHCP server allocates the first network address to the node 1 according to the first address type and the identity identifier of the node 1.
[0361] In another implementation, when the first message includes the identifier of the first service, 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.
[0362] After the DHCP server obtains the first network address through the above implementation, it may send a message carrying the first network address to node 2 .
[0363] In addition, the DHCP server can also add relevant information of the newly allocated first network address to the local address management information, for example, the mapping relationship between the identity of node 1, the first address type and the first network address of node 1, or the mapping relationship between the identifier of the first service, the first network address of the first service, the first address type and the identity of node 1, which is not specifically limited here.
[0364] In some possible embodiments, node 2 may further send the third message in S204 to multiple DHCP servers; receive address allocation feedback messages sent by multiple DHCP servers, the address allocation feedback message corresponding to the DHCP server including the first network address allocated by the DHCP server based on the third message; select a target DHCP server from the multiple DHCP servers; and obtain the first network address based on the address allocation feedback message sent by the target DHCP server. In addition, after obtaining the first network address, node 2 may further broadcast message 1, which is used to indicate that node 2 has selected the network address provided by the target DHCP server. In this way, the target DHCP server that receives message 1 may send a confirmation message to node 2 to indicate that the first network address selected by node 2 can be used. Other non-selected DHCP servers that receive message 1 may know that the network address provided by themselves has not been selected by node 2, and thus may reclaim the provided network address, thereby avoiding address waste.
[0365] In this case, compared with the traditional DHCP address allocation method, the client's work of performing address selection and receiving confirmation messages from the DHCP server is offloaded to node 2. This can reduce the burden on node 1, make the protocol stack on node 1 lightweight, and reduce the power consumption of node 1.
[0366] Among them, the target DHCP server can be the DHCP server corresponding to the maximum signal strength, or the DHCP server corresponding to the address allocation feedback message received earliest by node 2, or the DHCP server corresponding to the highest priority, or it can be determined by point 2 based on 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, which is not specifically limited here.
[0367] S206: Node 1 obtains the first network address according to the second message.
[0368] After obtaining the first network address, node 1 may perform local configuration according to the first network address.
[0369] It can be seen that by implementing the embodiment of the present application, node 1 that submits an address application can determine to discover and access a node 2 that has an address allocation service, and only receive the first allocated network address from node 2, which is conducive to improving the efficiency of network address allocation and can realize the allocation of network addresses in a star single-hop topology scenario. In addition, node 1 can also choose to apply for the desired address type and apply for a network address for a specific object (for example, a node or a service on a node), enriching the application scenarios of address allocation.
[0370] See Figure 5, which is a flowchart of another address allocation method provided in an embodiment of the present application. This 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 submits an address request, Node 2 is the access point for Node 1, and Node 3 is the management node. This method includes but is not limited to the following steps:
[0371] S301: Node 1 selects access node 2 based on the broadcast message sent by node 2.
[0372] The specific process of node 1 accessing node 2 can be referred to the relevant description of S201 in the embodiment of FIG4 , which will not be repeated here.
[0373] In the embodiment of the present application, 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.
[0374] For example, referring to FIG1(b), the node 3 may be the node G1, and the nodes 1 and 2 satisfy any of the following conditions:
[0375] (1) Node 1 is node T1 or G4, and node 2 is node G2;
[0376] (2) Node 1 is node T2, and node 2 is node G4; and
[0377] (3) Node 1 is node G4 or T3, and node 2 is node G3.
[0378] For example, referring to (c) of FIG. 1 , the node 3 may be the node G1, and the nodes 1 and 2 satisfy any of the following conditions:
[0379] (1) Node 1 is node T1 or T2, and node 2 is node G2; or
[0380] (2) The first node is node T3 or T4, and the second node is node G3.
[0381] S302: Node 1 sends a first message to node 2. For details of this step, please refer to the relevant description of S202 in the embodiment of FIG4 , and will not be repeated here.
[0382] S303: Node 2 determines whether the first message includes the identifier of the first service.
[0383] In the case that the first message does not include the identifier of the first service, it indicates that the first message is used to request allocation of the first network address to the node 1, and S304 is executed;
[0384] In the case that the first message includes the identifier of the first service, it means that the first message is used to request allocation of a first network address for the first service on node 1, and S305 is executed.
[0385] S304: Node 2 determines whether the mapping information includes the first mapping relationship.
[0386] The first mapping relationship represents the mapping relationship between the identity identifier of the node 1, the first network address and the first address type.
[0387] In this case, the mapping information is a set 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. In this case, the mapping information is the first mapping information in the embodiment of Figure 3 or the set 1 in the embodiment of Figure 4.
[0388] When the mapping information includes the first mapping relationship, the first network address allocated to the node 1 can be obtained according to the first mapping relationship.
[0389] When the mapping information does not include the first mapping relationship, S306 is executed, so that node 3 executes S307.
[0390] S305: Node 2 determines whether the mapping information includes the second mapping relationship.
[0391] The second mapping relationship represents the mapping relationship between the identity of node 1, the identifier of the first service, the first network address, and the first address type. In this case, 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 of the node where the service is located. In this case, the mapping information is the second mapping information in the embodiment of Figure 3 or Set 2 in the embodiment of Figure 4.
[0392] When the mapping information includes the second mapping relationship, the first network address allocated to the first service can be obtained according to the second mapping relationship.
[0393] When the mapping information does not include the second mapping relationship, S306 is executed, so that node 3 executes S308.
[0394] S306: Node 2 sends a third message to node 3.
[0395] Correspondingly, node 3 receives the third message sent by node 2.
[0396] In one specific implementation, corresponding to S304 above, the third message includes the first type identifier and the identity identifier of node 1, where the first type identifier indicates the first address type, and the first message does not include any service identifiers. In this case, the third message is described in detail in the embodiment "First Type: First Network Address Assigned to First Node" in S102 of Figure 3 , and is not further described here.
[0397] In another specific implementation, corresponding to S305 above, the third message includes the first type identifier, the identity identifier of node 1, and the identifier of the first service on node 1. In this case, the third message can be specifically described in the embodiment of "Second category: first network address is allocated to service on first node" in S102 of Figure 3, and will not be repeated here.
[0398] In some possible embodiments, there may be at least one sink node between node 2 and node 3. In this case, node 2 may also send all information related to the allocation of the first network address in the first message to node 3 through the at least one sink node.
[0399] In some possible embodiments, 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.
[0400] S307: Node 3 allocates a first network address to node 1 according to the first address type and the identity identifier of node 1.
[0401] In some possible embodiments, after node 3 allocates the first network address to node 1, node 3 may further store the mapping relationship between the identity identifier of node 1, the first address type, and the first network address to ensure that the allocated network address is non-repetitive.
[0402] S308: Node 3 allocates a first network address to the first service according to the first address type and the identifier of the first service.
[0403] In some possible embodiments, after node 3 allocates a first network address to the first service on node 1, node 3 may also store the mapping relationship between the identifier of the first service, the first network address, the first address type and the identity identifier of node 1 to ensure that the allocated network address is non-repetitive.
[0404] S309: Node 3 sends the first network address to node 2.
[0405] The first network address may be carried in a message, for example, an address allocation feedback message.
[0406] Correspondingly, node 2 obtains the first network address from node 3, that is, when node 2 fails to find the first mapping relationship or the second mapping relationship in the locally stored mapping information, node 2 can obtain the allocated first network address from node 3.
[0407] In some possible embodiments, 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 a preset rule and obtain the first network address provided by the target management node. In addition, after obtaining the first network address, node 2 can also broadcast message 2, which 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. Other non-selected management nodes that receive message 2 can know that the network address provided by themselves has not been selected by node 2, and can thus reclaim the provided network address, avoiding waste of addresses.
[0408] The preset rules include but are not limited to priority exceeding a preset level, signal strength exceeding a preset threshold, the node corresponding to the earliest received address allocation feedback message, etc. This embodiment can also refer to the description of selecting the target management node in the embodiment of FIG3 , which will not be repeated here.
[0409] In some possible embodiments, when there is at least one sink node between node 3 and node 2, node 3 sending the first network address to node 2 may include: node 3 sending the first network address to node 2 through the at least one sink node.
[0410] S310: Node 2 sends a second message to node 1.
[0411] In one specific implementation, the second message includes the first network address, and the first network address is assigned to node 1 .
[0412] In another specific implementation, the second message includes the first network address, wherein the first network address is assigned to the first service on node 1.
[0413] It can be understood that based on the above S304-S309, the first network address can be obtained by node 2 from local mapping information, or the first network address can be obtained by node 2 from node 3, which is not specifically limited here.
[0414] S311: Node 1 obtains the first network address according to the second message.
[0415] It can be seen that by implementing the embodiment of the present application, node 1 that submits an address application can determine to discover and access a node 2 that has an address allocation service, and only receive the first network address allocated from node 2, which is conducive to improving the efficiency of network address allocation and can realize the allocation of network addresses in a tree-like multi-hop topology scenario. In addition, node 1 can also apply for the desired address type and apply for a network address for a specific object (for example, a node or a service on a node), enriching the application scenarios of address allocation.
[0416] See Figure 6, which is a flowchart of another address allocation method provided in an embodiment of the present application. This 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 submits the address application, node 2 is the access point of node 1, and node 3 is the management node. Unlike the embodiment of Figure 5, Figure 6 provides a method for allocating a local IPv6 address to a node when the first address type is an IP address. This method includes but is not limited to the following steps:
[0417] S401: 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 FIG5 , and will not be repeated here.
[0418] S402: Node 1 sends a first message to node 2.
[0419] The first message includes the identity identifier and the first type identifier of node 1 , the first type identifier indicates the first address type, and the identity identifier of node 1 is used to identify node 1 .
[0420] In the embodiment of the present application, the first address type is an IP address.
[0421] S403: Node 2 determines whether the second network address history of the address type of the communication domain address used by node 1 in the first communication domain has been allocated.
[0422] Specifically, if node 2 determines that the second network address history has been allocated, S404 and S408 are executed; if node 2 determines that the second network address history has not been allocated, S405 to S408 are executed in sequence.
[0423] Exemplarily, node 2 can determine whether the second network address history of node 1 in the first communication domain, whose address type is a communication domain address, has been allocated based on locally maintained address allocation information (for example, the first mapping information in the embodiment of FIG3 ). Specifically, when node 2 finds the network address corresponding to the identity identifier of node 1 in the mapping information and the address type of the network address is a communication domain address, it indicates that the second network address history has been allocated; when node 2 does not find the network address corresponding to the identity identifier of node 1 in the mapping information, or when node 2 finds the network address corresponding to the identity identifier of node 1 in the mapping information but the address type of the network address is not a communication domain address, it indicates that the second network address history has not been allocated.
[0424] S404: Node 2 obtains a historically allocated second network address, and obtains a first network address according to the second network address and the IPv6 prefix of the first communication domain.
[0425] That is, in the case where the second network address has been historically allocated, the first network address can be directly allocated by node 2 .
[0426] The type of the second network address is a communication domain address. The second network address can 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.
[0427] In one implementation, the length of the second network address may be 8 bits, 16 bits, 24 bits, or other number of bits, which is not specifically limited here.
[0428] In a specific implementation, obtaining the first network address according to 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.
[0429] In this way, the second network address of the communication domain address type historically assigned 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 number of addresses, but also ensures that the first network address assigned to node 1 is not repeated.
[0430] S405: Node 2 sends a third message to node 3.
[0431] If the second network address has not been historically allocated, node 2 sends a third message to node 3, requesting node 3 to allocate the first network address to node 1 based on the third message. The third message includes the first type identifier and the identity identifier of node 1. For details about the third message, refer to the description of the third message in the embodiment "First Category: First Network Address Allocated to First Node" in S102 of Figure 3 , and will not be repeated here.
[0432] Correspondingly, node 3 receives the third message sent by node 2.
[0433] In some possible embodiments, when there is at least one aggregation node between node 2 and node 3, in this case, node 2 can also send all information related to the allocation of the first network address in the first message to node 3 through the at least one aggregation node.
[0434] S406: Node 3 allocates a second network address to node 1, and obtains the first network address according to the second network address and the IPv6 prefix of the first communication domain.
[0435] S407: Node 3 sends the first network address to node 2.
[0436] The first network address may be carried in one message.
[0437] Correspondingly, node 2 obtains the first network address from node 3 .
[0438] In some possible embodiments, when there is at least one sink node between node 3 and node 2, node 3 sending the first network address to node 2 may include: node 3 sending the first network address to node 2 through the at least one sink node.
[0439] S408: Node 2 sends a second message to node 1.
[0440] Correspondingly, node 1 receives the second message sent by node 2.
[0441] The second message includes the first network address allocated to node 1 .
[0442] S409: Node 1 obtains the first network address according to the second message.
[0443] As can be seen, by implementing the embodiment of the present application, node 1 submitting an address request can determine whether to discover and access a node 2 that provides address allocation services, and only receive the first network address allocated from node 2. This helps improve the efficiency of network address allocation and supports the allocation of local IPv6 addresses to nodes through a multi-hop mechanism. In addition, node 1 can also apply for specific types of network addresses, enriching the application scenarios of address allocation.
[0444] 7 is a schematic diagram of the structure of an address allocation device provided in an embodiment of the present application, wherein 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 hardware and software.
[0445] Among them, the receiving unit 310 is used to receive a first message sent by the first node, the first message includes a first type identifier, and the first type identifier indicates a first address type; the sending unit 312 is used to send a second message to the first node, the second message includes a first network address allocated to the first node or to a service on the first node, and the address type of the first network address is a first address type.
[0446] In some possible embodiments, the address allocating device 30 further includes a processing unit (not shown), which is configured to obtain the first network address according to the first address type.
[0447] The address allocation device 30 can be used to implement the method on the second node side described in the embodiment of Figure 3. In the embodiment of Figure 3, the receiving unit 310 can be used to perform S101, and the sending unit 312 can be used to perform S103. Optionally, the processing unit can be used to perform S102 in the embodiment of Figure 3. The address allocation device 30 can also be used to implement the method on the node 2 side described in the embodiments of Figures 4, 5, and 6. For the sake of brevity, these details are not repeated here.
[0448] 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 codes, and may be executed by a hardware processor. The hardware includes, but is not limited to, various integrated circuits, such as a central processing unit (CPU), a digital signal processor (DSP), a field-programmable gate array (FPGA), or an application-specific integrated circuit (ASIC).
[0449] 8 is a schematic diagram of the structure of an address acquisition device provided in 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 hardware and software.
[0450] Among them, 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 a first address type; the receiving unit 414 is used to receive a 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 a first address type; the obtaining unit 412 is used to obtain the first network address according to the second message.
[0451] The address acquisition device 40 can be used to implement the method on the first node side described in the embodiment of Figure 3. In the embodiment of Figure 3, the sending unit 410 can be used to perform S101, the receiving unit 414 can be used to perform S103, and the acquisition 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, this description will not be repeated here.
[0452] One or more of the various units in the embodiment shown in FIG8 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 codes, and may be executed by a hardware processor. The hardware includes, but is not limited to, various integrated circuits, such as a central processing unit (CPU), a digital signal processor (DSP), a field-programmable gate array (FPGA), or an application-specific integrated circuit (ASIC).
[0453] Referring to Figure 9 , which is a schematic diagram of the structure of a communication device provided in an embodiment of the present application, as shown in Figure 9 , 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 with each other via the bus 504 .
[0454] It should be understood that the present application does not limit the number of processors and memories in the communication device 50 .
[0455] In one specific implementation, the communication device 50 may be the first node that makes an address application in the above-mentioned embodiment. The first node may be, for example, a user terminal in a vehicle in an in-vehicle communication scenario. The user terminal may be, for example, a mobile phone, a tablet computer, a PDA, a desktop computer, a headset, a speaker, a wearable device, a vehicle-mounted device, a virtual reality device, an augmented reality device, etc. The first node may also be, for example, a household appliance in a smart home scenario, such as a TV, a sweeping robot, a printer, a projector, a user's mobile phone, an electric rice cooker, a speaker, a microphone, a wireless router, etc. The first node may also be, for example, a BMU in a battery management system BMS scenario. In some possible embodiments, the first node may also be a component in the above-mentioned user terminal or a component in a household appliance, wherein the component may be, for example, a single board, a line card, or a chip.
[0456] In another specific implementation, the communication device 50 may be the second node with address allocation functionality in the above-described embodiment. For example, the second node may be a T-BOX in an in-vehicle communication scenario, or a component within the T-BOX, such as a board, line card, or chip. The second node may also be, for example, a gateway, CPE (Customer Premises Equipment), a wireless router, or a user's mobile phone in a smart home scenario. The second node may also be, for example, a BCU or BMU in a battery management system (BMS) scenario, without specific limitation.
[0457] Bus 504 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG8 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 504 may include a pathway for transmitting information between the various components of communication device 50 (e.g., memory 503, processor 501, and communication interface 502).
[0458] The processor 501 may include any one or more processors such as a central processing unit (CPU), a microprocessor (MP), or a digital signal processor (DSP).
[0459] Memory 503 is used to provide storage space for storing data such as the operating system and computer programs. Memory 503 can be one or a combination of random access memory (RAM), erasable programmable read-only memory (EPROM), read-only memory (ROM), or compact disc read-only memory (CD-ROM). Memory 503 can exist independently or be integrated into processor 501.
[0460] The communication interface 502 can be used to provide information input or output for the processor 501. Alternatively, the communication interface 502 can be used to receive data transmitted externally and / or transmit data externally. It can be a wired link interface such as an Ethernet cable, or a wireless link interface (such as Wi-Fi, Bluetooth, general wireless transmission, etc.). Alternatively, the communication interface 502 can also include a transmitter (such as a radio frequency transmitter, antenna, etc.) or a receiver coupled to the interface.
[0461] The processor 501 in the communication device 50 is used to read the computer program stored in the memory 503 to execute the aforementioned method, such as the method described in Figure 3, Figure 4, Figure 5 or Figure 6.
[0462] In one possible design, the communication device 50 may be one or more modules in an execution entity of the method on the first node side shown in FIG3 , and the processor 501 may be configured to read one or more computer programs stored in a memory to perform the following operations:
[0463] Sending a first message to the second node through the sending unit 410, where the first message includes a first type identifier, and the first type identifier indicates a first address type;
[0464] receiving, through the receiving unit 414, a second message sent by the second node, where the second message includes a first network address allocated to the first node or to a service on the first node, where the address type of the first network address is a first address type;
[0465] According to the second message, a first network address is obtained.
[0466] In one possible design, the communication device 50 may be one or more modules in an execution entity of the method on the second node side shown in FIG3 , and the processor 501 may be configured to read one or more computer programs stored in a memory to perform the following operations:
[0467] receiving, by the receiving unit 310, a first message sent by the first node, where the first message includes a first type identifier, and the first type identifier indicates a first address type;
[0468] The second message is sent to the first node through the sending unit 312. The second message includes a first network address allocated to the first node or to a service on the first node. The address type of the first network address is a first address type.
[0469] An embodiment of the present application also provides a communication system, which includes a first device and a second device, wherein the first device can be, for example, the address acquisition device 40 shown in Figure 8 or the communication device 50 as the first node shown in Figure 9, and the second device can be, for example, the address allocation device 30 shown in Figure 7 or the communication device 50 as the second node shown in Figure 9. The first device can be used to execute the method on the first node side shown in the embodiment of Figure 3 above, and the second device can be used to execute the method on the second node side shown in the embodiment of Figure 3. In some possible embodiments, the communication system can also be used to execute the method shown in Figure 4, Figure 5, or Figure 6 above.
[0470] In the embodiments described above, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0471] It should be noted that those skilled in the art can see that all or part of the steps in the various methods of the above embodiments can be completed by a program to instruct relevant hardware. The program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0472] The technical solution of the present application, or the part that contributes to the prior art, 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 for enabling a device (which can be a personal computer, a server, or a network device, a robot, a single-chip microcomputer, a chip, a robot, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
Claims
1. An address allocation method, characterized in that: The method comprises: receiving a first message sent by a first node, where the first message includes a first type identifier, and the first type identifier indicates a first address type; A second message is sent to the first node, where the second message includes a first network address allocated to the first node or to a service on the first node, and the address type of the first network address is the first address type.
2. The method according to claim 1, characterized in that The method is applied to a second node, and the first node and the second node belong to a first communication domain.
3. The method according to claim 2, characterized in that The first address type is a communication domain address or an IP address.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: According to the first address type, the first network address is obtained.
5. The method according to claim 4, characterized in that The first message also includes an identity of the first node, and obtaining the first network address according to the first address type includes: Obtaining the first network address according to a first mapping relationship, where the first mapping relationship represents a mapping relationship between the identity of the first node, the first network address, and the first address type; The first mapping relationship belongs to a set of mapping relationships including an identity of a node assigned to a network address, the network address of the node, and an address type of the network address of the node.
6. The method according to claim 4, characterized in that The first message also includes an identity of the first node and an identifier of a first service on the first node. Obtaining the first network address according to the first address type includes: Obtain the first network address according to a second mapping relationship, where the second mapping relationship represents a mapping relationship between the identity of the first node, the identifier of the first service, the first network address, and the first address type; 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 identifier of the node where the service is located.
7. The method according to claim 4, characterized in that The obtaining the first network address according to the first address type includes: The first network address is allocated according to the first address type.
8. The method according to claim 4, characterized in that The first message also includes an identifier of a first service on the first node, and obtaining the first network address according to the first address type includes: The first network address allocated to the first service is obtained according to the first address type and the identifier of the first service.
9. The method according to claim 3, characterized in that The first address type is an IP address, and 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 one or more of an identity identifier of the first node and an identifier of a first service on the first node; A fourth message sent by the DHCP server is received, where the fourth message includes the first network address, and the first network address is allocated by the DHCP server based on the third message.
10. The method according to claim 2 or 3, characterized in that The method further comprises: Sending a third message to a third node, where the third message includes the first type identifier and one or more of an identity identifier of the first node and an identifier of a first service on the first node, where the third node is a management node within the first communication domain; A fifth message sent by the third node is received, where the fifth message includes the first network address, and the first network address is allocated by the third node based on the third message.
11. The method according to claim 2 or 3, characterized in that The first communication domain includes a plurality of management nodes, and the method further includes: Sending a third message to the multiple management nodes, where the third message includes the first type identifier and further includes one or more of an identity identifier of the first node and an identifier of a first service on the first node; receiving sixth messages sent by the multiple management nodes, where the sixth messages corresponding to the management nodes include network addresses allocated by the management nodes based on the third message; The first network address is obtained according to a sixth message sent by a target management node among the multiple management nodes.
12. The method according to claim 3, characterized in that The first address type is an IP address, and the method further includes: Acquire a second network address allocated historically, where the second network address is a network address of a communication domain address type used by the first node in the first communication domain; The first network address is obtained according to the IPv6 prefix of the first communication domain and the second network address.
13. The method according to claim 3, characterized in that The first address type is an IP address, and the method further includes: Allocating a second network address to the first node, where the address type of the second network address is 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.
14. The method according to claim 3, characterized in that The first address type is an IP address, and the method further includes: Sending a third message to a fourth node, where the third message includes the first type identifier and the identity identifier of the first node, and the fourth node is a management node in the first communication domain; Receive the seventh message sent by the fourth node, the seventh message including the first network address, the first network address including the IPv6 prefix of the first communication domain and the second network address, the second network address being a network address of the address type of the communication domain address used by the first node in the first communication domain, and the first network address being allocated by the fourth node based on the third message.
15. The method according to any one of claims 1 to 14, characterized in that The first message further 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; or The quantity identification information is used to indicate the application quantity of the first network address.
16. The method according to any one of claims 1 to 15, characterized in that The method further comprises: receiving an eighth message sent by the first node, where the eighth message includes a second type identifier, where the second type identifier indicates a second address type, and the second address type is different from the first address type; A ninth message is sent to the first node, where the ninth message includes a third network address allocated to the first node or to a service on the first node, and the address type of the third network address is the second address type.
17. An address allocation method, characterized in that: Applied to the first node, the method includes: Sending a first message to the second node, where the first message includes a first type identifier, and the first type identifier indicates a first address type; receiving a second message sent by the second node, where the second message includes a first network address allocated to the first node or a service on the first node, where the address type of the first network address is the first address type; The first network address is obtained according to the second message.
18. The method according to claim 17, characterized in that The first node and the second node belong to a first communication domain.
19. The method according to claim 17 or 18, characterized in that The first address type is a communication domain address or an IP address.
20. The method according to claim 19, characterized in that 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 and a second network address, and the second network address is a network address of the communication domain address type used by the first node in the first communication domain.
21. The method according to any one of claims 17 to 19, characterized in that The first message further includes an identifier of a first service on the first node, and the first network address is allocated to the first service.
22. The method according to any one of claims 17 to 21, characterized in that The first message further includes at least one of the following information: the identity of the first node; 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; or The quantity identification information is used to indicate the application quantity of the first network address.
23. The method according to any one of claims 17 to 22, characterized in that: The method further comprises: Sending a third message to the second node, where the third message includes a second type identifier, where the second type identifier indicates a second address type, and the second address type is different from the first address type; receiving a fourth message sent by the second node, where the fourth message includes a third network address allocated to the first node or to a service on the first node, and the address type of the third network address is the second address type; The third network address is obtained according to the fourth message.
24. An address allocation device, characterized in that: The device includes a processing unit and a communication unit, and the communication device is used to implement the method according to any one of claims 1 to 16.
25. An address acquisition device, characterized in that: The device includes a processing unit and a communication unit, and the communication device is used to implement the method according to any one of claims 17 to 23.
26. A communication device, characterized in that: The communication device includes at least one processor and a communication interface; The communication interface is used to receive and / or send data, and / or the communication interface is used to provide input and / or output for the processor; The at least one processor is used to implement the method according to any one of claims 1 to 16, or to implement the method according to any one of claims 17 to 23.
27. A system, characterized in that The system comprises at least a first device and a second device, wherein: The first device includes the address acquisition device according to claim 25, The second device comprises the address allocating device according to claim 24.
28. A terminal, characterized in that: The terminal includes the device according to any one of claims 24 to 26, or includes the system according to claim 27.
29. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on at least one processor, the method according to any one of claims 1 to 16 is implemented, or the method according to any one of claims 17 to 23 is implemented.
