Data transmission method, system, electronic device and storage medium

By identifying and converting the text and emoticons input in the live broadcast room into text strings and emoticons on the client side, and transmitting them to the server, rich text display in the live broadcast room is realized, and the problem of low efficiency of mixed transmission of traditional text and images is solved. Reduced data transmission costs and improved interactivity.

CN118433148BActive Publication Date: 2024-10-15GUANGZHOU QIANJUN NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410876618.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-15
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

Traditional text input methods cannot meet the interaction needs between viewers and anchors in the field of live broadcasts, resulting in high data transmission costs and low efficiency. Especially when text and images are mixed and transmitted, the client and server require a large amount of calculation and a large amount of data.

Method used

Receive data input by the user through the client, identify whether there are emoticon pictures and text data, convert the text data into text strings, convert the emoticon pictures into emoticons, insert the text string, form the target text string, and transmit it to the target through the server client, so that it can be displayed as rich text, reducing the amount of calculation and data transmission on the client and server.

Benefits of technology

It effectively reduces the calculation amount and data transmission cost of the client and server, improves the data transmission efficiency, increases the interactivity and participation in the live broadcast room, and reduces the server load and storage cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118433148B_ABST
    Figure CN118433148B_ABST
Patent Text Reader

Abstract

The present invention provides a data transmission method, system, electronic device and storage medium. A client receives user data input by a user and identifies whether there are emoticon pictures and text data in the user data; if there are emoticon pictures and text data in the user data, the text data is converted into a text string and the emoticon pictures are converted into emoticon symbols; the emoticon symbols are inserted into the text string to obtain a target text string of the user data; the target text string is transmitted to multiple target clients through a server, so that each target client changes the target text string into rich text and displays the rich text, wherein the target client is a client in an interactive scene where the client is currently located.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission, and more specifically, to a data transmission method, system, electronic device and storage medium. Background Art

[0002] With the continuous development of the Internet, people's demand for communication methods is also changing. Among the current communication methods, text input is one of the most basic and most commonly used methods. However, traditional text input methods only support basic text input and cannot meet people's needs for richer and more vivid expressions. Especially in the field of live broadcasting, effective interaction between the audience and the anchor can increase the fun and attractiveness of the live broadcast, but traditional text input methods cannot meet this demand.

[0003] Currently, the fun and attractiveness of live broadcast can be increased through the text + picture method. However, in the prior art, it is generally implemented in a transmission method that mixes text and picture content. Specifically, the client is required to pull text and picture resources separately, and upload the text resources and picture resources to the server. The server then integrates the received text resources and picture resources and transmits them to each client in the live broadcast room. This method will result in a large amount of computing on the client and server, and a large amount of data for transmitting text resources and picture resources at the same time, which will lead to high data transmission costs and low efficiency. Summary of the invention

[0004] In view of this, the present invention provides a data transmission method, system, electronic device and storage medium, with the purpose of reducing the computational workload of a client and a server, that is, reducing the cost of data transmission and improving the efficiency of data transmission.

[0005] A first aspect of the present invention provides a data transmission method, applied to a client, the method comprising:

[0006] Receive user data input by a user, and identify whether there are emoticon images and text data in the user data;

[0007] If there are emoticon pictures and text data in the user data, convert the text data into a text string and convert the emoticon pictures into emoticon symbols;

[0008] Inserting the emoticon into the text string to obtain a target text string of the user data;

[0009] The target text string is transmitted to multiple target clients through a server, so that each of the target clients changes the target text string into rich text and displays the rich text, wherein the target client is a client in the interactive scene where the client is currently located.

[0010] Optionally, the method further includes:

[0011] If only emoticon pictures exist in the user data, converting the emoticon pictures into emoticon symbols;

[0012] If only text data exists in the user data, converting the text data into a text string;

[0013] The emoticon or the text string is transmitted as a target text string to multiple target clients, so that each of the target clients converts the target text string into the emoticon image or the text data, and displays the emoticon image or the text data.

[0014] Optionally, converting the emoticon image into an emoticon includes:

[0015] Determine an emoticon associated with the emoticon image from among the emoticons in the pre-configured data list;

[0016] The process of generating the pre-configured data list includes:

[0017] Determine a pre-configured regular expression corresponding to each emoticon image from pre-configured regular expressions;

[0018] Process each emoticon image using a pre-configured regular expression corresponding to the emoticon image to obtain a key value corresponding to each pre-configured emoticon image;

[0019] Determine the key value corresponding to each pre-configured emoticon image as the emoticon symbol corresponding to each emoticon image, and establish an association relationship between each emoticon image and the corresponding emoticon symbol;

[0020] Generate a data list based on each pre-configured emoticon image and its associated emoticon symbols.

[0021] A second aspect of the present invention provides a data transmission method, applied to a target client, the method comprising:

[0022] Receiving a target text string sent by a server, wherein the target text string is obtained by processing user data input by a user by a client in the same interactive scene as the target client;

[0023] Determining whether there are emoticons and text strings in the target text string;

[0024] If there are emoticons and text strings in the target text string, convert the emoticons into corresponding emoticon images, and convert the text string into corresponding text data;

[0025] The emoticon image and the text data are spliced ​​to obtain a rich text of the user data, and the rich text is displayed.

[0026] Optionally, the method further includes:

[0027] If only emoticons exist in the target text string, convert the emoticons into emoticon images, and display the emoticon images;

[0028] If only a text string exists in the target text string, the text string is converted into text data, and the text data is displayed.

[0029] Optionally, converting the emoticon into an emoticon picture includes:

