CN110086862B - Identification distribution method, device, equipment and storage medium - Google Patents

Identification distribution method, device, equipment and storage medium Download PDF

Info

Publication number
CN110086862B
CN110086862B CN201910319497.6A CN201910319497A CN110086862B CN 110086862 B CN110086862 B CN 110086862B CN 201910319497 A CN201910319497 A CN 201910319497A CN 110086862 B CN110086862 B CN 110086862B
Authority
CN
China
Prior art keywords
identifier
message
occupied
session
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910319497.6A
Other languages
Chinese (zh)
Other versions
CN110086862A (en
Inventor
黄娜
郝桂兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN201910319497.6A priority Critical patent/CN110086862B/en
Publication of CN110086862A publication Critical patent/CN110086862A/en
Application granted granted Critical
Publication of CN110086862B publication Critical patent/CN110086862B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The embodiment of the application provides an identification distribution method, an identification distribution device, identification equipment and a storage medium. The scheme is as follows: the method comprises the steps that first equipment of a first backup group in the multi-master networking applies for a first identifier for a first session, the first identifier is sent to second equipment of a second backup group in the multi-master networking, the second equipment detects whether the first identifier is occupied or not, the first equipment receives a first message which is sent by the second equipment and aims at the first identifier, and if the first message contains a first message code indicating that the identifier is not occupied, the first equipment allocates the first identifier to the first session. By the technical scheme provided by the embodiment of the application, the probability of session identification conflict can be effectively reduced.

Description

Identification distribution method, device, equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for identifier allocation.
Background
In the process of accessing the server by the user side, the gateway device maintains the corresponding session according to the access behavior of the user side. Meanwhile, the gateway device also allocates a corresponding identifier, that is, a Session Identifier (ID), to the maintained Session, and returns the allocated identifier to the user side. When the user accesses the server, the server determines the access authority of the user according to the identifier carried in the access process of the user, thereby maintaining the network security.
Only one backup group exists in the main and standby networks, namely one main device exists, the identification of each session is allocated by the main device, the problem that a plurality of sessions share one identification cannot occur, and the problem of session identification conflict cannot occur. However, in the multi-master networking, there are multiple backup groups, that is, there are multiple master devices, and taking a dual-master networking as an example, there are two master devices in the dual-master networking, and there may be a mutual backup relationship between the two master devices, that is, the two master devices in the dual-master networking are backup to each other, and both the two master devices may allocate an identifier for a session. At this time, the two masters are likely to assign the same identification to the two sessions, which makes it highly likely that a conflict occurs when one of the two masters backs up the identification assigned to the session to the other master.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, a device, and a storage medium for allocating session identifiers, so as to reduce the probability of session identifier collision. The specific technical scheme is as follows:
the embodiment of the application provides an identifier allocation method, which is applied to first equipment of a first backup group in a multi-master networking, wherein the first backup group comprises the first equipment and second equipment, and the first equipment is master equipment of the first backup group and is backup equipment of a second backup group in the multi-master networking; the second device is a backup device of the first backup group and is a primary device of the second backup group, and the method includes:
applying for a first identifier for a first session;
sending the first identifier to the second device, so that the second device detects whether the first identifier is occupied;
receiving a first message aiming at the first identification sent by the second equipment;
and if the first message contains a first message code indicating that the identifier is not occupied, allocating the first identifier to the first session.
The embodiment of the present application further provides an identifier allocation method, which is applied to a second device of a second backup group in a multi-master networking, where the second backup group includes a first device and a second device, and the first device is a backup device of the second backup group and is a master device of a first backup group in the multi-master networking; the second device is a primary device of the second backup group and is a backup device of the first backup group, and the method includes:
receiving a first identifier sent by the first equipment; the first identifier is an identifier of the first device as a first session application;
detecting whether the first identifier is occupied;
if the first identifier is not occupied, sending a first message containing a first message code indicating that the first identifier is not occupied to the first device, so that the first device allocates the first identifier to the first session according to the first message code.
The embodiment of the present application further provides an identifier allocating apparatus, which is applied to a first device of a first backup group in a multi-master networking, where the first backup group includes a first device and a second device, where the first device is a master device of the first backup group and is a backup device of the second backup group in the multi-master networking; the second device is a backup device of the first backup group and is a master device of the second backup group, and the apparatus includes:
the first application module is used for applying for a first identifier for the first session;
a first sending module, configured to send the first identifier to the second device, so that the second device detects whether the first identifier is occupied;
a first receiving module, configured to receive a first message, which is sent by the second device and is addressed to the first identifier;
a first allocating module, configured to allocate the first identifier to the first session when the first message received by the first receiving module includes a first message code indicating that the identifier is not occupied.
The embodiment of the present application further provides an identifier allocating apparatus, which is applied to a second device in a second backup group in a multi-master networking, where the second backup group includes a first device and a second device, and the first device is a backup device of the second backup group and is a master device of a first backup group in the multi-master networking; the second device is a primary device of the second backup group and is a backup device of the first backup group, and the apparatus includes:
the second receiving module is used for receiving the first identifier sent by the first equipment; the first identifier is an identifier of the first device as a first session application;
the second detection module is used for detecting whether the first identifier is occupied or not;
a third sending module, configured to send, to the first device, a first message including a first message code indicating that the first identifier is unoccupied when the second detecting module determines that the first identifier is unoccupied, so that the first device allocates the first identifier to the first session according to the first message code.
An embodiment of the present invention further provides a device for each backup group in a multi-master networking, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor is caused by the machine-executable instructions to: implementing any of the above described identifier assignment method steps.
Embodiments of the present invention also provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implementing any of the above described identifier assignment method steps.
According to the identifier allocation method, device, equipment and storage medium provided by the embodiment of the application, first equipment of a first backup group in a multi-master networking can apply for a first identifier for a first session; the first identification is sent to second equipment of a second backup group in the multi-master networking, so that the second equipment detects whether the first identification is occupied, the first equipment receives a first message which is sent by the second equipment and aims at the first identification, and if the first message contains a first message code indicating that the identification is not occupied, the first equipment allocates the first identification to a first session.
According to the technical scheme provided by the embodiment of the application, before the first device allocates the identifier for the first session, the identifier is determined to be not occupied in the first device and the second device, so that the identifier allocated for the first session by the first device does not conflict with the identifiers allocated for other sessions by the second device, and the probability of conflict of session identifiers is effectively reduced.
Of course, it is not necessary for any product or method of the present application to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a signaling diagram of a gateway device allocating an identifier for a session of a user side login behavior;
fig. 2 is a schematic structural diagram of a gateway device of a dual-master networking architecture;
fig. 3 is a first flowchart of an identifier allocation method according to an embodiment of the present application;
fig. 4 is a second flowchart of an identifier allocation method according to an embodiment of the present application;
fig. 5 is a third flowchart illustrating an identifier allocation method according to an embodiment of the present application;
fig. 6 is a fourth flowchart illustrating an identifier assignment method according to an embodiment of the present application;
fig. 7 is a fifth flowchart illustrating an identifier assignment method according to an embodiment of the present application;
fig. 8 is a signaling diagram of an identifier assignment process according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a change in status of a tag according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a first identifier assigning apparatus according to an embodiment of the present application;
fig. 11 is a second structural diagram of an identifier distribution device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a first device of a first backup group in a multi-master networking according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a second device of a second backup group in a multi-master networking according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As shown in fig. 1, fig. 1 is a signaling diagram of a gateway device allocating an identifier for a session of a user side login behavior. A User performs a login operation In a login page provided by the User terminal 101, such as inputting a User name and a password, and clicking to login, a Secure Socket Layer (SSL) Virtual Private Network (VPN) gateway 102 receives a login request of the User terminal 101, and the SSL VPN gateway 102 may forward the login request to a Remote Authentication Dial In User Service (RADIUS) server 103. The RADUS server 103 will authenticate the login request of the user terminal 101. After the RADUS server 103 authenticates the login request of the user end 101, a session is established, and the SSL VPN gateway 102 may assign a corresponding identifier to the established session. The SSL VPN gateway 102 sends the identity to the user terminal 101. When the user terminal 101 accesses the network, the SSL VPN gateway 102 determines whether a session matching the identifier exists according to the identifier carried in the access request message of the user terminal 101. If there is no matching session, the ue 101 is allowed to log in again. If there is a matching session, the user terminal 101 is allowed to access the network.
The SSL VPN gateway 102 shown in fig. 1 may support Virtual Router Redundancy Protocol (VRRP), and may be applied to a network environment supporting a multi-host networking architecture. Taking fig. 2 as an example for explanation, fig. 2 is a schematic structural diagram of a gateway device of a dual-master networking structure. In the VRRP Backup group 1, the device 201 is a Master (Master) device, and the device 202 is a Backup (Backup) device. In the VRRP backup group 2, the device 202 is a master device and the device 201 is a backup device. There is a backup relationship between the device 201 and the device 202, i.e. the device 201 and the device 202 are backup to each other. The device 201 and the device 202 are the SSL VPN gateways described above.
In the process of allocating an identifier for the established session by the SSL VPN gateway, if the SSL VPN gateway is in a primary/standby networking structure, that is, only one backup group exists, such as the VRRP backup group 1, for the newly established session 1, the device 201 may allocate a corresponding identifier for the session 1. After the identifier assignment is successful, the device 201 may back up the identifier of the session 1 to a standby device of the device 201, that is, the device 202, and at this time, the device 201 completes the identifier assignment process for the session 1. However, in a network structure formed by two backup groups or a plurality of backup groups, backup relationships may exist between the master devices in different backup groups, for example, the device 201 in the VRRP backup group 1 and the device 202 in the VRRP backup group 2 in fig. 2 are backup for each other, which makes the master devices having backup relationships in the multi-master networking possibly conflict when allocating identifiers for different sessions.
For example, at a certain time, the identifier allocated by the device 201 for the session 1 is the identifier 1, and the identifier allocated by the device 202 for the session 2 is also the identifier 1. At this time, the device 201 needs to backup the identifier 1 corresponding to the session 1 to a standby device of the device 201, that is, the device 202. The device 202 also needs to backup the identifier 2 corresponding to the session 2 to the standby device of the device 202, i.e. the device 201. This causes the identities of session 1 and session 2 in both device 201 and device 202 to be identity 1, and a collision phenomenon occurs.
In order to solve the problem of a collision phenomenon occurring in an identifier allocation process, an embodiment of the present application provides an identifier allocation method. The method is suitable for the main equipment in the multi-main networking, and the main equipment can be network equipment such as gateway equipment, routing equipment and the like. In the method, a multi-master networking at least comprises a first backup group and a second backup group, wherein a first device is a master device in the first backup group but a standby device in the second backup group, a second device is a standby device in the first backup group but a master device in the second backup group, and a first device of the first backup group can apply for a first identifier for a first session; the first identification is sent to second equipment of a second backup group in the multi-master networking, so that the second equipment detects whether the first identification is occupied, the first equipment receives a first message which is sent by the second equipment and aims at the first identification, and if the first message contains a first message code indicating that the identification is not occupied, the first equipment allocates the first identification to a first session.
By the method provided by the embodiment of the application, when the first device allocates the identifier for the first session, it can be ensured that the allocated identifier is not occupied by the second devices which are backups for each other, so that the identifier allocated by the first device for the first session does not conflict with the identifier allocated by the second devices which are backups for each other, and the probability of session identifier conflict is effectively reduced.
The following examples are given to illustrate the examples of the present application.
As shown in fig. 3, fig. 3 is a first flowchart illustrating an identifier assignment method according to an embodiment of the present application. The method is applied to first equipment of a first backup group in the multi-master networking, and the first backup group comprises the first equipment and second equipment. The first device is a master device of the first backup group and is a backup device of a second backup group in the multi-master networking. The second device is a backup device of the first backup group and is a master device of the second backup group. The first device and the second device are backups of each other, are primary devices of any backup group in the multi-primary networking, and do not play a limiting role. For ease of understanding, the first device of the first backup group in the dual-master networking is taken as an example for description. Specifically, the identifier assignment method includes the following steps.
Step S301, apply for a first identifier for the first session.
In this step, the first session may be a newly established session or a session with a session identifier that is invalid. The first device may apply for a session identifier for the first session according to the first identifier list of the first device, so as to obtain a first identifier. The first identifier list comprises a plurality of identifiers.
In an embodiment, the first identifier list may only include identifiers that are not allocated. The first device may select an identifier from the first identifier list according to a certain rule, such as polling selection or random selection, as the first identifier that the first device applies for the first session.
In another embodiment, the first identifier list may include allocated identifiers and unallocated identifiers. The first device maintains the current state of each identifier in the first identifier list, and the maintenance process is described in the following text related to fig. 9. And the first equipment determines whether each identifier is already allocated according to the current state of each identifier in the first identifier list, so that the unassigned identifier is selected as the first identifier of the first session of the first equipment. For convenience of understanding, the first identification list is described by taking table 1 as an example.
TABLE 1
Figure BDA0002034203890000061
Figure BDA0002034203890000071
In table 1, the current states of flag 1 and flag 5 are "i.e., null values, indicating that flag 1 and flag 5 are in a no state or unoccupied state. In the stateless state, the identity 1 and the identity 5 may be applied for the identity of the first session as described above. The current state of identity 2 is a temporary occupied state, meaning that identity 2 is in a state that has been applied for an identity for a session, but has not yet been assigned to that session. In the temporary occupied state, identity 2 cannot be applied as an identity for the first session. The current state of identity 3 is an occupied state, indicating that identity 3 is in a state that has been allocated to the corresponding session. The current state of the identifier 4 is clear, which indicates that the identifier 4 is in a state that is unoccupied in the first device but is already occupied in the primary devices of the other backup groups.
According to table 1, when the first device applies for the identifier for the first session, the first device may apply for identifier 1 in table 1 as the first identifier for the first session, or may apply for identifier 5 in table 1 as the first identifier for the first session.
In another embodiment, the first identifier list may only include the allocated identifiers, and when the first device applies for the identifiers, the first device may generate an identifier as the first identifier applied for the first session in a conventional manner.
In the embodiment of the present application, the application method of the first identifier and the identifier in the first identifier list are not particularly limited.
In an alternative embodiment, when the first session applies for the first identifier, the first device may mark the state of the applied first identifier as the temporary occupied state.
In table 1, the temporary occupation state and the clear state are transition states that occur during identifier allocation, so as to record a change of state of each identifier in the first identifier list during identifier allocation. Taking the identifier 1 as an example, if the identifier 1 is applied by the first device as the first identifier of the first session, the state of the identifier 1 is changed from the non-state to the temporary occupied state, so that the first device cannot apply the identifier 1 as the identifier of another session. If the first device sends the identifier 1 to the second device in the second backup group, and the second device detects that the identifier 1 is in an occupied state in the second identifier list of the second device, when the first device determines that the identifier 1 is occupied in the second device, the first device may change the state of the identifier 1 from the temporary occupied state to a Clear state. The adjustment of the states of the identifiers in the first list of identifiers is described in the following text in fig. 9.
In this embodiment of the present application, the first identifier list and the second identifier list may be synchronized at preset time intervals. Specifically, it can be expressed as: the first device in the first backup group may backup data in the first identifier list to an identifier list of a standby device corresponding to the first device (i.e., a second identifier list of the second device), and the second device in the second backup group may backup data in the second identifier list to an identifier list of a standby device corresponding to the second device (i.e., a first identifier list of the first device), so that the data in the first identifier list and the data in the second identifier list are unified, that is, the status of each identifier and identifier in the first identifier list and the second identifier list are unified.
Step S302, the first identifier is sent to the second device, so that the second device detects whether the first identifier is occupied.
In this step, after the first device applies for the first identifier for the first session, the first device may send the first identifier to the second device in the second backup group, so that the second device detects whether the received first identifier is occupied according to the second identifier list of the second device. For the second identification list, reference may be made to the description of the first identification list section above, and no specific description is made here.
In one example, the first identification may be sent to the second device in the form of a message over the hot-standby channel.
In an embodiment, after applying for the first identifier for the first session, the first device may record a correspondence between the first session and the first identifier, and send the recorded correspondence between the first session and the first identifier to the second device through a hot standby channel between the first device and the second device. After receiving the corresponding relationship, the second device may determine that the first device is the first identifier of the first session application according to the received corresponding relationship. The hot standby channel is a channel for information interaction between the first device and the second device. For example, the process of unifying the data in the first identifier list and the second identifier list may also be completed through the hot standby channel. Here, the hot standby channel is not specifically described.
Step S303, receiving a first message for the first identifier sent by the second device.
In this step, the second device sends a first message for the first identifier to the first device in the first backup group according to a detection result of whether the first identifier is occupied. The first message may include a message code indicating whether the first identifier is occupied, such as an unoccupied first message code or an occupied second message code. The first device receives a first message aiming at the first identification sent by the second device.
In an embodiment, if the second device detects that the first identifier is not occupied in the second device, the first message includes a first message code indicating that the identifier is not occupied, that is, a message code indicating that the first identifier is not occupied.
In another embodiment, if the second device detects that the first identifier is occupied in the second device, the first message includes a second message code indicating that the identifier is occupied, that is, a message code indicating that the first identifier is occupied, and the second device is the second identifier of the first session application.
In the embodiment of the present application, the expression form of the first message code and the second message code is not particularly limited. Taking the first message code as an example, the first message code may be represented by a number, such as 200, 303, etc., in one example. In another example, the first message code may be represented in a combination of numbers and letters, such as a300, C500, and the like.
In an optional embodiment, the first message for the first identifier may further include the first identifier, so that after receiving the first message, the first device may determine that the first message is a message for the first identifier according to the first identifier included in the first message.
In another optional embodiment, for each identifier in the first identifier list, a corresponding unique message code exists in each identifier that is occupied and unoccupied, and according to the unique message code corresponding to the first identifier, the first device may determine that the first message is a message for the first identifier. The above-described symbols 1 and 2 are used as examples for explanation. If the unique message code corresponding to the identifier 1 is 10 when occupied, the unique message code corresponding to the identifier 1 when not occupied is 11, the unique message code corresponding to the identifier 2 when occupied is 20, and the unique message code corresponding to the identifier 2 when not occupied is 21. When the unique message code included in the first message received by the first device is 10, the first device may determine that the first message is a message for describing that identifier 1 is occupied.
Step S304, if the first message includes a first message code indicating that the identifier is not occupied, allocating the first identifier to the first session.
In this step, if the first message received by the first device includes the first message code indicating that the identifier is not occupied, the first device may determine that the first identifier is not occupied in the second device according to the first message code in the first message. The first device may assign a first identity to the first session.
In an optional embodiment, in a case where the first message includes a first message code indicating that the identifier is unoccupied and the first identifier is allocated to the first session, the first device may send an allocation success message to the second device, and convert the state of the first identifier from the temporary occupied state to the occupied state.
In an optional embodiment, after the first device assigns the first identifier to the first session, the first device may send a message that the assignment of the first identifier is successful to the second device, so that the second device determines that the first identifier has been assigned to the first session.
In an optional embodiment, according to the embodiment provided in fig. 3, an identifier allocation method is further provided in the embodiment of the present application, and the method is applied to the first device of the first backup group in the multi-master networking. Specifically, as shown in fig. 4, fig. 4 is a second flowchart of the identifier allocation method provided in the embodiment of the present application. The method comprises the following steps.
Step S401, apply for a first identifier for the first session.
Step S402, the first identifier is sent to the second device, so that the second device detects whether the first identifier is occupied.
Step S403, receiving a first message for the first identifier sent by the second device.
The above-described steps S401 to S403 are the same as the above-described steps S301 to S303.
Step S404, if the first message includes the second message code indicating that the identifier is occupied, extracting the second identifier included in the first message. The second identifier is an identifier of the first session application when the second device detects that the first identifier is occupied.
In this step, when the second device detects that the first identifier is occupied in the second identifier list, that is, it is determined that the first identifier is occupied in the second device, the second device may apply for the second identifier for the first session. The second identity is an unoccupied identity in the second device. The second device sends a first message containing the second identifier and the second message code to the first device. After receiving the first message, the first device may determine, according to the second message code, that the first identifier has been occupied by the second device, and the first device may extract the second identifier included in the first message. The application method of the second identifier may refer to the application method of the first identifier, and is not specifically described herein.
Step S405, detecting whether the second identifier is occupied. If it is detected that the second identifier is occupied, step S406 is executed.
In this step, the first device may detect whether the second identifier is occupied in the first identifier list according to the first identifier list, that is, detect whether the second identifier is occupied in the first device.
Step S406, a second message for the second identifier is sent to the second device. And the second message comprises a second message code, so that the second equipment applies for the third identifier for the first session again, and sends the third message comprising the third identifier to the first equipment.
In this step, if the first device detects that the second identifier is occupied, the first device may send a second message for the second identifier to the second device. Wherein, the second message includes the second message code indicating that the identifier is occupied, that is, includes the message code indicating that the second identifier is occupied. After receiving the second message, the second device may determine, according to a second message code included in the second message, that the second identifier is occupied in the first device, that is, it is determined that the second identifier cannot be allocated to the first session. The second device may apply for the third identifier for the first session again, and send a third message including the third identifier to the first device.
In an optional embodiment, if the first device detects that the second identifier is not occupied, the first device may allocate the second identifier to the first session, and send a fourth message for the second identifier to the second device, where the fourth message includes a third message code indicating that identifier allocation is successful.
In an optional embodiment, after the first device assigns the second identifier to the first session, the first device may send a message that the assignment of the second identifier is successful to the second device, so that the second device determines that the second identifier has been assigned to the first session.
In this embodiment, the third message code may be the same as the first message code or different from the first message code. Here, the third message code is not particularly limited.
According to the embodiment provided by fig. 4, after the first identifier determined by the first device is occupied in the second device, the second device directly applies for the identifier for the first session, and determines whether the identifier applied by the second device is occupied in the first device, thereby shortening the time of information interaction between the first device and the second device, ensuring that the identifier allocated for the first session is not occupied in the first device and the second device, and effectively reducing the probability of session identifier conflict, thereby being better applicable to a network environment with a multi-master networking structure.
In an alternative embodiment, the step of detecting whether the second identifier is occupied in step S405 may include the following steps.
Step S4051, determines the current state of the second identifier. And the current state of the second identifier is the first state or the second state. If the current state of the second identifier is the first state, step S4052 is executed. If the current state of the second identifier is the second state, step S4053 is executed.
In this step, the first device may determine, according to the first identifier list, a current state of the second identifier in the first identifier list. The first state is used to indicate that the identifier is not occupied, wherein the first state may be the above-mentioned no state. The second state is used for indicating that the identifier is occupied, wherein the second state may be the temporary occupied state, the occupied state or the clear state.
Step S4052, it is determined that the second identifier is unoccupied.
In this step, if the current state of the second identifier in the first identifier list is a first state indicating that the second identifier is not occupied, and if the current state of the first identifier is the non-state, the first device may determine that the second identifier is not occupied in the first identifier list, that is, the second identifier is not occupied in the first device.
Step S4053, it is determined that the second identifier is occupied.
In this step, if the current state of the second identifier in the first identifier list is a second state indicating that the second identifier is occupied, for example, the current state of the first identifier is the temporary occupied state or the occupied state, the first device may determine that the second identifier is occupied in the first identifier list, that is, the second identifier is occupied in the first device.
Based on the same inventive concept, according to the embodiment provided in fig. 3, the embodiment of the present application further provides an identifier allocation method, which is applied to the second device of the second backup group in the multi-master networking. The second device is a master device of any backup group in the multi-master networking, and the second device and the master device in the first backup group, namely the first device, are mutually backed up. Specifically, as shown in fig. 5, fig. 5 is a third schematic flow chart of the identifier allocation method provided in the embodiment of the present application. The method specifically comprises the following steps.
Step S501, receiving a first identifier sent by a first device. The first identifier is an identifier of the first device applying for the first session. The first device is a master device of any backup group in the multi-master networking, and does not play a limiting role.
In this step, after the first device applies for the first identifier for the first session, the first device may send the first identifier to the second device in the second backup group. The second device receives the first identifier sent by the first device.
Step S502, detecting whether the first mark is occupied. If the first flag is not occupied, go to step S503.
In this step, the second device may detect whether the first identifier is occupied in the second identifier list according to the second identifier list, that is, detect whether the first identifier is occupied in the second device.
Step S503 is to send a first message including a first message code indicating that the first identifier is not occupied to the first device, so that the first device allocates the first identifier to the first session according to the first message code.
In this step, if it is detected that the first identifier is not occupied in the second identifier list, the second device may send a first message including a first message code indicating that the identifier is not occupied to the first device, that is, the sent first message includes a message code indicating that the first identifier is not occupied, so that the first device may determine, according to the first message code in the first message, that the first identifier is not occupied in the second device, thereby enabling the first device to determine that the first identifier can be allocated to the first session.
In an optional embodiment, in the step S502, the step of detecting whether the first identifier is occupied may include the following steps.
Step S5021, the current state of the first identifier is determined.
Step S5022, if the current state of the first identifier is the first state, it is determined that the first identifier is unoccupied, and the first state is used to indicate that the identifier is unoccupied.
Step S5023, if the current state of the first identifier is the second state, it is determined that the first identifier is occupied, and the second state is used to indicate that the identifier is occupied.
The above steps S5021 to S5023 can refer to the above steps S4051 to S4053, and will not be specifically described here.
In an optional embodiment, according to the embodiment provided in fig. 5, an identifier allocation method is further provided in the embodiment of the present application. The method is applied to the second device of the second backup group in the multi-master networking. Specifically, as shown in fig. 6, fig. 6 is a fourth flowchart illustrating an identifier allocation method provided in the embodiment of the present application. The method comprises the following steps.
Step S601, receiving a first identifier sent by a first device. The first identifier is an identifier of the first device applying for the first session.
Step S602, detecting whether the first identifier is occupied. If the first identifier is occupied, step S603 is executed.
The above steps S601 and S602 are the same as the above steps S501 and S502.
Step S603, apply for a second identifier for the first session.
In this step, if the second device detects that the first identifier is occupied in the second device, the second device may apply for the second identifier for the first session. The method for applying the second identifier may refer to the method for applying the first identifier by the first device, which is not described herein again.
In an optional embodiment, if the second device detects that the first identifier is occupied in the second device, the second device may apply for the second identifier for the first session after a preset time period.
In this embodiment of the present application, a first identifier list in a first device and a second identifier list in a second device perform synchronization processing according to a preset time interval. And after the synchronization processing, the first identification list is the same as the second identification list. When the second device detects that the first identifier is occupied in the second device, the second device applies for the second identifier for the first session after the preset time, namely, the second device can apply for the second identifier for the first session after the first identifier list and the second identifier list are synchronously processed, the probability that the applied second identifier is occupied by the first device is reduced, and the identifier distribution efficiency is improved. The preset time duration may be set with reference to a preset time interval of the synchronization processing and a time of the synchronization processing.
For example, if the preset time interval of the synchronization process is 2 seconds, the preset time period may be 2.5 seconds.
For another example, the preset time interval of the synchronization process is 5 minutes, the current time is 12:03, and the time for completing the latest synchronization process is 12:00, so that the preset time duration may be any time from 3 minutes to 5 minutes from 12:03 to 12: 00.
By adjusting the time of the second device applying for the second identifier to the time of synchronous processing of the first identifier list and the second identifier list, the probability that the second identifier applied by the second device is occupied in the first device can be reduced, the time consumed by identifier allocation is shortened, and the identifier allocation efficiency is improved. In the embodiment of the present application, the preset time length and the preset time interval are not specifically limited.
In an optional embodiment, when the second device applies for the second identifier for the first session, the second device may mark the state of the second identifier as the temporary occupied state.
Step S604, a first message including the second identifier and a second message code indicating that the first identifier is occupied is sent to the first device.
In this step, the second device may send a first message to the first device containing the second identifier and a message code indicating that the first identifier is occupied. That is, the first message includes the second identifier and the second message code, so that the first device can determine that the first identifier is occupied according to the received second message code in the first message, and detect whether the second identifier is occupied in the first device.
In an optional embodiment, after receiving the allocation success message sent by the first device when the second identifier is allocated to the first session, the second device may convert the state of the second identifier from the temporary occupied state to the occupied state.
In an optional embodiment, after receiving the second message including the second message code, the second device may convert the state of the second identifier from the temporary occupied state to the clear state.
In an optional embodiment, according to the embodiment provided in fig. 6, an embodiment of the present application further provides an identifier allocation method, which is applied to the second device of the second backup group in the multi-primary networking. Specifically, as shown in fig. 7, fig. 7 is a fifth flowchart illustrating an identifier allocation method provided in the embodiment of the present application. The method comprises the following steps.
Step S701, receiving a first identifier sent by a first device. The first identifier is an identifier of the first device applying for the first session.
Step S702, detecting whether the first mark is occupied. If the first identifier is occupied, step S703 is executed.
Step S703, apply for the second identifier for the first session.
Step S704, a first message including the second identifier and a second message code indicating that the first identifier is occupied is sent to the first device.
The above steps S701 to S704 and the above steps S601 to S604.
Step S705, receiving a second message sent by the first device. Wherein the second message comprises a second message code indicating that the second identity is occupied.
In this step, after the first device detects that the second identifier is occupied in the first device, the first device may send a second message containing a second message code indicating that the identifier is occupied to the second device, that is, the second message contains a message code indicating that the second identifier is occupied. The second device may receive a second message for the second identity sent by the first device.
In an optional embodiment, after receiving the second message including the second message code, the second device may convert the state of the second identifier from the temporary occupied state to the clear state.
Step S706, apply for the third identifier for the first session again.
In this step, according to the second identifier list, the second device may apply for the third identifier for the first session again. As for the method for applying the third identifier, reference may be made to a method for applying the first identifier by the first device, which is not described herein again.
In an alternative embodiment, when the second device newly applies for the third identifier for the first session, the state of the third identifier may be marked as the temporary occupied state.
Step S707, a third message containing the third identifier is sent to the first device.
In this step, the second device may send a third message containing the third identifier to the first device. And the first equipment judges whether the third identifier is occupied again, if not, the third identifier is allocated to the first session, otherwise, the first equipment sends a message containing the third identifier and the second message code to the second equipment.
In an alternative embodiment, after the first device assigns the second identifier to the first session, the first device may send a fourth message containing a message code indicating successful assignment of the second identifier to the second device. The second device may receive a fourth message sent by the first device that the allocation of the second identity is successful, and send an Acknowledgement message, such as an Acknowledgement (ACK) message, for the fourth message to the first device.
In summary, according to the method provided in the embodiment of the present application, when a first device allocates an identifier for a first session, it can be determined that the allocated identifier is not occupied by a second device that is not a backup for each other, so that the identifier allocated for the first session by the first device does not conflict with the identifier allocated by the second device that is a backup for each other, and the probability of session identifier conflict is effectively reduced.
The above embodiment will be specifically described below by taking fig. 8 and 9 as an example. Fig. 8 is a signaling diagram of an identifier assignment process according to an embodiment of the present application. Fig. 9 is a schematic diagram of a change in an identifier state according to an embodiment of the present application. In fig. 8, a device 801 and a device 802 are devices included in a first backup group and a second backup group of a dual master networking structure. The device 801 and the device 802 are backup to each other, that is, the device 801 is the first device, and the device 802 is the second device. Assume that the first session is session 1, the first identifier list is list 1, and the second identifier list is list 2. In fig. 9, the Clear state is the Clear state described above.
For session 1, the device 801 may select a stateless identifier from list 1 according to a certain rule. Assuming the selected identity is a1, device 801 may apply for a1 as the identity of session 1. At this time, the state of a1 in list 1 will be changed from the no state to the temporary occupied state. Device 801 may send a1 to device 802.
The device 802, upon receiving a1, may find a1 in list 2 and determine the current state of a 1. In device 802, the current state of a1 may be any one of a no state, a temporary occupied state, or an occupied state.
If the current state of A1 in device 802 is stateless, device 802 may determine that A1 is not occupied in device 802. Device 802 may send message 1 containing the first message code described above for a1 to device 801. Device 801 upon receiving message 1, device 801 may determine that a1 is not occupied in device 802. Device 801 may assign a1 to session 1. At this time, the current state of a1 in list 1 will be changed from the temporary occupied state to the occupied state. At the same time, device 801 may send a message to device 802 indicating that the a1 assignment was successful, and device 802 may send an acknowledgement message to device 801 upon receiving the message.
If the current state of a1 in device 802 is a temporary occupied state or an occupied state, device 802 may determine that a1 is already occupied in device 802. After the preset duration, the device 802 may select a stateless identifier from the list 2, where the selected identifier is B1, and the device 802 may apply for the B1 as the identifier of the session 1. At this time, the current state of B1 is changed from the non-state to the temporary occupied state in list 2. Device 802 may send message 2 to device 801 containing B1 and the second message code for a1 described above. After device 801 receives message 2, device 801 may determine that a1 is already occupied in device 802 based on the second message code in message 2. At this time, the current state of a1 in list 1 will be changed from the temporary occupied state to the clear state. At the same time, device 801 may extract B1 in message 2 and find B1 in list 1, thereby determining the current status of B1 in list 1. In list 1, the current state of B1 may be any one of a no state, a temporary occupied state, or an occupied state.
If the current state of B1 in List 1 is stateless, device 801 may determine that B1 is unoccupied. Device 801 may assign B1 to session 1. At this point, the current state of B1 in list 1 will change from the no state to the occupied state. Meanwhile, device 801 may send a message to device 802 indicating that the B1 assignment was successful, and device 802 may send an acknowledgement message to device 801 upon receiving the message. At this time, the current state of B1 in list 2 may be changed from the temporary occupied state to the occupied state, or the current state of B1 in list 2 may be changed without any change, and the state of B1 in list 2 is changed according to the state of B1 in list 1 when synchronizing list 1 and list 2.
If the current state of B1 in list 1 is a temporary occupied state or an occupied state, device 801 may determine that B1 is already occupied. Device 801 may send message 3 to device 802 containing a message code indicating that B1 is occupied. At this point, the current state of B1 in Listing 1 will remain unchanged. Device 802, upon receiving message 3, may determine that B1 has been engaged by device 801 based on the message code in message 3. At this time, the current state of B1 in list 2 will be adjusted from the temporary occupied state to the clear state. Device 802 will reselect a stateless id from list 2, and assuming that the selected id is B2, device 802 may apply for B2 as the id for session 1. At this time, the current state of B2 in list 2 will be changed from the no state to the temporary occupied state. By analogy, device 802 may send B2 to device 801, such that device 801 detects whether B2 is occupied until the identity assignment process for session 1 is completed.
In addition, the case where the state indicated in fig. 9 is changed from the occupied state to the non-state, and the clear state is changed to the non-state will be described. For example, when session 1 is deleted or aging occurs after a period of time in which a1 is allocated to session 1 as described above, the state of a1 will be adjusted from the occupied state to the stateless state. For another example, in the identifier assignment process, a certain identifier C1 in the first device is in a clear state, that is, C1 is not occupied in the first device, but occupied in another device (such as the second device described above), at a certain time, the session corresponding to C1 in the second device is deleted, the state of C1 is changed from the occupied state to a non-state, at this time, the first identifier list and the second identifier list complete the above synchronization process, and the state of C1 in the first device is changed from the clear state to the non-state. The change of the identifier state may be adjusted according to the actual situation in the identifier allocation process, and in the embodiment of the present invention, the change of the identifier state is not specifically limited.
Based on the same inventive concept, according to the identifier allocation method provided in the embodiment of the present application, an identifier allocation apparatus is further provided in the embodiment of the present application, and is applied to the first device of the first backup group in the multi-master networking. Specifically, as shown in fig. 10, fig. 10 is a schematic view of a first structure of an identifier assigning apparatus provided in the embodiment of the present application. The apparatus includes the following modules.
A first applying module 1001, configured to apply for a first identifier for a first session.
A first sending module 1002, configured to send the first identifier to the second device, so that the second device detects whether the first identifier is occupied.
A first receiving module 1003, configured to receive a first message for the first identifier sent by the second device.
A first allocating module 1004, configured to allocate the first identifier to the first session when the first message received by the first receiving module 1003 contains the first message code indicating that the identifier is unoccupied.
Optionally, the identifier allocating apparatus may further include:
an extracting module, configured to extract a second identifier included in the first message when the first message received by the first receiving module 1003 includes a second message code indicating that the identifier is occupied; the second identifier is an identifier applied for the first session by the second device when the second device detects that the first identifier is occupied.
And the first detection module is used for detecting whether the second identifier is occupied or not.
And the second sending module is used for sending a second message aiming at the second identifier to the second equipment when the first detection module determines that the second identifier is occupied, wherein the second message comprises a second message code, so that the second equipment applies for a third identifier for the first session again, and sends a third message comprising the third identifier to the first equipment.
Optionally, the identifier allocating apparatus may further include:
and the second allocating module is used for allocating the second identifier to the first session and sending a fourth message aiming at the second identifier to the second equipment when the first detecting module determines that the second identifier is not occupied, wherein the fourth message contains a third message code indicating that the identifier is successfully allocated.
Optionally, the identifier allocating apparatus further includes:
the first marking module is used for marking the state of the first identifier as a temporary occupation state when the first identifier is applied for the first session.
And the first conversion module is used for sending an allocation success message to the second equipment and converting the state of the first identifier from the temporary occupied state into the occupied state under the condition that the first message contains a first message code indicating that the identifier is not occupied and the first identifier is allocated to the first session.
Based on the same inventive concept, according to the identifier allocation method provided in the embodiment of the present application, an identifier allocation apparatus is further provided in the embodiment of the present application, and is applied to the second device of the second backup group in the multi-master networking. Specifically, as shown in fig. 11, fig. 11 is a second schematic structural diagram of the identifier distribution apparatus provided in the embodiment of the present application. The apparatus includes the following modules.
A second receiving module 1101, configured to receive a first identifier sent by a first device; the first identifier is an identifier of the first device applying for the first session.
A second detecting module 1102, configured to detect whether the first identifier is occupied.
A third sending module 1103, configured to send, to the first device, a first message including a first message code indicating that the first identifier is unoccupied when the second detecting module 1102 determines that the first identifier is unoccupied, so that the first device allocates the first identifier to the first session according to the first message code.
Optionally, the identifier allocating apparatus may further include:
and a second applying module, configured to apply for the second identifier for the first session when the second detecting module 1102 determines that the first identifier is occupied.
And the fourth sending module is used for sending the first message containing the second identifier and a second message code indicating that the first identifier is occupied to the first equipment.
Optionally, the identifier allocating apparatus may further include:
and the third receiving module is used for receiving a second message sent by the first equipment, wherein the second message contains a second message code indicating that the second identifier is occupied.
And the third application module is used for reapplying the third identifier for the first session.
And a fifth sending module, configured to send a third message including the third identifier to the first device.
Optionally, the identifier allocating apparatus further includes:
a fourth receiving module, configured to receive an allocation success message sent by the first device, where the allocation success message is sent when the first identifier is allocated to the first session.
And the second marking module is used for marking the state of the first identifier as an occupied state.
Optionally, the apparatus further comprises:
and the third marking module is used for marking the state of the second identifier as a temporary occupation state when the second identifier is applied for the first session.
The second conversion module is used for converting the state of the second identifier from the temporary occupation state into a clear state after receiving a second message containing a second message code; or after receiving an allocation success message sent by the first device under the condition that the second identifier is allocated to the first session, converting the state of the second identifier from the temporary occupied state into the occupied state.
By the device provided by the embodiment of the application, when the first device allocates the identifier for the first session, it can be determined that the allocated identifier is not occupied by the second devices which are backups for each other, so that the identifier allocated for the first session by the first device does not conflict with the identifier allocated by the second devices which are backups for each other, and the probability of session identifier conflict is effectively reduced.
Based on the same inventive concept, according to the identifier allocation method provided in the embodiment of the present application, the embodiment of the present application further provides a first device of a first backup group in a multi-master networking. Specifically, as shown in fig. 12, fig. 12 is a schematic structural diagram of a first device of a first backup group in a multi-master networking according to an embodiment of the present application. The first device includes a processor 1201 and a machine-readable storage medium 1202, the machine-readable storage medium 1202 storing machine-executable instructions executable by the processor 1201.
In addition, as shown in fig. 12, the first device may further include: a communication interface 1203 and a communication bus 1204; the processor 1201, the machine-readable storage medium 1202, and the communication interface 1203 complete communication with each other through the communication bus 1204, and the communication interface 1203 is used for communication between the first device and other devices.
The processor 1201 is caused by machine executable instructions to implement the steps of:
applying for a first identifier for a first session;
sending the first identifier to the second equipment so that the second equipment can detect whether the first identifier is occupied or not;
receiving a first message aiming at a first identifier sent by a second device;
and if the first message contains a first message code indicating that the identifier is not occupied, allocating the first identifier to the first session.
By the first device provided by the embodiment of the application, when the first device allocates the identifier for the first session, it can be determined that the allocated identifier is not occupied by the second devices which are backups of each other, so that the identifier allocated for the first session by the first device does not conflict with the identifier allocated by the second devices which are backups of each other, and the probability of session identifier conflict is effectively reduced.
The communication bus 1204 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus 1204 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 12, but this is not intended to represent only one bus or type of bus.
The machine-readable storage medium 1202 may include a RAM (Random Access Memory) and may also include a NVM (Non-Volatile Memory), such as at least one disk Memory. Additionally, the machine-readable storage medium 1202 may also be at least one memory device located remotely from the aforementioned processor.
The Processor 1201 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also DSPs (Digital Signal Processing), ASICs (Application Specific Integrated circuits), FPGAs (Field Programmable Gate arrays) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Based on the same inventive concept, according to the identifier allocation method provided in the embodiment of the present application, the embodiment of the present application further provides a second device of a second backup group in a multi-master networking. Specifically, as shown in fig. 13, fig. 13 is a schematic structural diagram of a second device of a second backup group in a multi-master networking according to an embodiment of the present application. The second device comprises a processor 1301 and a machine-readable storage medium 1302, the machine-readable storage medium 1302 storing machine-executable instructions executable by the processor 1301.
In addition, as shown in fig. 13, the second device may further include: a communication interface 1303 and a communication bus 1304; the processor 1301, the machine-readable storage medium 1302, and the communication interface 1303 complete communication with each other through the communication bus 1304, and the communication interface 1303 is used for communication between the second device and another device.
Processor 1301 is caused by machine executable instructions to implement the following steps:
receiving a first identifier sent by first equipment; the first identifier is an identifier of the first session application, which is the first equipment;
detecting whether the first identifier is occupied or not;
if the first identifier is not occupied, sending a first message containing a first message code indicating that the first identifier is not occupied to the first device, so that the first device allocates the first identifier to the first session according to the first message code.
Through the second device provided by the embodiment of the application, when the first device allocates the identifier for the first session, it can be determined that the allocated identifier is not occupied by the second devices which are backups for each other, so that the identifier allocated for the first session by the first device does not conflict with the identifier allocated by the second devices which are backups for each other, and the probability of session identifier conflict is effectively reduced.
The communication bus 1304 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus 1304 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 13, but this is not intended to represent only one bus or type of bus.
The machine-readable storage medium 1302 may include a RAM (Random Access Memory) and may also include a NVM (Non-Volatile Memory), such as at least one disk Memory. Additionally, the machine-readable storage medium 1302 may also be at least one memory device located remotely from the aforementioned processor.
The Processor 1301 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also DSPs (Digital Signal Processing), ASICs (Application Specific Integrated circuits), FPGAs (Field Programmable Gate arrays) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for embodiments such as the apparatus, the first device, the second device, and the machine-readable storage medium, since they are substantially similar to the method embodiments, the description is simple, and for relevant points, reference may be made to part of the description of the method embodiments.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (14)

1. A method for allocating identifiers is characterized in that the method is applied to first equipment of a first backup group in a multi-master networking, wherein the first backup group comprises the first equipment and second equipment, and the first equipment is master equipment of the first backup group and is standby equipment of a second backup group in the multi-master networking; the second device is a backup device of the first backup group and is a primary device of the second backup group, and the method includes:
applying for a first identifier for a first session;
sending the first identifier to the second device, so that the second device detects whether the first identifier is occupied;
receiving a first message aiming at the first identification sent by the second equipment;
and if the first message contains a first message code indicating that the identifier is not occupied, allocating the first identifier to the first session.
2. The method of claim 1, further comprising:
if the first message contains a second message code indicating that the identifier is occupied, extracting a second identifier contained in the first message; the second identifier is an identifier applied for the first session by the second device when the second device detects that the first identifier is occupied;
detecting whether the second identifier is occupied;
and if the second identifier is occupied, sending a second message aiming at the second identifier to the second equipment, wherein the second message comprises the second message code, so that the second equipment applies for a third identifier for the first session again, and sending a third message comprising the third identifier to the first equipment.
3. The method of claim 2, further comprising:
and if the second identifier is not occupied, allocating the second identifier to the first session, and sending a fourth message aiming at the second identifier to the second device, wherein the fourth message comprises a third message code indicating that identifier allocation is successful.
4. A method according to any of claims 1-3, wherein upon applying for a first identity for a first session, the method further comprises: marking the state of the first identifier as a temporary occupation state;
and sending an allocation success message to the second device and converting the state of the first identifier from a temporary occupied state to an occupied state under the condition that the first message contains a first message code indicating that the identifier is unoccupied and the first identifier is allocated to the first session.
5. A method for allocating identifiers is characterized in that the method is applied to second equipment of a second backup group in a multi-main networking, wherein the second backup group comprises first equipment and second equipment, and the first equipment is the backup equipment of the second backup group and is the main equipment of a first backup group in the multi-main networking; the second device is a primary device of the second backup group and is a backup device of the first backup group, and the method includes:
receiving a first identifier sent by the first equipment; the first identifier is an identifier of the first device as a first session application;
detecting whether the first identifier is occupied;
if the first identifier is not occupied, sending a first message containing a first message code indicating that the first identifier is not occupied to the first device, so that the first device allocates the first identifier to the first session according to the first message code.
6. The method of claim 5, further comprising:
if the first identifier is occupied, applying for a second identifier for the first session;
and sending a first message containing the second identifier and a second message code indicating that the first identifier is occupied to the first device.
7. The method of claim 6, further comprising:
receiving a second message sent by the first device, wherein the second message contains a second message code indicating that a second identifier is occupied;
applying for a third identifier for the first session again;
and sending a third message containing the third identifier to the first equipment.
8. The method of claim 5, further comprising:
receiving an allocation success message sent by the first device, the allocation success message being sent if the first identifier is allocated to the first session;
and marking the state of the first identifier as an occupied state.
9. The method of claim 7, wherein when applying for a second identity for the first session, the method further comprises: marking the state of the second identifier as a temporary occupation state;
after receiving the second message containing a second message code, converting the state of the second identifier from a temporary occupation state into a clear state; or
And after receiving an allocation success message sent by the first device under the condition that the second identifier is allocated to the first session, converting the state of the second identifier from a temporary occupied state to an occupied state.
10. An identifier distribution device is characterized in that the identifier distribution device is applied to first equipment of a first backup group in a multi-master networking, wherein the first backup group comprises first equipment and second equipment, and the first equipment is master equipment of the first backup group and is standby equipment of a second backup group in the multi-master networking; the second device is a backup device of the first backup group and is a master device of the second backup group, and the apparatus includes:
the first application module is used for applying for a first identifier for the first session;
a first sending module, configured to send the first identifier to the second device, so that the second device detects whether the first identifier is occupied;
a first receiving module, configured to receive a first message, which is sent by the second device and is addressed to the first identifier;
a first allocating module, configured to allocate the first identifier to the first session when the first message received by the first receiving module includes a first message code indicating that the identifier is not occupied.
11. The apparatus of claim 10, further comprising:
the extracting module is used for extracting a second identifier contained in a first message received by the first receiving module when the first message contains a second message code indicating that the identifier is occupied; the second identifier is an identifier applied for the first session by the second device when the second device detects that the first identifier is occupied;
the first detection module is used for detecting whether the second identifier is occupied or not;
a second sending module, configured to send a second message for the second identifier to the second device when the first detecting module determines that the second identifier is occupied, where the second message includes the second message code, so that the second device applies for a third identifier for the first session again, and sends a third message including the third identifier to the first device.
12. An identifier allocating apparatus is applied to a second device of a second backup group in a multi-master networking, where the second backup group includes a first device and a second device, where the first device is a backup device of the second backup group and is a master device of a first backup group in the multi-master networking; the second device is a primary device of the second backup group and is a backup device of the first backup group, and the apparatus includes:
the second receiving module is used for receiving the first identifier sent by the first equipment; the first identifier is an identifier of the first device as a first session application;
the second detection module is used for detecting whether the first identifier is occupied or not;
a third sending module, configured to send, to the first device, a first message including a first message code indicating that the first identifier is unoccupied when the second detecting module determines that the first identifier is unoccupied, so that the first device allocates the first identifier to the first session according to the first message code.
13. An apparatus of backup groups in a multi-master networking comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 9.
14. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 9.
CN201910319497.6A 2019-04-19 2019-04-19 Identification distribution method, device, equipment and storage medium Active CN110086862B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910319497.6A CN110086862B (en) 2019-04-19 2019-04-19 Identification distribution method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910319497.6A CN110086862B (en) 2019-04-19 2019-04-19 Identification distribution method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110086862A CN110086862A (en) 2019-08-02
CN110086862B true CN110086862B (en) 2021-06-18

Family

ID=67415844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910319497.6A Active CN110086862B (en) 2019-04-19 2019-04-19 Identification distribution method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110086862B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111064662B (en) * 2020-01-02 2021-05-25 重庆紫光华山智安科技有限公司 Virtual routing redundancy protocol configuration method and related device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104955017B (en) * 2015-05-15 2018-07-24 宇龙计算机通信科技(深圳)有限公司 D2D resource allocation methods, device, base station and terminal based on multicarrier
CN106302205A (en) * 2015-05-26 2017-01-04 杭州华三通信技术有限公司 A kind of how main conflict processing method based on LLDP agreement and device
CN107517121B (en) * 2016-06-17 2020-07-07 华为技术有限公司 Equipment configuration method and device
CN108401540B (en) * 2017-11-29 2021-11-23 北京小米移动软件有限公司 Management method and device of data radio bearer identification pool

Also Published As

Publication number Publication date
CN110086862A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN110474797B (en) API service system, and method and device for switching between main and standby
EP2843910A1 (en) Address allocation method, device, and system
CN111259072B (en) Data synchronization method, device, electronic equipment and computer readable storage medium
CN111917895B (en) Alias management method and device
US20190020656A1 (en) Virtual address for controller in a controller cluster
CN109120746B (en) Network address translation method and device and address translation equipment
US20150312208A1 (en) Adaptive dynamic host configuration protocol assignment with virtual local area network pool
US20110035413A1 (en) Diameter bus communications between processing nodes of a network element
AU2014410591A1 (en) Connection establishment method, device, and system
CN115189913B (en) Data message transmission method and device
KR20200136751A (en) Apparatus for communicating diagnosis of a vehicle, system having the same and method thereof
CN106686592B (en) Network access method and system with authentication
CN110086862B (en) Identification distribution method, device, equipment and storage medium
US10581638B2 (en) Assign tunnel tag identifying virtual local area network tunnel
CN109617817B (en) Method and device for generating forwarding table entry of MLAG networking
US20200287784A1 (en) Priority based selection of time services
CN113992685B (en) Service controller determining method, system and device
JP2003318939A (en) Communication system and control method thereof
CN111064819B (en) Address backup method and device
CN103442098A (en) Method, system and server for allocating virtual IP addresses
CN106302854A (en) A kind of method that many DHCP of control Server dynamically distributes host address
CN101414892A (en) Method, system and node equipment for detecting link layer address collision
CN114866371B (en) Method and device for establishing IPSec tunnel, storage medium and electronic equipment
CN105830408B (en) Allocation of resources during a split brain situation
CN111654403B (en) Wireless access point configuration method and device, communication equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant