Communication message sending method and device, equipment, medium and product
By compressing images or their thumbnails based on bandwidth usage information in instant messaging systems to generate a second thumbnail, the problem of excessive bandwidth consumption in mass messaging is solved, improving communication efficiency and display quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU TENCENT TECH CO LTD
- Filing Date
- 2024-11-28
- Publication Date
- 2026-05-29
AI Technical Summary
In instant messaging, when sending mass messages containing images, the transmission of thumbnails consumes a significant amount of instantaneous bandwidth, impacting communication efficiency.
The server compresses the image or its thumbnail based on bandwidth usage information, generates a second thumbnail, and sends it to the receiving device in the communication message. This flexible compression strategy balances communication efficiency and display quality.
By employing flexible compression strategies, the instantaneous bandwidth pressure on the communication system was reduced, communication efficiency was improved, and the display effect of thumbnails was guaranteed.
Smart Images

Figure CN122120241A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of instant messaging technology, and in particular to a method, apparatus, device, medium and product for sending communication messages. Background Technology
[0002] In applications with communication functions, users can send communication messages containing pictures to other users.
[0003] In related technologies, when a message sending device sends a communication message containing an image, the server of the communication system can first send a communication message containing a thumbnail of the image to the message receiving device. Subsequently, when the user of the message receiving device clicks on the thumbnail, the receiving device requests the server to download the image.
[0004] However, in the above scheme, when a large number of communication messages containing images are transmitted simultaneously, the transmission of thumbnails in the communication messages requires a lot of instantaneous bandwidth resources, thus affecting communication efficiency. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and product for sending communication messages. The technical solution is as follows:
[0006] According to one aspect of this application, a method for sending communication messages is provided, the method comprising:
[0007] The message receiving device sends a mass message request, which is used to request the sending of a first communication message to at least two message receiving devices, the first communication message containing a first image;
[0008] Based on the bandwidth usage information corresponding to the mass messaging request, a compression operation is performed on the first image or the first thumbnail to obtain a second thumbnail; the first thumbnail is a thumbnail of the first image; the bandwidth usage information is used to indicate the bandwidth usage of the server by mass messaging the first communication message;
[0009] The first communication message containing the second thumbnail is sent to the at least two message receiving devices.
[0010] According to another aspect of this application, a communication message sending device is provided, the device comprising:
[0011] The request receiving module is used to receive a mass sending request sent by a message sending device. The mass sending request is used to request the sending of a first communication message to at least two message receiving devices. The first communication message includes a first image.
[0012] The compression module is used to perform a compression operation on the first image or the first thumbnail based on the bandwidth usage information corresponding to the mass sending request, to obtain a second thumbnail; the first thumbnail is a thumbnail of the first image; the bandwidth usage information is used to indicate the bandwidth usage of the server by mass sending the first communication message;
[0013] A message sending module is used to send the first communication message containing the second thumbnail to the at least two message receiving devices.
[0014] In one possible implementation, the bandwidth usage information includes a first data flow, which is the total data flow required to transmit the first image or the first thumbnail to the at least two message receiving devices.
[0015] The amount of data in the second thumbnail is negatively correlated with the amount of data in the first data flow.
[0016] In one possible implementation, the device further includes:
[0017] The data traffic acquisition module is used to calculate the product of the size of the first image or the first thumbnail and the number of devices of the at least two message receiving devices before the thumbnail compression module performs a compression operation on the first image or the first thumbnail based on the bandwidth occupancy information corresponding to the mass sending request to obtain the second thumbnail, thereby obtaining the first data traffic.
[0018] In one possible implementation, the mass transmission request is a request to send the first communication message to each of the at least two message receiving devices; the apparatus further includes:
[0019] The first device quantity acquisition module is used to acquire the number of communication accounts of the message receiving devices corresponding to the mass sending request as the device quantity of the at least two message receiving devices before the data traffic acquisition module calculates the product of the size of the first image or the first thumbnail and the number of devices of the at least two message receiving devices to obtain the first data traffic.
[0020] In one possible implementation, the mass communication request is a request to send the first communication message to a specified group; the apparatus further includes:
[0021] The first device quantity acquisition module is used to query the online communication accounts in the specified group before the data traffic acquisition module calculates the product of the size of the first image or the first thumbnail and the number of devices of the at least two message receiving devices to obtain the first data traffic; and to obtain the number of online communication accounts in the specified group as the number of devices of the at least two message receiving devices.
[0022] In one possible implementation, the thumbnail compression module is used for,
[0023] Obtain the compression parameters corresponding to the first data traffic;
[0024] The first image or the first thumbnail is compressed according to the compression parameters to obtain the second thumbnail.
[0025] In one possible implementation, the thumbnail compression module is used for,
[0026] Obtain the traffic range where the first data traffic is located; different traffic ranges correspond to different compression parameters.
[0027] Query the compression parameters corresponding to the traffic range.
[0028] In one possible implementation, the device further includes:
[0029] The resolution range acquisition module is used to acquire the resolution range in which the resolution of the first image or the first thumbnail is located before the thumbnail compression module queries the compression parameters corresponding to the traffic range.
[0030] The thumbnail compression module is used to query the compression parameters corresponding to the traffic range and the resolution range.
[0031] In one possible implementation, the compression parameters include at least one of the following parameters:
[0032] Compression level, compression method, compression ratio.
[0033] In one possible implementation, the message sending module is used to,
[0034] Acquire the second data traffic, which is the data traffic of the communication system transmitting a thumbnail of the second image; the second image is the image contained in the second communication message; the second communication message is each communication message transmitted within a specified time period corresponding to the current time.
[0035] If the second data traffic is less than the data traffic threshold, the first communication message containing the second thumbnail is sent to the at least two message receiving devices.
[0036] In one possible implementation, the thumbnail compression module is further configured to perform a compression operation on the second thumbnail to obtain a third thumbnail when the second data traffic is not less than the data traffic threshold.
[0037] The message sending module is further configured to send the first communication message containing the third thumbnail to the at least two message receiving devices.
[0038] In one possible implementation, the amount of data in the third thumbnail is negatively correlated with the second data flow.
[0039] In one possible implementation, the device further includes:
[0040] The log writing module is used to write the thumbnail information of the image in the communication message into the machine log each time a communication message including an image is received, before the message sending module obtains the second data traffic.
[0041] The traffic statistics module is used to obtain the data traffic of thumbnails of images transmitted by the communication system within each unit time period based on the machine logs;
[0042] The message sending module is used to obtain the second data traffic based on the data traffic of thumbnails of images transmitted by the communication system within the time period of each unit.
[0043] In one possible implementation, the device further includes:
[0044] The original thumbnail acquisition module is used to acquire the original thumbnail of the first image before the compression module performs compression on the first thumbnail based on the bandwidth occupancy information corresponding to the mass sending request to obtain the second thumbnail, when the second thumbnail is obtained by performing compression on the first thumbnail based on the bandwidth occupancy information corresponding to the mass sending request.
[0045] The cropping module is configured to perform a cropping operation on the original thumbnail according to the specified aspect ratio when the difference between the aspect ratio of the resolution of the original thumbnail and the specified aspect ratio is greater than a difference threshold, thereby obtaining the first thumbnail; and to acquire the original thumbnail as the first thumbnail when the difference between the aspect ratio of the resolution of the original thumbnail and the specified aspect ratio is not greater than the difference threshold.
[0046] In one possible implementation, the device further includes:
[0047] The aspect ratio acquisition module is used to acquire the aspect ratio of the screen resolution of each user device accessing the communication system before the original thumbnail acquisition module acquires the original thumbnail of the first image; and to acquire the aspect ratio with the highest percentage among the aspect ratios of the screen resolutions of each user device as the specified aspect ratio.
[0048] According to another aspect of this application, a computer device is provided, the computer device comprising: a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the communication message sending method as described above.
[0049] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, the computer program being loaded and executed by a processor to implement the communication message sending method as described above.
[0050] According to another aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, wherein a processor retrieves the computer instructions from the computer-readable storage medium, causing the processor to load and execute them to implement the communication message sending method as described above.
[0051] The beneficial effects of the technical solutions provided in this application include at least the following:
[0052] A scheme is provided to compress images or image thumbnails contained in mass-sent communication messages to reduce the communication resources required for transmitting image thumbnails in a communication system. Specifically, for a mass-sent first communication message containing a first image, the server of the communication system can compress the first image or its thumbnail according to the impact of mass-sent first communication messages on the server's bandwidth usage, and then send the compressed thumbnail along with the communication message to the message receiving device. Since thumbnails in mass-sent messages will increase the bandwidth usage of the communication system in a short period of time, the above scheme... The compression strategy for images or image thumbnails can be flexibly applied based on the impact of mass-sent communication messages on server bandwidth usage, thus balancing communication efficiency and the display effect of thumbnails in the communication messages. For example, when mass-sent communication messages have a significant impact on server bandwidth usage, a higher compression rate can be used to reduce the instantaneous bandwidth pressure and latency of the communication system, thereby improving communication efficiency. When mass-sent communication messages have a minor impact on server bandwidth usage, a lower compression rate can be used to ensure the display effect of thumbnails in the communication messages on the receiving end. Attached Figure Description
[0053] Figure 1 This is a structural block diagram of a computer system provided in an exemplary embodiment of this application;
[0054] Figure 2 This is a schematic diagram of a mass messaging process involved in this application;
[0055] Figure 3This is a flowchart of a communication message sending method provided in one embodiment of this application;
[0056] Figure 4 This is a flowchart of a communication message sending method provided in one embodiment of this application;
[0057] Figure 5 This is a flowchart of a communication message sending method provided in one embodiment of this application;
[0058] Figure 6 This is a schematic diagram of a mass messaging interface according to an embodiment of this application;
[0059] Figure 7 This is a flowchart of a communication message sending method provided in one embodiment of this application;
[0060] Figure 8 This is a schematic diagram of a mass image sending process according to an embodiment of this application;
[0061] Figure 9 This is a schematic diagram of a video group sending process according to an embodiment of this application;
[0062] Figure 10 This is a framework diagram of an office application involved in an embodiment of this application;
[0063] Figure 11 This is a schematic diagram of a mass messaging process for an office application according to an embodiment of this application;
[0064] Figure 12 This is a schematic diagram of the mass image compression process of an office application involved in the embodiments of this application;
[0065] Figure 13 This is a schematic diagram of the system traffic statistics process of an office application involved in the embodiments of this application;
[0066] Figure 14 This is a schematic diagram illustrating the mainstream resolution statistics process of office applications involved in the embodiments of this application;
[0067] Figure 15 This is a structural block diagram of a communication message sending device provided in one embodiment of this application;
[0068] Figure 16 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0070] Figure 1A structural block diagram of a computer system provided in an exemplary embodiment of this application is given. The computer system 100 includes: a first terminal 110, a server 120, and a second terminal 130.
[0071] The first terminal 110 has a client 111 installed and running that supports communication functions. This client 111 can be an instant messaging application, a social networking application, a shopping application, an office application, etc. When the first terminal runs the client 111, the user interface of the client 111 is displayed on the screen of the first terminal 110. The first terminal 110 is the terminal used by user 112.
[0072] The second terminal 130 has a client 131 with communication capabilities installed and running. This client 131 can be an instant messaging application, a social networking application, a shopping application, an office application, etc. When the second terminal 130 runs the client 131, the user interface of the client 131 is displayed on the screen of the second terminal 130. The second terminal 130 is the terminal used by the user 132.
[0073] Optionally, the clients installed on the first terminal 110 and the second terminal 130 are the same, or the clients installed on the two terminals are the same type of client on different operating system platforms. The first terminal 110 can generally refer to one of at least two terminals, and the second terminal 130 can generally refer to the other of at least two terminals. This embodiment only uses the first terminal 110 and the second terminal 130 as examples. The device types of the first terminal 110 and the second terminal 130 may be the same or different, and these device types include at least one of: smartphones, tablets, e-book readers, MP3 players, MP4 players, laptops, and desktop computers. The following embodiments use smartphones as an example.
[0074] Those skilled in the art will understand that the number of terminals described above can be more or less. For example, there may be only one terminal, or there may be six, eight, or more terminals. This application does not limit the number of terminals or the type of device.
[0075] Figure 1 Only two user terminals are shown in the illustration, but in different embodiments, one or at least two other user terminals can access server 120. Optionally, there are also one or at least two terminals 140 corresponding to developers, on which a client development and editing platform with communication functions is installed. Developers can edit and update the client on terminal 140 and transmit the updated client installation package to server 120 via wired or wireless network. The first terminal 110 and the second terminal 130 can download the client installation package from server 120 to update the client.
[0076] The first terminal 110, the second terminal 130, and other terminals 140 are connected to the server 120 via a wireless network or a wired network.
[0077] Server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Server 120 is used to provide background services for clients that support communication functions. Optionally, server 120 undertakes the main computing work, and the terminal undertakes the secondary computing work; or, server 120 undertakes the secondary computing work, and the terminal undertakes the main computing work; or, server 120 and the terminal use a distributed computing architecture for collaborative computing.
[0078] In an illustrative example, server 120 includes processor 122, user account database 123, communication service module 124, and user-facing input / output interface (I / O interface) 125. Processor 122 loads instructions stored in server 120 and processes data in user account database 123 and communication service module 124. User account database 123 stores user account data used by first terminal 110, second terminal 130, and other terminals 140, such as user account avatars, nicknames, account levels, and regions. Communication service module 124 provides background services for communication functions. User-facing I / O interface 125 establishes communication and exchanges data with first terminal 110 and / or second terminal 130 via wireless or wired networks.
[0079] based on Figure 1 The structural framework of the computer system shown is illustrated in one possible implementation. Please refer to [reference needed]. Figure 2 This illustrates a schematic diagram of a mass messaging processing flow related to this application. Figure 2 As shown, this application embodiment provides a solution for compressing thumbnails of images in mass messaging messages during the process of sending mass messaging messages, thereby reducing the system traffic consumed by mass messaging messages. For example... Figure 2As shown, user 112 sends a group communication message through client 111, targeting at least two terminals, including second terminal 130. This message includes image 20. First terminal 110 sends the communication message containing image 20 to server 120. Server 120 obtains a thumbnail 21 of image 20, compresses it to obtain thumbnail 22, and replaces image 20 in the communication message with thumbnail 22 before sending the message to the at least two terminals. Taking second terminal 130 as an example, second terminal 130 displays the communication message containing thumbnail 22 through client 131. When user 132 wants to view a clearer image, they can click on thumbnail 22. At this time, client 131 retrieves image 20 from server 120 and displays it.
[0080] Please refer to Figure 3 It illustrates a flowchart of a communication message sending method provided in an exemplary embodiment of this application, the method being executed by a computer device, so that the method is applied to Figure 1 or Figure 2 The server 120 shown is used as an example to illustrate that the method may include the following steps.
[0081] Step 310: Receive a mass message request sent by the message sending device. The mass message request is used to request the sending of a first communication message to at least two message receiving devices. The first communication message contains a first image.
[0082] The aforementioned mass messaging request may include a first communication message and information for instructing at least two message receiving devices.
[0083] Optionally, the aforementioned bulk message request may also include information used to indicate the message sending device, such as the communication account logged in on the message sending device.
[0084] The first image mentioned above can be an independent image; for example, the first communication message mentioned above is an image message containing one or at least two independent images, and the first image is one or at least two images in the image message.
[0085] Alternatively, the first image mentioned above could also be an image from a video; for example, the first communication message mentioned above is a video message containing one or at least two videos, and the first image mentioned above is the cover of one or at least two videos.
[0086] Step 320: Perform a compression operation on the first image or the first thumbnail based on the bandwidth usage information corresponding to the mass sending request to obtain the second thumbnail; the bandwidth usage information is used to indicate the bandwidth usage of the server for the mass sending of the first communication message.
[0087] In communication applications, the thumbnail of the first image, also known as the image cover image, is a thumbnail image displayed on the application interface of the message receiving device before the image is downloaded. Generally, the thumbnail of the first image is smaller than the actual size of the first image, and its resolution is also lower than the resolution of the first image.
[0088] In this embodiment of the application, after the server receives a communication message sent by the message sending device, if the communication message contains an image, the server will store the original image in the server and first transmit the thumbnail of the image to the message receiving device. Subsequently, when the user on the message receiving device needs to view the cleaned image, the server will transmit the original image to the message receiving device to save system traffic.
[0089] In this embodiment, the server can directly compress the first image according to bandwidth usage information to obtain a second thumbnail subsequently transmitted to the message receiving device; alternatively, the server can first compress the first image, for example, by using fixed compression parameters (e.g., parameters used by the server to uniformly compress images in all communication messages) to obtain a first thumbnail, and then compress the first thumbnail according to bandwidth usage information to obtain a second thumbnail. The size of the second thumbnail can be smaller than the size of the first thumbnail, and the resolution of the second thumbnail can be smaller than the resolution of the first thumbnail. In other words, in this embodiment, for the thumbnails of images in mass-sent communication messages (i.e., the first thumbnail), the server further performs compression operations on the first thumbnail to reduce the amount of data in the thumbnails subsequently sent to the message receiving device.
[0090] In one possible implementation, the bandwidth occupancy information can directly or indirectly indicate the data traffic or bandwidth required to send the first communication message in bulk; or, the bandwidth occupancy information can directly or indirectly indicate the proportion of the bandwidth required to send the first communication message in bulk to the bandwidth of the server.
[0091] Optionally, the amount of data in the second thumbnail can be negatively correlated with the bandwidth usage of the first mass communication message on the server; that is, the higher the bandwidth usage of the first mass communication message on the server, the smaller the amount of data in the second thumbnail, and the lower the bandwidth usage of the first mass communication message on the server, the larger the amount of data in the second thumbnail.
[0092] Step 330: Send a first communication message containing a second thumbnail to at least two message receiving devices.
[0093] For the first mass communication message, the server replaces the first image with a second thumbnail obtained by directly compressing the first image, and then sends the first communication message to each message receiving device.
[0094] For the first mass communication message, the server uses the first abbreviation. Figure 2 After the second thumbnail obtained from the compression replaces the first thumbnail, the first communication message is sent to each message receiving device.
[0095] In summary, the solution presented in this application provides a method for compressing images or image thumbnails contained in mass-sent communication messages to reduce the communication resources required for the communication system to transmit image thumbnails. Specifically, for a mass-sent first communication message containing a first image, the server of the communication system can compress the first image or its thumbnail according to the impact of mass-sent first communication messages on the server's bandwidth usage, and then send the compressed thumbnail along with the communication message to the message receiving device. Since thumbnails in mass-sent messages will increase the bandwidth usage of the communication system in a short period of time, this method is effective. The above-mentioned solution allows for flexible compression strategies for images or image thumbnails based on the impact of mass-sent communication messages on server bandwidth usage. This balances communication efficiency with the display effect of thumbnails within the communication messages. For example, when mass-sent communication messages significantly impact server bandwidth usage, a higher compression rate can be used to reduce the instantaneous bandwidth pressure and latency of the communication system, thereby improving communication efficiency. Conversely, when the impact of mass-sent communication messages on server bandwidth usage is relatively small, a lower compression rate can be used to ensure the display effect of thumbnails on the receiving end.
[0096] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, the bandwidth occupancy information includes a first data flow, which is the total data flow required to transmit the first image or the first thumbnail to at least two message receiving devices; wherein, the data volume of the second thumbnail is negatively correlated with the first data flow.
[0097] For example, please refer to Figure 4 The diagram illustrates a flowchart of a communication message sending method provided in an exemplary embodiment of this application, wherein the bandwidth occupancy information includes a first data flow; as shown below. Figure 4 As shown above, Figure 3 Step 320 can be implemented as the following steps 320a.
[0098] Step 320a: Perform a compression operation on the first image or the first thumbnail based on the first data traffic to obtain the second thumbnail; the first data traffic is the data traffic required to transmit the first image or the first thumbnail to at least two message receiving devices.
[0099] In this embodiment of the application, the server calculates the data traffic required to transmit the first image or the first thumbnail in the first mass communication message to at least two message receiving devices, and performs compression operations according to the data traffic.
[0100] In other words, the more data traffic required to transmit the first image or thumbnail, the more instantaneous traffic the image or thumbnail in the first communication message occupies, and the greater the impact on other communication messages being transmitted in the communication system at the current moment. In this case, the first image or thumbnail can be compressed to obtain a second thumbnail with a smaller data volume, thereby minimizing the high instantaneous traffic pressure generated during the mass transmission of the first communication message and ensuring the instantaneous transmission efficiency of the communication system. Conversely, the less data traffic required to transmit the first image or thumbnail, the less instantaneous traffic the image or thumbnail in the first communication message occupies, and the smaller the impact on other communication messages being transmitted in the communication system at the current moment. In this case, the first image or thumbnail can be compressed to obtain a second thumbnail with a larger data volume, thereby ensuring the clarity of the thumbnails carried in the mass transmission of the first communication message and ensuring the display effect of the thumbnails in the mass transmission of the communication message.
[0101] The solution described in the above embodiments of this application implements a flexible compression strategy for the first image or the first thumbnail according to the data flow required to transmit the first image or the first thumbnail, thereby taking into account both the instantaneous transmission efficiency of the communication system and the display effect of the thumbnail in the mass-sent communication message.
[0102] In other embodiments, the server may also perform different compression operations on the first image or the first thumbnail based on factors other than the first data traffic.
[0103] For example, the bandwidth usage information mentioned above may include the number of devices of at least two message receiving devices; the server may perform compression operations on the first image or the first thumbnail based on the number of devices of at least two message receiving devices to obtain the second thumbnail; wherein, the data volume of the second thumbnail is negatively correlated with the number of devices of at least two message receiving devices.
[0104] Since the data volume of the first image or thumbnail is fixed, the server can roughly estimate the data traffic required to transmit the first image or thumbnail to at least two message receiving devices by considering the number of receiving devices. Specifically, the more message receiving devices that need to receive the first image or thumbnail, the more data traffic is required to transmit it, and the higher the bandwidth consumption of the server for sending the first mass communication message. In this case, the first image or thumbnail can be compressed to obtain a second thumbnail with a smaller data volume. Conversely, the fewer message receiving devices that need to receive the first image or thumbnail, the less data traffic is required to transmit it, and the lower the bandwidth consumption of the server for sending the first mass communication message. In this case, the first image or thumbnail can be compressed to obtain a second thumbnail with a larger data volume. This solution eliminates the need to perform the process of acquiring the first data traffic, thus improving the compression efficiency of the thumbnails corresponding to the mass communication messages.
[0105] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, please refer to... Figure 5 It illustrates a flowchart of a communication message sending method provided in an exemplary embodiment of this application, such as... Figure 5 As shown above, in the above Figure 3 Before step 320, the following step 312 may also be included.
[0106] Step 312: Calculate the product of the size of the first image or the first thumbnail and the number of devices of at least two message receiving devices to obtain the first data traffic.
[0107] In this embodiment of the application, the server multiplies the number of devices of at least two message receiving devices by the size (i.e., the data volume) of the first image or the first thumbnail, thereby quickly estimating the data traffic required to transmit the first image or the first thumbnail in the first mass communication message to the message receiving devices, ensuring the compression efficiency of the thumbnail corresponding to the mass communication message.
[0108] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, the group sending request is a request to send a first communication message to at least two message receiving devices respectively; before step 320 or step 312, the following steps may also be included:
[0109] Get the number of communication accounts of the message receiving devices included in the bulk message request, which is the number of devices with at least two message receiving devices.
[0110] In one possible implementation, when the sender of a communication message needs to send a first communication message containing a first image to multiple recipients, the application in the message sending device can be triggered to display a mass sending interface. In this interface, at least two recipient users' communication accounts can be selected, and the first communication message containing the first image can be edited or set. After clicking "Confirm Send," the message sending device can send the aforementioned mass sending request to the communication system's server.
[0111] For example, please refer to Figure 6 The diagram illustrates a group messaging interface according to an embodiment of this application. Figure 6 As shown, when a user sending a group message needs to send a group message, the application in the message sending device can be triggered to display the group sending interface 61. The group sending interface 61 includes a selection control 62 for the recipients, a message editing area 63, and a sending control 64. The message editing area 63 includes an image adding control 63a. The sender can trigger the selection control 62, and the application can display the options for available contacts. The sender can select at least two contacts to select at least two contacts as recipients. The sender can also add images to the message by triggering the image adding control 63a. For example, after the sender triggers the image adding control 63a, the application can display a resource management interface (such as a photo album interface). The sender can select images to add to the message to be sent in this resource management interface. After successfully adding an image, a thumbnail 63b of the image can be displayed in the message editing area 63. After the user confirms the completion of the communication message including the image, they can click the send control 64. At this point, the application can send a mass message request to the server, containing the image selected or set by the sender user, and the communication accounts of at least two recipient users selected by the sender user (i.e., the communication accounts of the aforementioned message receiving devices). After receiving the mass message request, the server can obtain the number of communication accounts of the message receiving devices carried in the mass message request, which is taken as the number of the aforementioned at least two message receiving devices.
[0112] In this embodiment of the application, for a group sending request to send the first communication message to at least two message receiving devices, the server can directly count the number of communication accounts on the receiving side included in the group sending request, thereby quickly determining the number of devices of at least two message receiving devices and ensuring the compression efficiency of the first image or the first thumbnail.
[0113] In one possible implementation, when the mass sending request is a request to send the first communication message to at least two message receiving devices respectively, the server may also consider the online status of the communication accounts of the message receiving devices; for example, the step of obtaining the number of communication accounts of the message receiving devices included in the mass sending request as the number of devices of at least two message receiving devices can be replaced by: obtaining the number of communication accounts in the online status of the communication accounts of the message receiving devices included in the mass sending request as the number of devices of at least two message receiving devices.
[0114] Since not all recipients' communication accounts may be online when sending mass messages, the server will send the mass message to the receiving devices corresponding to the online communication accounts. For offline communication accounts, the server can send the message to the account the next time it comes online. Therefore, when calculating the impact of the mass message on the server's instantaneous traffic pressure at the current moment, the number of online communication accounts among the message receiving devices included in the mass message request can be taken as the number of at least two message receiving devices. This eliminates interference from devices that will not receive the message at the moment, ensuring the accuracy of the calculation of the number of message receiving devices and the first data traffic, and thus ensuring the accuracy of the subsequent compression of the first image or the first thumbnail.
[0115] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, the group sending request is a request to send a first communication message to a specified group; before step 320 or step 312 above, the following steps may also be included:
[0116] Query the online communication accounts in a specified group; obtain the number of online communication accounts in a specified group as the number of devices with at least two message receiving devices.
[0117] The aforementioned online communication accounts can be communication accounts in a specified group that currently have a communication connection with the server.
[0118] In this embodiment, the sender can also send a message containing an image to at least two message receiving devices in a designated group by sending the message in the chat interface of the designated group. Since there may be many members in the designated group, but only some may be online, the server will send the message to online group members. For offline group members, the server can send the message to them the next time they come online. Therefore, when calculating the impact of the mass-sent message on the server's instantaneous traffic pressure, the number of online communication accounts in the designated group can be used as the number of at least two message receiving devices. This eliminates interference from devices that will not currently receive the message, ensuring the accuracy of the calculation of the number of message receiving devices and the first data traffic, thereby ensuring the accuracy of the subsequent compression of the first image or the first thumbnail.
[0119] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, step 320a can be implemented as the following steps:
[0120] Obtain the compression parameters corresponding to the first data traffic; perform compression operation on the first image or the first thumbnail according to the compression parameters to obtain the second thumbnail.
[0121] In this embodiment of the application, the server can obtain the corresponding compression parameters according to the first data traffic.
[0122] For example, the server can look up the corresponding compression parameters in a table using the first data traffic; or, the server can calculate the corresponding compression parameters by inputting the value of the first data traffic into a pre-set calculation formula.
[0123] In this embodiment of the application, the server can determine the compression parameters through the first data traffic, and then perform compression processing on the first image or the first thumbnail through the determined compression parameters, thereby ensuring the feasibility of dynamically controlling the compression operation through data traffic.
[0124] Optionally, if the bandwidth occupancy information includes the number of devices with at least two message receiving devices, the step of obtaining the compression parameters corresponding to the first data traffic can also be replaced by: obtaining the compression parameters corresponding to the number of devices with at least two message receiving devices.
[0125] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, the process of obtaining the compression parameters corresponding to the first data traffic may include:
[0126] Get the traffic range where the first data traffic is located. Different traffic ranges correspond to different compression parameters. Query the compression parameters corresponding to the traffic range.
[0127] In this embodiment of the application, the server can pre-set the correspondence between compression parameters corresponding to at least two traffic ranges, with different traffic ranges corresponding to different compression parameters; for example, please refer to Table 1, which shows a correspondence between traffic ranges and compression parameters.
[0128] Table 1
[0129] Traffic volume range (unit: MB) Compression parameters (0,1] Uncompressed (1,10] Compression parameter 1 (10,50] Compression parameter 2 (50,﹢∞] Compression parameter 3
[0130] After obtaining the first data traffic, the server can determine the traffic range in which the first data traffic is located, and query the corresponding relationship through the determined traffic range to obtain the compression parameter corresponding to the first data traffic. For example, taking Table 1 above as an example, assuming that the first data traffic obtained by the server is 3 megabytes (MB) and is located in the traffic range (1, 10], the server will query Table 1 to obtain the corresponding compression parameter as compression parameter 1. Optionally, assuming that the first data traffic obtained by the server is 0.5MB and is located in the traffic range (0, 1], the server can query Table 1 to determine that no compression operation needs to be performed on the first image or the first thumbnail.
[0131] The solution shown in this application embodiment can quickly determine the compression parameters corresponding to the first data traffic simply by performing a query operation through the traffic range, thereby ensuring the compression efficiency of the first image or the first thumbnail.
[0132] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, before querying the compression parameters corresponding to the traffic range, the method further includes: obtaining the resolution range in which the resolution of the first image or the first thumbnail is located; the querying of the compression parameters corresponding to the traffic range includes: querying the compression parameters corresponding to the traffic range and the resolution range.
[0133] In this embodiment of the application, for the same compression parameters, the size of the compressed image is different when compressing images of different sizes (data volume). Therefore, in this embodiment of the application, when the server queries the compression parameters, in addition to considering the traffic range where the first data traffic is located, it can also combine the resolution (corresponding size / data volume) of the first image or the first thumbnail to determine the compression parameters.
[0134] For example, multiple correspondences can be pre-set in the server. Each correspondence is a relationship between traffic range, resolution range, and compression parameters. Different compression parameters correspond to different traffic ranges and resolution ranges. After obtaining the first data traffic, in addition to determining the traffic range in which the first data traffic is located, the server can also determine the resolution range in which the resolution of the first image or the first thumbnail is located. Then, by querying the above correspondences through the determined traffic range and resolution range, the compression parameters corresponding to the first data traffic can be obtained.
[0135] For example, please refer to Table 2, which shows the correspondence between flow range, resolution range and compression parameters.
[0136] Table 2
[0137]
[0138]
[0139] After obtaining the first data traffic, the server can determine the traffic range where the first data traffic is located, and the resolution range where the resolution of the first image or the first thumbnail is located. By querying the corresponding relationship between the determined traffic range and resolution range, the server can obtain the compression parameters corresponding to the first data traffic. For example, taking Table 2 above as an example, assuming that the first data traffic obtained by the server is 3 megabytes (MB), located in the traffic range (1, 10], and the resolution range where the resolution of the first image or the first thumbnail is located is located in the resolution range (200, 300], then the server can obtain the corresponding compression parameter 2 by querying Table 2. Optionally, assuming that the first data traffic obtained by the server is 0.5MB, located in the traffic range (0, 1], and the resolution range where the resolution of the first image or the first thumbnail is located is located in the resolution range (0, 100], then the server can determine by querying Table 2 that no compression operation needs to be performed on the first image or the first thumbnail.
[0140] The solution shown in this application embodiment can simultaneously consider the first data flow and the resolution of the first image or the first thumbnail when determining the compression parameters, thereby determining the size of the thumbnail obtained after compression more accurately, in order to improve the accuracy of compression.
[0141] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, before querying the compression parameters corresponding to the traffic range, the method further includes: obtaining network information of at least two message receiving devices, the network information including at least one of network type and traffic type used; wherein, the network type may include cellular network (e.g., fourth-generation / fifth-generation mobile communication network), wireless local area network, etc., and the traffic type may include paid traffic, free traffic, etc.; determining reference network information, the reference network information being the network information that appears most frequently in the network information of each of the at least two message receiving devices; the querying of the compression parameters corresponding to the traffic range includes: querying the compression parameters corresponding to the traffic range and the reference network information; or, the querying of the compression parameters corresponding to the traffic range includes: querying the compression parameters corresponding to the traffic range, the resolution range, and the reference network information.
[0142] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, the compression parameters include at least one of the following parameters: compression level, compression method, and compression ratio.
[0143] Different compression levels, compression methods, and compression ratios can represent different degrees of compression for the first image or the first thumbnail. By setting at least two compression levels, compression methods, and compression ratios, the server can flexibly set the compression degree for the first image or the first thumbnail according to compression requirements, thereby ensuring the flexibility and accuracy of the compression of the first image or the first thumbnail.
[0144] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, please refer to... Figure 7 It illustrates a flowchart of a communication message sending method provided in an exemplary embodiment of this application, such as... Figure 7 As shown, step 330 above can be implemented as the following steps 330a and 330b.
[0145] Step 330a: Obtain the second data traffic, which is the data traffic of the communication system transmitting the thumbnail of the second image; the second image is the image contained in the second communication message; the second communication message is each communication message transmitted within a specified time period corresponding to the current time.
[0146] The specified time period corresponding to the current moment can be one of the specified time periods in a pre-divided set of specified time periods, where the current moment is located; or, the specified time period corresponding to the current moment can be the most recent specified time period before the current moment in a pre-divided set of specified time periods.
[0147] In this embodiment of the application, the server can count the traffic consumed by the communication system in transmitting thumbnails of images in each communication message within each specified time period, in order to measure the traffic pressure / load of global thumbnail transmission in the communication system within the specified time period.
[0148] The specified time period can be manually set by developers / maintenance personnel as needed. For example, the specified time period can be set to 1 second (s) or 0.5 seconds, etc. For instance, taking a specified time period of 1 second as an example, the server can divide the timeline into several specified time periods in units of 1 second. Before sending the first communication message, the server first obtains the second data traffic transmitted in the global thumbnail of the communication system within the specified time period corresponding to the current moment.
[0149] Step 330b: If the second data traffic is less than the data traffic threshold, send a first communication message containing the second thumbnail to at least two message receiving devices.
[0150] In this embodiment of the application, after the server obtains the second data traffic of the global thumbnail transmission in the communication system within the specified time period corresponding to the current time, if the second data traffic is small (i.e. less than the data traffic threshold), it indicates that the instantaneous bandwidth pressure of the thumbnail of the image being transmitted in the communication system is not large. At this time, a first communication message containing the second thumbnail can be sent to at least two message receiving devices.
[0151] The solution described in the above embodiments of this application allows the server to send a first communication message containing a second thumbnail to at least two message receiving devices when the instantaneous bandwidth pressure of the thumbnail being transmitted in the communication system is not high. This ensures that the transmission of the first communication message containing the second thumbnail will not have a significant impact on the instantaneous bandwidth pressure of the communication system, thereby guaranteeing the communication efficiency of the communication system.
[0152] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, the above method further includes:
[0153] If the second data traffic is not less than the data traffic threshold, perform a compression operation on the second thumbnail to obtain a third thumbnail; and send a first communication message containing the third thumbnail to at least two message receiving devices.
[0154] In this embodiment of the application, after the server obtains the second data traffic, if the second data traffic is large (i.e. not less than the data traffic threshold), it indicates that the instantaneous bandwidth pressure of the thumbnail of the image being transmitted by the communication system is large. If the first communication message containing the second thumbnail is directly transmitted, it may have a significant impact on the instantaneous bandwidth pressure of the communication system. At this time, the server can further compress the second thumbnail and send the first communication message containing the compressed third thumbnail to at least two message receiving devices, thereby ensuring the communication efficiency of the communication system.
[0155] In one possible implementation, before acquiring the second data traffic, the method further includes: writing the thumbnail information of the image in the communication message to the machine log each time a communication message containing an image is received; acquiring the data traffic of thumbnails of images transmitted by the communication system within each unit time period based on the machine log; and acquiring the second data traffic based on the data traffic of thumbnails of images transmitted by the communication system within each unit time period.
[0156] In this embodiment, each time the server receives a communication message containing an image, it can write information about the thumbnail of the image in the communication message (i.e., the thumbnail to be carried in the communication message sent to the receiving device) (such as the size of the thumbnail, the number of devices receiving the communication message containing the thumbnail, the sending timestamp, etc.) into the machine log, and periodically pull the machine log, extracting the data traffic corresponding to the thumbnails within each unit time period from the pulled machine log. For example, for a certain unit time period, the server can obtain the information of each thumbnail whose sending timestamp is within that unit time period, multiply the size of each thumbnail by the number of devices to obtain the data traffic of each thumbnail, and then sum the data traffic of each thumbnail to obtain the data traffic of the thumbnails of the image transmitted by the communication system within that unit time period. The specified length time period can include one or more unit time periods. The server can obtain the data traffic corresponding to one or more unit time periods included in the specified length time period and perform summation to obtain the second data traffic.
[0157] Through the scheme shown in the above embodiments, the server can record the information of thumbnails of images contained in communication messages through machine logs, and periodically obtain the data traffic occupied by thumbnails in each unit time period according to unit time duration. This facilitates the server to obtain the second data traffic consumed by the thumbnails of images in the communication messages transmitted within a specified length time period, ensuring the timeliness and accuracy of the second data traffic statistics.
[0158] In one possible implementation, the data volume of the third thumbnail is negatively correlated with the second data traffic. For example, if the second data traffic is not less than a data traffic threshold, the process of compressing the second thumbnail to obtain the third thumbnail may include: the server obtaining compression parameters corresponding to the second data traffic; and performing compression on the second thumbnail according to the compression parameters corresponding to the second data traffic to obtain the third thumbnail.
[0159] The scheme described in the above embodiments allows for a flexible compression strategy to be applied to the second thumbnail based on the data traffic consumed by the server in transmitting image thumbnails within a specified time period. This balances the instantaneous transmission efficiency of the communication system with the display effect of thumbnails in mass-sent communication messages.
[0160] In one possible implementation, when the server obtains the compression parameters corresponding to the second data traffic, it obtains the traffic range in which the second data traffic is located and queries the compression parameters corresponding to the traffic range in which the second data traffic is located.
[0161] In one possible implementation, the server obtains the resolution range of the second thumbnail before querying the compression parameters corresponding to the traffic range where the second data traffic is located; when querying the compression parameters corresponding to the traffic range where the second data traffic is located, the server queries the compression parameters corresponding to the traffic range where the second data traffic is located and the resolution range where the second thumbnail is located.
[0162] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, when step 320 is to perform a compression operation on the first thumbnail based on the bandwidth occupancy information corresponding to the mass sending request to obtain the second thumbnail, the following steps may be included before step 320: obtaining the first thumbnail of the first image.
[0163] The server can obtain the original thumbnail of the first image; if the difference between the aspect ratio of the original thumbnail's resolution and the specified aspect ratio is greater than a difference threshold, the server can perform a cropping operation on the original thumbnail according to the specified aspect ratio to obtain the first thumbnail; if the difference between the aspect ratio of the original thumbnail's resolution and the specified aspect ratio is not greater than a difference threshold, the server can obtain the original thumbnail as the first thumbnail.
[0164] In this embodiment, the server can first obtain the original thumbnail of the first image. If the aspect ratio of the resolution of the original thumbnail differs significantly from the specified aspect ratio, for example, if the original thumbnail of the first image is a long image, then the thumbnail of the first image will also be displayed as an unclear long image on the receiving end, which will affect the display effect of the thumbnail of the first image on the receiving end. In this regard, in the solution shown in this embodiment, if the aspect ratio of the resolution of the original thumbnail differs significantly from the specified aspect ratio, the server can crop the original thumbnail to obtain the portion with the specified aspect ratio as the first thumbnail, thereby ensuring the display effect of the thumbnail of the subsequent first image on the receiving end.
[0165] Based on the solutions shown in any one or at least two of the above embodiments of this application, in one possible implementation, the above method further includes:
[0166] Obtain the aspect ratio of the screen resolution of each user device accessing the communication system; and select the aspect ratio with the highest percentage among the screen resolutions of each user device as the specified aspect ratio.
[0167] In this embodiment of the application, the specified aspect ratio can be set to the aspect ratio of the mainstream resolution in the communication system, so that the thumbnail of the first image can be adapted to most user devices and ensure the display effect of the thumbnail of the first image on the receiving side.
[0168] The solutions described in the above embodiments of this application can be applied to at least two scenarios in instant messaging: independent image group sending and video group sending, reducing the bandwidth pressure on the server when transmitting thumbnails to the receiving end. The applications of the solutions described in the above embodiments of this application in these two scenarios are described below.
[0169] Scenario 1: Sending individual images in bulk
[0170] Please refer to Figure 8 This illustration shows a schematic diagram of a mass image sending process according to an embodiment of this application. Figure 8 As shown, the process of sending images in bulk can include the following steps:
[0171] S1, server 820 receives a group message request sent by message sending device 810. The group message request is used to request to send image messages (corresponding to the first communication message mentioned above) to at least two message receiving devices 830.
[0172] S2, server 820 retrieves the image cover 820b (also called the image cover image, corresponding to the first thumbnail) of image file 820a (corresponding to the first image above) in the image message.
[0173] S3, server 820 obtains bandwidth usage information 820c corresponding to the mass sending request; bandwidth usage information 820c is used to indicate the bandwidth usage of server 820 for mass sending image messages.
[0174] S4, server 820 performs a compression operation on the image cover 820b based on bandwidth usage information 820c, and obtains the compressed cover 820d.
[0175] S5, server 820 sends an image message containing a compressed cover 820d to at least two message receiving devices 830.
[0176] S6, the message receiving device 830 displays a video message containing a compressed cover 820d. When it receives an operation from the user to click on the image message, it retrieves the image file 820a from the server 820 and displays it.
[0177] In one possible implementation, bandwidth occupancy information 820c includes a first data flow, which is the data flow required to transmit the image cover 820b to at least two message receiving devices 830; wherein the amount of data in the compressed cover 820d is negatively correlated with the first data flow.
[0178] In one possible implementation, before the server 820 performs a compression operation on the image cover 820b based on the bandwidth occupancy information 820c and obtains the compressed cover 820d, the server 820 further includes: obtaining the product of the size of the image cover 820b and the number of devices of at least two message receiving devices 830 as the first data traffic.
[0179] In one possible implementation, the mass sending request is a request to send image messages to at least two message receiving devices 830 respectively; before the server 820 obtains the product of the size of the image cover 820b and the number of devices of the at least two message receiving devices 830 as the first data traffic, it also includes: the server 820 obtaining the number of communication accounts of the message receiving devices included in the mass sending request as the number of devices of the at least two message receiving devices 830.
[0180] In one possible implementation, the mass sending request is a request to send an image message to a specified group; before the server 820 obtains the product of the size of the image cover 820b and the number of devices of at least two message receiving devices 830 as the first data traffic, the process further includes: the server 820 querying the online communication accounts in the specified group; obtaining the number of online communication accounts in the specified group as the number of devices of at least two message receiving devices 830.
[0181] In one possible implementation, the server 820 performs a compression operation on the image cover 820b based on the bandwidth occupancy information 820c to obtain a compressed cover 820d, including: the server 820 obtaining compression parameters corresponding to the first data traffic; and performing a compression operation on the image cover 820b according to the compression parameters to obtain the compressed cover 820d.
[0182] In one possible implementation, the server 820 obtains the compression parameters corresponding to the first data traffic, including: the server 820 obtains the traffic range where the first data traffic is located; and queries the compression parameters corresponding to the traffic range.
[0183] In one possible implementation, before the server 820 queries the compression parameters corresponding to the traffic range, the method further includes: the server 820 obtaining the resolution range in which the resolution of the image cover 820b is located; the server 820 querying the compression parameters corresponding to the traffic range includes: the server 820 querying the compression parameters corresponding to both the traffic range and the resolution range.
[0184] In one possible implementation, server 820 sends an image message containing a compressed cover 820d to at least two message receiving devices, including:
[0185] Server 820 acquires the second data traffic, which is the data traffic of the communication system transmitting a thumbnail of the second image; the second image is the image or video cover contained in the second communication message; the second communication message is each communication message transmitted within a specified length time period corresponding to the current time; if the second data traffic is less than the data traffic threshold, the server sends an image message containing the compressed cover 820d to at least two message receiving devices 830.
[0186] In one possible implementation, the above scheme further includes: server 820 performing compression operation on compressed cover 820d to obtain a third thumbnail when the second data traffic is not less than the data traffic threshold; and sending an image message containing the third thumbnail to at least two message receiving devices 830.
[0187] Scenario 2: Group Video Sending
[0188] Please refer to Figure 9 This illustration shows a schematic diagram of a video group sending process according to an embodiment of this application. Figure 9 As shown, the video mass sending process can include the following steps:
[0189] S1, server 920 receives a group sending request from message sending device 910. The group sending request is used to request that video files be sent to at least two message receiving devices 930.
[0190] S2, server 920 obtains the cover thumbnail 920b (corresponding to the first thumbnail) of the video file's cover 920a (corresponding to the first image above).
[0191] S3, server 920 obtains bandwidth usage information 920c corresponding to the mass video message request; bandwidth usage information 920c is used to indicate the bandwidth usage of server 920 for mass video messages.
[0192] S4, server 920 performs a compression operation on the cover thumbnail 920b based on bandwidth usage information 920c, and obtains the compressed cover 920d.
[0193] S5, server 920 sends a video message containing a compressed cover 920d (corresponding to the first communication message mentioned above) to at least two message receiving devices 930.
[0194] S6, the message receiving device 930 displays a video message containing a compressed cover 920d. When it receives an operation from the user clicking on the video message, it retrieves the video file from the server 920 and plays it.
[0195] In one possible implementation, bandwidth occupancy information 920c includes a first data flow, which is the data flow required to transmit the cover thumbnail 920b to at least two message receiving devices 930; wherein the amount of data in the compressed cover 920d is negatively correlated with the first data flow.
[0196] In one possible implementation, before the server 920 performs a compression operation on the cover thumbnail 920b based on the bandwidth occupancy information 920c and obtains the compressed cover 920d, the server 920 further includes: obtaining the product of the size of the cover thumbnail 920b and the number of devices of at least two message receiving devices 930 as the first data traffic.
[0197] In one possible implementation, the mass sending request is a request to send video messages to at least two message receiving devices 930 respectively; before the server 920 obtains the product of the size of the cover thumbnail 920b and the number of devices of the at least two message receiving devices 930 as the first data traffic, it also includes: the server 920 obtaining the number of communication accounts of the message receiving devices included in the mass sending request as the number of devices of the at least two message receiving devices 930.
[0198] In one possible implementation, the mass sending request is a request to send video messages to a specified group; before the server 920 obtains the product of the size of the cover thumbnail 920b and the number of devices of at least two message receiving devices 930 as the first data traffic, the process further includes: the server 920 querying the online communication accounts in the specified group; obtaining the number of online communication accounts in the specified group as the number of devices of at least two message receiving devices 930.
[0199] In one possible implementation, the server 920 performs a compression operation on the cover thumbnail 920b based on the bandwidth occupancy information 920c to obtain a compressed cover 920d, including: the server 920 obtaining compression parameters corresponding to the first data traffic; and performing a compression operation on the cover thumbnail 920b according to the compression parameters to obtain a compressed cover 920d.
[0200] In one possible implementation, the server 920 obtains the compression parameters corresponding to the first data traffic, including: the server 920 obtains the traffic range where the first data traffic is located; and queries the compression parameters corresponding to the traffic range.
[0201] In one possible implementation, before the server 920 queries the compression parameters corresponding to the traffic range, the method further includes: the server 920 obtaining the resolution range in which the resolution of the cover thumbnail 920b is located; the server 920 querying the compression parameters corresponding to the traffic range includes: the server 920 querying the compression parameters corresponding to both the traffic range and the resolution range.
[0202] In one possible implementation, server 920 sends a video message containing a compressed cover 920d to at least two message receiving devices, including:
[0203] Server 920 acquires the second data traffic, which is the data traffic of the communication system transmitting the thumbnail of the second image; the second image is the image or video cover contained in the second communication message; the second communication message is each communication message transmitted within a specified length time period corresponding to the current time; if the second data traffic is less than the data traffic threshold, a video message containing the compressed cover 920d is sent to at least two message receiving devices 930.
[0204] In one possible implementation, the above scheme further includes: server 920 performing compression operation on compressed cover 920d to obtain third thumbnail when the second data traffic is not less than the data traffic threshold; and sending video message containing third thumbnail to at least two message receiving devices 930.
[0205] The solutions shown in the above embodiments of this application can be applied to applications with communication functions, such as office applications, instant messaging applications, and social platform applications.
[0206] Taking the application involved in Scenario 1 above as an example, which is an office application, in the daily operation of an enterprise, it is often necessary to send images to customers in bulk. When the images sent by users are large, they will consume a lot of system resources. However, based on the intelligent identification of bulk image size provided in the above embodiments of this application, the image cover image can be compressed according to at least two conditions, such as the user's image size, the scale of customers sending the images, and the aspect ratio of mainstream screen resolutions, thereby reducing the overhead of the backend system and optimizing the operating costs of office applications. Specifically, for example, enterprise users of office applications can edit and upload images through the client of the office application to create bulk sending tasks; the backend of the office application compresses the user's image cover image (i.e., the first image mentioned above) according to the user's image information (i.e., the first image mentioned above), combined with at least two conditions such as the sending scale of a single bulk message and the backend system load, and then delivers the compressed image thumbnail (i.e., the second thumbnail mentioned above) to the customers sending the images.
[0207] For example, please refer to Figure 10 It shows a framework diagram of an office application according to an embodiment of this application; based on Figure 10 The communication functionality of this office application can be implemented using the framework shown in the diagram as follows:
[0208] A) The user sends a request to the background 1002 of the office application by using the client 1001 of the office application on the mobile phone / PC.
[0209] B) The background 1002 of the office application is responsible for handling requests sent from the client 1001 of the office application.
[0210] C) The backend database (DB) of office applications 1003 is responsible for storing relevant data of office applications.
[0211] D) The background message queue (MQ) 1004 of office applications is responsible for handling background asynchronous requests of office applications.
[0212] Please refer to Figure 11 It illustrates a schematic diagram of a mass messaging process for an office application according to an embodiment of this application; such as Figure 11 As shown, the mass messaging process of this office application may include the following steps:
[0213] A) Company member 1101 created a group message through an office application.
[0214] B) The office application backend 1102 stores the requested data in the office application backend database DB1103.
[0215] C) The background of office applications sends asynchronous mass mailing tasks.
[0216] D) The background MQ 1104 of office applications performs intelligent image cover image compression.
[0217] E) The background MQ 1104 of the office application delivers the user's mass messaging task to the enterprise's customers 1005.
[0218] Please refer to Figure 12 It illustrates a schematic diagram of a mass image compression process in an office application according to an embodiment of this application; such as Figure 12 As shown, the mass image compression process of this office application may include the following steps:
[0219] S1201, the background message queue (MQ) of an office application retrieves the image cover of a message sent by a user.
[0220] S1202, the background message queue (MQ) of office applications obtains the resolution of mainstream mobile phones.
[0221] S1203: If the aspect ratio of the original image differs significantly from the mainstream resolution aspect ratio, the original cover image will be cropped.
[0222] S1204, the background of office applications calculates the estimated traffic based on the mass sending scale of the mass sending task multiplied by the size of the user's cover image, and performs image compression for different levels of sending scale.
[0223] S1205: The background of the office application determines whether the system load corresponding to the current system image traffic statistics exceeds the threshold. If so, it compresses the image again.
[0224] S1206, Office applications replace the original message cover image with a new cover image before sending the message.
[0225] Please refer to Figure 13 It illustrates a schematic diagram of a system traffic statistics process for an office application according to an embodiment of this application; such as Figure 13 As shown, the system traffic statistics process for this office application may include the following steps:
[0226] A) Whenever there is a picture message, the communication system 1301 of the office application writes the cover image information to the machine log 1301a.
[0227] B) The statistics system 1302 for office applications deploys an agent 1303 to periodically collect machine logs on the machine to which the communication system belongs.
[0228] C) The statistics system 1302 for office applications summarizes machine logs and provides statistics on global traffic.
[0229] D) The statistics system 1302 of the office application provides an interface so that the communication system 1301 of the office application can obtain the traffic of the image cover image within a unit of time.
[0230] Please refer to Figure 14 It illustrates a schematic diagram of the mainstream resolution statistics process for an office application according to an embodiment of this application; as shown below. Figure 14 As shown, the mainstream resolution statistics update process for this office application may include the following steps:
[0231] A) When the client of the office application 1401 runs the APP for the first time, it reports the local resolution information.
[0232] B) The background 1402 of the office application collects the reports from the client and stores the data in the background DB 1403 of the office application.
[0233] C) The statistics system for office applications 1404 regularly updates mainstream resolution information.
[0234] In this application, the background of the office application can use lossy compression to compress the cover image, or it can compress the image by combining at least two pixels into one pixel. Optionally, the background of the office application can also use other compression methods, which are not limited in this embodiment.
[0235] The above-described embodiment of this application provides a solution for intelligently identifying the size of mass messages. It can compress the cover image based on factors such as the user's image size, the number of customers sending the message, and the mainstream screen size, thereby reducing the overhead of the backend system and optimizing operating costs.
[0236] Please refer to Figure 15 The diagram illustrates a structural block diagram of a communication message sending apparatus provided in an exemplary embodiment of this application. The communication message sending apparatus includes:
[0237] The request receiving module 1501 is used to receive a mass sending request sent by a message sending device. The mass sending request is used to request the sending of a first communication message to at least two message receiving devices. The first communication message includes a first image.
[0238] Compression module 1502 is used to perform a compression operation on the first image or the first thumbnail based on the bandwidth usage information corresponding to the mass sending request, to obtain a second thumbnail; the first thumbnail is a thumbnail of the first image; the bandwidth usage information is used to indicate the bandwidth usage of the server by mass sending the first communication message;
[0239] The message sending module 1503 is used to send the first communication message containing the second thumbnail to the at least two message receiving devices.
[0240] In one possible implementation, the bandwidth usage information includes a first data flow, which is the total data flow required to transmit the first image or the first thumbnail to the at least two message receiving devices; wherein the data volume of the second thumbnail is negatively correlated with the first data flow.
[0241] In one possible implementation, the device further includes:
[0242] The data traffic acquisition module is used to calculate the product of the size of the first image or the first thumbnail and the number of devices of the at least two message receiving devices before the compression module 1502 performs a compression operation on the first image or the first thumbnail based on the bandwidth occupancy information corresponding to the mass sending request to obtain the second thumbnail, thereby obtaining the first data traffic.
[0243] In one possible implementation, the mass transmission request is a request to send the first communication message to each of the at least two message receiving devices; the apparatus further includes:
[0244] The first device quantity acquisition module is used to acquire the number of communication accounts of the message receiving devices corresponding to the mass sending request as the device quantity of the at least two message receiving devices before the data traffic acquisition module calculates the product of the size of the first image or the first thumbnail and the number of devices of the at least two message receiving devices to obtain the first data traffic.
[0245] In one possible implementation, the mass communication request is a request to send the first communication message to a specified group; the apparatus further includes:
[0246] The first device quantity acquisition module is used to query the online communication accounts in the specified group before the data traffic acquisition module calculates the product of the size of the first image or the first thumbnail and the number of devices of the at least two message receiving devices to obtain the first data traffic; and to obtain the number of online communication accounts in the specified group as the number of devices of the at least two message receiving devices.
[0247] In one possible implementation, the compression module 1502 is used for,
[0248] Obtain the compression parameters corresponding to the first data traffic;
[0249] The first image or the first thumbnail is compressed according to the compression parameters to obtain the second thumbnail.
[0250] In one possible implementation, the compression module 1502 is used for,
[0251] Obtain the traffic range where the first data traffic is located; different traffic ranges correspond to different compression parameters.
[0252] Query the compression parameters corresponding to the traffic range.
[0253] In one possible implementation, the device further includes:
[0254] The resolution range acquisition module is used to acquire the resolution range in which the first image or the first thumbnail is located before the compression module 1502 queries the compression parameters corresponding to the traffic range.
[0255] The compression module 1502 is used to query the compression parameters corresponding to the traffic range and the resolution range.
[0256] In one possible implementation, the compression parameters include at least one of the following parameters:
[0257] Compression level, compression method, compression ratio.
[0258] In one possible implementation, the message sending module 1503 is used for,
[0259] Acquire the second data traffic, which is the data traffic of the communication system transmitting a thumbnail of the second image; the second image is the image contained in the second communication message; the second communication message is each communication message transmitted within a specified time period corresponding to the current time.
[0260] If the second data traffic is less than the data traffic threshold, the first communication message containing the second thumbnail is sent to the at least two message receiving devices.
[0261] In one possible implementation, the compression module 1502 is further configured to perform a compression operation on the second thumbnail to obtain a third thumbnail when the second data traffic is not less than the data traffic threshold.
[0262] The message sending module 1503 is further configured to send the first communication message containing the third thumbnail to the at least two message receiving devices.
[0263] In one possible implementation, the amount of data in the third thumbnail is negatively correlated with the second data flow.
[0264] In one possible implementation, the device further includes:
[0265] The log writing module is used to write the thumbnail information of the image in the communication message into the machine log each time a communication message including an image is received, before the message sending module 1503 obtains the second data traffic.
[0266] The traffic statistics module is used to obtain the data traffic of thumbnails of images transmitted by the communication system within each unit time period based on the machine logs;
[0267] The message sending module 1503 is used to obtain the second data traffic based on the data traffic of thumbnails of images transmitted by the communication system within the time period of each unit.
[0268] In one possible implementation, the device further includes:
[0269] The original thumbnail acquisition module is used to acquire the original thumbnail of the first image before the compression module 1502 performs compression on the first thumbnail based on the bandwidth occupancy information corresponding to the mass sending request to obtain the second thumbnail, when the second thumbnail is obtained by performing compression on the first thumbnail based on the bandwidth occupancy information corresponding to the mass sending request.
[0270] The cropping module is configured to perform a cropping operation on the original thumbnail according to the specified aspect ratio when the difference between the aspect ratio of the resolution of the original thumbnail and the specified aspect ratio is greater than a difference threshold, thereby obtaining the first thumbnail; and to acquire the original thumbnail as the first thumbnail when the difference between the aspect ratio of the resolution of the original thumbnail and the specified aspect ratio is not greater than the difference threshold.
[0271] In one possible implementation, the device further includes:
[0272] The aspect ratio acquisition module is used to acquire the aspect ratio of the screen resolution of each user device accessing the communication system before the original thumbnail acquisition module acquires the original thumbnail of the first image; and to acquire the aspect ratio with the highest percentage among the aspect ratios of the screen resolutions of each user device as the specified aspect ratio.
[0273] It should be noted that the device provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0274] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments of the relevant method; the technical effects achieved by each module performing its operation are the same as the technical effects in the embodiments of the relevant method, and will not be elaborated here.
[0275] Please refer to Figure 16 , Figure 16 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application. The computer device 1600 includes a Central Processing Unit (CPU) 1601, a system memory 1604 including Random Access Memory (RAM) 1602 and Read-Only Memory (ROM) 1603, and a system bus 1605 connecting the system memory 1604 and the CPU 1601. The computer device 1600 also includes a Basic Input / Output System (I / O System) 1606 to facilitate information transfer between various devices within the computer, and a mass storage device 1607 for storing the operating system 1613, application programs 1614, and other program modules 1615.
[0276] The basic input / output system 1606 includes a display 1608 for displaying information and an input device 1609 for user input, such as a mouse or keyboard. Both the display 1608 and the input device 1609 are connected to the central processing unit 1601 via an input / output controller 1610 connected to the system bus 1605. The basic input / output system 1606 may also include the input / output controller 1610 for receiving and processing input from other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1610 also provides output to a display screen, printer, or other types of output devices.
[0277] The mass storage device 1607 is connected to the central processing unit 1601 via a mass storage controller (not shown) connected to the system bus 1605. The mass storage device 1607 and its associated computer-readable media provide non-volatile storage for the computer device 1600. That is, the mass storage device 1607 may include computer-readable media (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0278] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM (Random Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 1604 and mass storage device 1607 described above can be collectively referred to as memory.
[0279] Computer device 1600 can be connected to the Internet or other network devices via network interface unit 1611 connected to the system bus 1605.
[0280] The memory also includes one or more programs stored in the memory, and the central processing unit 1601 executes the one or more programs to implement all or part of the steps in the methods shown in the above embodiments of this application.
[0281] In an exemplary embodiment, this application provides a chip that includes programmable logic circuits and / or program instructions. When the chip is run on a computer device, it is used to implement the communication message sending method provided in the above method embodiments.
[0282] This application provides a computer-readable storage medium storing a computer program, which is loaded and executed by a processor to implement the communication message sending method provided in the above method embodiments.
[0283] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, causing the processor to load and execute them to implement the communication message sending method provided in the above method embodiments.
[0284] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0285] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0286] Those skilled in the art will recognize that, in one or at least two of the examples described above, the functions depicted in the embodiments of this application can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or at least two instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.
[0287] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for sending communication messages, characterized in that, The method includes: The message receiving device sends a mass message request, which is used to request the sending of a first communication message to at least two message receiving devices, the first communication message containing a first image; Based on the bandwidth usage information corresponding to the mass messaging request, a compression operation is performed on the first image or the first thumbnail to obtain a second thumbnail; the first thumbnail is a thumbnail of the first image; the bandwidth usage information is used to indicate the bandwidth usage of the server by mass messaging the first communication message; The first communication message containing the second thumbnail is sent to the at least two message receiving devices.
2. The method according to claim 1, characterized in that, The bandwidth usage information includes a first data flow, which is the total data flow required to transmit the first image or the first thumbnail to the at least two message receiving devices. The amount of data in the second thumbnail is negatively correlated with the amount of data in the first data flow.
3. The method according to claim 2, characterized in that, Before performing compression on the first image or first thumbnail based on the bandwidth usage information corresponding to the mass sending request to obtain the second thumbnail, the method further includes: The first data flow is obtained by multiplying the size of the first image or the first thumbnail by the number of devices of the at least two message receiving devices.
4. The method according to claim 3, characterized in that, The mass message request is a request to send the first communication message to each of the at least two message receiving devices; Before calculating the product of the size of the first image or the first thumbnail and the number of the at least two message receiving devices to obtain the first data traffic, the method further includes: The number of communication accounts of the message receiving devices corresponding to the mass message request is obtained as the number of devices of the at least two message receiving devices.
5. The method according to claim 3, characterized in that, The mass message request is a request to send the first communication message to a specified group; Before calculating the product of the size of the first image or the first thumbnail and the number of the at least two message receiving devices to obtain the first data traffic, the method further includes: Query the online communication accounts in the specified group; The number of online communication accounts in the specified group is obtained as the number of devices of the at least two message receiving devices.
6. The method according to any one of claims 2 to 5, characterized in that, The step of compressing the first image or the first thumbnail based on the bandwidth usage information corresponding to the mass sending request to obtain the second thumbnail includes: Obtain the compression parameters corresponding to the first data traffic; The first image or the first thumbnail is compressed according to the compression parameters to obtain the second thumbnail.
7. The method according to claim 6, characterized in that, The step of obtaining the compression parameters corresponding to the first data traffic includes: Obtain the traffic range where the first data traffic is located; different traffic ranges correspond to different compression parameters. Query the compression parameters corresponding to the traffic range.
8. The method according to claim 7, characterized in that, Before querying the compression parameters corresponding to the traffic range, the method further includes: Obtain the resolution range of the first image or the first thumbnail; The query for the compression parameters corresponding to the traffic range includes: Query the compression parameters corresponding to the traffic range and the resolution range.
9. The method according to any one of claims 6 to 8, characterized in that, The compression parameters include at least one of the following parameters: Compression level, compression method, compression ratio.
10. The method according to any one of claims 1 to 9, characterized in that, Sending the first communication message containing the second thumbnail to the at least two message receiving devices includes: Acquire the second data traffic, which is the data traffic of the communication system transmitting a thumbnail of the second image; the second image is the image contained in the second communication message; the second communication message is each communication message transmitted within a specified time period corresponding to the current time. If the second data traffic is less than the data traffic threshold, the first communication message containing the second thumbnail is sent to the at least two message receiving devices.
11. The method according to claim 10, characterized in that, The method further includes: If the second data flow is not less than the data flow threshold, a compression operation is performed on the second thumbnail to obtain a third thumbnail; The first communication message containing the third thumbnail is sent to the at least two message receiving devices.
12. The method according to claim 11, characterized in that, The amount of data in the third thumbnail is negatively correlated with the second data flow.
13. The method according to any one of claims 10 to 12, characterized in that, Before acquiring the second data traffic, the process also includes: Each time a communication message containing an image is received, the information of the thumbnail of the image in the communication message is written into the machine log. Based on the machine logs, obtain the data traffic of thumbnails of images transmitted by the communication system within each unit's time period; The acquisition of the second data traffic includes: The second data traffic is obtained based on the data traffic of thumbnails of images transmitted by the communication system within the time periods of each unit.
14. The method according to any one of claims 1 to 13, characterized in that, In the case where the second thumbnail is a thumbnail obtained by compressing the first thumbnail based on the bandwidth usage information corresponding to the mass sending request, the method further includes the following steps before performing compression on the first thumbnail based on the bandwidth usage information corresponding to the mass sending request to obtain the second thumbnail: Obtain the original thumbnail of the first image; If the difference between the aspect ratio of the original thumbnail's resolution and the specified aspect ratio is greater than a difference threshold, the original thumbnail is cropped according to the specified aspect ratio to obtain the first thumbnail. If the difference between the aspect ratio of the original thumbnail and the specified aspect ratio is not greater than the difference threshold, the original thumbnail is obtained as the first thumbnail.
15. The method according to claim 14, characterized in that, Before obtaining the original thumbnail of the first image, the method further includes: Obtain the aspect ratio of the screen resolution of each user device connected to the communication system; The aspect ratio with the highest percentage among the aspect ratios of the screen resolutions of each user device is obtained as the specified aspect ratio.
16. A communication message sending device, characterized in that, The device includes: The request receiving module is used to receive a mass sending request sent by a message sending device. The mass sending request is used to request the sending of a first communication message to at least two message receiving devices. The first communication message includes a first image. The compression module is used to perform a compression operation on the first image or the first thumbnail based on the bandwidth usage information corresponding to the mass sending request, to obtain a second thumbnail; the first thumbnail is a thumbnail of the first image; the bandwidth usage information is used to indicate the bandwidth usage of the server by mass sending the first communication message; A message sending module is used to send the first communication message containing the second thumbnail to the at least two message receiving devices.
17. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the communication message sending method as described in any one of claims 1 to 15.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is loaded and executed by a processor to implement the communication message sending method as described in any one of claims 1 to 15.
19. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, wherein a processor retrieves the computer instructions from the computer-readable storage medium, causing the processor to load and execute them to implement the communication message sending method as described in any one of claims 1 to 15.