[0030] Determine an emoticon image associated with the emoticon symbol from among the emoticon images in the pre-configured data list;

[0031] The process of generating the pre-configured data list includes:

[0032] Determine a pre-configured regular expression corresponding to each emoticon image from pre-configured regular expressions;

[0033] Process each emoticon image using a pre-configured regular expression corresponding to the emoticon image to obtain a key value corresponding to each pre-configured emoticon image;

[0034] Determine the key value corresponding to each pre-configured emoticon image as the emoticon symbol corresponding to each emoticon image, and establish an association relationship between each emoticon image and the corresponding emoticon symbol;

[0035] Generate a data list based on each pre-configured emoticon image and its associated emoticon symbols.

[0036] A third aspect of the present invention provides a data transmission system, applied to a client, the system comprising an emoticon processing module and a text parsing module;

[0037] The emoticon processing module is used to receive user data input by the user, and identify whether there are emoticon pictures and text data in the user data; if there are emoticon pictures and text data in the user data, convert the text data into a text string, and convert the emoticon pictures into emoticons;

[0038] A text parsing module is used to insert the emoticon into the text string to obtain a target text string of the user data; the target text string is transmitted to multiple target clients through a server, so that each of the target clients converts the target text string into rich text and displays the rich text, wherein the target client is a client in the interactive scene where the client is currently located.

[0039] A fourth aspect of the present invention provides a data transmission system, which is applied to a target client, and the system includes a user interface module and a text parsing module:

[0040] The text parsing module is used to receive a target text string sent by a server, wherein the target text string is obtained by processing user data input by a user in the same interactive scene as the target client; determine whether there are emoticons and text strings in the target text string; if there are emoticons and text strings in the target text string, convert the emoticons into corresponding emoticon images, and convert the text string into corresponding text data; splice the emoticon images and the text data to obtain rich text of the user data;

[0041] A user interface module is used to display the rich text.

[0042] The fifth aspect of the present invention provides an electronic device, comprising: a processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; and the memory is used to store a program, wherein the program is used to implement the data transmission method provided in the first aspect of the present invention, or the data transmission method provided in the second aspect of the present invention.

[0043] The sixth aspect of the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used to execute the data transmission method provided in the first aspect of the present invention, or the data transmission method provided in the second aspect of the present invention.

[0044] The present invention provides a data transmission method, system, electronic device and storage medium. When a client receives user data input by a user, it identifies whether there are emoticon pictures and text data in the user data; if there are emoticon pictures and text data in the user data, the text data is converted into a text string, and the emoticon pictures are converted into emoticon symbols; the emoticon symbols are inserted into the text string to obtain a target text string of the user data; the target text string is transmitted to multiple target clients through a server, so that each target client changes the target text string into rich text and displays the rich text, wherein the target client is a client in an interactive scene where the client is currently located. It can be seen that the technical solution provided by the present invention can convert text data into text strings and convert emoticon pictures into emoticon symbols when the user data input by the user contains text data and emoticon pictures. Finally, the emoticon symbols are inserted into the text strings to obtain the corresponding target text strings. There is no need to pull text and image resources separately, which can effectively reduce the client's calculation amount and data transmission volume, thereby reducing data transmission costs and improving data transmission efficiency; and when the server forwards data, it only needs to directly forward the corresponding target text string without integrating text resources and image resources, which can further reduce the server's calculation amount and data transmission volume, reduce server load, improve data transmission efficiency and reduce data storage costs. Finally, after receiving the target text string, the target client can replace the target text string with rich text and display the rich text, thereby achieving the purpose of interaction among customers in the interactive scene, and increasing the interactivity and sense of participation among customers. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0046] Figure 1 A schematic diagram of a data transmission method according to an embodiment of the present invention;

[0047] Figure 2 An example diagram of a user inputting corresponding user data in a user interface provided by an embodiment of the present invention;

[0048] Figure 3 An example diagram of a data list provided by an embodiment of the present invention;

[0049] Figure 4 An example diagram of a target text string provided by an embodiment of the present invention;

[0050] Figure 5 A schematic diagram of a flow chart of another data transmission method provided by an embodiment of the present invention;

[0051] Figure 6 A flowchart of another data transmission method provided by an embodiment of the present invention;

[0052] Figure 7 A schematic diagram of the structure of a data transmission system provided by an embodiment of the present invention;

[0053] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0056] In order to better understand the present invention, the technical terms used in the present invention are explained below:

[0057] Rich text: refers to text containing non-standard text formats or embedded objects, such as HTML, RTF, rich text documents, etc. In the present invention, rich text refers to a new type of text data generated by inserting emoticon images into text.

[0058] Runtime: refers to the Objective-C runtime system, which is the core of the Objective-C language. It provides an interface for interacting with the underlying system and manages the life cycle of Objective-C objects and other core functions such as message passing. The Objective-C runtime system makes the Objective-C language dynamic and flexible, and can dynamically create, modify, and find classes, objects, and messages while the program is running.

[0059] See also Figure 1 , shows a flow chart of a data transmission method provided by an embodiment of the present invention, the data transmission method specifically comprises the following steps:

[0060] S101: The client receives user data input by the user, and identifies whether there are emoticon pictures and text data in the user data; if there are emoticon pictures and text data in the user data, execute step S102.

[0061] During the specific execution of step S101, after the user enters a certain interactive scene through the client, the user data that the user wants to input can be input through the user interface of the client. When the client receives the user data input by the user through the user interface, the client can identify the user data to determine whether there are emoticon images and text data in the user data. If it is determined that there are emoticon images and text data in the user data, step S102 can be executed.

