Method, system, server and medium for setting user role in instant messaging
By detecting and updating the user roles of terminal devices in instant messaging scenarios through the server, the problem of terminal device disconnection affecting communication stability is solved, thus achieving the stability and rationality of instant messaging scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN UNITED IMAGING HEALTHCARE SURGICAL TECH CO LTD
- Filing Date
- 2023-10-18
- Publication Date
- 2026-07-10
Smart Images

Figure CN119854251B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of instant messaging technology, and in particular to a method, system, server, and storage medium for setting user roles in instant messaging. Background Technology
[0002] In multi-user shared instant messaging scenarios, multiple terminal devices typically connect to the server simultaneously for multi-user conversations and interactions. The server assigns corresponding user roles to each terminal device, such as host and audience roles, with different user roles having different operational permissions. However, due to network instability and other reasons, terminal devices may experience disconnections after connecting to the server. If the user role of the disconnected terminal device has important permissions, its disconnection may affect the normal operation of the instant messaging scenario, leading to a decrease in scenario stability. Summary of the Invention
[0003] In view of this, embodiments of this application provide a method, system, server, and storage medium for setting user roles in instant messaging, which can improve the stability of instant messaging scenarios.
[0004] The first aspect of this application provides a method for setting user roles in instant messaging, including:
[0005] The system detects the connection status between each terminal device and the server, and the multiple terminal devices interact through the server.
[0006] If the communication connection between the first terminal device and the server is detected to be disconnected among multiple terminal devices, obtain the user role of the first terminal device before the communication connection with the server was disconnected;
[0007] Based on the user role of the first terminal device before it lost communication with the server, update the user role of at least one other terminal device among the multiple terminal devices that is still communicating with the server, excluding the first terminal device.
[0008] In this embodiment, when multiple terminal devices connect to the server for multi-user interactions such as multi-person sessions, the server detects the connection status of each terminal device. If a terminal device is detected to have lost its connection, the server retrieves the user role of that terminal device before the connection was lost and updates the user roles of at least one other terminal device based on that user role. This enables adaptive adjustment of user roles after a terminal device disconnects, thereby improving the stability of the instant messaging scenario. For example, suppose a terminal device holds a target role with important permissions. When it disconnects, the server can select a replacement terminal device from the currently connected terminal devices to assume that target role, thus ensuring the normal operation of the instant messaging scenario.
[0009] In one implementation of this application, updating the user role of at least one other terminal device (excluding the first terminal device) that maintains a communication connection with the server, based on the user role of the first terminal device before disconnecting from the server, includes:
[0010] If the user role of the first terminal device before disconnecting from the server was the target role, then the user role of the second terminal device in at least one other terminal device will be updated to the target role. The target role is the user role with the highest privileges among the user roles of multiple terminal devices.
[0011] This configuration ensures that at least one target role with the highest privileges is online in the scenario, thereby improving the stability of the instant messaging scenario.
[0012] Specifically, the second terminal device meets any one or more of the following conditions:
[0013] The location of the second terminal device is a designated location;
[0014] The user identity of the second terminal device is the designated identity;
[0015] The activity level of the second terminal device is greater than or equal to a preset threshold. The activity level is determined based on the operations performed by the second terminal device on the virtual 3D model created by the server.
[0016] In one implementation of this application, selecting a second terminal device from other terminal devices includes:
[0017] Obtain the geographical location and IP address of each terminal device in other terminal devices;
[0018] Based on the geographical location and IP address of each terminal device, determine the location of each of the other terminal devices;
[0019] Select a terminal device from other terminal devices that is located in the designated location, and use it as the second terminal device.
[0020] Target roles are generally best suited for professionals, who are typically located in specific workplaces, such as schools or hospitals. Therefore, by selecting a terminal device located in that specific location as the secondary terminal device, the likelihood of assigning the target role to a professional can be increased, thereby improving the rationality and accuracy of the target role allocation.
[0021] In another implementation of the embodiments of this application, selecting a second terminal device from other terminal devices includes:
[0022] Acquire user images from each terminal device in other terminal devices;
[0023] Based on the user image of each terminal device, determine the user identity of each terminal device in other terminal devices;
[0024] Select a terminal device from other terminal devices that has the user's identity specified, and use it as the second terminal device.
[0025] Target roles are generally suitable for professionals, who typically possess designated user identities, such as teachers or doctors. Therefore, by selecting a terminal device with the designated user identity as the secondary terminal device, the likelihood of assigning the target role to a professional can be increased, thereby improving the rationality and accuracy of target role allocation.
[0026] In another implementation of the embodiments of this application, selecting a second terminal device from other terminal devices includes:
[0027] The activity level of each terminal device in other terminal devices is obtained. The activity level is determined based on the number of operations performed by the corresponding terminal device on the virtual 3D model created by the server.
[0028] Select a terminal device with an activity level greater than a preset threshold from other terminal devices as the second terminal device.
[0029] Since activity level is determined by the number of operations performed by the corresponding terminal device on the virtual 3D model created by the server, users with high activity levels are generally more familiar with the scene or more skilled in operation, and are more suitable to assume the target role. Therefore, this method of selecting a second terminal device can also improve the rationality and accuracy of assigning target roles.
[0030] In one implementation of this application, updating the user role of the second terminal device to the target role includes:
[0031] Set the user role of the second terminal device to a temporary target role;
[0032] If the first terminal device does not reacquire the target role within the first time period, the user role of the second terminal device will be set as the permanent target role during the interaction.
[0033] Since the first terminal device is currently only disconnected, it can reconnect to the server through the reconnection mechanism. After joining a multi-user session and other interactive processes, it can reacquire and assume the target role. Therefore, the server can initially set the second terminal device's user role as a temporary target role. Furthermore, considering the limited duration of multi-user sessions, the server cannot indefinitely retain the first terminal device's right to reacquire the target role. Therefore, the server can set a time limit for permission retention, i.e., a first duration. If the first terminal device does not reacquire the target role within the first duration, the server will set the second terminal device's user role as a permanent target role. This setting effectively improves the rationality and practicality of user role allocation.
[0034] In one implementation of this application, the method further includes:
[0035] When a third terminal device is detected to be connected to the server and request to join the interaction process, the user role of the third terminal device is set to the target role if the third terminal device meets the conditions for obtaining the target role.
[0036] With this setup, each terminal device joining a multi-user session can obtain the corresponding user role as appropriate, thereby improving the integrity and comprehensiveness of the application scenario.
[0037] In one implementation of this application, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0038] If the third terminal device is a terminal device that has reconnected after multiple terminal devices have lost communication, and the user role of the third terminal device before the communication connection was lost was the target role, then the third terminal device is determined to meet the condition of obtaining the target role.
[0039] With this configuration, the original target character's terminal device has the legitimate right to reclaim the target character after a disconnection and reconnection, thereby improving the rationality and practicality of the application scenario.
[0040] In another implementation of this application embodiment, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0041] If the third terminal device is a terminal device that has reconnected after multiple terminal devices have lost communication, the user role of the third terminal device before the communication connection was disconnected is the target role, and the third terminal device confirms that it has reacquired the target role, then the third terminal device is determined to meet the conditions for acquiring the target role.
[0042] This configuration allows for a comprehensive assessment, considering both the original target device's willingness to reclaim the target role, to determine whether to reassign the target role to that device. This further enhances the rationality and practicality of the application scenario. Specifically, whether the third-party terminal device confirms the reacquisition of the target role is determined in the following ways:
[0043] Obtain the parameter data sent when the third terminal device connects to the server;
[0044] Based on the transmitted parameter data, determine whether the third terminal device confirms the reacquisition of the target role.
[0045] By analyzing the transmitted parameter data, the server can easily identify the user's intentions on the third-party terminal device, that is, determine whether the third-party terminal device confirms the re-acquisition of the target role.
[0046] In another implementation of this application, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0047] If the third terminal device is a terminal device that has reconnected after multiple terminal devices have lost connection, the user role of the third terminal device before the communication connection was lost is the target role, the third terminal device confirms that it has reacquired the target role, and the disconnection time of the third terminal device does not exceed the second time limit, then the third terminal device is determined to meet the conditions for acquiring the target role.
[0048] Considering that the server cannot retain the right of a terminal device to reacquire the target role indefinitely, a permission retention period, or a second duration, can be set. When the terminal device is disconnected for longer than the permission retention period, the terminal device loses the right to reacquire the target role. This improves the rationality and practicality of the application scenario.
[0049] In another implementation of this application, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0050] If the third terminal device is not a terminal device that has reconnected after multiple terminal devices have interrupted their connection, then the third terminal device is determined not to meet the conditions for obtaining the target role.
[0051] If the third terminal device is not a disconnected and reconnected terminal device, it means that in the multi-terminal interaction scenario, other terminal devices must have already been assigned the target role. Therefore, the server can determine that the third terminal device does not meet the conditions for obtaining the target role, and thus assign a non-target role to the third terminal device.
[0052] In one implementation of this application, before detecting the connection status between each terminal device and the server among multiple terminal devices, the method further includes:
[0053] Set the user role of the first terminal device among multiple terminal devices to connect to the server as the target role.
[0054] This configuration enables a mechanism that prioritizes the allocation of target roles based on the order of access.
[0055] A second aspect of this application provides a device for setting user roles in instant messaging, including:
[0056] The detection module is used to detect the connection status between each of the multiple terminal devices and the server, and the multiple terminal devices interact through the server.
[0057] The acquisition module is used to acquire the user role of the first terminal device before the communication connection with the server was disconnected when the communication connection between the first terminal device and the server is detected to be disconnected.
[0058] The update module is used to update the user role of at least one other terminal device among the plurality of terminal devices that maintains a communication connection with the server, based on the user role of the first terminal device before it disconnects from the server.
[0059] A third aspect of this application provides a server including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method for setting user roles in instant messaging as provided in the first aspect of this application.
[0060] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for setting user roles in instant messaging as provided in the first aspect of this application.
[0061] A fifth aspect of this application provides an instant messaging system, which includes a server as provided in the third aspect of this application and a plurality of terminal devices connected to the server.
[0062] A sixth aspect of this application provides a computer program product that, when run on a server, causes the server to execute the user role setting method in instant messaging as provided in the first aspect of this application.
[0063] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0064] Figure 1 This is a schematic diagram of an instant messaging system provided in an embodiment of this application;
[0065] Figure 2 This is a schematic diagram of a practical demonstration scenario shared by multiple users, provided in an embodiment of this application.
[0066] Figure 3 yes Figure 2 The software system structure diagram corresponding to the practical demonstration scenario shown;
[0067] Figure 4 This is a flowchart illustrating a method for setting user roles in instant messaging, as provided in an embodiment of this application.
[0068] Figure 5 This is a schematic diagram of the interaction process between devices in a multi-user sharing scenario of instant messaging, provided in an embodiment of this application.
[0069] Figure 6 This is a schematic diagram of an operation process provided in this application embodiment of assigning user roles to accessed terminal devices by a server;
[0070] Figure 7 This is a schematic diagram of the structure of a user role setting device in instant messaging provided in an embodiment of this application;
[0071] Figure 8 This is a schematic diagram of a server provided in an embodiment of this application. Detailed Implementation
[0072] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail. Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0073] Currently, there are many multi-user instant messaging scenarios, such as online multi-person meetings, online courses, or virtual hands-on demonstrations. In these scenarios, multiple terminal devices typically interact by connecting to a server. The server assigns corresponding user roles to each terminal device, such as host and audience roles, teacher and student roles, etc., with different user roles having different operational permissions. However, terminal devices may experience disconnections after connecting to the server. If the user role of the disconnected terminal device has important permissions (such as the host role in the following embodiment), its disconnection may affect the normal operation of the instant messaging scenario, leading to a decrease in scenario stability. In view of this, embodiments of this application provide a method, system, server, and storage medium for setting user roles in instant messaging, which can improve the stability of instant messaging scenario operation. For more specific technical implementation details of the embodiments of this application, please refer to the various embodiments described below.
[0074] like Figure 1 The diagram shown is a schematic representation of an instant messaging system provided in an embodiment of this application. Figure 1 The system includes a server and multiple terminal devices (terminal devices 1-N) connected to the server. Each terminal device can interact through the server, including multi-person conversations. For different instant messaging scenarios, the server can assign different user roles to each connected terminal device, with different user roles having different operational permissions. For example, in online multi-person meetings or practical demonstrations, the server can assign a host role to at least one terminal device and audience roles to the remaining devices. The host role has higher operational permissions than the audience roles. For instance, the host role's operational permissions may include all permissions such as view switching, microphone switching and on / off, conversation communication, and transferring the host role, while the audience role's operational permissions only include regular conversation communication. As another example, in online course scenarios, the server can assign a teacher role to one or more terminal devices and student roles to the remaining devices. The teacher role has higher operational permissions than the student roles. It should be noted that these multiple terminal devices can be distributed in the same location or in different locations; this embodiment does not limit this. Regarding... Figure 1 The specific working principle of the system shown can be referred to the method embodiment described below.
[0075] Figure 1The servers and terminal devices in this application can be various types of devices, such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, desktop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), large-screen TVs, etc. This application does not limit them.
[0076] like Figure 2 The diagram shown is a schematic representation of a practical demonstration scenario for multi-user sharing provided in an embodiment of this application. Figure 2 The demonstration features four terminal devices: A, B, C, and D. All four devices are connected to a server, enabling real-time, multi-user, shared practical demonstrations. The user on terminal A acts as the host, while users on terminals B, C, and D act as viewers. Figure 2 In this scenario, only one host role exists at a time, but multiple audience roles are allowed. The host role has the highest level of access to all functions, while audience roles have access to a limited number of functions. Additionally, a virtual 3D model, such as a 3D model of a human heart or liver, can be created on the server side. Various terminal devices can perform various operations on this 3D model (such as cutting, rotating, and translating) and observe the resulting changes. As an example, terminal device A can manipulate the virtual 3D model, inputting model operation data to the server. The server can then synchronize this data to terminal devices B, C, and D, allowing each terminal device to access and display the changed virtual 3D model.
[0077] Figure 3 for Figure 2 The software system architecture diagram corresponding to the practical demonstration scenario shown is shown. Figure 3The software system architecture comprises three parts: user login, patient list, and model browsing. After connecting to the server, the terminal device can log in using its user account, mobile phone number, or exit the application. Users can log in using their registered account or mobile phone number and exit the system application. The patient list interface primarily displays a list of patient models, allowing users to refresh the list, load more models, log out, and select models. These patient models can be virtual 3D models of various diseased organs. Refreshing and loading more models allows users to obtain the latest patient model data. Users can log out of their currently logged-in account and return to the user login interface. Users can select the desired patient model from the patient model list to enter single-user viewing or multi-user sharing mode. The technical solution in this application primarily addresses the multi-user sharing mode. When browsing models, the system includes tools, model management, reset, and exit functions. For multi-user sharing mode, it also includes functions such as exiting multi-user sharing, switching sharing modes, and sharing the field of view. In addition, the multi-user sharing mode also supports the reconnection function after disconnection. This function can be initiated manually by the user or automatically by the terminal device after disconnection.
[0078] Please see Figure 4 This application illustrates a method for setting user roles in instant messaging, as provided in an embodiment of the present application. The method includes:
[0079] 401. The server detects the connection status between each terminal device and the server, and the multiple terminal devices interact through the server.
[0080] When multiple terminal devices connect to a server and engage in multi-user conversations or other interactive activities, the server monitors the connection status of each terminal device in real-time or periodically to determine if any device has disconnected. Specifically, all shared multi-user connections established between terminal devices and the server are instant messaging connections, and a heartbeat mechanism is used from the start of the connection to determine if a terminal device has disconnected. For the heartbeat mechanism, a terminal device can send a heartbeat signal at regular intervals, continuously looping until the connection is lost. By monitoring the number of heartbeat signal transmissions and responses from the server, the terminal device can determine if it has disconnected. For example, if it receives no response from the server for two consecutive heartbeat signals, it can determine that the terminal device has disconnected and can initiate a reconnection process to re-establish a connection with the server. The server can also determine if a terminal device has dropped the connection by continuously monitoring both the instant messaging connection and the heartbeat connection. For instance, if it does not receive a heartbeat signal from a terminal device within a certain timeframe, it can determine that the terminal device has dropped the connection, meaning its communication connection with the server has been broken.
[0081] As an example, each of the multiple terminal devices has its own user role. At least one terminal device has a user role that is different from the user roles of the other terminal devices, and at least one terminal device has a user role with higher permissions than the user roles of the other terminal devices. For example, at least one terminal device has a user role that is the target role with the highest permissions.
[0082] The user roles of each terminal device can be assigned by the server, or they can be determined by the time it takes for each terminal device to establish a communication connection with the server. Of course, this can be combined with... Figure 3 The user role corresponding to at least one of the terminal devices can be determined by the user role corresponding to the account logged in on that terminal device, but this application embodiment does not limit this.
[0083] Once a terminal device connects to a server and joins a multi-user session or other interactive activity, the server can assign corresponding user roles to that terminal device, such as host roles and audience roles, etc. Different user roles have different operating permissions.
[0084] As an example, once the server determines the user roles of each terminal device, it can store the user roles of each terminal device in the current multi-user session and maintain the correspondence between each terminal device and its user roles in the current multi-user session.
[0085] 402. When the server detects that the communication connection between the first terminal device and the server has been lost among multiple terminal devices, the server obtains the user role of the first terminal device before the communication connection with the server was lost.
[0086] As an example, in Figure 2 In the scenario shown, the host role has the highest level of authority. It has both the conventional functions of operating the virtual 3D model, such as using the distance measurement, drawing, and cropping functions, and the advanced functions of adjusting permissions, such as transferring the host role and enabling or disabling the permissions of the audience role. The audience role has lower level of authority and only has the conventional functions of operating the virtual 3D model.
[0087] When the server detects that a terminal device has gone offline, assuming that terminal device is the first terminal device, the server will retrieve the user role of the first terminal device before the communication connection was lost. As an example, in... Figure 2In the scenario shown, if the first terminal device to lose connection is terminal device A, the server will obtain the user role "host role" of terminal device A before the communication connection is lost. If the first terminal device to lose connection is terminal device B, the server will obtain the user role "audience role" of terminal device B before the communication connection is lost.
[0088] 403. The server updates the user role of at least one other terminal device (excluding the first terminal device) that maintains a communication connection with the server, based on the user role of the first terminal device before it disconnected from the server.
[0089] The server will adjust and update the user roles of at least one other terminal device that is still communicating with the server, excluding the first terminal device, based on the user role of the first terminal device before the communication connection is lost. This enables adaptive adjustment of user roles after the terminal device is disconnected, thereby improving the stability of the instant messaging scenario.
[0090] As an example, if the user role of the first terminal device before the communication connection is disconnected is the most important target role, such as "host role" or "teacher role", then the server can select at least one other terminal device that is maintaining a communication connection with the server and set its user role as the target role, for example, selecting one or more other terminal devices as the target role; the server can also select at least one other terminal device that is maintaining a communication connection with the server and set its user role as a secondary role with permissions second only to the target role, such as "class monitor role" or "backup host role", and so on.
[0091] As another example, if the user role of the first terminal device before the communication connection was disconnected was a secondary role of moderate importance, such as "class monitor" or "backup host", then the server can select another terminal device that is maintaining a communication connection with the server and set its user role to a secondary role.
[0092] As another example, if the user role of the first terminal device before the communication connection was disconnected was a low-importance non-target role, such as a "student role" or a "spectator role," the server may not adjust the user roles of other terminal devices, or it may adjust more than one other user role to the non-target role. For example, when a terminal device with a "student role" disconnects, if there are two terminal devices with a "class monitor role" among all the terminal devices currently connected to the server, the server may adjust one of the "class monitor role" terminal devices to a "student role." In one implementation of this application embodiment, the server updates the user role of at least one other terminal device (excluding the first terminal device) that is connected to the server, based on the user role of the first terminal device before the communication connection was disconnected, including:
[0093] If the user role of the first terminal device before disconnecting from the server was the target role, then the server will update the user role of the second terminal device in at least one other terminal device to the target role. The target role is the user role with the highest privileges among the user roles of multiple terminal devices.
[0094] If the user role of the first terminal device before the communication connection was disconnected was the target role with the highest privileges, such as a host or teacher, its disconnection would severely impact the normal operation of the scenario. Therefore, the server will select another terminal device from the currently online terminals as a replacement, called the second terminal device, and update the user role of the second terminal device to the target role. In other words, the second terminal device will take over the responsibilities of the disconnected first terminal device, ensuring the normal operation of the instant messaging scenario. Conversely, if the user role of the first terminal device before the communication connection was not the target role, but a non-target role with lower importance, such as a viewer or student, its disconnection will not severely impact the normal operation of the scenario. In this case, the server does not need to adjust the user roles of each terminal device. In addition, the server can use various different selection methods when selecting the second terminal device from the various terminal devices, such as specified selection, random selection, selection by connection order, selection by device number, or other methods described below, etc.
[0095] As an example, in Figure 2 In the scenario shown, if the first terminal device to go offline is terminal device A, since it has the highest privileges as the host, the server needs to select a second terminal device from the other terminal devices (terminal devices B, C, and D). Let's say it's terminal device B. Then, the user role of terminal device B will be changed from viewer to host. If the first terminal device to go offline is terminal device B, since it has a viewer role, the server does not need to adjust the user roles of the other terminal devices.
[0096] In one implementation of this application, the server selects a second terminal device from other terminal devices, including:
[0097] The server selects a terminal device from the other terminal devices that meets the priority requirements as the second terminal device, based on the priority of the other terminal devices.
[0098] In one implementation of this application, the server selects a second terminal device from other terminal devices, including:
[0099] (1) The server obtains the geographical location and IP address of each terminal device in other terminal devices;
[0100] (2) The server determines the location of each terminal device among the other terminal devices based on the geographical location and IP address of each terminal device;
[0101] (3) The server selects the location of the terminal device from other terminal devices as the designated location and uses it as the second terminal device.
[0102] When selecting a second terminal device, the server first obtains the geographical location and IP address of each of the other terminal devices besides the first. Since terminal devices typically connect to the server via a network, the server can easily obtain the IP address. The geographical location can be obtained using the terminal device's own location tracking function and then sent to the server. Based on the geographical location and IP address, the server can determine the location of each terminal device and ultimately select the terminal device whose location is designated as the second terminal device. For example, a target role is generally suitable for professionals, who are typically located in designated workplaces such as schools or hospitals. Therefore, by selecting a terminal device whose location is designated as the second terminal device, the likelihood of assigning the target role to a professional is increased, thereby improving the rationality and accuracy of the target role allocation.
[0103] In another implementation of the embodiments of this application, selecting a second terminal device from other terminal devices includes:
[0104] (1) Obtain the user identity of each terminal device in other terminal devices;
[0105] (2) Select a terminal device from other terminal devices that has the user's identity specified as the second terminal device.
[0106] The process of obtaining the user identity of each terminal device among other terminal devices includes: obtaining the user image of each terminal device; and determining the user identity of each terminal device among other terminal devices based on the user image of each terminal device.
[0107] In another implementation of selecting a second terminal device, the server can acquire user images from each terminal device, identify the user's identity based on the user images, and then select the terminal device whose user identity matches the specified identity as the second terminal device. The user images can be pre-collected by each terminal device and uploaded to the server, which can then perform facial recognition on the user images to determine the corresponding user identity. The target role is generally suitable for professionals, who typically possess the specified user identity, such as teachers or doctors. Therefore, by selecting a terminal device whose user identity matches the specified identity as the second terminal device, the likelihood of assigning the target role to a professional is increased, thereby improving the rationality and accuracy of the target role allocation.
[0108] In another implementation of the embodiments of this application, selecting a second terminal device from other terminal devices includes:
[0109] (1) Obtain the activity level of each terminal device in other terminal devices. The activity level is determined based on the number of operations performed by the corresponding terminal device on the virtual 3D model created by the server.
[0110] (2) Select a terminal device with an activity level greater than a preset threshold from other terminal devices as the second terminal device.
[0111] In another implementation of selecting a second terminal device, the server can maintain a list to record the activity level of each terminal device. The activity level is determined by the number of operations performed by the corresponding terminal device on the virtual 3D model created by the server. Specifically, for each operation performed by the terminal device on the virtual 3D model, the server can increase its activity level by a certain value (e.g., 1). Different types of operations can increase the activity level by different values. The server can retrieve the activity level of each terminal device by querying this list, and then select the terminal device with an activity level greater than a preset threshold or the highest activity level as the second terminal device. Since users with high activity levels are generally more familiar with the scene or more skilled in the operation, they are more suitable for important target roles such as hosts. Therefore, this method of selecting a second terminal device can improve the rationality and accuracy of target role allocation.
[0112] In summary, the selected second terminal device can satisfy any one or more of the following conditions:
[0113] (1) The location of the second terminal device is a designated location;
[0114] (2) The user identity of the second terminal device is the designated identity;
[0115] (3) The activity level of the second terminal device is greater than or equal to the preset threshold. The activity level is determined based on the operation performed by the second terminal device on the virtual three-dimensional model created by the server.
[0116] By taking these factors into account, a more suitable second terminal device can be selected to assume the target role, thereby further improving the rationality and accuracy of user role adaptation adjustments.
[0117] In one implementation of this application, before the server detects the connection status between each terminal device and the server among multiple terminal devices, the method further includes:
[0118] The server sets the user role of the first terminal device that connects to the server out of multiple terminal devices as the target role.
[0119] The server can assign user roles sequentially according to the order in which each terminal device connects to the server. For example, the user role of the first terminal device to connect to the server can be set as the target role, and the user roles of subsequent terminal devices connecting to the server can be set as non-target roles, thereby realizing a mechanism of prioritizing the allocation of target roles according to the access order.
[0120] In one implementation of this application, the server updates the user role of the second terminal device to the target role, including:
[0121] (1) The server sets the user role of the second terminal device to a temporary target role;
[0122] (2) If the first terminal device does not reacquire the target role within the first time period, the server will set the user role of the second terminal device as the permanent target role during multi-person sessions and other interactive processes.
[0123] Since the first terminal device is currently only disconnected, it can reconnect to the server through the reconnection mechanism. After joining the multi-person session, it can reacquire and assume the target role. Therefore, the server can initially set the second terminal device's user role as a temporary target role, such as assigning it a temporary host role, until the first terminal device reacquires the target role, at which point the second terminal device's user role is restored to the audience role. Considering the limited time of the multi-person session, the server cannot retain the first terminal device's right to reacquire the target role indefinitely. Therefore, the server can set a time limit for retaining the permission, such as a first duration (approximately 2 minutes). If the first terminal device does not reacquire the target role within the first duration, the server sets the second terminal device's user role as a permanent target role, such as assigning it a permanent host role. This way, even if the first terminal device rejoins the multi-person session later, the second terminal device's host role will not change, and the first terminal device will be reassigned as an audience member. It should be noted that the permanent target role assigned to the second terminal device here means that if the second terminal device does not disconnect during this multi-person session or other interaction, it will always be the target role. However, if the second terminal device disconnects, the server will reassign the target role in the same way as if the first terminal device disconnected, meaning that the second terminal device will no longer be the target role.
[0124] In one implementation of this application, after updating the user role of the second terminal device to the target role, the server will also notify all other online terminal devices of the target role change, so that all participants in the multi-person session can know the corresponding changes in user roles and permissions.
[0125] like Figure 5 The diagram shown illustrates the interaction flow between devices in a multi-user sharing scenario for instant messaging, as provided in an embodiment of this application. Figure 5The system comprises terminal device 1, terminal device 2, terminal device 3, and a server. Terminal device 1 has the user role of host, while terminal devices 2 and 3 have the user roles of audience. Terminal device 1 first establishes a multi-user shared connection through the server. The server returns a connection response and assigns the host role to terminal device 1. Subsequently, terminal devices 2 and 3 also establish multi-user shared connections through the server, which returns connection responses and assigns audience roles to them. The server continuously monitors each terminal device for disconnections, for example, using the heartbeat mechanism described earlier. When terminal device 1 is detected to be disconnected, the server assigns a temporary host role to terminal device 2 and notifies terminal device 3 of the corresponding user role and permission changes. If terminal device 1 successfully reconnects and re-establishes a multi-user shared connection, the server first determines whether terminal device 1 can reclaim the host role. The specific criteria for this determination are described below. If terminal device 1 can reclaim the host role, the server reclaims the host role from terminal device 2, reassigns the host role to terminal device 1, and notifies terminal device 3 of the corresponding user role and permission changes. If terminal device 1 cannot reclaim the host role, the server will assign a viewer role to terminal device 1 and can change the temporary host role of terminal device 2 to a permanent host role.
[0126] In one implementation of this application, the method for setting user roles in instant messaging further includes:
[0127] When a third-party terminal device is detected connecting to the server and requesting to join a multi-person session or other interactive activity, the server sets the user role of the third-party terminal device to the target role if the third-party terminal device meets the conditions for obtaining the target role.
[0128] If the server detects that a terminal device has connected to the server and requests to join a multi-user session, assuming this terminal device is a third-party terminal device, the server will first determine whether the third-party terminal device meets the conditions for obtaining the target role. If the third-party terminal device meets the conditions, its user role will be set to the target role, such as the host role. Conversely, if the third-party terminal device does not meet the conditions, its user role will be set to another non-target role, such as the audience role. Clearly, the third-party terminal device here refers to any terminal device currently connected to the server. This could be a terminal device that has reconnected after a disconnection (e.g., the first terminal device described earlier that reconnected, or another terminal device that reconnected), or a terminal device newly joining a multi-user session. Through this setting, each terminal device joining a multi-user session can obtain the appropriate user role as appropriate, thereby improving the completeness and comprehensiveness of the application scenario.
[0129] In one implementation of this application, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0130] If the third terminal device is a terminal device that has reconnected after multiple terminal devices have lost connection, and the user role of the third terminal device before the communication connection was lost was the target role, then the server determines that the third terminal device meets the conditions for obtaining the target role.
[0131] When determining whether a third-party terminal device meets the conditions for obtaining the target role, the server can first check whether the third-party terminal device is a reconnected terminal device. Specifically, when the server receives a connection request from a third-party terminal device, it can obtain information such as the type and unique identifier of the third-party terminal device. Then, it can query based on the unique identifier to determine whether the server has stored the third-party terminal device's previous connection or disconnection record. If a record exists, it means that the third-party terminal device is a reconnected terminal device; otherwise, it means that the third-party terminal device is not a reconnected terminal device. If the third-party terminal device is a reconnected terminal device, the server will continue to check whether the user role of the third-party terminal device before the communication connection was broken is the target role. If it is, it is determined that the third-party terminal device meets the conditions for obtaining the target role; otherwise, it is determined that the third-party terminal device does not meet the conditions for obtaining the target role. Through this setting, the terminal device with the original target role has the legitimate right to reclaim the target role after reconnection, thereby improving the rationality and practicality of the application scenario.
[0132] In another implementation of this application embodiment, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0133] If the third terminal device is a terminal device that has reconnected after multiple terminal devices have lost communication, the user role of the third terminal device before the communication connection was lost is the target role, and the third terminal device confirms that it has reacquired the target role, then the server determines that the third terminal device meets the conditions for acquiring the target role.
[0134] In some situations, after a user with the original target role reconnects, the server may assign the target role to another terminal device. To ensure smooth operation of the scenario, this user may not want to reclaim the target role. To address this, the server can add a condition when determining whether a third-party terminal device meets the conditions for reclaiming the target role: whether the third-party terminal device confirms its intention to reclaim the target role. Specifically, after determining that the third-party terminal device is one that reconnected and that its user role before the communication connection was broken was the target role, the server further determines whether the third-party terminal device confirms its intention to reclaim the target role. If so, the third-party terminal device is deemed to meet the conditions for reclaiming the target role; otherwise, it is deemed not to meet the conditions. This setting allows for a comprehensive judgment based on the original target role's willingness to reclaim it, determining whether to reassign the target role to that terminal device, thus improving the rationality and practicality of the scenario application.
[0135] Specifically, whether the third-party terminal device confirms the reacquisition of the target role is determined in the following ways:
[0136] (1) The server obtains the parameter data sent when the third terminal device connects to the server;
[0137] (2) The server determines whether the third terminal device confirms to reacquire the target role based on the transmitted parameter data.
[0138] When a third-party terminal device connects to a server, it sends some parameter data. The server uses this data to determine whether the third-party terminal device confirms its intention to reacquire the target role. For example, when a third-party terminal device connects to the server and chooses to join a multi-user session, the server can provide two entry points: one for the target role and the other for a non-target role. If the user of the third-party terminal device wants to reclaim the target role, they can choose the target role entry point; otherwise, they can choose the non-target role entry point. Based on the parameter data sent by the third-party terminal device, the server can determine which entry point it used to enter the session, thus confirming whether the third-party terminal device confirms its intention to reacquire the target role.
[0139] In another implementation of this application, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0140] If the third terminal device is a terminal device that has reconnected after multiple terminal devices have lost connection, the user role of the third terminal device before the communication connection was lost is the target role, the third terminal device confirms that it has reacquired the target role, and the disconnection time of the third terminal device does not exceed the second time limit, then the server determines that the third terminal device meets the conditions for acquiring the target role.
[0141] As described earlier, the server cannot indefinitely retain the right for a terminal device to reacquire the target role. Therefore, when determining whether a third terminal device meets the conditions for acquiring the target role, the server can add another condition: whether the disconnection duration of the third terminal device has not exceeded a second duration. This second duration and the first duration described earlier can be the same permission retention period. Specifically, after determining in the above manner that the third terminal device is a disconnected and reconnected terminal device, that its user role before the communication connection was broken was the target role, and confirming the reacquisition of the target role, the server further determines whether the disconnection duration of the third terminal device has not exceeded the second duration. If so, the third terminal device is determined to meet the conditions for acquiring the target role; otherwise, the third terminal device is determined not to meet the conditions for acquiring the target role.
[0142] In another implementation of this application, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0143] If any of the terminal devices currently connected to the server has already acquired a permanent target role, then the server determines that the third terminal device does not meet the conditions for acquiring a target role.
[0144] Referring to the preceding description, if the disconnected terminal device of the original target role fails to reacquire the target role within the permission retention period, the server will change the temporary target role assigned to another terminal device to a permanent target role. Based on this, when determining whether a third terminal device meets the conditions for acquiring a target role, the server can first check if any of the terminal devices currently connected to the server has already acquired a permanent target role. If so, it means that even if the third terminal device was the disconnected terminal device of the original target role, its disconnection time has exceeded the permission retention period. Therefore, it can be determined that the third terminal device definitely does not meet the conditions for acquiring a target role, and there is no need to perform the aforementioned other condition checks, which can reduce system overhead to some extent. Conversely, if it does not exist, the server continues to perform the aforementioned other condition checks to determine whether the third terminal device meets the conditions for acquiring a target role.
[0145] In another implementation of this application, whether the third terminal device meets the conditions for obtaining the target role is determined in the following way:
[0146] If the third terminal device is not a terminal device that has reconnected after a disconnection, the server determines that the third terminal device does not meet the conditions for obtaining the target role.
[0147] If the third terminal device is not a disconnected and reconnected terminal device, it indicates that the third terminal device is a newly connected terminal device. To ensure the normal operation of the instant messaging scenario, the server can assign a target role to at least one already connected terminal device before the third terminal device connects. Therefore, the server can determine that the third terminal device does not meet the conditions for obtaining a target role, and thus assign a non-target role to the third terminal device. In another implementation of this application embodiment, whether the third terminal device meets the conditions for obtaining a target role is determined in the following way:
[0148] If the third terminal device is not a disconnected and reconnected terminal device, and the user roles of all terminal devices currently connected to the server are not the target role, then the server determines that the third terminal device meets the conditions for obtaining the target role.
[0149] If the third terminal device is not a reconnected terminal device, it indicates that the third terminal device is a newly connected terminal device. In this case, the server can first determine whether there is a terminal device among all currently connected terminal devices with a user role as the target role. If not, it determines that the third terminal device meets the conditions for obtaining the target role; otherwise, it determines that the third terminal device does not meet the conditions for obtaining the target role. It can be seen that if the third terminal device is the first terminal device to access multi-user sessions or other interactive activities, since no other terminal devices are connected to the server at this time, there is definitely no terminal device with a user role as the target role. Therefore, the server determines that the third terminal device meets the conditions for obtaining the target role and assigns the target role to the third terminal device. This is a mechanism that prioritizes the allocation of target roles according to the access order. Conversely, if there is a terminal device among all currently connected terminal devices with a user role as the target role, regardless of whether the terminal device has the initial target role or a temporary target role assigned by the server later, the server determines that the third terminal device does not meet the conditions for obtaining the target role and assigns a non-target role to the third terminal device.
[0150] like Figure 6 The diagram shown illustrates an operation flow diagram of a server assigning user roles to accessed terminal devices, as provided in an embodiment of this application. Figure 6In this system, when the server detects a terminal device joining a multi-user shared connection, it first determines whether the terminal device is a reconnected device. If it is not a reconnected device, the user on that terminal device is considered a new user. At this point, it checks if a host role exists among the other connected devices. If it does, a viewer role is assigned to the terminal device; otherwise, a host role is assigned. If the terminal device is a reconnected device, it first determines whether it is the original host. If not, a viewer role is assigned. If it is, it further determines whether the terminal device wishes to regain the host role. If the terminal device does not wish to regain the host role, a viewer role is assigned; otherwise, it checks whether the disconnection duration has exceeded the permission retention period. If the disconnection duration exceeds the permission retention period, a viewer role is assigned; otherwise, a host role is assigned.
[0151] In this embodiment, when multiple terminal devices simultaneously connect to the server for multi-user interactions such as conversations, the server monitors the connection status of each terminal device in real time. If a terminal device is detected to have lost its connection, the server retrieves the user role of that terminal device before the connection was lost and updates the user roles of at least one other terminal device based on that user role. This enables adaptive adjustment of user roles after a terminal device disconnects, thereby improving the stability of the instant messaging scenario. For example, suppose a terminal device holds a target role with important permissions. When it disconnects, the server can select a replacement terminal device from the currently connected terminal devices to assume that target role, thus ensuring the normal operation of the instant messaging scenario.
[0152] In summary, the embodiments of this application establish multi-user sharing through instant messaging technology, support permission protection based on the role status of the terminal device before disconnection after the terminal device is disconnected and reconnected, and support the allocation of temporary important permissions to other terminal devices during the disconnection period, thereby improving the stability of instant messaging scenarios.
[0153] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0154] The above mainly describes a method for setting user roles in instant messaging. The following will describe a device for setting user roles in instant messaging.
[0155] Please see Figure 7 One embodiment of a user role setting device in instant messaging according to this application includes:
[0156] The detection module 701 is used to detect the connection status between each terminal device and the server among multiple terminal devices, and the multiple terminal devices interact through the server;
[0157] The acquisition module 702 is used to acquire the user role of the first terminal device before the communication connection with the server was disconnected when the communication connection between the first terminal device and the server is detected to be disconnected.
[0158] The update module 703 is used to update the user role of at least one other terminal device among multiple terminal devices that maintains a communication connection with the server, based on the user role of the first terminal device before it disconnects from the server.
[0159] In one implementation of this application, the update module 703 includes:
[0160] The user role update unit is used to update the user role of at least one other terminal device to the target role if the user role of the first terminal device before disconnecting from the server is the target role. The target role is the user role with the highest authority among the user roles of multiple terminal devices.
[0161] In one implementation of this application, the user role update unit includes:
[0162] The temporary role setting subunit is used to set the user role of the second terminal device as a temporary target role.
[0163] The permanent role setting subunit is used to set the user role of the second terminal device as the permanent target role during the interaction if the first terminal device does not reacquire the target role within the first time period.
[0164] In one implementation of this application, the device for setting user roles in instant messaging further includes:
[0165] The user role setting module is used to set the user role of the third terminal device as the target role when a third terminal device is detected to be connected to the server and request to join the interaction, provided that the third terminal device meets the conditions for obtaining the target role.
[0166] In one implementation of this application, the device for setting user roles in instant messaging further includes:
[0167] The target role setting module is used to set the user role of the first terminal device that connects to the server among multiple terminal devices as the target role.
[0168] In one implementation of this application, the device for setting user roles in instant messaging further includes:
[0169] The condition judgment module is used to determine that the third terminal device does not meet the conditions for obtaining the target role if the third terminal device is not a terminal device that has been reconnected after the interruption of multiple terminal devices.
[0170] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a method for setting user roles in instant messaging as described in any of the above embodiments.
[0171] This application also provides a computer program product that, when run on a server, causes the server to execute a method for setting user roles in instant messaging as described in any of the above embodiments.
[0172] Figure 8 This is a schematic diagram of a server provided in one embodiment of this application. For example... Figure 8 As shown, the server 8 in this embodiment includes a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and executable on the processor 80. When the processor 80 executes the computer program 82, it implements the steps in the embodiments of the various methods described above, for example... Figure 4 Steps 401 to 403 are shown. Alternatively, when the processor 80 executes the computer program 82, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 7 The functions of the detection module 701 to the update module 703 are shown.
[0173] The computer program 82 can be divided into one or more modules / units, which are stored in the memory 81 and executed by the processor 80 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 82 in the server 8.
[0174] The processor 80 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0175] The memory 81 can be an internal storage unit of the server 8, such as a hard drive or memory. The memory 81 can also be an external storage device of the server 8, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 81 can include both internal and external storage units of the server 8. The memory 81 is used to store the computer program and other programs and data required by the server. The memory 81 can also be used to temporarily store data that has been output or will be output.
[0176] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0177] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0178] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0179] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0180] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0181] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0182] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0183] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0184] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for setting user roles in instant messaging, characterized in that, The method, applied to medical virtual practice demonstration scenarios, includes: The connection status between each of the multiple terminal devices and the server is detected, and the multiple terminal devices interact through the server; If the communication connection between the first terminal device among the plurality of terminal devices and the server is detected to be disconnected, the user role of the first terminal device before the communication connection with the server was disconnected is obtained; Based on the user role of the first terminal device before it disconnected from the server, update the user role of at least one other terminal device among the plurality of terminal devices that is not the first terminal device but maintains a communication connection with the server. The step of updating the user role of at least one other terminal device (excluding the first terminal device) that maintains a communication connection with the server, based on the user role of the first terminal device before disconnecting from the server, includes: If the user role of the first terminal device before disconnecting from the server is the target role, then the user role of the second terminal device among the at least one other terminal device is updated to the target role, where the target role is the user role with the highest authority among the user roles of the multiple terminal devices. The second terminal device meets the following conditions: the activity level of the second terminal device is greater than or equal to a preset threshold. The activity level is determined based on the operations performed by the second terminal device on the three-dimensional human organ model created by the server. Different types of operations increase the activity level by different values. The server maintains a list to record the activity level of each terminal device.
2. The method as described in claim 1, characterized in that, The step of updating the user role of the second terminal device in the at least one other terminal device to the target role includes: Set the user role of the second terminal device to the temporary target role; If the first terminal device does not reacquire the target role within a first time period, then the user role of the second terminal device is set to the permanent target role.
3. The method as described in claim 1 or 2, characterized in that, The method further includes: When a third terminal device is detected to be connected to the server and request to join the interaction, if the third terminal device meets the conditions for obtaining the target role, the user role of the third terminal device is set as the target role.
4. The method as described in claim 3, characterized in that, The third terminal device is determined to meet the condition for obtaining the target role when it meets any one of the following conditions: The third terminal device is the terminal device that reconnects to the multiple terminal devices after the interruption, and the user role of the third terminal device before disconnecting the communication connection with the server is the target role; The third terminal device is the terminal device that reconnects to the multiple terminal devices after the interruption; the user role of the third terminal device before the communication connection with the server was the target role; and the third terminal device confirms that it has reacquired the target role. The third terminal device is the terminal device that reconnected after the interruption of the multiple terminal devices. The user role of the third terminal device before disconnecting from the server was the target role. The third terminal device confirmed that it had reacquired the target role, and the disconnection time of the third terminal device did not exceed the second duration.
5. The method as described in claim 3, characterized in that, Whether the third terminal device meets the conditions for obtaining the target role is determined in the following way: If the third terminal device is not the terminal device that the multiple terminal devices interrupted and reconnected, then it is determined that the third terminal device does not meet the conditions for obtaining the target role.
6. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for setting user roles in instant messaging as described in any one of claims 1 to 5.
7. An instant messaging system, characterized in that, It includes the server as described in claim 6 and a plurality of terminal devices connected to the server.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for setting user roles in instant messaging as described in any one of claims 1 to 5.