Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example one
Referring to fig. 1, a flowchart of a method for joining a group according to an embodiment of the present invention is shown, where the method includes:
101: receiving a group joining request from a first user, wherein the group joining request carries information indicating that the first user is currently in a first local area network;
102: searching for a group created by a second user currently in the first local area network;
103: and joining the first user into the searched group.
The embodiment of the invention adds the first user needing to be added into the group of the second user in the same local area network with the first user, so that the efficiency of adding into the group is improved, and the operation process is simpler and more convenient.
Example two
Referring to fig. 2, a flowchart of a method for joining a group according to a second embodiment of the present invention is shown, where the method includes:
201: monitoring a trigger event for applying to join a group;
202: and if the trigger event is monitored, sending a group joining request, wherein the group joining request carries information indicating that the current local area network is located.
The embodiment of the invention adds the first user needing to be added into the group of the second user in the same local area network with the first user, so that the efficiency of adding into the group is improved, and the operation process is simpler and more convenient.
EXAMPLE III
Referring to fig. 3, a flowchart of a method for joining a group according to a third embodiment of the present invention is shown, where the method for joining a group is mainly applied to a server, a terminal of a first user, and a terminal of a second user to perform group joining.
The method for joining the group comprises the following steps:
301: and the server receives a request for creating a group from the second user, wherein the request for creating the group carries information indicating that the second user is currently in the first local area network.
In the embodiment of the present invention, the local area network information is an IP (internet protocol, protocol for interconnection between networks) address of the terminal of the user in the public network.
302: and the server allocates an identifier for the group created by the second user request.
Step 301 and step 302 are processes of applying for a group by a second user, and after the server approves the application group for the second user, the server allocates a group identifier to the second user.
303: the server receives a request for triggering and approving the user account to join the group from the second user, wherein the request for triggering and approving the user account to join the group carries information indicating that the second user is currently in the first local area network and the identifier of the group created when the second user is in the second local area network.
The second user needs to perform an operation of joining the user participating in the group chat into the group at this time, so that a request for triggering and approving the user account to join the group, the identifier of the group carried in the request, and the network address where the second user is currently located are sent to the server, and the network address is information that the second user is currently located in the first local area network.
The network address where the second user is located when creating the group may be information of a second local area network that is different from the first local area network where the second user is currently located. Further, the network address may also be information of the first local area network where the second user was located when creating the group.
In an implementation scenario, a second user (creator or administrator of the group) sends an operation in the group setup that triggers a request to approve a user account to join the group, to send the request to the server that triggers the approval of the user account to join the group.
304: it is monitored whether a mode of joining a group has been currently entered.
After the second user sends a request for triggering and approving the user account to join the group, the first user applying for joining the group opens a preset page of the instant messaging application in the terminal to carry out operation of applying for joining the group. At this time, the terminal needs to monitor the event for applying to join the group.
Before monitoring, whether a mode of joining the group is entered is judged. In the implementation scenario of the embodiment of the present invention, the following is presented: and monitoring whether the set application page is opened.
305: and if the mode of joining the group is entered currently, executing the step of monitoring the trigger event applying for joining the group.
306: and monitoring a trigger event for applying to join the group.
When a first user applies for group joining, the terminal triggers an event applying for group joining, and when the event is monitored, the terminal performs a group joining process.
The event triggered by the terminal and applying for joining the group can be in the following mode:
(1) monitoring whether the acceleration in the preset direction reaches the preset acceleration.
In the method, when the gravity sensing module in the terminal senses that the acceleration generated by shaking the terminal reaches the preset acceleration, the terminal triggers an event for applying to join the group.
(2) And monitoring whether the gesture input by the user is matched with a preset gesture.
The method comprises the steps of setting nine-square grids in a preset page, presetting sliding track information in the nine-square grids, carrying out sliding operation after a user opens the preset page, recording the sliding track information corresponding to the sliding operation, comparing the sliding track information with the preset sliding track information, and triggering an event applying for joining the group if the sliding track information is matched with the preset sliding track information.
(3) And monitoring whether the text information input by the user is matched with the preset text information.
The method comprises the steps of setting an input frame in a preset page, presetting character information input in the input frame, carrying out character input operation after a user opens the preset page, recording the input character information, comparing the preset character information, and triggering an event applying for joining the group if the preset character information is matched with a terminal.
307: and if the trigger event is monitored, sending a group joining request, wherein the group joining request carries information indicating that the current local area network is located.
The process of acquiring the address information of the terminal comprises the following steps:
and acquiring the public network IP address of the network where the terminal is located.
308: the method comprises the steps that a server receives a group joining request from a first user, wherein the group joining request carries information indicating that the first user is located in a first local area network currently.
309: the server looks up a group created by a second user currently in the first local area network.
And determining a group created by a second user in the same local area network with the first user according to information of the second user in the first local area network, wherein the information is carried in a request for triggering and approving the user account to join the group and is sent by the second user.
310: and the server joins the first user into the searched group.
311: the server sends confirmation information to the first user who joins the group, wherein the confirmation information carries the identification, the attribute information and the member identification of the group which the first user joins.
Further, another group joining method is provided in the embodiment of the present invention, which is used for controlling, by a server, joining of another first user to a group after a first request of the first user to join the group is received, as shown in fig. 4, and the method includes:
401: the method comprises the steps that a server receives a group joining request from a first user, wherein the group joining request carries information indicating that the first user is located in a first local area network currently.
402: a timer is started when a request from a first user to join a group is first received.
403: and stopping executing the step of receiving the request of joining the group from the first user when the timing reaches the set timing length.
By means of timing, the process of triggering the request of approving the user to find the group to be joined initiated by a certain second user can be limited, so that the local area network where the certain second user is located can respectively start the processes of joining different groups at different time intervals.
According to the embodiment of the invention, the first user needing to join the group is joined to the group of the second user in the same local area network with the first user, so that the efficiency of joining the group is improved, and the operation process is simpler and more convenient; furthermore, the utilization rate of the same local area network for joining the group is improved by limiting the time of the first user applying for joining the group.
Example four
Please refer to fig. 5, which shows a flowchart of a method for joining a group according to a fourth embodiment of the present invention. The embodiment of the invention describes a group joining method based on an application scene of a plurality of persons participating in a party.
The method for joining the group comprises the following steps:
501: and the group owner serves as a second user to send a group creating request to the server, wherein the group creating request carries the current public network address.
502: the server receives a request to create a group and assigns an identification of the group to the user.
503: the server receives a request from the group owner to trigger approval of the user account to join the group.
At this time, the group owner approves the user account to join the group through the page triggered in the group of the terminal, and starts the function of approving the user account to join the group.
504: and other users participating in the party as first users open application pages to trigger events applying for joining the group, and send requests applying for joining the group to the server, wherein the requests carry the current public network address.
At this time, the users participating in the party open the pages of the joining group in the instant messaging application, and the event of applying for joining the group is triggered by shaking the terminal.
505: the server receives requests for joining the group sent by other users participating in the party, wherein the requests for joining the group carry public network addresses of the other users participating in the party.
506: the server looks up a group created by a group owner currently at the same public network address as the other users participating in the party.
507: the user accounts of other users participating in the party are added to the looked up group.
The embodiment of the invention adds the first user needing to be added into the group of the second user in the same local area network with the first user, so that the efficiency of adding into the group is improved, and the operation process is simpler and more convenient.
EXAMPLE five
An embodiment of the present invention provides a device for joining a group, and referring to fig. 6, the device includes:
a first receiving module 601, configured to receive a request for joining a group from a first user, where the request for joining the group carries information indicating that the first user is currently located in a first local area network;
a searching module 602, configured to search for a group created by a second user currently located in the first local area network;
a joining module 603, configured to join the first user to the searched group.
The embodiment of the invention adds the first user needing to be added into the group of the second user in the same local area network with the first user, so that the efficiency of adding into the group is improved, and the operation process is simpler and more convenient.
EXAMPLE six
An embodiment of the present invention provides a device for joining a group, and referring to fig. 7, the device includes:
a first receiving module 701, configured to receive a request for joining a group from a first user, where the request for joining the group carries information indicating that the first user is currently located in a first local area network;
a searching module 702, configured to search for a group created by a second user currently located in the first local area network;
a joining module 703, configured to join the first user to the searched group.
Wherein the apparatus further comprises:
a second receiving module 704, configured to receive a request for creating a group from the second user, where the request for creating a group carries information indicating that the second user is currently located in a first local area network;
an allocating module 705, configured to allocate an identifier to the group created by the second user request.
Wherein the apparatus further comprises:
a third receiving module 706, configured to receive a request for triggering approval of a user account to join a group from the second user, where the request for triggering approval of the user account to join the group carries information indicating that the second user is currently located in the first local area network and an identifier of the group created when the second user is located in the second local area network.
Wherein the apparatus further comprises:
a timing module 707, configured to start timing when a request for joining a group is received from a first user for the first time;
a first processing module 708, configured to stop executing the step of receiving, by the first receiving module, the request for joining the group from the first user when the time reaches a set duration.
Wherein the apparatus further comprises:
a first sending module 709, configured to send confirmation information to the first user joining the group, where the confirmation information carries an identifier, attribute information, and a member identifier of the group joined by the first user.
The embodiment of the invention adds the first user needing to be added into the group of the second user in the same local area network with the first user, so that the efficiency of adding into the group is improved, and the operation process is simpler and more convenient.
EXAMPLE seven
An embodiment of the present invention provides a device for joining a group, and referring to fig. 8, the device includes:
a first monitoring module 801, configured to monitor a trigger event for applying for joining a group;
a second sending module 802, configured to send a group joining request if the trigger event is monitored, where the group joining request carries information indicating that the current node is in the first lan.
The embodiment of the invention adds the first user needing to be added into the group of the second user in the same local area network with the first user, so that the efficiency of adding into the group is improved, and the operation process is simpler and more convenient.
Example eight
An embodiment of the present invention provides a device for joining a group, and referring to fig. 9, the device includes:
a first monitoring module 901, configured to monitor a trigger event for applying for joining a group;
a second sending module 902, configured to send a group joining request if the trigger event is monitored, where the group joining request carries information indicating that the current node is in the first lan.
Wherein the apparatus further comprises:
a second monitoring module 903, configured to monitor whether the group joining mode is currently entered;
a second processing module 904, configured to execute the step of monitoring the trigger event of applying for joining the group in the first monitoring module if the mode of joining the group has been entered currently.
The second monitoring module 903 is configured to monitor whether a set application page is opened.
Wherein the first monitoring module 901 includes:
the first monitoring unit 9011 is configured to monitor whether the acceleration in the preset direction reaches a preset acceleration;
the second monitoring unit 9012 is configured to monitor whether a gesture input by the user matches a preset gesture;
and a third monitoring unit 9013, configured to monitor whether the text information input by the user matches with preset text information.
The embodiment of the invention adds the first user needing to be added into the group of the second user in the same local area network with the first user, so that the efficiency of adding into the group is improved, and the operation process is simpler and more convenient.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.