[0062] For example, when a user is broadcasting a live broadcast through a client, the user can enter the corresponding text data in the input control UITextView of the user interface displayed on the client, and select the emoticon image to be sent from the pre-configured emoticon images. After detecting that the user has selected the corresponding emoticon image, the client can use the NSTextAttachment class with the emojiStr attribute dynamically added to concatenate the emoticon of the emoticon image identification number emojiStr value selected by the user with the plain text data to obtain the corresponding user data, such as Figure 2 The client is installed with iOS system, which includes NSTextAttachment class, and uses runtime technology to dynamically add emojiStr attribute in NSTextAttachment class in advance, so that the user can input text data and select corresponding emoticon pictures through input control UITextView, and then display the text data and emoticon pictures together.

[0063] It should be noted that the NSTextAttachment class is a text attachment class in the iOS system, which can be used to create non-text elements in rich text, such as images and so on.

[0064] It should also be noted that the pre-configured emoticon pictures may include fixed emoticon pictures in the live broadcast room, and may also include user-defined emoticon pictures. Specifically, the user adds the emoticon pictures that he is interested in to the fixed emoticon pictures to achieve the purpose of expanding the emoticon pictures. This solves the problem in the prior art that due to the limited number of emoticon pictures, users are limited in expressing their emotions, that is, the user's demand for more emoticons cannot be met. At the same time, the present invention does not require the use of a third-party rich text editor or rich text library, reduces the dependency and risk of the project, and can meet the needs of various projects or scenarios.

[0065] It is worth noting that if the user data contains both text data and emoticon images, the user data can be converted into rich text.

[0066] S102: The client converts the text data into a text string and converts the emoticon image into an emoticon symbol.

[0067] In the specific process of executing step S102, a regular expression corresponding to each emoticon picture can be pre-defined, and each emoticon picture and its regular expression can be used to generate an emoticon symbol for each emoticon picture, and a corresponding data list can be generated based on each emoticon picture and its emoticon chart; so that when it is determined that there are text data and emoticon pictures in the user data, the user data is analyzed to determine the text data and emoticon pictures in the user data, so as to convert the text data into a corresponding text string, and determine the emoticon symbol corresponding to the emoticon picture from the pre-configured data list.

[0068] For example, you can pre-define smiling emoticons (such as Figure 2 The regular expression corresponding to the smiling expression picture shown in ) is "\\[[_a-zA-Z0-9\\u4e00-\\u9fa5]+\\]", and the corresponding emoticon symbol can be obtained by processing the smiling expression picture with the regular expression: "[:)]".

[0069] Optionally, the generation process of the pre-configured data list may specifically be: determining a regular expression corresponding to each pre-configured emoticon image from pre-configured regular expressions; processing each pre-configured emoticon image using the regular expression corresponding to it to obtain a key value corresponding to each pre-configured emoticon image; determining the key value corresponding to each pre-configured emoticon image as the emoticon symbol corresponding to each emoticon image, and establishing an association relationship between each emoticon image and the corresponding emoticon symbol; generating a data list according to each pre-configured emoticon image and the emoticon symbol with which it has an associated relationship.

[0070] For example, the pre-configured emoticon pictures may be a snickering emoticon picture, a smiling emoticon picture, a wronged emoticon picture, a vomiting emoticon picture, a face-covering emoticon picture, a laughing and crying emoticon picture, and a squinting emoticon picture; firstly, the corresponding emoticon picture is processed using the pre-configured regular expression corresponding to each emoticon picture to obtain the emoticon symbol corresponding to each emoticon picture; secondly, an association relationship between each emoticon picture and the corresponding emoticon symbol is established in the form of a label; finally, a data list is generated according to each emoticon picture and the emoticon symbol with which it is associated, such as Figure 3 shown.

[0071] Accordingly, according to the association relationship between the emoticon picture and the emoticon symbol, the emoticon symbol associated with the emoticon picture in the user data can be determined from the emoticon symbols in the pre-configured data list.

[0072] S103: The client inserts the emoticon into the text string to obtain a target text string of the user data.

[0073] In the specific process of executing step S103, after obtaining the corresponding text string and emoticon, the client can first determine the positional relationship between the text data and the emoticon image in the user data, and can use the runtime technology to use the NSTextAttachment class with dynamically added emojiStr attributes to insert the emoticon into the text string according to the determined positional relationship to obtain the target text string carrying the emoticon, thereby realizing the insertion of emoticons, parsing and adapting to different text contents, and being able to flexibly combine emoticons with text, thereby solving the problems in the prior art of being unable to flexibly combine emoticons with text and lacking creativity, and being unable to automatically adapt corresponding emoticons according to text content, resulting in insufficient coordination between emoticons and text content.

[0074] It should be noted that the positional relationship between the text data and the expression picture can be: a front-to-back relationship, an intermediate relationship, etc., which is not limited in this embodiment of the present invention.

[0075] S104: The client transmits the target text string to multiple target clients through the server.

[0076] In the process of executing step S104, after obtaining the target text string corresponding to the user data, the client can directly transmit the target text string to multiple target clients through the server. It can be seen that the client does not need to obtain text data resources and emoticon image resources separately, and the server does not need to integrate and transmit text data resources and emoticon image resources. It only needs to transmit a plain text string, which greatly reduces the amount of data calculation and data transmission. It can not only improve the efficiency of data transmission, but also reduce the storage cost of the server and reduce the server load.

[0077] It should be noted that the target client is a client in the interactive scene where the client is currently located. The target client can be the client or any other client in the interactive scene except the client.

