Disclosure of Invention
In view of the above problems, the present invention is proposed to provide a group member updating method and apparatus that solve the above problems.
According to an aspect of the present invention, there is provided a group member update method, including:
when the group member is updated, detecting whether the updated member and a certain subgroup of the group are registered on a member host, if so, adding the updated member into the subgroup or deleting the updated member from the subgroup according to the update type, and requesting the member host where the corresponding subgroup is located to update the subgroup.
Optionally, in the method of the present invention, when the update type is a new member, the new member is added to the subgroup, and a member host in which the subgroup is located is requested to perform corresponding subgroup update; and when the update type is a deletion member, deleting the corresponding member in the subgroup, and requesting the member host in which the subgroup is positioned to update the corresponding subgroup.
Optionally, in the method of the present invention, when the updated member is not registered in a member host with the subgroup of the group, if the update type is the new member, the new member is added to the group and it is detected whether the new member is registered in a member host with other members of the group, if so, the member host is requested to create the corresponding subgroup, and information of the subgroup created by the member host is stored.
Optionally, in the method of the present invention, after storing information of the subgroup created by the member host, the method further includes: and replacing the information of a plurality of members registered in the member host in the group member list with the created subgroup information.
Optionally, in the method of the present invention, after deleting a member in a subgroup, if the number of members in the subgroup is zero, the subgroup is deleted in the group, and the member host in which the subgroup is located is requested to delete the subgroup.
Optionally, in the method of the present invention, after the member is deleted in the subgroup, if the number of members in the subgroup is 1, the information of the subgroup in the group is replaced with the information of the remaining subgroup members, and the member host in which the subgroup is located is requested to delete the subgroup.
According to another aspect of the present invention, there is provided a group member update apparatus, including:
the detection module is used for detecting whether the updated member and a certain subgroup of the group are registered on a member host or not when the group member is updated;
and the updating module is used for adding the updated member into the subgroup or deleting the updated member from the subgroup according to the updating type and requesting the member host where the corresponding subgroup is located to update the subgroup when the detection result of the detecting module is positive.
Optionally, in the apparatus of the present invention, the update module is specifically configured to, when the update type is a new member, add the new member to the subgroup, and request the member host in which the subgroup is located to update the corresponding subgroup; and when the update type is a deletion member, deleting the corresponding member in the subgroup, and requesting the member host in which the subgroup is positioned to update the corresponding subgroup.
Optionally, in the apparatus of the present invention, the update module is further configured to, when the updated member is not registered on a member host with the subgroup of the group, if the update type is the new member, join the new member into the group and detect whether the new member is registered on a member host with other members of the group, and if so, request the member host to create the corresponding subgroup and store information of the subgroup created by the member host.
Optionally, in the apparatus of the present invention, the updating module is further configured to, after storing information of a subgroup created by the member host, replace the information of the plurality of members registered in the member host in the group member list with the created subgroup information.
Optionally, in the apparatus of the present invention, the update module is further configured to delete the subgroup in the group and request the member host in which the subgroup is located to delete the subgroup if the number of members of the subgroup is zero after the members are deleted in the subgroup.
Optionally, in the apparatus of the present invention, the update module is further configured to, after deleting a member from the subgroup, if the number of members in the subgroup is 1, replace the subgroup information in the group with the remaining subgroup member information, and request the member host in which the subgroup is located to delete the subgroup.
The invention has the following beneficial effects:
according to the updating method and the updating device, when the group is updated, the information of the subgroup is updated at the same time, so that the effectiveness of the updating operation is improved; and timely detecting whether the subgroup is formed, deleting the subgroup which does not meet the subgroup condition, and releasing the storage space.
Example one
An embodiment of the present invention provides a group member updating method, which is applied to a group host side, and as shown in fig. 1, the method specifically includes:
step S101, when the group member is updated, detecting whether the updated member is registered on a member host together with a certain subgroup of the group;
step S102, when the updated member and a subgroup of the group are registered on a member host, the updated member is added into the subgroup or deleted in the subgroup according to the update type, and the member host where the corresponding subgroup is located is requested to update the subgroup.
That is to say, when the method of the present invention updates the members of the group, if the method is directed to the members of the subgroup, the method correspondingly updates the members of the subgroup, thereby improving the effectiveness of the updating operation.
Based on the above description of the principles, several specific and preferred embodiments are given below to refine and optimize the function of the method of the present invention, so as to make the implementation of the solution of the present invention more convenient and accurate. It should be noted that the following features may be arbitrarily combined with each other without conflict.
In the embodiment of the present invention, according to the update type, adding or deleting an updated member to or from a subgroup, and requesting a member host in which the subgroup is located to perform subgroup update, specifically including:
when the update type is a new member, adding the new member into the subgroup, and requesting the member host in which the subgroup is located to perform corresponding subgroup update, namely requesting the member host to add the new member into the subgroup on the member host side;
and when the update type is the deletion member, deleting the corresponding member in the subgroup, and requesting the member host in which the subgroup is positioned to perform corresponding subgroup update, namely requesting the member host to delete the corresponding member in the subgroup on the member host side.
Further, in the embodiment of the present invention, when the updated member is not registered on a member host with the subgroup of the group, if the update type is the new member, the new member is added to the group and it is detected whether the new member is registered on a member host with other members of the group, if so, the member host is requested to create the corresponding subgroup, and the information of the subgroup created by the member host is stored.
After storing the information of the subgroup created by the member host, the method further comprises the following steps: and replacing the information of a plurality of members registered in the member host in the group member list with the created subgroup information.
That is, when a new member forms a subgroup with other group members, the subgroup including the new member and other group members may be established on the corresponding member host side, and all members forming the subgroup on the group side may be replaced with the subgroup, that is, the group members are updated by using the subgroup.
Further, in the embodiment of the present invention, when the update type is a delete member, after deleting the member in the subgroup, if the number of members in the subgroup is zero, deleting the subgroup in the group, and requesting the member host in which the subgroup is located to delete the subgroup. That is, when the update operation causes all members of the subgroup to be deleted, the subgroup freed space may be deleted.
Further, in the embodiment of the present invention, when the update type is a delete member, after the member is deleted in the subgroup, if the number of members in the subgroup is 1, the information of the subgroup in the group is replaced with the information of the remaining subgroup members, and the member host in which the subgroup is located is requested to delete the subgroup. That is, when only 1 member remains for a subgroup member, only the remaining 1 member needs to be maintained separately, so the subgroup is also deleted.
Several specific application examples of the present invention are given below according to fig. 2 to fig. 5, and further details of the present invention are given in conjunction with the description of the application examples, so that it can better explain the specific implementation process of the method provided by the present invention.
The application context of each application example is:
the group host CSE has a subgroup present on the member host CSE 1.
The member host CSE1 comprises resource A, B, C, D, wherein BCD is a member of the subgroup;
the member host CSE2 comprises resource E, F, where E is a member of the group host.
Application example 1
The application example provides a group member updating method, which realizes that a certain resource on a member host containing a subgroup is added to a member list of the group. If a on the member host CSE1 is added to the member list of the group, as shown in fig. 2, the method specifically includes:
step S201, the initiator sends a request for updating the group to the group host CSE, and carries the updated member list, for example, the member a is carried, and indicates to join the member a into the group.
Step S202, after receiving the request, the group host CSE detects whether the added member and a sub-group are registered on the same member host CSE, and if so, executes step S203.
In step S203, the group host CSE sends a request for updating the group to the detected member host CSE 1.
In step S204, the member host CSE1 adds the new member a located on the member host to the member list of the subgroup.
In step S205, the member host CSE1 sends an update response to the group host CSE.
In step S206, the group host CSE detects the member list, and if only the information of the subgroup (e.g., URI of the distribution information of the subgroup) is stored in the member list and the member information in the subgroup (e.g., URI of the member included in the subgroup) is not in the member list, the member list is not updated, and only the stored member information of the subgroup is updated. If the member information in the subgroup is in the member list, the member list is updated, and the stored member information of the subgroup is updated.
Step S207, the group host CSE sends an update response to the initiator.
Scheme II:
the present application example provides a group member update method, where the method implements that an added member and a member in an original member list are co-registered on a member host that does not include the group subgroup, such as F added on CSE2, as shown in fig. 3, and the method specifically includes:
step S301, the initiator sends a request for updating the group to the group host CSE, and carries the updated member list, for example, the member F is carried, and indicates to join the member F into the group.
Step S302, after receiving the request, the CSE detects whether the added member and a member in the original member list are registered in a member host that does not contain the group subgroup, and if yes, executes step S303.
Step S303, the group host CSE sends a request for creating a subgroup to the detected member host CSE2, where the member list carried in the request includes resources of the new member and the original member to be located on the member host, such as E and F on CSE 2.
In step S304, the member host CSE2 creates a corresponding sub-group after receiving the request for creating a sub-group.
At step S305, the member host CSE2 sends a create response to the group host CSE.
Step S306, the group host CSE updates the member list, namely, the member information E, F on the same member host CSE2 is replaced by the information of the created subgroup, and the member information of the subgroup is stored; if E, F address information of the member is included in the member list, the address information of the subgroup is replaced.
Step S307, the group host CSE sends an update response to the initiator.
Application example three
This application example provides a group member update method, which implements deleting a certain member in an original member list, which is located on a member host including the group subgroup, for example, deleting member B from the member list, as shown in fig. 4, where the method specifically includes:
step S401, the initiator sends a request for updating the group to the group host CSE, and carries updated member information, such as carrying member B, indicating to delete member B from the group.
Step S402, after receiving the request, the group host CSE detects whether the deleted member is located on a member host containing the group of subgroups, and if so, performs step S403.
At step S403, the group host CSE sends a request for updating the group to the detected member host CSE 1.
In step S404, the member host CSE1 deletes the deleted member located on the member host from the member list of the subgroup based on the request, for example, deletes member B from the member list of the subgroup, thereby completing the update of the subgroup.
In step S405, the member host CSE1 sends an update response to the group host CSE.
In step S406, the group host CSE detects the member list, and if only information of the subgroup (e.g., URI of the distribution information of the subgroup) is stored in the member list and the member information in the subgroup (e.g., URI of the member included in the subgroup) is not in the member list, the member list is not updated, and only the stored member information of the subgroup is updated. If the member information in the subgroup is in the member list, the member list is updated, and the stored member information of the subgroup is updated.
Step S407, the group host CSE sends an update response to the initiator.
Application example four
The application example provides a group member updating method, which realizes that only one or zero members are left in the subgroup after a certain member is deleted, such as the BC or BCD is deleted from the member list. As shown in fig. 5, the method specifically includes:
step S501, the initiator sends a request for updating the group to the group host CSE, and carries the updated member list, such as the member BC or the member BCD, to indicate to delete the member BC or BCD from the group.
Step S502, after the group host CSE receives the request, it detects whether the deleted member is in the subgroup, if it is in the subgroup, it judges whether there are more member resources in the subgroup after deleting the member to be deleted, if it is, it directly processes according to the steps S403-S407 in the third application example; if not, step S503 is executed.
In step S503, the group host CSE sends a request for deletion of the subgroup to the detected member host CSE 1.
At step S504, the member host CSE1 deletes the corresponding sub-group based on the request.
In step S505, the member host CSE1 sends a delete response to the group host CSE.
In step S506, the group host CSE updates the member list, specifically, deletes the information of the deleted subgroup (for example, deleting BCD), or replaces the information of the deleted subgroup with the information of the only member left on the member host where the deleted subgroup is located (for example, deleting BC, leaving D). If the information of the subgroup and its members is stored before, the stored information is deleted.
Step S507, the group host CSE sends a delete response to the initiator.
Example two
An embodiment of the present invention provides a group member updating apparatus, as shown in fig. 6, specifically including:
a detecting module 610, configured to detect whether an updated member is registered on a member host with a certain subgroup of the group when the group member is updated;
an updating module 620, configured to, when the detection result of the detecting module 610 is positive, add an updated member to the subgroup or delete the updated member from the subgroup according to the update type, and request the member host where the corresponding subgroup is located to perform subgroup update.
Based on the above structural framework and implementation principle, several specific and preferred embodiments under the above structure are given below to refine and optimize the functions of the device of the present invention, so as to make the implementation of the scheme of the present invention more convenient and accurate. The method specifically comprises the following steps:
in this embodiment of the present invention, the updating module 620 is specifically configured to, when the update type is a new member, add the new member to the subgroup, and request the member host in which the subgroup is located to update the corresponding subgroup; and when the update type is a deletion member, deleting the corresponding member in the subgroup, and requesting the member host in which the subgroup is positioned to update the corresponding subgroup.
Further, in this embodiment of the present invention, the updating module 620 is further configured to, when the updated member is not registered on a member host with the subgroup of the group, if the update type is the new member, join the new member into the group and detect whether the new member is registered on a member host with other members of the group, and if so, request the member host to create the corresponding subgroup and store information of the subgroup created by the member host.
Further, in this embodiment of the present invention, the updating module 620 is further configured to, after storing information of the created subgroup by the member host, replace the information of the plurality of members registered in the member host in the group member list with the created subgroup information.
Further, in this embodiment of the present invention, the updating module 620 is further configured to delete the subgroup in the group and request the member host in which the subgroup is located to delete the subgroup if the number of the members of the subgroup is zero after the members are deleted from the subgroup.
Further, in this embodiment of the present invention, the updating module 620 is further configured to, after deleting a member from the subgroup, if the number of members in the subgroup is 1, replace the subgroup information in the group with the remaining subgroup member information, and request the member host in which the subgroup is located to delete the subgroup.
In summary, it can be seen that the updating apparatus of the present invention updates the information of the subgroups simultaneously when the groups are updated, thereby improving the effectiveness of the updating operation; and timely detecting whether the subgroup is formed, deleting the subgroup which does not meet the subgroup condition, and releasing the storage space.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.