Group head portrait processing method and device, equipment and storage medium
Group change information is obtained and processed through the client device, and the updated group avatar is generated and displayed, which solves the problem of untimely update of group avatars and low recognition, reduces the load on server devices, and improves user experience.
Patent Information
- Application Number
- CN202411161192.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, the update of group avatars leads to high pressure on data processing of server devices and high pressure on network bandwidth, and the recognition of group avatars is not high enough, and the update is not timely, which affects the user experience.
Get group change information through the client device to determine whether the preset avatar change conditions are met. If so, perform the steps of updating the group avatar, generate and display the updated group avatar, and reduce the data processing and network bandwidth pressure of the server device. And improve the recognition of group avatars.
It realizes timely update of group avatars, reduces the load on server devices, improves user experience, and improves the recognition of group avatars.
Smart Images

Figure CN119211170A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data processing technology, and in particular to a method, device, equipment and storage medium for processing group portraits. Background Art
[0002] Instant Messaging Tool is usually an application or software that allows users to send and receive text, images, videos and other multimedia content in real time via the Internet.
[0003] In instant messaging software and chat social software, group chat is one of the common functions. In group chat, the group avatar is an important identifier of the group, which can help users quickly identify the group. In related technologies, the group avatar is generally generated and updated by the server device, and then distributed by the server device to each client device for display.
[0004] Based on the above-mentioned group avatar processing method, not only will the data processing pressure of the server-side device be very high, the network bandwidth pressure will also be very high, and it will also cause problems such as untimely updates of group avatars. Summary of the invention
[0005] The present application provides a group avatar processing method, device, equipment and storage medium, which are used to solve the problems of high data processing pressure on server-side devices, high network bandwidth pressure, insufficient recognition of group avatars, and untimely updating of group avatars.
[0006] In a first aspect, the present application provides a method for processing a group avatar, the method being applied to a client device, the method comprising:
[0007] Obtaining group change information of the target group; wherein the group change information is used to indicate changes that have occurred to the target group, and the group change information includes any one or more of group type change information, member change information, personnel ranking change information, personnel quantity change information, and personal portrait change information;
[0008] Determine whether the group change information meets the preset avatar change condition, and if so, execute the step of updating the group avatar;
[0009] Get and display the updated group avatar.
[0010] In a possible design, obtaining the group change information of the target group includes:
[0011] Receiving a session information change instruction sent by a server device; wherein the session information change instruction includes group change information;
[0012] The session information change instruction is parsed to obtain group change information.
[0013] In a possible design, obtaining the group change information of the target group includes:
[0014] In response to a setting operation by a user, group change information is determined.
[0015] In a possible design, the steps of updating the group avatar include:
[0016] Determine the group type to which the target group belongs, and determine identification information corresponding to the group type;
[0017] According to a preset display strategy corresponding to the target group, a target member avatar is determined and downloaded, and layout information of the target member avatar is determined; wherein the target member avatar is a personal avatar of the group member to be displayed in the group avatar;
[0018] Generate a new group avatar according to the identification information corresponding to the group type and the layout information of the target member avatar; wherein the generated group avatar includes the identification information and the target member avatar;
[0019] The new group avatar is saved in the local cache of the client device, and the session table of the target group is updated; wherein the value of the address attribute of the group avatar in the session table is the local address of the group avatar.
[0020] In a possible design, the layout information includes position information and size information, the position information is used to indicate the display position of the target member avatar in the group avatar, and the size information is used to indicate the display size of the target member avatar in the group avatar; generating a group avatar according to the identification information corresponding to the group type and the layout information of the target member avatar includes:
[0021] In a preset group avatar template corresponding to the layout information, add identification information corresponding to the group type to obtain a first picture;
[0022] The size of the target member avatar is adjusted according to the size information, and the resized target member avatar is filled into the corresponding position of the first picture according to the position information to obtain the group avatar.
[0023] In a possible design, the layout information includes position information and size information, the position information is used to indicate the display position of the target member avatar in the group avatar, and the size information is used to indicate the display size of the target member avatar in the group avatar; generating a group avatar according to the identification information corresponding to the group type and the layout information of the target member avatar includes:
[0024] Add identification information corresponding to the group type to the target member's avatar to obtain a second picture;
[0025] According to the size information, the size of the second image is adjusted, and the resized second image is filled into a corresponding position of a preset group avatar template corresponding to the layout information according to the position information to obtain the group avatar.
[0026] In one possible design, the updated group avatar is displayed, including:
[0027] It is determined whether the value of the address attribute of the group avatar in the session table of the target group is empty. If it is determined that the value is not empty, an updated group avatar is obtained from the local cache based on the local address of the group avatar, and the updated group avatar is displayed.
[0028] In one possible design, the method further includes:
[0029] The group avatar is sent to a server device; wherein the server device is used to send the group avatar to client devices of other members in the target group, and the other members are members of the target group except the member who generated the updated group avatar.
[0030] In a second aspect, the present application provides a group avatar processing device, the device is applied to a client device, and the device includes:
[0031] an acquisition unit, configured to acquire group change information of a target group; wherein the group change information is used to indicate changes that have occurred to the target group, and the group change information includes any one or more of group type change information, member change information, personnel ranking change information, personnel quantity change information, and personal portrait change information;
[0032] a processing unit, configured to determine whether the group change information satisfies a preset avatar change condition, and if so, execute a step of updating the group avatar;
[0033] The display unit is used to obtain and display the updated group avatar.
[0034] In a third aspect, the present application provides an electronic device, the electronic device comprising: a processor, and a memory communicatively connected to the processor;
[0035] The memory stores computer-executable instructions;
[0036] The processor executes the computer-executable instructions stored in the memory to implement the aforementioned method.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to implement the method as described above when executed by a processor.
[0038] In a fifth aspect, the present application provides a computer program product, including a computer program, which is used to implement the method as described above when executed by a processor.
[0039] In the processing method, device, equipment and storage medium of the group avatar provided by the present application, the method is applied to the client device, by obtaining the group change information of the target group; wherein the group change information is used to indicate the changes that have occurred in the target group, and the group change information includes any one or more of group type change information, member change information, personnel ranking change information, personnel quantity change information and personal avatar change information; it is determined whether the group change information meets the preset avatar change conditions, and if so, the step of updating the group avatar is executed; the updated group avatar is obtained and displayed. Compared with the related art, the embodiment of the present application executes the update of the group avatar by the client device, so that the server device does not need to update the group avatar for the target group, and does not need to consume network bandwidth, which reduces the data processing pressure and network bandwidth pressure of the server device; in addition, the update of the group avatar by the client device can also display the updated group avatar more timely, so that the user knows the changes that have occurred in the group, which can improve the user's experience and solve the problem of untimely update of the group avatar. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0041] Figure 1 A schematic diagram of a process flow of a group portrait processing method provided in an embodiment of the present application;
[0042] Figure 2 A flowchart of a method for generating a group avatar provided in an embodiment of the present application;
[0043] Figure 3 A schematic diagram of a group avatar provided in an embodiment of the present application;
[0044] Figure 4 A schematic diagram of another type of group avatar provided in an embodiment of the present application;
[0045] Figure 5 A flowchart of another method for processing group portraits provided in an embodiment of the present application;
[0046] Figure 6A flowchart of another method for processing group avatars provided in an embodiment of the present application;
[0047] Figure 7 A schematic diagram of the structure of a group portrait processing device provided in an embodiment of the present application;
[0048] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0049] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0051] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0052] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0053] In group chats in instant messaging software or social chat software, the group avatar is an important attribute identifier of the group. Based on the highly recognizable group avatars, users can quickly identify the group and quickly locate the group they want to find in a bunch of conversations. However, the recognition of common group avatars is relatively low. They are generally directly synthesized based on the avatars of each member without other identification information. Users can only distinguish between groups based on the differences between group names. This has a high degree of limitation and the user experience is not good enough.
[0054] In addition, in the current related technologies, group avatars are usually generated by the server device, and then distributed by the server device to the client device for display. For example, when user A creates a new group, which includes three users A, B, and C, the server can synthesize a group avatar image containing the personal avatars of users A, B, and C based on the personal avatars of the three group members A, B, and C, and save the group avatar image on the server. Then, the client devices of A, B, and C are notified of the changes in the group avatar information, and the client re-pulls the group avatar image to display it on the client devices of A, B, and C. When a new user D joins the group or user A changes his personal avatar, the server device will also re-generate a new group avatar image based on the latest group member avatars.
[0055] In the above group avatar processing scheme, when there are many groups created, or the number of group members is large (large groups with more than 500 or 2,000 people), or group members change frequently (for example, new people keep entering or leaving the group, or group members frequently update their personal avatars, etc.), the server device needs to continuously generate and update the group avatar, and the data processing pressure of the central processing unit (CPU) and graphics processing unit (GPU) of the server device will be very large, which will cause the service performance to decrease, and even cause the server to crash in serious cases. When the group avatar changes, the client device needs to be notified to update the group avatar, which will also put pressure on the network bandwidth. If the client device is not notified in time to update the group avatar, it will also cause problems such as untimely updating of the group avatar.
[0056] To this end, the embodiment of the present application provides a method for processing group avatars. In order to reduce the data processing pressure and network bandwidth pressure of the server-side device and to update the group avatars in a timely manner, in the embodiment of the present application, the processing of the group avatars is completed by the client device. Specifically, after the client obtains the group change information of the target group, it will determine whether the group change information meets the preset avatar change conditions. If so, the group avatar will be changed. In this way, there is no need for the server-side device to update the group avatar for the target group, and there is no need to consume network bandwidth, which reduces the data processing pressure and network bandwidth pressure of the server-side device and solves the problem of untimely update of group avatars.
[0057] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0058] Figure 1 The present invention provides a flowchart of a method for processing a group avatar in an embodiment of the present invention. The method provided in an embodiment of the present invention is applied to a client device. Optionally, the client device can be a mobile phone, a computer, a tablet, a computer, a server, a smart watch, or other electronic device capable of running instant messaging software. Figure 1 As shown, the method for processing a group avatar provided in this embodiment may include:
[0059] S101. Obtain group change information of a target group.
[0060] The group change information is used to indicate changes in the target group, and includes any one or more of group type change information, member change information, personnel ranking change information, personnel quantity change information, and personal portrait change information.
[0061] For example, in actual scenarios, the information of the constructed group will change. When the group information changes, the group avatar may need to be updated. It is understandable that the group change information is used to indicate the changes that have occurred in the target group, and the changes that have occurred in the group may be changes in the group type, changes in the members in the group, changes in the order of the group members, changes in the number of people, changes in the personal avatars of each member, etc. When these changes occur, the group avatar may change. In order to update the group avatar in a timely manner, when these changes occur in the target group, each client device in the target group needs to obtain the group change information of the target group so as to update the group avatar later.
[0062] In a possible embodiment, obtaining group change information of a target group may include:
[0063] S01. Receive a session information change instruction sent by a server device; wherein the session information change instruction includes group change information.
[0064] S02. Parse the session information change instruction to obtain group change information.
[0065] Exemplarily, a client device where information has been changed will send an information change request to a server device, and the request will include the information that the user wants to change. After the server device determines the group information that has been changed by the client device where information has been changed, it can send a session information change instruction including the group change information to the client devices of all group members in the group. Correspondingly, each client device will receive the session information change instruction including the group change information sent by the server device. After receiving the session information change instruction sent by the server device, each client device can parse the session information change instruction to obtain the group change information.
[0066] In another possible embodiment, obtaining the group change information of the target group may further include:
[0067] In response to a setting operation by a user, group change information is determined.
[0068] Exemplarily, the change of group information is generally caused by the user operating the client device. For example, the members in the group reset the group type, pull new group members, delete the original members in the group, modify the personal avatar, etc. When the members in the group perform these operations on their own client devices, their own client devices can respond to the user's setting operation to determine the group change information, and according to the group change information, their own client devices can determine whether to update the group avatar and perform the update of the group avatar. In this embodiment, the client device of the own can directly obtain only the group change information caused by itself. At this time, the client device of the own can send the group change information to the server device so that the server device sends the group change information to the client devices of other group members. After each client obtains the group change information, it performs the group avatar change; or after the client of the own performs the group avatar change, it sends the updated group avatar to the server device, and then the server device sends the updated group avatar to the client devices of other group members. The embodiment of the present application does not limit this.
[0069] S102: Determine whether the group change information satisfies a preset avatar change condition.
[0070] If yes, execute step S103; if no, do not update the group avatar and continue to obtain group change information.
[0071] For example, some changes in group information will cause changes in group avatars, while some changes in group information will not cause changes in group avatars. Therefore, when the client device obtains the group change information of the target group, it can first determine whether the group change information meets the preset avatar change conditions, that is, determine whether the group change information will cause the group avatar to change. When it is determined that the group change information meets the preset avatar change conditions and the group avatar needs to be changed, the subsequent step of updating the group avatar needs to be performed. If it is determined that the group change information does not meet the preset avatar change conditions, the update of the group avatar can be directly canceled.
[0072] For example, if only the first 9 people's personal portraits are displayed in the group portrait, when the number of members in the group is less than or equal to 9, whether the group type changes, or the members in the group, the order of group members, the number of people, the personal portraits of each member, etc. change, the group portrait will change. At this time, the group portrait needs to be changed. When the number of members in the group is greater than 9, the group portrait will only change if the group type changes, and the information of the first 9 people in the group, such as members, order, personal portraits, etc., changes.
[0073] Among them, in a possible embodiment, each client device in the group can execute the update of the group avatar separately, so as to complete the update of the group avatar in a timely and effective manner, and avoid the situation where the group avatar is not updated in time. For example, when the personal avatar of user B in the group created by user A and including three users A, B, and C changes, the server device will send the session information change instruction containing the group change information of the change of user B's personal avatar to the client devices of the three users A, B, and C respectively, and the client devices of users A, B, and C need to determine whether the group avatar needs to be updated respectively, and update the group avatar respectively when it needs to be updated. This method does not require the service device to execute the update process of the group avatar, reducing the data processing pressure of the server device.
[0074] In another possible embodiment, the step of generating a new group avatar when updating the group avatar may also be executed only by the client device where the group information has changed. In this case, after generating the new group avatar, the client device where the group information has changed needs to send the updated group avatar to the server device, and then the server device sends the updated group avatar to the client devices of other members in the target group.
[0075] It can be understood that the client device whose group information is changed due to user operation can first determine the group change information. Therefore, the client device can also update the group avatar. After obtaining the updated group avatar, the updated group avatar is sent to the server device, and then the server device sends it to the client devices of other members in the group, so that other client devices can also update the group avatar in time.
[0076] For example, when the personal avatar of user B in the group created by user A that includes three users A, B, and C changes, the group avatar needs to be updated. The group avatar can be updated only by user B's client device, and the updated group avatar can be sent to the server device, and then the server device sends the updated group avatar to the client devices of user A and user C respectively. In this way, the client devices of user A and user C do not need to execute the process of updating the group avatar separately to achieve the update of the group avatar.
[0077] S103: Execute the step of updating the group avatar, obtain and display the updated group avatar.
[0078] Among them, this application does not limit the process of how the client device updates the group avatar. The visual effect presented by the updated group avatar should be different from that before the update. An optional step of updating the group avatar is introduced in other embodiments and will not be repeated here.
[0079] Exemplarily, after executing the step of updating the group avatar, each client device may obtain and display the updated group avatar so that the user can be aware of the change of the group avatar in a timely manner, thereby improving the user experience.
[0080] The processing method of the group avatar provided in the embodiment of the present application is applied to the client device, and the method includes: obtaining the group change information of the target group; wherein the group change information is used to indicate the changes that have occurred in the target group, and the group change information includes any one or more of the group type change information, member change information, personnel ranking change information, personnel quantity change information and personal avatar change information; judging whether the group change information meets the preset avatar change conditions, and if so, executing the step of updating the group avatar; and displaying the updated group avatar. Compared with the related art, the embodiment of the present application performs the update of the group avatar by the client device, so that there is no need for the server device to update the group avatar for the target group, and there is no need to consume network bandwidth, which reduces the data processing pressure and network bandwidth pressure of the server device; in addition, the update of the group avatar by the client device can also display the updated group avatar more timely, so that the user knows the changes that have occurred in the group, which can improve the user's experience and solve the problem of untimely update of the group avatar.
[0081] Next, the process of how the client device generates a group avatar is described in detail. Figure 2 A flow chart of a method for generating a group avatar provided in an embodiment of the present application. Figure 2 As shown, the process of generating a group avatar may include:
[0082] S201: Determine the group type to which the target group belongs, and determine identification information corresponding to the group type.
[0083] The target group in this embodiment may be a group newly created by the client device, or a group newly joined by the client device, which is not limited in this embodiment of the present application.
[0084] For example, taking a new group as an example, when a client device receives a request from a user to create a new group, the client device can generate a corresponding group based on the user's request, and the group newly created by the client device is the target group. When a user requests to create a group, the group type of the created group can be selected on the user interface, and then, the client device can also determine the group type to which the target group belongs while creating the group. Similarly, when a user joins a new group, the user's client device can also know the group type to which the newly joined group belongs.
[0085] Optionally, group types can be divided according to different standards. For example, according to the function and purpose classification, it can be divided into work groups, study groups, interest groups, social groups, takeaway groups, shopping groups, etc.; according to the member relationship classification, it can be divided into family groups, friend groups, colleague groups, community groups, etc.; according to the management method classification, it can be divided into open groups, closed groups, secret groups, etc. Each type of group can also be subdivided according to needs. For example, the work group can be divided into department groups (only including department personnel), comprehensive groups (including all company owners), internal and external mixed groups (including both internal company employees and customers), etc. according to the personnel composition. The embodiment of the present application does not limit the specific division of group types.
[0086] In the embodiment of the present application, corresponding identification information is designed for each group type to uniquely identify the corresponding group type. Optionally, the identification information can be a specific icon or color, or a corresponding text watermark, etc., which is not limited in the embodiment of the present application. After the client device determines the group type of the target group, the corresponding identification information can be determined.
[0087] S202: Determine and download target member avatars according to a preset display strategy corresponding to the target group, and determine layout information of the target member avatars.
[0088] Among them, the target member avatar is the personal avatar of the group member to be displayed in the group avatar, and the layout information includes position information and size information. The position information is used to indicate the display position of the target member avatar in the group avatar, and the size information is used to indicate the display size of the target member avatar in the group avatar.
[0089] Exemplarily, different group avatar display strategies can be pre-designed according to the number of people in the target group. For example, it can be set that groups with N people (N is a positive integer), such as groups with 9 people or less, display the personal avatars of all members in a "square" in the group avatar. For 3 people, it is displayed in a triangular shape, for 4 people, it is displayed in a four-grid pattern, and so on. For 9 people, it is displayed in a nine-grid pattern; for groups with more than 9 people, it can be set to display only the personal avatars of the first 9 people in the group avatar according to the sorting. Among them, the sorting can be based on the time when the members enter the group, or sorted according to the member structure. For example, the group owner, administrator, etc. are ranked in the front, and the following are sorted in turn according to the time of entering the group or the first letter order of the member names, etc. The embodiments of the present application do not make restrictions. In addition, in addition to the above "square" display of the group avatar, the group avatar can also be displayed in a "circular" or other shapes, and the embodiments of the present application do not make restrictions.
[0090] In the embodiments of the present application, after the client device determines the number of people in the target group, it can determine the preset display strategy corresponding to the target group. Then, according to the preset display strategy corresponding to the target group, it can determine the target member avatars to be displayed in the group avatar of the target group and the layout information of each target member avatar, and then download each target member avatar to the local cache to prepare data for generating the group avatar.
[0091] S203. Generate a group avatar according to the identification information corresponding to the group type and the layout information of the target member avatars; wherein, the generated group avatar includes the identification information and the target member avatars.
[0092] Exemplarily, according to the identification information corresponding to the group type, the group type to which the group belongs can be determined, and according to the layout information of the target member avatars, the position and size of the target member avatars when displayed in the group avatar can be determined. When generating the group avatar, the client device can draw the group avatar according to the display mode of the group avatar, as long as the generated group avatar includes the identification information and the target member avatars.
[0093] Optionally, in order to improve the data processing efficiency, the step of drawing the group avatar can be executed by the graphics processing unit GPU on the client device, and other steps are executed by the central processing unit CPU on the client device. The embodiments of the present application do not make restrictions on this.
[0094] In a possible embodiment, generating a group avatar according to the identification information corresponding to the group type and the layout information of the target member avatars may include:
[0095] S1. Add the identification information corresponding to the group type to the preset group avatar template corresponding to the layout information to obtain a first picture.
[0096] S2. Adjust the size of the target member's avatar according to the size information, and fill the resized target member's avatar into the corresponding position of the first picture according to the position information to obtain the group avatar.
[0097] Exemplarily, corresponding preset group avatar templates can be pre-designed according to different layout information. These templates can include different layout structures to accommodate different numbers and arrangements of target member avatars. In each template, a specific position can be reserved for displaying identification information of the group type.
[0098] In this embodiment, when generating a group avatar, the client device may first select a preset group avatar template that matches the layout information, and then add the identification information corresponding to the group type to the reserved position of the template to generate a first image containing the identification information. For example, if the group type is a "work group", an icon or color identification representing a "work group" is added to the reserved position of the template. Among them, this application does not limit the position reserved for identification information in the preset group avatar template. For example, the reserved position can be any corner of the edge position of the group avatar (such as the upper left corner, upper right corner, etc.), or it can be any position within the group avatar.
[0099] At the same time, the client device can also adjust the size of each target member avatar according to the size information of the target member avatar in the group avatar to ensure that they can fit into the display area in the preset template. Among them, the size information may include specific values of the width and height of the avatar image, or the ratio relative to the template size, the interval between each display area and other information. After adjusting the size of the target member avatar, the client device fills each target member avatar into the area corresponding to the position information in the first picture according to the position information of the target member avatar in the group avatar, and the group avatar can be obtained after fusion processing. Among them, the position information indicates the specific display position of each target member avatar in the first picture, such as the upper left corner, the lower right corner, the upper right corner, the lower left corner, etc. By placing the resized target member avatars in these specified positions, a complete group avatar can be generated in the end.
[0100] For example, Figure 3 A schematic diagram of a group avatar provided in an embodiment of the present application. Figure 3 As shown, three different types of groups are illustrated, and their group avatars are 10, 20, and 30. The logo 11 in the group avatar 10, the logo 21 in the group avatar 20, and the logo 31 in the group avatar 30 are respectively located at designated positions of the group avatar template, and can be used to indicate different group types. Based on this presentation method, users can know the type of group through the identification information on the group avatar, the group avatar is more recognizable, and the user experience is improved.
[0101] In another possible embodiment, generating a group avatar according to identification information corresponding to the group type and layout information of target member avatars may include:
[0102] S10. Add identification information corresponding to the group type to the target member's avatar to obtain a second picture.
[0103] S20. Adjust the size of the second image according to the size information, and fill the resized second image into a corresponding position of a preset group avatar template corresponding to the layout information according to the position information to obtain a group avatar.
[0104] Exemplarily, when generating a group avatar, the client device may also first add identification information of the group type to each target member avatar. For example, if the group type is a "work group", an icon or color identification representing a "work group" is added to a corner or background of each member avatar. In this way, each target member avatar becomes a second picture containing group type identification information. Then, according to the display size of the target member avatar in the group avatar, the size of each second picture is adjusted to ensure that they can fit into the display area in the preset group avatar template. After resizing, each second picture is filled into the corresponding position of the preset group avatar template according to the display position of the target member avatar in the group avatar, and finally a complete group avatar is generated.
[0105] For example, Figure 4 This is a schematic diagram of another type of group avatar provided in an embodiment of the present application. Figure 4 As shown, two different types of groups are illustrated, and their group avatars are 40 and 50 respectively. The logo 41 on each member avatar in the group avatar 40 and the logo 51 on each member avatar in the group avatar 50 are respectively located at the designated positions of each member avatar, and can be used to indicate different group types. Based on this presentation method, the user can determine the type of group through the identification information on each member avatar in the group avatar, the group avatar is more recognizable, and the user experience will be higher. Of course, in some possible examples, the corresponding identification information can be displayed on each member avatar in the group to improve the recognition, and the embodiments of the present application are not limited to this.
[0106] S204: Save the group avatar in the local cache of the client device and update the session table of the target group; wherein the value of the address attribute of the group avatar in the session table is the local address of the group avatar.
[0107] Exemplarily, the session table of the target group is stored in a local database of the client device, and can be used to store information related to the target group, such as the address attributes of the group avatar, the group name, the group type, etc. In the embodiment of the present application, after generating the group avatar, the client device saves the group avatar in the local cache of the client device, and updates the local address of the group avatar in the session table corresponding to the group avatar, so that the subsequent client device can load the group avatar according to the local address of the group avatar to display it in the user interface.
[0108] By saving the group avatar in the local cache of the client device and updating the session table of the corresponding target group, the access speed of the group avatar can be significantly improved, the server burden can be reduced, and the offline availability can be improved, so that the client device can display the group avatar even when it is offline. It can also save network traffic and improve user experience and system performance.
[0109] S205. Display group avatars.
[0110] Exemplarily, after the client device generates the group avatar, it also displays the group avatar in the user interface.
[0111] It is understandable that for a client device that generates a group avatar, after the group avatar is generated, the group avatar can be directly displayed in the user interface. For a client device that has not yet displayed the group avatar, when displaying the group avatar, it can first determine whether the value of the address attribute of the group avatar in the session table of the target group is empty. If it is determined that the value is not empty, it indicates that the group avatar has been generated, and it can be further determined whether the group avatar needs to be updated. If it is determined that the group avatar does not need to be updated, the group avatar is obtained based on the local address of the group avatar and displayed. If the value is determined to be empty, or if it is determined that the group avatar needs to be updated, the step of generating the group avatar needs to be executed, and the group avatar can be displayed only after the group avatar is generated.
[0112] In the method for generating a group avatar provided in the embodiment of the present application, the generation process of the group avatar is completed by the client device. Therefore, there is no need for the server device to generate a group avatar for the target group, and there is no need to consume network bandwidth to send the group avatar to the client devices of each group member, which reduces both the data processing pressure of the server device and the network bandwidth pressure. Furthermore, in the embodiment of the present application, identification information of the group type is added to the group avatar, so that the recognition of the group avatar is higher, which can improve the user experience. In addition, the embodiment of the present application also saves the group avatar in the local cache of the client device, which can not only significantly improve the access speed of the group avatar and reduce the server burden, but also improve the offline availability, so that the client device can display the group avatar even in the offline state, and can also save network traffic, further improving the user experience and system performance.
[0113] Optionally, in a possible embodiment, the client device of each group member in the target group can execute steps S201 to S205 to generate a group avatar, and each client device does not interfere with each other. This processing method reduces both the data processing pressure of the server device and the network bandwidth pressure. For example, when user A creates a new group, which includes three users A, B, and C, the client devices of the three users A, B, and C can execute steps S201 to S205 to generate and display the group avatar on their respective client devices.
[0114] In another possible embodiment, steps S201 to S203 may be performed only by the client device that creates the target group to generate the group avatar. After the group avatar is generated, the client device that creates the target group sends the generated group avatar to the server device, and the server device sends the group avatar to the client devices of other members in the target group. Among them, other members are members of the target group other than the members who create the target group. In this implementation, only the client device that creates the group needs to generate the group avatar, and other client devices can be sent by the server device. Compared with the solution that requires all clients to generate group avatars separately, the overall resource consumption is reduced. For example, when user A creates a new group including three users A, B, and C, only the client device of user A can execute steps S201 to S203 to generate a group avatar, and send the generated group avatar to the server device, which then sends the group avatar to the client devices of user B and user C respectively. In this way, the client devices of user B and user C no longer need to execute steps S201 to S203 to generate the group avatar, and only need to execute steps S204 to S205 to display the group avatar.
[0115] It can be understood that the process of updating the group avatar is similar to the process of generating the group avatar. When the client device determines that the group change information meets the preset avatar change conditions and updates the group avatar, the client device can execute Figure 2 In the steps S201 to S204 shown, the group type to which the target group belongs is first determined, and the identification information corresponding to the group type is determined; then, according to the preset display strategy corresponding to the target group, the target member avatar is determined and downloaded, and the layout information of the target member avatar is determined; then, according to the identification information corresponding to the group type and the layout information of the target member avatar, a new group avatar is generated; finally, the new group avatar is saved in the local cache of the client device, and the session table of the target group is updated so that the updated group avatar can be displayed later.
[0116] Among them, in some embodiments, when generating and updating the group avatar, step S201 is an optional step. When identification information corresponding to the group type is displayed in the group avatar, step S201 needs to be executed. When identification information corresponding to the group type is not displayed in the group avatar, step S201 may not be executed.
[0117] When the client device is based on Figure 2 After the updated group avatar is obtained in steps S201 to S204 shown, the updated group avatar can be displayed. At this time, the client device can first determine whether the value of the address attribute of the group avatar in the session table of the target group is empty. If it is determined that the value is not empty, the updated group avatar is obtained from the local cache based on the local address of the group avatar, and the updated group avatar is displayed.
[0118] Optionally, in a possible embodiment, the process of updating the group avatar may be executed separately by each client device in the group. Figure 5 A flowchart of another method for processing group avatars provided in an embodiment of the present application. Figure 5 As shown, the process of the client device processing the group avatar may include:
[0119] S501: Receive a session information change instruction sent by a server device.
[0120] Among them, the session information change instruction includes group change information, which is used to indicate the changes that have occurred in the target group. The group change information includes any one or more of group type change information, member change information, personnel sorting change information, personnel quantity change information and personal portrait change information.
[0121] S502: parse the session information change instruction to obtain group change information.
[0122] S503: Determine whether the group change information satisfies a preset avatar change condition.
[0123] If yes, execute step S504; if no, execute step S501.
[0124] S504: Determine the group type to which the target group belongs, and determine identification information corresponding to the group type.
[0125] S505: Determine and download target member avatars according to a preset display strategy corresponding to the target group, and determine layout information of the target member avatars.
[0126] S506: Generate a new group avatar according to the identification information corresponding to the group type and the layout information of the target member avatars.
[0127] S507: Save the new group avatar in the local cache of the client device, and update the session table of the target group.
[0128] S508: Display the updated group avatar.
[0129] It should be noted that the specific implementation of steps S501 to S508 may refer to the description of the above embodiment and will not be described in detail here.
[0130] In the method for updating group avatars by a client device provided in this embodiment, each client device in the group can execute the update of the group avatar separately, so as to complete the update of the group avatar in a timely and effective manner, thereby avoiding the situation where the group avatar is not updated in time. For example, when the personal avatar of user B in the group created by user A and including three users A, B, and C changes, the server device will send the session information change instruction containing the group change information of the change of the personal avatar of user B to the client devices of the three users A, B, and C respectively, and the client devices of users A, B, and C need to determine whether the group avatar needs to be updated respectively, and update the group avatar separately when it needs to be updated. This method does not require the server device to execute the update process of the group avatar, thereby reducing the data processing pressure of the server device.
[0131] Optionally, in another possible embodiment, the step of generating a new group avatar when updating the group avatar may also be performed only by the client device where the group information is changed. Figure 6 A flowchart of another method for processing group avatars provided in an embodiment of the present application is shown below. Figure 6 As shown, the process of the client device processing the group avatar may also include:
[0132] S601: In response to a setting operation of a user, determine group change information.
[0133] The group change information is used to indicate changes in the target group, and includes any one or more of group type change information, member change information, personnel ranking change information, personnel quantity change information, and personal portrait change information.
[0134] S602: Determine whether the group change information satisfies a preset avatar change condition.
[0135] If yes, execute step S603; if no, execute step S601.
[0136] S603: Determine the group type to which the target group belongs, and determine identification information corresponding to the group type.
[0137] S604: Determine and download target member avatars according to a preset display strategy corresponding to the target group, and determine layout information of the target member avatars.
[0138] S605: Generate a new group avatar according to the identification information corresponding to the group type and the layout information of the target member avatars.
[0139] S606: Send the updated group avatar to the server device.
[0140] The server device is used to send the updated group avatar to the client devices of other members in the target group, where the other members are members of the target group other than the member who generated the updated group avatar.
[0141] S607: Save the new group avatar in the local cache of the client device, and update the session table of the target group.
[0142] S608. Display the updated group avatar.
[0143] It should be noted that the specific implementation of steps S601 to S608 may refer to the description of the above embodiment and will not be described in detail here.
[0144] For example, a client device whose group information is changed due to user operation can first determine the group change information. Therefore, the client device can also update the group avatar. After obtaining the updated group avatar, the updated group avatar is sent to the server device, and then the server device sends it to the client devices of other members in the group, so that other client devices can also update the group avatar in time.
[0145] For example, when the personal avatar of user B in the group created by user A that includes three users A, B, and C changes, the group avatar needs to be updated. The group avatar can be updated only by user B's client device, and the updated group avatar can be sent to the server device, and then the server device sends the updated group avatar to the client devices of user A and user C respectively. In this way, the client devices of user A and user C do not need to execute the process of updating the group avatar separately to achieve the update of the group avatar.
[0146] In this embodiment, only the client device that first determines the group change information can update the group avatar, which is suitable for scenarios with abundant network bandwidth resources. Compared with the solution that requires all clients to update the group avatar separately, it reduces the overall resource consumption.
[0147] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0148] Figure 7The structure diagram of a group avatar processing device provided in an embodiment of the present application is shown in FIG. The group avatar processing device provided in an embodiment of the present application is applied to a client device, such as Figure 7 As shown, the processing device for group portraits provided in the embodiment of the present application may include an acquisition unit 701, a processing unit 702 and a display unit 703.
[0149] The acquisition unit 701 is used to acquire group change information of the target group; wherein the group change information is used to indicate changes that have occurred in the target group, and the group change information includes any one or more of group type change information, member change information, personnel sorting change information, personnel quantity change information and personal portrait change information.
[0150] The processing unit 702 is used to determine whether the group change information meets the preset avatar change condition, and if so, execute the step of updating the group avatar.
[0151] The display unit 703 is used to obtain and display the updated group avatar.
[0152] In a possible embodiment, the acquiring unit 701 is specifically configured to:
[0153] Receiving a session information change instruction sent by a server device; wherein the session information change instruction includes group change information;
[0154] The session information change instruction is parsed to obtain group change information.
[0155] In a possible embodiment, the acquiring unit 701 is specifically configured to:
[0156] In response to a setting operation by a user, group change information is determined.
[0157] In a possible embodiment, the processing unit 702 is specifically configured to:
[0158] Determine the group type to which the target group belongs, and determine identification information corresponding to the group type;
[0159] According to a preset display strategy corresponding to the target group, a target member avatar is determined and downloaded, and layout information of the target member avatar is determined; wherein the target member avatar is a personal avatar of the group member to be displayed in the group avatar;
[0160] Generate a new group avatar according to the identification information corresponding to the group type and the layout information of the target member avatar; wherein the generated group avatar includes the identification information and the target member avatar;
[0161] The new group avatar is saved in the local cache of the client device, and the session table of the target group is updated; wherein the value of the address attribute of the group avatar in the session table is the local address of the group avatar.
[0162] In a possible embodiment, the layout information includes position information and size information, the position information is used to indicate the display position of the target member avatar in the group avatar, and the size information is used to indicate the display size of the target member avatar in the group avatar; the processing unit 702 is specifically used to:
[0163] In the preset group avatar template corresponding to the layout information, add identification information corresponding to the group type to obtain a first picture;
[0164] The size of the target member's avatar is adjusted according to the size information, and the resized target member's avatar is filled into the corresponding position of the first picture according to the position information to obtain the group avatar.
[0165] In a possible embodiment, the layout information includes position information and size information, the position information is used to indicate the display position of the target member avatar in the group avatar, and the size information is used to indicate the display size of the target member avatar in the group avatar; the processing unit 702 is specifically used to:
[0166] Add identification information corresponding to the group type to the target member's avatar to obtain a second picture;
[0167] According to the size information, the size of the second image is adjusted, and the resized second image is filled into the corresponding position of the preset group avatar template corresponding to the layout information according to the position information to obtain the group avatar.
[0168] In a possible embodiment, the display unit 703 is specifically used to:
[0169] It is determined whether the value of the address attribute of the group avatar in the session table of the target group is empty. If it is determined that the value is not empty, an updated group avatar is obtained from the local cache based on the local address of the group avatar, and the updated group avatar is displayed.
[0170] In a possible embodiment, the processing unit 702 is further configured to:
[0171] The updated group avatar is sent to the server device; wherein the server device is used to send the updated group avatar to the client devices of other members in the target group, and the other members are members of the target group except the member who generated the updated group avatar.
[0172] The device provided in this embodiment can be used to execute the method of the above embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.
[0173] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. In addition, it can also be stored in the memory of the above device in the form of program code, and the functions of the above data processing modules can be called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0174] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 80 includes: a processor 801, and a memory 802 communicatively connected to the processor.
[0175] The memory 802 stores computer-executable instructions; the processor 801 executes the computer-executable instructions stored in the memory 802 to implement any of the aforementioned methods.
[0176] In the specific implementation of the above electronic device, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The method disclosed in the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in the processor for execution.
[0177] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement any of the methods described above.
[0178] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to computer instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0179] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement any of the aforementioned methods when executed by a processor.
[0180] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0181] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for processing a group portrait, characterized in that: The method is applied to a client device, and the method comprises: Obtaining group change information of the target group; wherein the group change information is used to indicate changes that have occurred to the target group, and the group change information includes any one or more of group type change information, member change information, personnel ranking change information, personnel quantity change information, and personal portrait change information; Determine whether the group change information meets the preset avatar change condition, and if so, execute the step of updating the group avatar; Get and display the updated group avatar.
2. The method according to claim 1, characterized in that The obtaining of the group change information of the target group includes: Receiving a session information change instruction sent by a server device; wherein the session information change instruction includes group change information; The session information change instruction is parsed to obtain group change information.
3. The method according to claim 1, characterized in that The obtaining of the group change information of the target group includes: In response to a setting operation by a user, group change information is determined.
4. The method according to claim 1, characterized in that The steps to update the group avatar include: Determine the group type to which the target group belongs, and determine identification information corresponding to the group type; According to a preset display strategy corresponding to the target group, a target member avatar is determined and downloaded, and layout information of the target member avatar is determined; wherein the target member avatar is a personal avatar of the group member to be displayed in the group avatar; Generate a new group avatar according to the identification information corresponding to the group type and the layout information of the target member avatar; wherein the generated group avatar includes the identification information and the target member avatar; The new group avatar is saved in the local cache of the client device, and the session table of the target group is updated; wherein the value of the address attribute of the group avatar in the session table is the local address of the group avatar.
5. The method according to claim 4, characterized in that The layout information includes position information and size information, wherein the position information is used to indicate the display position of the target member avatar in the group avatar, and the size information is used to indicate the display size of the target member avatar in the group avatar; Generating a group avatar according to the identification information corresponding to the group type and the layout information of the target member avatars includes: In a preset group avatar template corresponding to the layout information, add identification information corresponding to the group type to obtain a first picture; The size of the target member avatar is adjusted according to the size information, and the resized target member avatar is filled into the corresponding position of the first picture according to the position information to obtain the group avatar.
6. The method according to claim 4, characterized in that The layout information includes position information and size information, wherein the position information is used to indicate the display position of the target member avatar in the group avatar, and the size information is used to indicate the display size of the target member avatar in the group avatar; Generating a group avatar according to the identification information corresponding to the group type and the layout information of the target member avatars includes: Add identification information corresponding to the group type to the target member's avatar to obtain a second picture; According to the size information, the size of the second image is adjusted, and the resized second image is filled into a corresponding position of a preset group avatar template corresponding to the layout information according to the position information to obtain the group avatar.
7. The method according to claim 4, characterized in that Display updated group avatars, including: It is determined whether the value of the address attribute of the group avatar in the session table of the target group is empty. If it is determined that the value is not empty, an updated group avatar is obtained from the local cache based on the local address of the group avatar, and the updated group avatar is displayed.
8. The method according to claim 1, characterized in that The method further comprises: The updated group avatar is sent to a server device; wherein the server device is used to send the updated group avatar to client devices of other members in the target group, wherein the other members are members of the target group other than the member that generated the updated group avatar.
9. A group portrait processing device, characterized in that: The device is applied to a client device, and the device comprises: an acquisition unit, configured to acquire group change information of a target group; wherein the group change information is used to indicate changes that have occurred to the target group, and the group change information includes any one or more of group type change information, member change information, personnel ranking change information, personnel quantity change information, and personal portrait change information; a processing unit, configured to determine whether the group change information satisfies a preset avatar change condition, and if so, execute a step of updating the group avatar; The display unit is used to obtain and display the updated group avatar.
10. An electronic device, characterized in that: The electronic device comprises: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.