[0078] For example, a user enters a live broadcast room through a client, and enters corresponding user data in the user interface of the live broadcast room, such as Figure 2 As shown, the client processes the user data accordingly and obtains the corresponding target text string (hello [:)]). When it is detected that the user clicks the send button, the client transmits the target text string to the server, as shown in Figure 4 As shown, the server then transmits the target text string to each target client in the live broadcast room; wherein each target client includes the client, the anchor client and other clients.

[0079] S105: When the target client receives the target text string sent by the server, it determines whether there are emoticons and text strings in the target text string; if there is a text string of emoticons in the target text string, execute step S106.

[0080] In the specific process of executing step S105, the target client can receive the target text string (plain text) sent by the service through the input control callback textViewDidChange, and detect whether there are emoticons and text strings in the target text string; if there are emoticons and text strings, step S106 can be executed.

[0081] S106: The target client converts the emoticon into a corresponding emoticon image, converts the text string into corresponding text data, and concatenates the emoticon image and the text data to obtain a rich text of the user data, and displays the rich text.

[0082] In the specific process of executing step S106, when determining that the target text string contains a text string and an emoticon, the target client converts the text string into text data, selects an emoticon image corresponding to the emoticon from a pre-configured data list, and finally splices the text data and the emoticon image to obtain corresponding rich text, and displays the obtained rich text. The process of generating the data list can refer to the process of generating the data list shown in step S102, and is not limited in this embodiment of the present invention.

[0083] In some embodiments, the target client can use the NSTextAttachment class with dynamically added emojiStr attributes to splice the emoticon image selected by the user with the text data to obtain the corresponding rich text, and finally display the obtained rich text to achieve the purpose of the user interacting with other interactions in the same interactive scene.

[0084] In an embodiment of the present invention, the data list includes multiple emoticon pictures and emoticon symbols with associated relationships therewith, so that when it is determined that an emoticon symbol exists in a target text string, the emoticon picture that has an associated relationship with the emoticon symbol in the target text string can be determined from the emoticon pictures in the data list based on the pre-set association relationship between the emoticon symbol and the emoticon picture.

[0085] The present invention provides a data transmission method. When a client receives user data input by a user, it identifies whether there are emoticon pictures and text data in the user data; if there are emoticon pictures and text data in the user data, the text data is converted into a text string, and the emoticon pictures are converted into emoticon symbols; the emoticon symbols are inserted into the text string to obtain a target text string of the user data; the target text string is transmitted to at least one target client through a server, so that each target client changes the target text string into rich text and displays the rich text, wherein the target client is a client in an interactive scene where the client is currently located. It can be seen that the technical solution provided by the present invention is that, when the user data input by the user contains text data and emoticon pictures, the client can convert the text data into a text string and the emoticon picture into an emoticon symbol, and finally insert the emoticon symbol into the text string to obtain the corresponding target text string, without having to pull text and image resources separately, which can effectively reduce the client's calculation amount and data transmission amount, thereby reducing the data transmission cost and improving the data transmission efficiency; and when the server forwards data, it only needs to directly forward the corresponding target text string without integrating the text resources and image resources, which can further reduce the server's calculation amount and data transmission amount, reduce the server load, improve data transmission efficiency and reduce data storage costs, and finally, after receiving the target text string, the target client can replace the target text string with rich text and display the rich text, thereby achieving the purpose of interaction among customers in the interactive scene, and increasing the interactivity and sense of participation among customers.

[0086] Furthermore, based on the data transmission method provided in the above embodiment of the present invention, the embodiment of the present invention also includes the following contents:

[0087] In some embodiments, when the client determines that the user data contains text data and emoticons, the client converts the text data into a text string and transmits the text string as a target text string to multiple target clients, so that each target client, when determining that the target text string only contains a text string, converts the text string into text data and displays the text data.

[0088] In some embodiments, when there is an emoticon picture but no text data in the user data, the client can convert the emoticon picture into an emoticon symbol, and use the emoticon as the target text string to transmit the target text string to multiple target clients through the server, so that when the target client receives the target text string, if it is determined that the text string only includes emoticons, the emoticon symbol can be converted into an emoticon picture and the emoticon picture can be displayed.

[0089] It should be noted that the process of converting emoticon images into emoticon symbols by the client can be seen in Figure 1 The corresponding contents disclosed in step S102 are not described in detail in this embodiment of the present invention; the process of converting emoticons into emoticon pictures by the target client can be referred to in Figure 1 The corresponding contents disclosed in step S106 will not be described in detail in this embodiment of the present invention.

[0090] In an embodiment of the present invention, when there is an emoticon picture in the user data input by the user, the client can convert the text data into a text string and the emoticon picture into an emoticon symbol, and use the emoticon symbol as the target text string, and finally transmit the obtained plain text (target text string) to the target client, without the need to separately pull and transmit image resources, which can effectively reduce the client's computing power and data transmission volume, thereby reducing the data transmission cost and improving the data transmission efficiency; and when the server forwards data, it can directly forward the corresponding target text string (plain text), which can further reduce the server's data transmission volume, reduce the server load, improve data transmission efficiency and reduce data storage costs. Finally, after receiving the target text string, the target client can replace the target text string with an emoticon picture and display the emoticon picture, thereby achieving the purpose of interaction among various customers in the interactive scene, and increasing the interactivity and sense of participation among various customers.

[0091] See also Figure 5 , shows another data transmission method provided by an embodiment of the present invention, the data transmission method is applied to a client, and the data transmission method specifically includes the following steps:

