WO2017054597A1 - 表情字符串的处理方法及装置 - Google Patents
表情字符串的处理方法及装置 Download PDFInfo
- Publication number
- WO2017054597A1 WO2017054597A1 PCT/CN2016/096919 CN2016096919W WO2017054597A1 WO 2017054597 A1 WO2017054597 A1 WO 2017054597A1 CN 2016096919 W CN2016096919 W CN 2016096919W WO 2017054597 A1 WO2017054597 A1 WO 2017054597A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- expression
- mapping relationship
- single code
- string
- processing
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/40—Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
- G06F16/43—Querying
- G06F16/432—Query formulation
- G06F16/434—Query formulation using image data, e.g. images, photos, pictures taken by a user
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/40—Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
- G06F16/48—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
Definitions
- the present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing an expression string.
- Emoji word comes from Japanese ⁇ .
- the meaning in Japanese is character. It is the visual emotion symbol used in Japanese wireless communication.
- this emoji became popular.
- image expressions are widely used in almost all mobile chat software, such as WeChat, E-mail, and QQ, which support the sending of expressions.
- the image expression is essentially a string that conforms to a specific format. Most implementations use a layer of correspondence between the image expression and its corresponding string. For example, "[:smile]” corresponds to the "smile” expression. [:cry]” corresponds to the "cry” expression.
- the TextView control that comes with the operating system has powerful graphics and text processing capabilities. It mainly realizes the conversion of text to image expressions through the graphic and text mixing function SpannableString. It can replace the text in the scope with the Emoji expression, but although The expression displayed in the specified range is actually the original string stored in the TextView control, that is, the image expression and the string are treated as two separate individuals, causing some applications (such as input method) to perform image expressions. When processing, you need to perform multiple executions on the image emoticon to complete the operation. For example, FIG. 1 shows an example of a client inputting a picture emoticon in the prior art. The picture embedding in the second place in FIG. 1 needs to be deleted, and FIG.
- FIG. 2 shows the image emoticon deletion performed by the client in the prior art. After an example image of emoticon code appears, it can be seen from Figure 2 that after deleting the image emoticon, the original string "/::” in the background still exists and is displayed in the client interface, if necessary, "/::” If you delete it, you need to delete it twice.
- the picture expression processing operation may require multiple operations to complete, and the increase in the number of operations wastes corresponding resources and increases the operation difficulty.
- the present invention has been made in order to provide a method and apparatus for processing an expression string that overcomes the above problems or at least partially solves or alleviates the above problems.
- a method for processing an expression string including:
- an apparatus for processing an expression string includes:
- the adding module is adapted to add a second mapping relationship between the expression string and the single code unicode on the basis of the first mapping relationship for the picture expression having the first mapping relationship of the picture expression-expression string;
- a establishing module configured to combine the first mapping relationship and the second mapping relationship to establish a corresponding mapping relationship between the picture emoticon and the single code.
- a computer program comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform an emoticon according to any of the above The processing method of the string.
- a computer readable medium storing a computer program as described above is provided.
- the embodiment of the invention provides a method and a device for processing an expression string. Since the first mapping relationship between the image expression and the expression string has certain loopholes in identifying the image expression, the image expression and the expression string may be It is regarded as two separate individuals. At this time, if the expression needs to be processed, it may need to be executed multiple times to complete the processing. To solve this technical problem, the present invention increases the second mapping of the expression string and unicode. Relationship, unicode is an international standard encoding used on computers that can represent, in a unified and unique binary code, characters, hieroglyphs, and other symbols that may be used for computer communication in all written languages of the world, ie, unicode Uniqueness.
- FIG. 1 is a schematic diagram showing an example of a client inputting a picture emoticon in the prior art
- FIG. 2 is a schematic diagram showing an example of an emoticon code appearing after a client performs a picture emoticon deletion in the prior art
- FIG. 3 is a schematic flow chart showing a processing method of an expression character string according to an embodiment of the present invention
- FIG. 4 is a schematic diagram showing a mapping relationship between a picture emoticon, an emoticon string, and a single code according to an embodiment of the present invention
- FIG. 5 is a schematic flow chart showing a processing manner of a picture expression according to an embodiment of the present invention.
- FIG. 6 is a flow chart showing a process of uploading the text to a server after the text input including at least one picture expression ends, according to an embodiment of the present invention
- FIG. 7 is a schematic diagram showing a combined reverse mapping relationship of a picture emoticon, an emoticon string, and a single code according to an embodiment of the present invention
- FIG. 8 is a schematic block diagram showing the structure of an apparatus for processing an expression character string according to an embodiment of the present invention.
- FIG. 9 is a schematic block diagram showing another structure of an apparatus for processing an expression character string according to an embodiment of the present invention.
- FIG. 10 is a schematic block diagram showing another structure of an apparatus for processing an expression character string according to an embodiment of the present invention.
- FIG. 11 is a schematic diagram showing a system diagram of multi-client message transmission according to a preferred embodiment of the present invention.
- Figure 12 is a block diagram schematically showing a computing device for performing a processing method of an emoticon string according to the present invention
- Fig. 13 schematically shows a storage unit for holding or carrying program code for implementing a processing method of an emoticon character string according to the present invention.
- FIG. 3 shows a process flow diagram of a method of processing an expression string in accordance with one embodiment of the present invention. Referring to FIG. 3, the method includes at least the following steps S302 to S304.
- step S302 for the picture expression having the first mapping relationship between the picture expression and the expression string, the second mapping relationship between the expression string and the unicode is added on the basis of the first mapping relationship.
- the first mapping relationship between the picture expression and the expression string is an existing mapping relationship in the expression database, and the image expression is caused by a certain vulnerability in the recognition of the first mapping relationship.
- the expression string may be treated as two separate individuals, which in turn need to be executed multiple times to complete the processing of the image expression.
- the first mapping relationship is improved in the embodiment of the present invention.
- a second mapping relationship that is, a mapping relationship between an expression string and a single code is added.
- an Emoji expression library is set, the expression library includes a common picture expression, and the first mapping relationship between the picture expression and the corresponding character string is stored in the Emoji expression library, and in addition, the Emoji class is all Image emoticons can be saved in a class directory (for example: assets directory).
- a class directory for example: assets directory
- the expression string in the Emoji expression library of the present embodiment is processed according to the second mapping relationship between the expression string and the unicode mentioned in step S302, and the corresponding unicode is set for it.
- unicode is an international standard encoding used on computers that can represent characters, hieroglyphs, and other symbols that may be used for computer communication in all written languages of the world in a uniform and unique binary code. It is precisely because unicode is unique that the mapping relationship between image expressions, expression strings and unicode is unique, so that each image expression can be represented by a unique character.
- the other two elements When executing the program, due to the uniqueness of the default unicode in the background and the uniqueness of the mapping relationship established by the three, the other two elements can be found by any one of the unique mapping relationships, so that the operation of the image expression is also provided.
- Uniqueness when operating on any one element, it can process the other two elements involved according to the unique mapping relationship between the image expression, the expression string and the unicode, and can guarantee the completion of the picture at one time.
- the expression processing avoids the problems of slow time, waste of resources, and poor user experience due to the need for multiple operations of one expression processing.
- all the image expressions of the entire Emoji expression library can be added with a second mapping relationship, so that the expression database
- Each image expression in the image can be mapped to a unique unicode, when any image expression in the expression library is processed, due to unicode
- the uniqueness of the uniqueness and the uniqueness of the mapping relationship established by the three, the operation processing of each picture expression can be completed at one time.
- the added single code is set in the blank area of the client, so that the blank area of the client is fully utilized, and the added single code is clear and concise, and the added mapping relationship is also easily obtained, avoiding other existing
- the code is confusing in the same area, causing confusion caused by code superposition and reducing the difficulty of obtaining.
- the second mapping relationship between the added expression string and the unicode can be saved in the class directory (for example, the assets directory) through a lightweight data exchange format (for example, json), and can be defined as a mapping in the following format. table:
- mapping table is loaded into the memory for the client to find, extract, process, and the like.
- step S304 combining the first mapping relationship and the second mapping relationship to establish a corresponding mapping relationship between the picture expression and the single code.
- FIG. 4 is a schematic diagram showing a mapping relationship between a picture emoticon, an emoticon string, and a unicode according to an embodiment of the present invention.
- the first mapping relationship and the second mapping relationship are implemented by using an expression string to achieve a mapping relationship between the picture expression and the unicode.
- a smile expression combining the first mapping relationship between a smile picture expression and a smile expression string "[:smile]” and the second mapping relationship between "[:smile]” and a single code "0xF001", in a smile picture expression and a single The code "0xF001" establishes the corresponding mapping relationship.
- the embodiment of the present invention provides a method and a device for processing an expression string, because the first mapping relationship between the image expression and the expression string has certain loopholes in the image recognition, resulting in image expressions and expressions.
- the string may be treated as two separate individuals. In this case, if the expression needs to be processed, it may need to be executed multiple times to complete the processing.
- the present invention adds an expression string and unicode.
- the second mapping relationship, unicode is an international standard encoding used on computers that can represent characters, hieroglyphs, and other symbols that may be used for computer communication in all written languages of the world in a uniform and unique binary code. That is, unicode is unique.
- FIG. 5 shows a process flow diagram of a manner in which a picture emoticon is processed in accordance with one embodiment of the present invention. Referring to FIG. 5, the method includes at least steps S502 to S504.
- Step S502 When receiving a processing message of a certain image expression, using the corresponding mapping relationship established between the image expression and the single code, finding a single code corresponding to the image expression;
- Step S504 Perform the processing operation carried in the processing message of step S502 on the found single code.
- the mapping relationship between the three is also unique, so that the operation of the image expression is unique, and after the single code performs the processing operation,
- the image expression on the operation interface has a unique character representation in the background program, and when the image expression is processed, the background image and the expression string corresponding to the single code are processed in the background, thereby avoiding an expression processing.
- the implementation body of the foregoing steps may be an instant messaging client, such as QQ, E-mail, WeChat, SMS, MMS, etc., which can communicate using text formats such as text and pictures.
- instant messaging client such as QQ, E-mail, WeChat, SMS, MMS, etc.
- the finding a single code corresponding to the image expression mentioned in step S502 may specifically include the following steps:
- Step 1 According to the first mapping relationship between the image expression and the expression string, the expression string corresponding to the image expression is found;
- Step 2 According to the second mapping relationship between the expression string and the unicode, according to the expression string found in the step 1, further find a single code corresponding to the expression string.
- the processing operation carried in the processing message of the single code that is performed in the step S504 may include the following steps:
- Step 1 calling a processing function corresponding to the processing message
- Step 2 using a processing function to set a conversion relationship between a single code and a picture emoticon bitmap
- Step 3 Perform a processing operation carried in the foregoing processing message on the single code by using the processing function, and map the processing operation to the image expression bitmap by using a conversion relationship between the single code and the image expression bitmap.
- the processing function is used to set a conversion relationship between a single code and a picture emoticon bitmap, wherein the image emoticon bitmap is formed by all the image emoticons in the Emoji expression library, that is, the image needs to be firstly selected.
- the expression is converted into a Windows standard format graphic file, and then the Windows standard format graphic file is parsed to form a bitmap file.
- the bitmap uses a pixel array to represent the image expression, and defines the image expression as a point (for example, a pixel). Each point can be represented by a variety of colors, including 2, 4, 8, 16, 24, and 32-bit colors.
- Each image emoticon in the database is parsed into a corresponding bitmap and saved.
- the corresponding bitmap can be called and displayed on the client interface.
- the text view control needs to create a new image and text mixing function SpannableString in the program runtime, and then call the setSpan function to set
- the conversion relationship between the single code "0xF001" and the bitmap file corresponding to the smile picture expression the converted single code "0xF001” is converted into a bitmap file, and finally the obtained SpannableString is inserted into the current cursor position of the edit text to complete the smile picture expression. Input.
- the information transmission is two-party. Any information (commonly text information) is generated by the local client. After being uploaded to the server, the server processes the information, and then the processed information. Forward to the other client. It can be seen that after the information is generated, both the server and the client need to be able to identify the corresponding information.
- a second image is added to the image expression. If the image expression containing the second mapping relationship is directly sent out, the server and the client may not recognize this.
- FIG. 6 shows a process flow diagram of uploading the text to a server after the text input including at least one picture emoticon is completed, in accordance with one embodiment of the present invention.
- the flow of the text uploading includes at least steps S602 to S608.
- Step S602 obtaining text content of the text
- Step S604 parsing a single code therein, and using the reverse mapping relationship between the single code stored in the expression database and the expression string to find the corresponding expression string;
- Step S606 replacing the position of the single code in the text by using the found corresponding expression string
- Step S608 uploading the text obtained by the replacement to the server.
- the step S604 uses the reverse mapping relationship between the expression string and the unicode to find the expression string corresponding to the unicode
- FIG. 7 shows the combined reverse of the picture expression, the expression string and the unicode according to an embodiment of the present invention.
- Schematic diagram of the mapping relationship In practical applications, the mapping relationship between image expressions, expression strings and unicode is reversible. For example, some smartphone cores can recognize expression strings, and in actual processing, they can use the reverse of expression strings and image expressions. The mapping relationship finds the image expression, and then displays the image expression. Similarly, some terminals may exist, and the background can only recognize unicode, and then the corresponding image expression can be found according to the indirect reverse mapping relationship between unicode and the image expression, and displayed on the terminal interface.
- the text content using the second mapping relationship is processed, and the corresponding emoticon string is searched according to the reverse mapping rule of the single code and the emoticon string, and then the found emoticon string is used.
- the position of the single code in the text is replaced, and the modification causes the text information to be restored to the original text information before the second mapping relationship is used.
- the restored original text information is uploaded to the server and transmitted by the server.
- the purpose of the recovery operation shown in FIG. 6 is to effectively prevent the server side from recognizing the added unicode, avoiding problems such as garbled text content when the server recognizes the text content, or transmitting errors or losing when transmitting text to other clients. Package and other issues.
- the recovery operation shown in Figure 6 is performed on the client side, and does not require server participation.
- the server does not need to add an emoticon character.
- the mapping between the string and the single code adds a new data parsing manner without any modification. Therefore, the embodiment of the present invention can complete the image emoticon processing operation without changing the hardware cost of the server, and saves a lot of resources.
- the above text content processing operation is more conducive to the server responding to the service request and guaranteeing the quality of the service.
- first mapping relationship between the picture expression and the expression string proposed by the present invention and the second mapping relationship between the expression string and the unicode are transparent to the server, and the server does not need to perform additional compatibility processing.
- the client will send the text content of a small red flower (here, "small red flower” image expression) to the other client as a specific embodiment of the present invention, further explaining the present.
- a small red flower here, "small red flower” image expression
- the text content that needs to be input includes both the text content of "Today's teacher sent Xiao Xiao a small red flower” and the picture content of "Little Red Flower”.
- the client edits the text and enters the text part of "Today the teacher sent Xiao Xiao a small red flower", you need to input the small red flower image expression.
- the background program according to the first mapping relationship between the image expression and the expression string. Find the expression string "[:red flower]” corresponding to the expression of the small red flower, and then find the single code "0xF003" corresponding to "[:red flower]” according to the second mapping relationship between the added expression string and unicode. ".
- the single code "0xF003" After the single code "0xF003" performs the processing operation, first edit the text Textview control to create a new image mixing function SpannableString, and then call the setSpan function to convert the single code "0xF003" into a small red flower image emoticon bitmap file, the resulting SpannableString Insert the edited text to the current cursor position to complete the input of the small safflower picture emoticon.
- the small red flower picture expression in the text content is input by the processing operation of the added single code "0xF003", in order to ensure that the server can recognize the small red flower picture expression, it needs to be processed as follows to obtain "Today the teacher gave Xiao Mingfa
- the text content of a small red flower here, "small red flower” image expression)
- parsing out the single code "0xF003” of the small red flower image expression in the text content and according to the reverse of the single code and the expression string Map the relationship, find the expression string "[:red flower]” corresponding to the single code "0xF003”, and replace "[:red flower]” with the single code "0xF003" in the background, that is, the text information is restored to the unused Before the second mapping relationship, the recovered text information is uploaded to the server and transmitted by the server to the other client.
- the "small red flower” picture expression in the text content is input by the operation of the added single code "0xF003". Since the single code "0xF003" is unique, the small red flower picture expression, "[ :red flower]” and the single code "0xF003" established the mapping relationship is also unique, if you need to "Today's teacher gave Xiao Ming a small red flower (here "small red flower” image expression)" In the “Little Red Flower” image emoticon is deleted Or when copying and other processing operations, when the program is executed in the background, because of the uniqueness of the default "0xF003" and the uniqueness of the relationship established by the three, the operation of the expression on the small red flower is unique, and the small red will be involved.
- the flower image emoticon, "[:red flower]” and the single code "0xF003" are processed, so that the processing operation can be completed at one time.
- FIG. 8 is a block diagram showing the structure of an apparatus for processing an expression character string according to an embodiment of the present invention.
- the device includes at least:
- the adding module 810 is adapted to add a second mapping relationship between the expression string and the single code unicode on the basis of the first mapping relationship for the picture expression having the first mapping relationship between the picture expression and the expression string;
- the establishing module 820 is coupled to the adding module 810 and is adapted to combine the first mapping relationship and the second mapping relationship to establish a corresponding mapping relationship between the image emoticon and the single code.
- FIG. 9 illustrates an embodiment according to an embodiment of the present invention.
- Another structural schematic diagram of an apparatus for processing an expression string the apparatus further comprising:
- the searching module 830 is coupled to the establishing module 820, and is adapted to receive a processing message of a certain image expression, and use a corresponding mapping relationship between the image expression and the single code to find a single code corresponding to the image expression;
- the processing module 840 is coupled to the lookup module 830 and is adapted to perform a processing operation carried in the processing message on the found single code.
- the lookup module 830 is further adapted to:
- the lookup module 830 is further adapted to:
- the processing function carried in the processing message is performed on the single code by using the processing function, and the processing operation is mapped to the image expression bitmap by using the conversion relationship between the single code and the image expression bitmap.
- the processing device for the expression string may further include:
- the uploading module 850 is coupled to the processing module 840, and is adapted to upload the text to the server after the text input including the at least one picture expression ends:
- FIG. 11 is a schematic diagram of a system for transmitting messages between multiple clients according to a preferred embodiment of the present invention.
- the system includes a server 1110, and a multi-client 1120 for message transmission through the server 1110, respectively.
- the number of the clients in FIG. 11 is only a schematic value, and may be hundreds or even more in practical applications, and the present invention does not limit this.
- the method and apparatus for processing an expression string provided by the embodiment of the present invention can achieve the following beneficial effects:
- the embodiment of the invention provides a method and a device for processing an expression string. Since the first mapping relationship between the image expression and the expression string has certain loopholes in identifying the image expression, the image expression and the expression string may be It is regarded as two separate individuals. At this time, if the expression needs to be processed, it may need to be executed multiple times to complete the processing. To solve this technical problem, the present invention increases the second mapping of the expression string and unicode. Relationship, unicode is an international standard encoding used on computers that can represent, in a unified and unique binary code, characters, hieroglyphs, and other symbols that may be used for computer communication in all written languages of the world, ie, unicode Uniqueness.
- modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
- the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
- any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
- Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
- the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
- a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of the emoticon processing device in accordance with embodiments of the present invention.
- the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
- a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
- Figure 12 illustrates a computing device that can implement a method of processing an emoticon string in accordance with the present invention.
- the computing device conventionally includes a processor 1210 and a computer program product or computer readable medium in the form of a memory 1220.
- the memory 1220 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
- Memory 1220 has a memory space 1230 for program code 1231 for performing any of the method steps described above.
- storage space 1230 for program code may include various program codes 1231 for implementing various steps in the above methods, respectively.
- the program code can be read from or written to one or more computer program products.
- Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
- Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
- the storage unit can have the memory 1220 in the computing device of FIG. Similarly arranged storage segments, storage spaces, and the like.
- the program code can be compressed, for example, in an appropriate form.
- the storage unit includes computer readable code 1231 ', ie, code readable by a processor, such as 1210, that when executed by a computing device causes the computing device to perform each of the methods described above step.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Document Processing Apparatus (AREA)
- Mathematical Physics (AREA)
- Library & Information Science (AREA)
Abstract
一种表情字符串的处理方法及装置,包括:对于具备图片表情-表情字符串的第一映射关系的图片表情,在第一映射关系的基础上,增加表情字符串与单一码unicode的第二映射关系(S302),结合第一映射关系和第二映射关系,以在图片表情和单一码间建立对应映射关系(S304),接收到某个图片表情的处理消息时,利用在图片表情和单一码间建立的对应映射关系,查找到与该图片表情对应的单一码(S502),对查找到的单一码执行处理消息中携带的处理操作(S504)。采用上述方法和装置能够解决图片表情处理操作时需要执行多次才能完成的问题。
Description
本发明涉及计算机技术领域,尤其涉及一种表情字符串的处理方法及装置。
Emoji词义来自日语えもじ,在日语中的含义是字符,是日本在无线通信中所使用的视觉情感符号,在苹果公司发布的IOS 5输入法引入了Emoji之后,这种表情符号逐渐流行起来。目前,图片表情几乎在所有的移动聊天软件得到了广泛地应用,比如微信、易信、QQ都支持表情的发送。图片表情本质上是一个符合特定格式的字符串,大多的实现方案都是将图片表情和其所对应的字符串建立一层对应关系,比如"[:smile]"对应着“微笑”表情,"[:cry]"对应着“哭泣”表情。
操作系统自带的TextView控件具有强大的图文混排处理能力,它主要通过图文混排函数SpannableString方便地实现文本到图片表情的转换,可以将制定范围内的文字替换为Emoji表情,但是虽然指定范围内显示的是表情,实际上TextView控件内部保存的仍旧是原始的字符串,即图片表情与字符串被视为两个单独的个体存在,导致某些应用(例如输入法)进行图片表情处理时,需要对该图片表情执行多次才能完成操作。例如,图1示出了现有技术中客户端输入图片表情的一个示例图,图1中排在第2位的图片表情需要删除,图2示出了现有技术中客户端进行图片表情删除后出现表情编码的一个示例图,由图2可以看出,删除图片表情之后,后台的原始字符串“/::”仍然存在,并显示在客户端的界面中,若需要将“/::”删除,则需要二次进行删除操作。
由此可以看出,现有技术中,图片表情处理操作可能需要多次操作才能够完成,操作次数的增多会浪费相应的资源,同时也增加了操作难度。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决或者减缓上述问题的表情字符串的处理方法及装置。
根据本发明的一个方面,提供了一种表情字符串的处理方法,包括:
对于具备图片表情-表情字符串的第一映射关系的图片表情,在所述第一映射关系的基础上,增加表情字符串与单一码unicode的第二映射关系;
结合所述第一映射关系和所述第二映射关系,以在所述图片表情和所述单一码间建立对应映射关系。
根据本发明的另一个方面,提供了一种表情字符串的处理装置,包括:
增加模块,适于对于具备图片表情-表情字符串的第一映射关系的图片表情,在所述第一映射关系的基础上,增加表情字符串与单一码unicode的第二映射关系;
建立模块,适于结合所述第一映射关系和所述第二映射关系,以在所述图片表情和所述单一码间建立对应映射关系。
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据上述中的任一个表情字符串的处理方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了如上所述的计算机程序。
本发明的有益效果为:
本发明实施例提供了一种表情字符串的处理方法及装置,由于图片表情与表情字符串的第一映射关系在用于识别图片表情时存在一定的漏洞,导致图片表情与表情字符串可能会被视为两个单独的个体存在,此时,若需要对表情进行处理,可能需要得执行多次才能完成处理,为解决这一技术问题,本发明增加了表情字符串与unicode的第二映射关系,unicode是一种在计算机上使用的国际标准编码,能够用统一并且唯一的二进制编码表示世界上所有的书写语言中可能用于电脑通讯的字元、象形文字和其他符号,即,unicode具备唯一性。正是因为unicode具备唯一性,使得图片表情、表情字符串与unicode三者间建立的映射关系也具有唯一性,此时若对图片表情进行处理,通过具备唯一性的映射关系中的任意一个元素可以查找到其他两个元素,从而使得图片表情的操作也具备唯一性,对任意一个元素进行操作时,均能够根据图片表情、表情字符串与unicode三者间建立的具备唯一性的映射关系,将涉及到的其他两个元素进行处理,因此能够保证一次完成图片表情处理,从而避免了一个表情处理需要多次操作所导致的时间缓慢、资源浪费、用户感受体验较差等问题。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示意性示出了现有技术中客户端输入图片表情的一个示例图;
图2示意性示出了现有技术中客户端进行图片表情删除后出现表情编码的一个示例图;
图3示意性示出了根据本发明一个实施例的表情字符串的处理方法的处理流程图;
图4示意性示出了根据本发明一个实施例的图片表情、表情字符串及单一码的映射关系示意图;
图5示意性示出了根据本发明一个实施例的图片表情的处理方式的处理流程图;
图6示意性示出了根据本发明一个实施例的包括至少一个图片表情的文本输入结束后,将该文本上传至服务器的处理流程图;
图7示意性示出了根据本发明一个实施例的图片表情、表情字符串及单一码的结合逆向映射关系示意图;
图8示意性示出了根据本发明一个实施例的表情字符串的处理装置的结构示意图;
图9示意性示出了根据本发明一个实施例的表情字符串的处理装置的另一种结构示意图;
图10示意性示出了根据本发明一个实施例的表情字符串的处理装置的另一种结构示意图;
图11示意性示出了根据本发明一个优选实施例的多客户端间消息传输的系统示意图;
图12示意性示出了用于执行根据本发明的表情字符串的处理方法的计算设备的框图;以及
图13示意性示出了用于保持或者携带实现根据本发明的表情字符串的处理方法的程序代码的存储单元。
下面结合附图和具体的实施方式对本发明作进一步的描述。
为解决上述技术问题,本发明实施例提供了一种表情字符串的处理方法。图3示出了根据本发明一个实施例的表情字符串的处理方法的处理流程图。参见图3,该方法至少包括以下步骤S302至步骤S304。
首先,执行步骤S302,对于具备图片表情与表情字符串的第一映射关系的图片表情,在第一映射关系的基础上,增加表情字符串与单一码(unicode)的第二映射关系。
需要说明地是,在本发明实施例中,图片表情与表情字符串的第一映射关系是表情库中的现有映射关系,正在因为第一映射关系的识别性有一定的漏洞,导致图片表情和表情字符串可能会被视为两个单独的个体存在,进而需要执行多次才能够完成图片表情的处理。为解决这一技术问题,本发明实施例对第一映射关系进行改进,在第一映射关系的基础上,增加了第二映射关系,即表情字符串与单一码之间的映射关系。
具体地,在一个实施例中,设置一个Emoji表情库,该表情库包含常用图片表情,同时该Emoji表情库中存储有图片表情和其对应字符串的第一映射关系,此外,该Emoji类所有图片表情可以保存在类目录(例如:assets目录)中。
根据步骤S302提及的增加表情字符串与unicode的第二映射关系对本实施例的Emoji表情库中的表情字符串进行处理,为其设置对应的unicode。需要注意地是,unicode是一种在计算机上使用的国际标准编码,能够用统一并且唯一的二进制编码表示世界上所有的书写语言中可能用于电脑通讯的字元、象形文字和其他符号。正是因为unicode具备唯一性,使得图片表情、表情字符串与unicode三者间建立的映射关系也具有唯一性,这样每个图片表情都可以用一个唯一的字符表示。执行程序时,因后台默认unicode的唯一性和三者建立的映射关系的唯一性,通过具备唯一性的映射关系中的任意一个元素可以查找到其他两个元素,从而使得图片表情的操作也具备唯一性,对任意一个元素进行操作时,均能够根据图片表情、表情字符串与unicode三者间建立的具备唯一性的映射关系,将涉及到的其他两个元素进行处理,能够保证一次完成图片表情处理,从而避免了一个表情处理需要多次操作所导致的时间缓慢、资源浪费、用户感受体验较差等问题。进一步,为保证整个Emoji表情库的所有表情都不会出现多次处理才能够完成一个处理需求的情况,优选地,可以将整个Emoji表情库的全部图片表情均增设第二映射关系,使表情库中的每个图片表情均可以映射到唯一的unicode,对表情库中的任一图片表情进行处理时,因unicode
的唯一性及三者建立的映射关系的唯一性,各图片表情的操作处理均能一次完成。
其中,本发明实施例将增设的单一码设置于客户端的空白区域,使其充分利用客户端的空白区域,并使得增设的单一码清楚简洁,其增设的映射关系也容易获取,避免与其他已有代码混淆在同一区域,导致代码叠加所造成的混乱,也降低了获取难度。
实际应用中,增加的表情字符串与unicode间的第二映射关系可以通过轻量级的数据交换格式(例如:json)保存在类目录(例如:assets目录)中,可以定义为如下格式的映射表:
{"unicode":"0xF001","imgCode":"[:smile]"}
{"unicode":"0xF002","imgCode":"[:cry]"}
......
当图片表情处理程序运行时将上述映射表加载至内存,供客户端查找、提取、处理等等。
步骤S302增设了第二映射关系之后,本发明实施例执行步骤S304,结合第一映射关系和第二映射关系,以在图片表情和单一码间建立对应映射关系。
具体地,图4示出了根据本发明一个实施例的图片表情、表情字符串及unicode的映射关系示意图。参见图4,第一映射关系和第二映射关系通过表情字符串实现两者的结合,使得图片表情与unicode建立对应的映射关系。以微笑表情为例,结合微笑图片表情与微笑表情字符串"[:smile]"的第一映射关系及"[:smile]"与单一码"0xF001"第二映射关系,在微笑图片表情与单一码"0xF001"建立对应的映射关系。
综上可知,本发明实施例提供了一种表情字符串的处理方法及装置,由于图片表情与表情字符串的第一映射关系在用于识别图片表情时存在一定的漏洞,导致图片表情与表情字符串可能会被视为两个单独的个体存在,此时,若需要对表情进行处理,可能需要得执行多次才能完成处理,为解决这一技术问题,本发明增加了表情字符串与unicode的第二映射关系,unicode是一种在计算机上使用的国际标准编码,能够用统一并且唯一的二进制编码表示世界上所有的书写语言中可能用于电脑通讯的字元、象形文字和其他符号,即,unicode具备唯一性。正是因为unicode具备唯一性,使得图片表情、表情字符串与unicode三者间建立的映射关系也具有唯一性,此时若对图片表情进行处理,通过具备唯一性的映射关系中的任意一个元素可以查找到其他两个元素,从而使得图片表情的操作也具备唯一性,对任意一个元素进行操作时,均能够根据图片表情、表情字符串与unicode三者间建立的具备唯一性的映射关系,将涉及到的其他两个元素进行处理,因此能够保证一次完成图片表情
处理,从而避免了一个表情处理需要多次操作所导致的时间缓慢、资源浪费、用户感受体验较差等问题。
在图片表情与单一码之间建立起对应的映射关系(即步骤S304)之后,若接收到某个图片表情的处理消息,则可以根据增设的unicode对图片表情进行处理。具体地,图5示出了根据本发明一个实施例的图片表情的处理方式的处理流程图。参见图5,该方法至少包括步骤S502至步骤S504。
步骤S502、接收到某个图片表情的处理消息时,利用该图片表情和单一码间建立的对应映射关系,查找到与该图片表情对应的单一码;
步骤S504、对查找到的单一码执行步骤S502的处理消息中携带的处理操作。
在本发明实施例中,如前文所述,因单一码具备唯一性,使得三者间的映射关系也具备唯一性,使得对图片表情的操作也具备唯一性,单一码执行完成处理操作后,使得操作界面上的图片表情在后台程序中有一个唯一的字符表示,再对该图片表情进行处理时,后台对单一码对应的图片表情及表情字符串均进行处理,从而避免了因一个表情处理需多次操作所导致的时间缓慢、资源浪费、用户感受体验较差等问题。
本发明实施例中,上述步骤的实施主体可能是即时通信客户端,例如QQ、易信、微信、短信、彩信等能够使用文字、图片等文本格式进行沟通的客户端。
进一步,在本发明的一个优选实施例中,步骤S502所提及的查找到与图片表情对应的单一码具体可以包括如下步骤:
步骤1、根据图片表情与表情字符串的第一映射关系,查找到该图片表情对应的表情字符串;
步骤2、根据表情字符串与unicode的第二映射关系,根据步骤1中查找到的表情字符串,进一步查找到与该表情字符串对应的单一码。
具体地,以微笑表情为例,输入微笑图片表情时,程序运行时通过建立的第一映射关系,查找到微笑图片表情对应的表情字符串"[:smile]",通过增加建立的第二映射关系,查找到该表情字符串对应的单一码"0xF001"。
在本发明的一个优选实施例中,步骤S504所提及对查找到的单一码执行处理消息中携带的处理操作,可以包括如下步骤:
步骤1、调用与处理消息对应的处理函数;
步骤2、利用处理函数设置单一码与图片表情位图间的转换关系;
步骤3、利用处理函数对单一码执行上述处理消息中携带的处理操作,并利用单一码与图片表情位图间的转换关系将处理操作映射到图片表情位图。
本发明实施例中步骤2提及的利用处理函数设置单一码与图片表情位图间的转换关系,其中,图片表情位图是由Emoji表情库中所有图片表情解析而成,即首先需要将图片表情转化为Windows标准格式图形文件,进而对Windows标准格式图形文件进行解析,形成位图文件(bitmap),bitmap是使用像素阵列来表示图片表情,将图片表情定义为由点(例如像素)组成,每个点可以由多种色彩表示,包括2、4、8、16、24和32位色彩。将每个图片表情解析成对应的位图文件bitmap后,将对应的bitmap与其对应的文件名配对,并用列表(List)对配对结果进行保存,List中各项可以定义为如下格式,
public class Emoji{
/**表情名称*/
public String name;
/**对应图片*/
public Bitmap bitmap;
},
以微笑表情为例,
public class Emoji{
/**Smile*/
public String name;
/**Smile Image*/
public Bitmap bitmap;
}。
数据库中的各图片表情被解析成对应的bitmap并进行保存,相应地,当进行图片表情处理时,可以调用相应的bitmap并显示在客户端界面。
具体地,以微笑表情输入为例,查找微笑图片表情对应的单一码后"0xF001",由于输入部分包括图片,程序运行时Textview控件中需要新建一个图文混排函数SpannableString,然后调用setSpan函数设置单一码"0xF001"与微笑图片表情对应的位图文件的转换关系,即将查找到的单一码"0xF001"转换为位图文件,最后将得到的SpannableString插入到编辑文本当前光标位置完成微笑图片表情的输入。
对于常用的即时通信类客户端,信息传输是双方的,任意一个信息(常见的是文本信息)由本地客户端生成,上传至服务器后,由服务器对该信息进行处理,进而将处理后的信息转发至对方客户端。由此可见,信息生成之后,服务器端与对方客户端均需要能够识别出相应信息。而本发明实施例中,对图片表情增设了第二映
射关系,如果直接将包含增设了第二映射关系的图片表情发送出去,则服务器、对方客户端均可能对此无法识别。
因此,以文本内容为例,为了保障服务器能够识别文本内容,并能够将文本内容完整地转发至对方客户端,需要对文本内容进行处理。图6示出了根据本发明一个实施例的包括至少一个图片表情的文本输入结束后,将该文本上传至服务器的处理流程图。参见图6,该文本上传的流程至少包括步骤S602至步骤S608。
步骤S602、获取文本的文本内容;
步骤S604、解析出其中的单一码,利用表情库中存储的单一码与表情字符串的逆向映射关系查找到对应的表情字符串;
步骤S606、使用查找出的对应的表情字符串替换单一码在上述文本中的位置;
步骤S608、将替换结束得到的文本上传至服务器。
本发明实施例中步骤S604利用表情字符串与unicode的逆向映射关系,查找到unicode对应的表情字符串,图7示出了根据本发明一个实施例的图片表情、表情字符串及unicode的结合逆向映射关系示意图。在实际应用中,图片表情、表情字符串及unicode的映射关系均是可逆的,例如某些智能机内核能够识别的是表情字符串,在实际处理中就可以使用表情字符串与图片表情的逆向映射关系查找到图片表情,进而显示图片表情。同理,也可能存在某些终端,其后台仅能够识别unicode,进而可以根据unicode与图片表情间的间接逆向映射关系查找到对应的图片表情,并显示在终端界面。
具体地,以包括微笑表情的文本内容为例,客户端将该文本内容上传至服务器时需要对其进行如下处理,首先获取编辑文本(EditText)中的文本内容,解析出文本内容中的单一码"0xF001",通过单一码"0xF001"与对应的表情字符串的逆向映射关系找到微笑表情字符串"[:smile]",并将微笑表情字符串"[:smile]"替换掉单一码"0xF001",最后将替换后的文本上传至服务器。
图6所示的文本内容处理流程中,对使用了第二映射关系的文本内容进行处理,根据单一码与表情字符串的逆向映射规则查找对应的表情字符串,进而使用查找到的表情字符串替换单一码在文本中的位置,该修改使得文本信息恢复到未使用第二映射关系之前,可视为原始文本信息。随后,将恢复得到的原始文本信息上传至服务器,由服务器进行传输。图6所示的恢复操作的目的是能够有效地防止服务器端不识别增设的unicode,避免服务器在识别文本内容时出现文本内容乱码等问题,或者在传输文本至其他客户端时发生传送错误、丢包等问题。另一方面,图6所示的恢复操作在客户端侧执行,并不需要服务器参与,服务器不需要为增设的表情字符
串与单一码的映射关系增加新的数据解析方式,无须作任何改动,因此,本发明实施例能够在不改变服务器等增加硬件成本的情况下,完成图片表情处理操作,节省了大量资源。综上,上述文本内容处理操作更加有利于服务器响应服务请求,保障服务的质量。
另外,本发明提出的图片表情与表情字符串的第一次映射关系和表情字符串与unicode的第二次映射关系对服务器来说是透明的,服务器不需要做额外的兼容处理。
下面,以客户端将“今天老师给小明发了一朵小红花(此处为“小红花”图片表情)”的文本内容发送至对方客户端作为本发明一个具体实施例,进一步说明本发明的表情字符串的处理方法的流程及按照本发明生成的图片表情进行处理操作时的有益效果。
需要输入的文本内容既包括“今天老师给小明发了一朵小红花”的文字内容,又包括“小红花”的图片内容。客户端编辑文本输入完“今天老师给小明发了一朵小红花”的文字部分后,需要输入小红花图片表情,此时,后台程序根据图片表情与表情字符串的第一映射关系,查找到小红花图片表情对应的表情字符串"[:red flower]",再根据增设的表情字符串与unicode的第二映射关系,查找到"[:red flower]"对应的单一码"0xF003"。之后单一码"0xF003"执行处理操作,首先编辑文本Textview控件中新建一个图文混排函数SpannableString,然后调用setSpan函数将单一码"0xF003"转换为小红花图片表情的位图文件,得到的SpannableString插入到编辑文本当前光标位置完成小红花图片表情的输入。客户端完成“今天老师给小明发了一朵小红花(此处为“小红花”图片表情)”的文本内容输入后,需要将该段文本内容上传至服务器,并由服务器转发至对方客户端。由于该文本内容中小红花图片表情是由增设的单一码"0xF003"执行处理操作完成输入的,为了保障服务器能够识别小红花图片表情,需要对其进行如下处理,获取“今天老师给小明发了一朵小红花(此处为“小红花”图片表情)”的文本内容,解析出该文本内容中小红花图片表情的单一码"0xF003",并根据单一码与表情字符串的逆向映射关系,查找到单一码"0xF003"对应的表情字符串"[:red flower]",并在后台将"[:red flower]"替换掉单一码"0xF003",即文本信息恢复到未使用第二映射关系之前,将恢复得到的文本信息上传至服务器,由服务器传送至对方客户端。
需要说明地是,文本内容中的“小红花”图片表情是由增设的单一码"0xF003"执行操作完成输入的,由于单一码"0xF003"具有唯一性,使得小红花图片表情、"[:red flower]"与单一码"0xF003"三者建立的映射关系也具有唯一性,若需要对“今天老师给小明发了一朵小红花(此处为“小红花”图片表情)”中的“小红花”图片表情进行删除
或者复制等处理操作时,后台执行程序时,因默认"0xF003"的唯一性及三者建立的关系的唯一性,使对小红花图片表情的操作也具备唯一性,将涉及到的小红花图片表情、"[:red flower]"与单一码"0xF003"三个元素均进行处理,因此能够一次完成处理操作。
基于同一发明构思,本发明实施例还提供了一种表情字符串的处理装置。图8示出了根据本发明一个实施例的表情字符串的处理装置的结构示意图。参见图8,该装置至少包括:
增加模块810,适于对于具备图片表情与表情字符串的第一映射关系的图片表情,在第一映射关系的基础上,增加表情字符串与单一码unicode的第二映射关系;
建立模块820,与增加模块810耦合,适于结合第一映射关系和第二映射关系,以在图片表情和单一码间建立对应映射关系。
在表情字符串处理装置中增加了表情字符串与unicode的第二映射关系后,本发明实施例可以进一步根据增设的映射关系对图片表情进行处理,图9示出了根据本发明一个实施例的表情字符串的处理装置的另一种结构示意图,该装置至少还包括:
查找模块830,与建立模块820耦合,适于接收到某个图片表情的处理消息时,利用图片表情和单一码间建立的对应映射关系,查找到与该图片表情对应的单一码;
处理模块840,与查找模块830耦合,适于对查找到的单一码执行处理消息中携带的处理操作。
在一个优选的实施例中,查找模块830还适于:
根据第一映射关系,查找到该图片表情对应的表情字符串;
进而,根据第二映射关系,查找到与该表情字符串对应的单一码。
在一个优选的实施例中,查找模块830还适于:
调用与处理消息对应的处理函数;
利用处理函数设置单一码与图片表情位图间的转换关系;
利用处理函数对单一码执行处理消息中携带的处理操作,并利用单一码与图片表情位图间的转换关系将处理操作映射到图片表情位图。
在一个优选的实施例中,参见图10,表情字符串的处理装置还可以包括:
上传模块850,与处理模块840耦合,适于在包括至少一个图片表情的文本输入结束后,按如下步骤将该文本上传至服务器:
获取上述文本的文本内容;
解析出其中的单一码,利用表情库中存储的单一码与表情字符串的逆向映射关
系查找到对应的表情字符串;
使用查找出的对应的表情字符串替换单一码在所述文本中的位置;
将替换结束得到的文本上传至服务器。
本发明实施例提供的任意一个优选实施例或其组合,可应用于多客户端间的消息传送过程,图11示出了根据本发明一个优选实施例的多客户端间消息传输的系统示意图。参见图11,该系统包括服务器1110,以及分别通过服务器1110进行消息传输的多客户端1120。图11的客户端的个数仅仅为示意值,在实际应用中可能成千上百甚至更多,本发明对此不做任何限定。
综上,采用本发明实施例提供的表情字符串的处理方法及装置可以达到如下有益效果:
本发明实施例提供了一种表情字符串的处理方法及装置,由于图片表情与表情字符串的第一映射关系在用于识别图片表情时存在一定的漏洞,导致图片表情与表情字符串可能会被视为两个单独的个体存在,此时,若需要对表情进行处理,可能需要得执行多次才能完成处理,为解决这一技术问题,本发明增加了表情字符串与unicode的第二映射关系,unicode是一种在计算机上使用的国际标准编码,能够用统一并且唯一的二进制编码表示世界上所有的书写语言中可能用于电脑通讯的字元、象形文字和其他符号,即,unicode具备唯一性。正是因为unicode具备唯一性,使得图片表情、表情字符串与unicode三者间建立的映射关系也具有唯一性,此时若对图片表情进行处理,通过具备唯一性的映射关系中的任意一个元素可以查找到其他两个元素,从而使得图片表情的操作也具备唯一性,对任意一个元素进行操作时,均能够根据图片表情、表情字符串与unicode三者间建立的具备唯一性的映射关系,将涉及到的其他两个元素进行处理,因此能够保证一次完成图片表情处理,从而避免了一个表情处理需要多次操作所导致的时间缓慢、资源浪费、用户感受体验较差等问题。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开
的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的表情字符串处理装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图12示出了可以实现根据本发明的表情字符串的处理方法的计算设备。该计算设备传统上包括处理器1210和以存储器1220形式的计算机程序产品或者计算机可读介质。存储器1220可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1220具有用于执行上述方法中的任何方法步骤的程序代码1231的存储空间1230。例如,用于程序代码的存储空间1230可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1231。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图13所述的便携式或者固定存储单元。该存储单元可以具有与图12的计算设备中的存储器1220
类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码1231’,即可以由例如诸如1210之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。
Claims (12)
- 一种表情字符串的处理方法,包括:对于具备图片表情-表情字符串的第一映射关系的图片表情,在所述第一映射关系的基础上,增加表情字符串与单一码unicode的第二映射关系;结合所述第一映射关系和所述第二映射关系,以在所述图片表情和所述单一码间建立对应映射关系。
- 根据权利要求1所述的方法,其中,还包括:接收到某个图片表情的处理消息时,利用在所述图片表情和所述单一码间建立的对应映射关系,查找到与该图片表情对应的单一码;对查找到的单一码执行所述处理消息中携带的处理操作。
- 根据权利要求2所述的方法,其中,利用在所述图片表情和所述单一码间建立的对应映射关系,查找到与该图片表情对应的单一码,包括:根据所述第一映射关系,查找到该图片表情对应的表情字符串;进而,根据所述第二映射关系,查找到与该表情字符串对应的单一码。
- 根据权利要求2或3所述的方法,其中,对查找到的单一码执行所述处理消息中携带的处理操作,包括:调用与所述处理消息对应的处理函数;利用所述处理函数设置所述单一码与所述图片表情位图间的转换关系;利用所述处理函数对所述单一码执行所述处理消息中携带的处理操作,并利用所述单一码与所述图片表情位图间的转换关系将所述处理操作映射到所述图片表情位图。
- 根据权利要求2至4任一项所述的方法,其中,在包括至少一个所述图片表情的文本输入结束后,按如下步骤将该文本上传至服务器:获取所述文本的文本内容;解析出其中的单一码,利用表情库中存储的单一码与表情字符串的逆向映射关系查找到对应的表情字符串;使用查找出的对应的表情字符串替换所述单一码在所述文本中的位置;将替换结束得到的文本上传至服务器。
- 一种表情字符串的处理装置,包括:增加模块,适于对于具备图片表情-表情字符串的第一映射关系的图片表情,在所述第一映射关系的基础上,增加表情字符串与单一码unicode的第二映射关系;建立模块,适于结合所述第一映射关系和所述第二映射关系,以在所述图片表情和所述单一码间建立对应映射关系。
- 根据权利要求6所述的装置,其中,还包括:查找模块,适于接收到某个图片表情的处理消息时,利用在所述图片表情和所述单一码间建立的对应映射关系,查找到与该图片表情对应的单一码;处理模块,适于对查找到的单一码执行所述处理消息中携带的处理操作。
- 根据权利要求7所述的装置,其中,所述查找模块还适于:根据所述第一映射关系,查找到该图片表情对应的表情字符串;进而,根据所述第二映射关系,查找到与该表情字符串对应的单一码。
- 根据权利要求7或8所述的装置,其中,所述查找模块还适于:调用与所述处理消息对应的处理函数;利用所述处理函数设置所述单一码与所述图片表情位图间的转换关系;利用所述处理函数对所述单一码执行所述处理消息中携带的处理操作,并利用所述单一码与所述图片表情位图间的转换关系将所述处理操作映射到所述图片表情位图。
- 根据权利要求7至9任一项所述的装置,其中,还包括:上传模块,适于在包括至少一个所述图片表情的文本输入结束后,按如下步骤将该文本上传至服务器:获取所述文本的文本内容;解析出其中的单一码,利用表情库中存储的单一码与表情字符串的逆向映射关系查找到对应的表情字符串;使用查找出的对应的表情字符串替换所述单一码在所述文本中的位置;将替换结束得到的文本上传至服务器。
- 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-5中的任一个表情字符串的处理方法。
- 一种计算机可读介质,其中存储了如权利要求11所述的计算机程序。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510642793.1A CN105160033B (zh) | 2015-09-30 | 2015-09-30 | 表情字符串的处理方法及装置 |
CN201510642793.1 | 2015-09-30 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017054597A1 true WO2017054597A1 (zh) | 2017-04-06 |
Family
ID=54800889
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/096919 WO2017054597A1 (zh) | 2015-09-30 | 2016-08-26 | 表情字符串的处理方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105160033B (zh) |
WO (1) | WO2017054597A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111200552A (zh) * | 2018-11-16 | 2020-05-26 | 腾讯科技(深圳)有限公司 | 一种即时通讯方法及其装置、设备和存储介质 |
CN111369645A (zh) * | 2020-02-28 | 2020-07-03 | 北京百度网讯科技有限公司 | 表情信息的展现方法、装置、设备及介质 |
CN112036247A (zh) * | 2020-08-03 | 2020-12-04 | 北京小米松果电子有限公司 | 表情包文字生成方法、装置及存储介质 |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105160033B (zh) * | 2015-09-30 | 2018-09-11 | 北京奇虎科技有限公司 | 表情字符串的处理方法及装置 |
CN105718534B (zh) * | 2016-01-14 | 2017-05-03 | 广州市动景计算机科技有限公司 | 信息推送装置、信息推送方法以及客户端 |
CN106055416B (zh) * | 2016-05-23 | 2020-08-18 | 珠海市魅族科技有限公司 | 数据跨应用转移的方法和装置 |
CN106951105A (zh) * | 2017-03-03 | 2017-07-14 | 深圳市联谛信息无障碍有限责任公司 | 一种使用无障碍服务阅读表情符号的方法 |
CN107360898A (zh) * | 2017-07-05 | 2017-11-21 | 佛山杰致信息科技有限公司 | 大棚远程管理系统 |
US10650095B2 (en) * | 2017-07-31 | 2020-05-12 | Ebay Inc. | Emoji understanding in online experiences |
CN108805960A (zh) * | 2018-05-31 | 2018-11-13 | 北京字节跳动网络技术有限公司 | 图文混排方法、装置、计算机可读存储介质和终端 |
CN110780955B (zh) * | 2019-09-05 | 2023-08-22 | 连尚(新昌)网络科技有限公司 | 一种用于处理表情消息的方法与设备 |
WO2024046275A1 (zh) * | 2022-09-02 | 2024-03-07 | 华为技术有限公司 | 显示方法和电子设备 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1780437A (zh) * | 2004-11-27 | 2006-05-31 | 乐金电子(中国)研究开发中心有限公司 | 移动通信终端的用户表情图释生成方法及短消息收发方法 |
CN101639755A (zh) * | 2009-09-10 | 2010-02-03 | 腾讯科技(深圳)有限公司 | 一种支持图片输入的方法和设备 |
CN103809766A (zh) * | 2012-11-06 | 2014-05-21 | 夏普株式会社 | 将文字转换成表情符号的方法和电子装置 |
CN104881146A (zh) * | 2015-04-28 | 2015-09-02 | 北京美秒科技有限公司 | 图片输入方法 |
CN105160033A (zh) * | 2015-09-30 | 2015-12-16 | 北京奇虎科技有限公司 | 表情字符串的处理方法及装置 |
CN105279247A (zh) * | 2015-09-30 | 2016-01-27 | 北京奇虎科技有限公司 | 表情库的生成方法及装置 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2481065C (en) * | 2004-09-07 | 2014-01-21 | Research In Motion Limited | System and method for inserting a graphic object in to a text based message |
CN101281430A (zh) * | 2007-04-06 | 2008-10-08 | 北京三星通信技术研究有限公司 | 具有表情符号联想输入功能的装置及其联想输入方法 |
CN104331245A (zh) * | 2014-11-03 | 2015-02-04 | 荀亮 | 基于触摸屏的点击输入方法、汉字输入方法 |
-
2015
- 2015-09-30 CN CN201510642793.1A patent/CN105160033B/zh active Active
-
2016
- 2016-08-26 WO PCT/CN2016/096919 patent/WO2017054597A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1780437A (zh) * | 2004-11-27 | 2006-05-31 | 乐金电子(中国)研究开发中心有限公司 | 移动通信终端的用户表情图释生成方法及短消息收发方法 |
CN101639755A (zh) * | 2009-09-10 | 2010-02-03 | 腾讯科技(深圳)有限公司 | 一种支持图片输入的方法和设备 |
CN103809766A (zh) * | 2012-11-06 | 2014-05-21 | 夏普株式会社 | 将文字转换成表情符号的方法和电子装置 |
CN104881146A (zh) * | 2015-04-28 | 2015-09-02 | 北京美秒科技有限公司 | 图片输入方法 |
CN105160033A (zh) * | 2015-09-30 | 2015-12-16 | 北京奇虎科技有限公司 | 表情字符串的处理方法及装置 |
CN105279247A (zh) * | 2015-09-30 | 2016-01-27 | 北京奇虎科技有限公司 | 表情库的生成方法及装置 |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111200552A (zh) * | 2018-11-16 | 2020-05-26 | 腾讯科技(深圳)有限公司 | 一种即时通讯方法及其装置、设备和存储介质 |
CN111200552B (zh) * | 2018-11-16 | 2022-05-13 | 腾讯科技(深圳)有限公司 | 一种即时通讯方法及其装置、设备和存储介质 |
CN111369645A (zh) * | 2020-02-28 | 2020-07-03 | 北京百度网讯科技有限公司 | 表情信息的展现方法、装置、设备及介质 |
CN111369645B (zh) * | 2020-02-28 | 2023-12-05 | 北京百度网讯科技有限公司 | 表情信息的展现方法、装置、设备及介质 |
CN112036247A (zh) * | 2020-08-03 | 2020-12-04 | 北京小米松果电子有限公司 | 表情包文字生成方法、装置及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN105160033B (zh) | 2018-09-11 |
CN105160033A (zh) | 2015-12-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017054597A1 (zh) | 表情字符串的处理方法及装置 | |
US20120190388A1 (en) | Methods and apparatus for modifying a multimedia object within an instant messaging session at a mobile communication device | |
US10613717B2 (en) | Reproducing state of source environment when image was screen captured on a different computing device using resource location, resource navigation and positional metadata embedded in image | |
US11126784B2 (en) | Methods, systems, and apparatus for email to persistent messaging | |
US11283740B2 (en) | Name label display method and apparatus | |
US20130191366A1 (en) | Pattern Matching Engine | |
US20200396187A1 (en) | Email reactions through embedded tokens | |
CN104035565A (zh) | 输入方法、输入装置、辅助输入方法及辅助输入系统 | |
CN109474512B (zh) | 即时通信的背景更新方法、终端设备及存储介质 | |
EP3432559A1 (en) | System and method for contextually based fulfillment of communicated service requests via a telephony platform | |
US11582173B2 (en) | Message processing method and electronic device supporting the same | |
CN106878145B (zh) | 一种自定义图片的显示方法、显示装置及显示系统 | |
CN112968828A (zh) | 一种聊天消息的显示方法、装置、设备及存储介质 | |
CN110912801B (zh) | 一种检测电子红包的方法、系统及终端设备 | |
CN114189331A (zh) | 一种密钥存储和读取方法、装置、设备及存储介质 | |
CN114239501A (zh) | 合同生成方法、装置、设备及介质 | |
CN114039969A (zh) | 一种数据传输方法及装置 | |
CN113382086A (zh) | 文档传输方法、装置、电子设备及计算机程序产品 | |
CN112383888A (zh) | 一种短信系统、方法以及设备 | |
CN110796137A (zh) | 一种识别图像的方法和装置 | |
WO2014161425A1 (zh) | 二维码处理方法及移动终端 | |
CN112783407B (zh) | 截图方法及装置 | |
WO2023119302A1 (en) | Message capture in a multi channel communication environment | |
CN115277617A (zh) | 信息处理方法和装置、电子设备、计算机可读存储介质 | |
CN106789560A (zh) | 一种图片显示方法及图片处理设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16850221 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16850221 Country of ref document: EP Kind code of ref document: A1 |