Group member management method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a group member management method and apparatus.
Background
The machine-to-machine communication refers to data communication between machines without human participation, and is suitable for scenes such as traffic control management, remote meter reading, remote monitoring, medical monitoring, intelligent home control and the like. To provide a standardized interface between machines and devices of a machine communication system, the OneM2M standard organization defines a standard specification of the machine communication system.
In this specification, a group resource is created on a group host CSE (Common Services Entity), which contains information on the group members. In the process of creating the group, whether the type of the member is consistent with the set type needs to be verified, and if so, the group is created. If not, whether to create the group is decided according to a preset rule.
In addition, the member list can include not only the individual but also the subgroup, so that when the member type is verified, the type of the member can be judged for the individual through the provided member information, such as URI; for the subgroup, an acquisition request needs to be sent to the subgroup to acquire the member type.
At present, when a message is distributed through a group, a group host detects whether a plurality of members are registered on the same host, if so, a subgroup is created, and the members are taken as members of the subgroup; if not, the distributed work is performed.
In the prior art, detecting whether a plurality of members are registered on the same host and creating subgroup resources on the host are all performed when the group host performs message distribution, and no identifier established by the subgroup exists on the group host side, so the following problems are easily caused: the detection process is performed each time a message is distributed, the distribution operation is delayed, and the problem of creating subgroups repeatedly many times may occur.
In addition, in the prior art, if the request for creating the group includes the subgroup as a member, other platforms or applications cannot see the member information in the subgroup. In the process of message distribution, the platform needs to acquire member information of all members in the group in order to avoid sending errors or retransmitting messages, so that the platform needs to interact with the member host where the subgroup is located through the group host for multiple times to acquire the member information. However, the member information acquisition mode is low in efficiency, and affects the message distribution efficiency.
Disclosure of Invention
In view of the above problems, the present invention has been made to provide a group member management method and apparatus that solve the above problems or partially solve the above problems.
According to an aspect of the present invention, there is provided a group member management method, including:
detecting whether a plurality of members in the group members are registered on the same member host;
in the case that the detection result is positive, requesting the member host to create a subgroup for the plurality of members;
when the subgroup is created, the information of the subgroup is stored.
Optionally, in the method of the present invention, when creating the group, it is detected whether a plurality of members of the group are registered on the same member host.
Optionally, in the method of the present invention, when a group is created, if a member list sent by a group creation initiator includes a subgroup, when type information of a subgroup member is obtained from a member host side where the subgroup is located, member information of the subgroup is obtained at the same time.
Optionally, in the method of the present invention, after storing the information of the subgroup, the method further includes: and replacing the information of a plurality of members forming the subgroup in the group member list with the corresponding subgroup information.
Optionally, in the method of the present invention, when the information of the subgroup is stored, the subgroup is identified as the subgroup created by the group host side.
Optionally, in the method of the present invention, when a group is deleted, a member host in which each subgroup in the group is located is requested to delete the subgroup of the group, or only a member host in which the subgroup created by the group host in the group is located is requested to delete the subgroup of the group.
According to another aspect of the present invention, there is provided a group member management apparatus, including:
the detection module is used for detecting whether a plurality of members in the group members are registered on the same member host or not, and requesting the member host to establish subgroups for the members under the condition that the detection result is positive;
and the information management module is used for storing the information of the subgroups after the subgroups are created.
Optionally, the apparatus of the present invention further includes: and the group creating module is used for creating a group and triggering the detection module when the group is created.
Optionally, in the apparatus of the present invention, the group creating module is further configured to, when creating the group, if the member list sent by the group creation initiator includes the subgroup, obtain the member information of the subgroup when obtaining the type information of the subgroup member from the member host side where the subgroup is located.
Optionally, in the apparatus of the present invention, the information management module is further configured to, after storing the information of the subgroup, replace information of a plurality of members forming the subgroup in the group member list with corresponding subgroup information.
Optionally, in the apparatus according to the present invention, the information management module is further configured to, when storing the information of the subgroup, identify the subgroup as the subgroup created by the group member management apparatus.
Optionally, the apparatus of the present invention further includes: and the group deleting module is used for requesting the member host where each subgroup is positioned in the group to delete the subgroup of the group when the group is deleted, or only requesting the member host where the created subgroup is positioned in the group initiated by the group member management device to delete the subgroup of the group.
The invention has the following beneficial effects:
firstly, before the group does not distribute the message, preferably after the group is established, the invention actively requests the member host side to establish the subgroup and stores the information of the established subgroup, thereby avoiding the problems of group message distribution delay and repeated subgroup establishment for many times;
in the group creating process, the invention acquires the subgroup member types and also acquires the subgroup member information, so that other platforms can directly acquire the member information of the subgroups from the group host, and the information acquisition efficiency is improved.
Thirdly, after the group is deleted, the invention simultaneously informs the member host where the subgroup is located to delete the subgroup, thereby avoiding unnecessary waste of storage space.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a group member management method provided in the present invention;
fig. 2 is a flowchart of a group member management method according to an exemplary application of the present invention;
FIG. 3 is a flowchart of a group member management method according to an exemplary application of the present invention;
fig. 4 is a flowchart of a group member management method according to a third application example provided in the present invention;
fig. 5 is a block diagram of a group member management device according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
Example one
The embodiment of the invention provides a group member management method, which is applied to a group host side, and as shown in fig. 1, the method comprises the following steps:
step S101, detecting whether a plurality of members in the group member are registered on the same member host;
step S102, requesting the member host to create subgroups for the plurality of members under the condition that the detection result is positive;
step S103, when the subgroup is created, the information of the subgroup is stored.
That is, the method of the present invention actively requests the member host side to establish the subgroup before the group does not distribute the message, and stores the information of the subgroup. The problems of group message distribution delay and multiple iterations of creating subgroups are avoided.
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.
The execution of the method of the present invention is preferably, but not limited to, when creating the group. Optionally, it can also be done before the message is distributed over the group.
In some embodiments, when a group is created, if a member list sent by a group creation initiator includes a subgroup, when type information of a subgroup member is acquired from a member host side where the subgroup is located, member information of the subgroup, such as a URI of the member, is acquired at the same time. That is, in the group creating process, the invention acquires the subgroup member information while acquiring the subgroup member type, so that other platforms can acquire the subgroup member information by directly performing one-time interaction with the group host, and support is provided for improving the information acquisition efficiency.
In some embodiments, after storing the information of the subgroup, the method further comprises: and replacing the information of a plurality of members forming the subgroup in the group member list with the corresponding subgroup information. I.e., updates to the group member list.
In some embodiments, when storing information for a subgroup, the subgroup is identified as the subgroup created by the group host side initiative to distinguish from the subgroup contained in the member list sent by the group creation originator.
In some embodiments, when deleting the group, the member host in which each subgroup is located in the group is requested to delete the subgroup of the group, or only the member host in which the subgroup initiated by the group host is located in the group is requested to delete the subgroup of the group. Therefore, after the group is deleted, the member host where the subgroup is located is informed to delete the subgroup at the same time, and the storage space is released. In addition, when the subgroup is deleted, the subgroup can be deleted conditionally according to the identification, so that the flexibility is higher.
Specific application examples of the present invention are given below according to fig. 2 to fig. 4, and further details of the present invention are given in conjunction with the description of the application examples, so that the present invention can better explain specific implementation procedures of the method provided by the present invention.
Application example 1
As shown in fig. 2, a flowchart of a group member management method provided for the application example specifically includes the following steps:
step S201, the initiator AE or CSE sends a request for creating a group to the group host CSE, and carries the member list.
The member list includes information of the member, such as a URI (Uniform resource identifier) of the member. Example (c): the member list includes member A, B, C, D and sub-group sub-GA, etc., wherein B, C, D is registered on member host CSE1, and sub-group sub-GA is registered on member host CSE 2.
Step S202, after receiving the request, the group host CSE initiates a request for obtaining the subgroup member type and member information (such as member URI) to the member host CSE2 where the subgroup is located;
in step S203, the member host CSE2 returns the member type and member information, such as URI, to the group host CSE.
In step S204, the group host CSE verifies whether the type of each member is consistent with the set type, and if so, creates a group and stores the acquired information of the subgroup, i.e. stores the information of the subgroup and the members constituting the subgroup, e.g. the subgroup sub-GA is composed of GA1, GA2, etc. and contains information of members such as GA1, GA2, etc., e.g. URIs.
Step S205, the group host CSE detects whether there are multiple members in the member list registered on the same member host, if so, creates a subgroup on the member host, where the members in the subgroup are the members in the list registered on the member host, and if B, C, D in the member list are all registered on the member host CSE1, creates a subgroup on the member host CSE1, where the member of the subgroup is B, C, D.
Step S206, the group host CSE sends a create subgroup request to the member host CSE1, carrying the member list, e.g., B, C, D.
Step S207, the group host CSE sends a group creation response to the initiator.
Step S208, after receiving the request, the member host CSE1 detects whether each member in the carried member list is registered in the host, and if so, creates a subgroup.
At step S209, the member host CSE1 sends a subgroup creation response to the group host CSE.
In step S210, the group host stores the information of the subgroup and updates the member list, i.e. replaces the information of the members registered in the CSE1 of the member host with the information of the subgroup, such as replacing the information of B, C, D with the information of the subgroup. The stored information of the subgroup includes information of the subgroup and members constituting the subgroup. And when the information of the subgroup is stored, the created subgroup is distinguished from the subgroup carried in the member list of the request.
Application example two
As shown in fig. 3, the flowchart of the group member management method provided for the application example specifically includes the following steps:
step S301, the initiator sends a request for deleting the group to the group host CSE.
Step S302, after receiving the request, the CSE detects whether there is a subgroup in the member list, and if yes, executes step S303.
In step S303, the group host CSE sends a request for deleting the subgroup to the member hosts including the subgroup, such as the member host CSE1 and the member host CSE 2.
In step S304, the member hosts CSE1 and CSE2 delete the corresponding subgroups.
In step S305, the member hosts CSE1 and CSE2 send delete responses to the group host CSE.
Step S306, the group host CSE deletes the group and sends a deletion response to the initiator. This step may also be completed in step S302.
Application example three
As shown in fig. 4, the flowchart of the group member management method provided for the application example specifically includes the following steps:
step S401, the initiator sends a request for deleting the group to the group host CSE.
Step S402, after the CSE receives the request, it detects whether there is a subgroup marked as the created by the CSE in the member list, if yes, then it executes step S403;
in step S403, the group host CSE sends a request for deleting the subgroup to the member host CSE1 containing the subgroup marked as created by the group host.
In step S404, the member host CSE1 deletes the subgroup.
In step S405, the member host CSE1 sends a delete response to the group host CSE.
Step S406, the group host deletes the group and sends a deletion response to the initiator. This step may also be completed in step S402.
Example two
An embodiment of the present invention provides a group member management device, as shown in fig. 5, specifically including:
a detecting module 510, configured to detect whether multiple members of a group member are registered in the same member host, and request the member host to create a subgroup for the multiple members if a detection result is positive;
and an information management module 520, configured to store information of the subgroup after the subgroup is created.
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:
the group member management device according to the embodiment of the present invention further includes:
a group creation module 530 for creating a group and, when creating a group, triggering the detection module 510.
The group creating module 530, when creating a group, if the member list sent by the group creation initiator includes a subgroup, obtains the type information of the subgroup member from the member host side where the subgroup is located, and obtains the member information of the subgroup at the same time.
Further, in this embodiment of the present invention, the information management module 520 is further configured to, after storing the information of the subgroup, replace information of a plurality of members forming the subgroup in the group member list with information of the corresponding subgroup. I.e., updates to the group member list.
Further, in this embodiment of the present invention, when storing the information of the subgroup, the information management module 520 identifies the subgroup as the subgroup created by the group member management apparatus, so as to distinguish the subgroup from the subgroup included in the member list sent by the group creation initiator.
Further, the group member management apparatus according to the embodiment of the present invention further includes:
the group deleting module 540 is configured to, when the group is deleted, request the member host in which each subgroup is located in the group to delete the subgroup of the group, or request only the member host in which the subgroup created by the group member management device is located in the group to delete the subgroup of the group.
The group member management device of the embodiment of the invention is applied to the group host.
In summary, it can be seen that the device of the present invention actively requests the member host side to establish the subgroup before the group does not distribute the message, preferably, when the group is created, and stores the information of the subgroup, thereby avoiding the problems of group message distribution delay and repeated subgroup creation.
In addition, in the group creating process, the subgroup member types are acquired and the subgroup member information is also acquired, so that the member information of the subgroups can be acquired through one-time interaction between other platforms and the group host, and support is provided for improving the information acquisition efficiency.
In addition, after the group is deleted, the member host where the subgroup is located is informed to delete the subgroup at the same time, and the storage space is released.
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.