[0092] S501: Receive user data input by the user, and identify whether there are emoticon pictures and text data in the user data; if there are emoticon pictures and text data in the user data, execute step S502; if there are emoticon pictures but no text data in the user data, execute step S505; if there are text data but no emoticons in the user data, execute step S507.

[0093] S502: Convert text data into text strings, and convert emoticon images into emoticon symbols.

[0094] S503: Insert the emoticon into the text string to obtain a target text string of the user data.

[0095] S504: The target text string is transmitted to at least one target client through the server, so that each target client changes the target text string into rich text and displays the rich text, wherein the target client is a client in the interactive scene where the client is currently located.

[0096] In the specific execution process of step S501-step S504, the specific execution process and implementation principle of step S501-step S502 are the same as those provided in the above embodiment of the present invention. Figure 1 The specific execution process and implementation principle of steps S101 to S104 are the same, and reference may be made to the contents disclosed in steps S101 to S104, which will not be described in detail in this embodiment of the present invention.

[0097] S505: Convert the emoticon image into emoticon symbols.

[0098] In an embodiment of the present invention, when there is an emoticon picture but no text data in the user data, the client can convert the emoticon picture into an emoticon symbol, and use the emoticon symbol as the target text string, so as to transmit the target text string to multiple target clients through the server, so that when the target client receives the target text string, if it is determined that the text string only includes emoticons, the emoticon symbol can be converted into an emoticon picture and the emoticon picture can be displayed.

[0099] It should be noted that the process of converting emoticon images into emoticon symbols by the client can be seen in Figure 1 The corresponding contents disclosed in step S102 are not described in detail in this embodiment of the present invention; the process of converting emoticons into emoticon pictures by the target client can be referred to in Figure 1 The corresponding contents disclosed in step S106 will not be described in detail in this embodiment of the present invention.

[0100] S506: Transmitting the emoticon as the target text string to the at least one target client, so that each target client converts the target text string into an emoticon image and displays the emoticon image.

[0101] S507: Convert the text data into a text string.

[0102] In an embodiment of the present invention, when the client determines that the user data contains text data but no emoticons, the client converts the text data into a text string, and transmits the text string as a target text string to multiple target clients, so that each target client, when determining that the target text string only contains the text string, converts the text string into text data and displays the text data.

[0103] S508: Transmitting the text string as a target text string to the at least one target client, so that each target client converts the target text string into text data and displays an emoticon image or text data.

[0104] The data transmission method provided by the present invention is applied to a client. When the user data input by the user contains text data and emoticon pictures, the client can convert the text data into a text string and convert the emoticon picture into an emoticon symbol. Finally, the emoticon symbol is inserted into the text string to obtain a corresponding target text string. There is no need to pull text and picture resources separately, which can effectively reduce the calculation amount and data transmission amount of the client, thereby reducing the data transmission cost and improving the data transmission efficiency. When forwarding data, the server directly forwards the corresponding target text string without integrating text resources and picture resources, which can further reduce the calculation amount and data transmission amount of the server, reduce the server load, improve data transmission efficiency and reduce data storage costs. Finally, after receiving the target text string, the target client can change the target text string into rich text and display the rich text, thereby achieving the purpose of interaction among various customers in the interactive scene and increasing the interactivity and participation among various customers.

[0105] See also Figure 6 , shows another data transmission method provided by an embodiment of the present invention, the data transmission method is applied to a target client, and the data transmission method specifically includes the following steps:

[0106] S601: Receive a target text string sent by a server.

[0107] In the embodiment of the present invention, the target text string is obtained by processing the user data input by the user at the client in the same interactive scene as the target client. The specific process and implementation principle of the client processing the user data input by the user are the same as those provided in the above embodiment of the present invention. Figure 1 The specific execution process and implementation principle of steps S101 to S104 are the same, and reference may be made to the contents disclosed in steps S101 to S104, which will not be described in detail in this embodiment of the present invention.

[0108] S602: Determine whether there are emoticons and text strings in the target text string; if there are emoticons and text strings in the target text string, execute step S603; if there are emoticons in the target text string but no text string, execute step S605; if there are text strings but no emoticons in the target text string, execute step S606.

[0109] S603: Convert the emoticon into a corresponding emoticon image, and convert the text string into corresponding text data.

[0110] S604: splicing the emoticon image and the text data to obtain rich text of the user data, and displaying the rich text.

[0111] In the specific execution process of step S603-step S604, the specific execution process and implementation principle of step S603-step S604 are the same as those provided in the above embodiment of the present invention. Figure 1 The specific execution process and implementation principle of steps S101 to S104 are the same, and reference may be made to the contents disclosed in steps S101 to S104, which will not be described in detail in this embodiment of the present invention.

[0112] S605: Convert the emoticon into an emoticon image, and display the emoticon image.

[0113] In the embodiment of the present invention, when the target client receives the target text string, if it is determined that the text string only includes emoticons, the emoticons may be converted into emoticon images and the emoticon images may be displayed.

[0114] It should be noted that the process of converting emoticons into emoticon images by the target client can be seen in Figure 1 The corresponding contents disclosed in step S106 will not be described in detail in this embodiment of the present invention.

[0115] S606: Convert the text string into text data, and display the text data.

[0116] In the embodiment of the present invention, when determining that the target text string only exists as a text string, the target client converts the text string into text data and displays the text data.

[0117] The data transmission system provided by the present invention is applied to a target client, receives a target text string sent by a server, and in the case where the target text string includes emoticons and text strings, converts the target text string into rich text, and displays the rich text, so as to realize the interaction between various users in an interactive scene, and improve the interaction and fun between various users. Wherein, the target text string is converted into a text string and the emoticon picture is converted into an emoticon when the user data input by the user exists text data and emoticon pictures, and finally the emoticon is inserted into the text string to obtain, without the need to pull text and picture resources separately, which can effectively reduce the calculation amount and data transmission amount of the client, thereby reducing the data transmission cost and improving the data transmission efficiency; and when the server forwards data, it can directly forward the corresponding target text string, without the need to integrate text resources and picture resources, which can further reduce the calculation amount and data transmission amount of the server, reduce the server load, improve data transmission efficiency and reduce data storage cost, and finally, after receiving the target text string, the target client can convert the target text string into rich text and display the rich text, so as to achieve the purpose of interaction between various customers in the interactive scene, and increase the interactivity and participation between various customers.

[0118] Based on the data transmission method provided by the above embodiment of the present invention, the embodiment of the present invention also provides a data transmission system, which includes a user interface module, an emoticon processing module and a text parsing module. Figure 7 shown.

[0119] It should be noted that for each client in the same interactive scene, the client can act as a client to receive user data input by the user, and process the received user data to obtain the corresponding target text string; it can also act as a target client to receive the target text string sent by the server, and process the received target text string to obtain the corresponding emoticon rich text (i.e. text data + emoticon chart) or text data or emoticon picture, and display the corresponding emoticon rich text or text data or emoticon picture with an attribute string. Therefore, for each client in the same interactive scene, it is necessary to install Figure 5 The data transmission system shown.

[0120] It is worth mentioning that the user interface module is the interface for users to interact with the system, which can display the processed result data to the user and other users in the same interactive scenario with the user; the emoticon processing module and the text parsing module work together to convert the user data entered by the user into rich text, and automatically adapt emoticons according to the text content.

[0121] In an embodiment of the present invention, when the interactive scene is a live broadcast room, the data transmission system may further include a live broadcast interactive module, which allows each user in the live broadcast room to send corresponding barrage (user data) or emoticon pictures in the live broadcast room, thereby increasing the interaction and fun between users and anchors.

[0122] Based on the embodiment of the present invention Figure 5 The data transmission method provided, accordingly, an embodiment of the present invention also provides a data transmission system, applied to a client, the system comprising:

[0123] The emoticon processing module is used to receive user data input by the user and identify whether there are emoticon pictures and text data in the user data; if there are emoticon pictures and text data in the user data, the text data is converted into a text string and the emoticon picture is converted into an emoticon;

[0124] The emoticon processing module is used to receive user data input by the user, and when recognizing that the user data contains emoticon pictures and text data, it can use regular expressions to convert the recognized emoticon pictures into corresponding emoticons.

[0125] The text parsing module is used to insert emoticons into a text string to obtain a target text string of user data; the target text string is transmitted to multiple target clients through a server, so that each target client converts the target text string into rich text and displays the rich text, wherein the target client is a client in the interactive scene where the client is currently located.

[0126] The file parsing module is used to parse the user data to obtain the positional relationship between the text data and the emoticon pictures in the user data, and insert the emoticons obtained by the emoticon processing module into the text string according to the positional relationship to achieve a flexible combination of emoticons and text content.

[0127] The specific principles and execution processes of each module in the data transmission system disclosed in the above embodiment of the present invention are the same as the data transmission method disclosed in the above embodiment of the present invention. Figure 4 The corresponding parts of the disclosed data transmission method will not be described in detail here.

[0128] The data transmission system provided by the present invention can convert the text data into a text string and the emoticon into an emoticon symbol when the user data input by the user contains text data and emoticon images, and finally insert the emoticon symbol into the text string to obtain the corresponding target text string, without separately pulling text and image resources, which can effectively reduce the client's calculation amount and data transmission amount, thereby reducing the data transmission cost and improving the data transmission efficiency; and when the server forwards data, it only needs to directly forward the corresponding target text string without integrating the text resources and the image resources, which can further reduce the server's calculation amount and data transmission amount, reduce the server load, improve the data transmission efficiency and reduce the data storage cost, and finally, after receiving the target text string, the target client can replace the target text string with rich text and display the rich text, thereby achieving the purpose of interaction among various customers in the interactive scene, and increasing the interactivity and participation among various customers.

[0129] Optionally, the emoticon processing module is also used to convert the emoticon image into an emoticon if only emoticon images exist in the user data; if only text data exists in the user data, convert the text data into a text string; transmit the emoticon or text string as a target text string to multiple target clients, so that each target client converts the target text string into an emoticon image or text data, and displays the emoticon image or text data.

[0130] Optionally, an emoji processing module for converting emoji images into emojis, specifically for:

[0131] Determine an emoticon associated with the emoticon image from among the emoticons in the pre-configured data list;

[0132] Among them, the generation process of the pre-configured data list includes: determining the regular expression corresponding to each pre-configured emoticon image from the pre-configured regular expressions; processing the regular expression corresponding to each pre-configured emoticon image to obtain the key value corresponding to each pre-configured emoticon image; determining the key value corresponding to each pre-configured emoticon image as the emoticon symbol corresponding to each emoticon image, and establishing an association relationship between each emoticon image and the corresponding emoticon symbol; generating a data list according to each pre-configured emoticon image and the emoticon symbol with which it has an associated relationship.

[0133] Based on the embodiment of the present invention Figure 6 The data transmission method provided, accordingly, an embodiment of the present invention also provides a data transmission system, applied to a target client, the system comprising:

[0134] The text parsing module is used to receive a target text string sent by a server, wherein the target text string is obtained by processing user data input by a client in the same interactive scene as the target client; determine whether there are emoticons and text strings in the target text string; if there are emoticons and text strings in the target text string, convert the emoticons into corresponding emoticon images, and convert the text strings into corresponding text data; splice the emoticon images and text data to obtain rich text of the user data;

[0135] User interface module for displaying rich text.

[0136] The specific principles and execution processes of each module in the data transmission system disclosed in the above embodiment of the present invention are the same as the data transmission method disclosed in the above embodiment of the present invention. Figure 5 The corresponding parts of the disclosed data transmission method will not be described in detail here.

[0137] The data transmission system provided by the present invention is applied to a target client, receives a target text string sent by a server, and in the case where the target text string includes emoticons and text strings, converts the target text string into rich text, and displays the rich text, so as to realize the interaction between various users in an interactive scene, and improve the interaction and fun between various users. Wherein, the target text string is converted into a text string and the emoticon picture is converted into an emoticon when the user data input by the user exists text data and emoticon pictures, and finally the emoticon is inserted into the text string to obtain, without the need to pull text and picture resources separately, which can effectively reduce the calculation amount and data transmission amount of the client, thereby reducing the data transmission cost and improving the data transmission efficiency; and when the server forwards data, it can directly forward the corresponding target text string, without the need to integrate text resources and picture resources, which can further reduce the calculation amount and data transmission amount of the server, reduce the server load, improve data transmission efficiency and reduce data storage cost, and finally, after receiving the target text string, the target client can convert the target text string into rich text and display the rich text, so as to achieve the purpose of interaction between various customers in the interactive scene, and increase the interactivity and participation between various customers.

[0138] Optionally, the text parsing module is also used to: if only emoticons exist in the target text string, convert the emoticons into emoticon images, and display the emoticon images through the user interface module; if only text strings exist in the target text string, convert the text strings into text data, and display the text data through the user interface module.

[0139] Optional, a text parsing module that converts emojis into emoji images, specifically used for:

[0140] Determine an emoticon image associated with the emoticon symbol from among the emoticon images in the pre-configured data list;

[0141] Among them, the generation process of the pre-configured data list includes: determining the regular expression corresponding to each pre-configured emoticon image from the pre-configured regular expressions; processing the regular expression corresponding to each pre-configured emoticon image to obtain the key value corresponding to each pre-configured emoticon image; determining the key value corresponding to each pre-configured emoticon image as the emoticon symbol corresponding to each emoticon image, and establishing an association relationship between each emoticon image and the corresponding emoticon symbol; generating a data list according to each pre-configured emoticon image and the emoticon symbol with which it has an associated relationship.

[0142] The present application embodiment provides an electronic device, such as Figure 8As shown, the electronic device includes a processor 801 and a memory 802, the memory 802 is used to store program codes and data for data transmission, and the processor 801 is used to call program instructions in the memory to execute the steps shown in the data transmission method in the above embodiment.

[0143] An embodiment of the present application provides a storage medium, which includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the data transmission method shown in the above embodiment.

[0144] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0145] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0146] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0147] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A data transmission method, characterized in that: Applied to a client, the method comprises: Receive user data input by a user, and identify whether there are emoticon images and text data in the user data; If there are emoticon pictures and text data in the user data, the text data is converted into a text string, and the emoticon pictures are converted into emoticon symbols; wherein, the conversion of the emoticon pictures into emoticon symbols includes: determining the emoticon symbols associated with the emoticon pictures from the emoticon symbols in the pre-configured data list; the generation process of the pre-configured data list includes: determining the regular expression corresponding to each pre-configured emoticon picture from the pre-configured regular expressions; processing each pre-configured emoticon picture using the regular expression corresponding to the pre-configured regular expression to obtain the key value corresponding to each pre-configured emoticon picture; determining the key value corresponding to each pre-configured emoticon picture as the emoticon symbol corresponding to each emoticon picture, and establishing the association relationship between each emoticon picture and the corresponding emoticon symbol; generating a data list according to each pre-configured emoticon picture and the emoticon symbol associated with it; Determine the positional relationship between the text data and the emoticon image in the user data, and insert the emoticon into the text string according to the positional relationship by using the runtime technology and the NSTextAttachment class to which the emojiStr attribute is dynamically added, to obtain a target text string carrying the emoticon; wherein the target text string includes the emoticon and the text string; The target text string is transmitted to multiple target clients through a server, so that each target client converts the emoticons in the target text string into corresponding emoticon images and converts the text string into corresponding text data, and uses the NSTextAttachment class to which the emojiStr attribute is dynamically added to splice the emoticon image with the text data to obtain and display corresponding rich text, wherein the target client is a client in the interactive scene where the client is currently located.

2. The method according to claim 1, characterized in that The method further comprises: If only emoticon pictures exist in the user data, converting the emoticon pictures into emoticon symbols; If only text data exists in the user data, converting the text data into a text string; The emoticon or the text string is transmitted as a target text string to multiple target clients, so that each of the target clients converts the target text string into the emoticon image or the text data, and displays the emoticon image or the text data.

3. A data transmission method, characterized in that: Applied to a target client, the method comprises: Receive a target text string sent by a server, wherein the target text string is a text string converted by a client in the same interactive scene as the target client, and the emoticon image in the user data input by the user is converted into an emoticon, and the positional relationship between the text data and the emoticon image in the user data is determined, and the emoticon is inserted into the text string according to the positional relationship by using the NSTextAttachment class to which the emojiStr attribute is dynamically added through runtime technology to obtain a target text string carrying the emoticon; the client converts the emoticon image into an emoticon, including: Determine the emoticons associated with the emoticon picture from the emoticons in the list; the generation process of the pre-configured data list includes: determining the regular expression corresponding to each pre-configured emoticon picture from the pre-configured regular expressions; processing the regular expression corresponding to each pre-configured emoticon picture to obtain the key value corresponding to each pre-configured emoticon picture; determining the key value corresponding to each pre-configured emoticon picture as the emoticon corresponding to each emoticon picture, and establishing the association between each emoticon picture and the corresponding emoticon symbol; generating a data list according to each pre-configured emoticon picture and the emoticon symbol associated with it; the user data includes text data and emoticon pictures; Determining whether there are emoticons and text strings in the target text string; If there are emoticons and text strings in the target text string, convert the emoticons into corresponding emoticon images, and convert the text string into corresponding text data; The NSTextAttachment class with the emojiStr attribute dynamically added is used to splice the emoticon image with the text data to obtain corresponding rich text, and the rich text is displayed.

4. The method according to claim 3, characterized in that The method further comprises: If only emoticons exist in the target text string, convert the emoticons into emoticon images, and display the emoticon images; If only a text string exists in the target text string, the text string is converted into text data, and the text data is displayed.

5. The method according to claim 3 or 4, characterized in that: The step of converting the emoticon into an emoticon picture comprises: Determine an emoticon image associated with the emoticon symbol from among the emoticon images in the pre-configured data list; The process of generating the pre-configured data list includes: Determine a pre-configured regular expression corresponding to each emoticon image from pre-configured regular expressions; Process each emoticon image using a pre-configured regular expression corresponding to the emoticon image to obtain a key value corresponding to each pre-configured emoticon image; Determine the key value corresponding to each pre-configured emoticon image as the emoticon symbol corresponding to each emoticon image, and establish an association relationship between each emoticon image and the corresponding emoticon symbol; Generate a data list based on each pre-configured emoticon image and its associated emoticon symbols.

6. A data transmission system, characterized in that: Applied to the client, the system includes an emoticon processing module and a text parsing module; An emoticon processing module is used to receive user data input by a user, and identify whether there are emoticon pictures and text data in the user data; if there are emoticon pictures and text data in the user data, convert the text data into a text string, and convert the emoticon picture into an emoticon symbol; wherein, converting the emoticon picture into an emoticon symbol comprises: determining an emoticon symbol associated with the emoticon picture from each emoticon symbol in a pre-configured data list; the generation process of the pre-configured data list comprises: determining a regular expression corresponding to each pre-configured emoticon picture from each pre-configured regular expression; processing each pre-configured emoticon picture using the regular expression corresponding to the pre-configured regular expression to obtain a key value corresponding to each pre-configured emoticon picture; determining the key value corresponding to each pre-configured emoticon picture as an emoticon symbol corresponding to each emoticon picture, and establishing an association relationship between each emoticon picture and the corresponding emoticon symbol; generating a data list according to each pre-configured emoticon picture and the emoticon symbol associated with the pre-configured emoticon picture; A text parsing module is used to determine the positional relationship between text data and emoticon images in user data, and insert the emoticon into the text string according to the positional relationship by using the NSTextAttachment class to which the emojiStr attribute is dynamically added through runtime technology to obtain a target text string carrying the emoticon; wherein the target text string includes the emoticon and the text string; the target text string is transmitted to multiple target clients through a server, so that each of the target clients converts the emoticon in the target text string into a corresponding emoticon image and the text string into corresponding text data, and uses the NSTextAttachment class to which the emojiStr attribute is dynamically added to splice the emoticon image with the text data to obtain and display corresponding rich text, wherein the target client is a client in the interactive scene where the client is currently located.

7. A data transmission system, characterized in that: Applied to the target client, the system includes a user interface module and a text parsing module: The text parsing module is used to receive a target text string sent by a server, wherein the target text string is a client in the same interactive scene as the target client. The client converts the text data in the user data input by the user into a text string and converts the emoticon picture in the user data into an emoticon symbol, and determines the positional relationship between the text data and the emoticon picture in the user data. The emoticon symbol is inserted into the text string according to the positional relationship by using the NSTextAttachment class to which the emojiStr attribute is dynamically added through runtime technology to obtain a target text string carrying the emoticon symbol; the client converts the emoticon picture into an emoticon symbol, including: determining the emoticon symbol associated with the emoticon picture from each emoticon in a pre-configured data list; the generation process of the pre-configured data list includes: determining each pre-configured regular expression from each pre-configured regular expression. a regular expression corresponding to an emoticon image; use the pre-configured regular expression corresponding to each emoticon image to process it, and obtain the key value corresponding to each pre-configured emoticon image; determine the key value corresponding to each pre-configured emoticon image as the emoticon symbol corresponding to each emoticon image, and establish an association relationship between each emoticon image and the corresponding emoticon symbol; generate a data list according to each pre-configured emoticon image and the emoticon symbol with which there is an association relationship; the user data includes text data and emoticon images; determine whether there are emoticons and text strings in the target text string; if there are emoticons and text strings in the target text string, convert the emoticons into corresponding emoticon images, and convert the text string into corresponding text data; use the NSTextAttachment class with the emojiStr attribute dynamically added to splice the emoticon image with the text data to obtain the corresponding rich text; A user interface module is used to display the rich text.

8. An electronic device, characterized in that: include: A processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program, and the program is used to implement the data transmission method according to any one of claims 1-2, or the data transmission method according to any one of claims 3-5.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the data transmission method according to any one of claims 1-2, or the data transmission method according to any one of claims 3-5.