CN113590239A - Session information labeling method and device, electronic equipment and storage medium - Google Patents

Session information labeling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113590239A
CN113590239A CN202110177480.9A CN202110177480A CN113590239A CN 113590239 A CN113590239 A CN 113590239A CN 202110177480 A CN202110177480 A CN 202110177480A CN 113590239 A CN113590239 A CN 113590239A
Authority
CN
China
Prior art keywords
session
text
information
session information
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110177480.9A
Other languages
Chinese (zh)
Inventor
黄铁鸣
代云浩
陈卓铭
李斌
邓林升
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110177480.9A priority Critical patent/CN113590239A/en
Publication of CN113590239A publication Critical patent/CN113590239A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a method and a device for labeling session information, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring session service data of instant messaging application; according to the user dimension information, marking session information generated by the session user in the instant messaging application to obtain marked session information; marking the login state identification based on a marking symbol corresponding to the login state identification to obtain a marked login state identification; and generating session information tagging data according to the tagged session information and the tagged login state identifier, and sending the session information tagging data to the instant messaging application, so that the instant messaging application can tag the session information of a target user according to the session information tagging data.

Description

Session information labeling method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for labeling session information, an electronic device, and a storage medium.
Background
With the continuous development of multimedia technology and the emergence of various social application software, more and more users use the social application software for entertainment activities, such as users can communicate and interact in the social application.
In the existing instant messaging application, a plurality of users can interact with each other through a conversation window, specifically in a text mode, and each user can only perform text interaction in a fixed area of the conversation window, so that only texts are displayed in the fixed area of the conversation window, that is, the display form of text messages is too single, and the interaction mode in the instant messaging application is too single.
Disclosure of Invention
The embodiment of the invention provides a method and a device for labeling session information, electronic equipment and a storage medium, which can enrich the display form of the session information and further enrich the interaction mode in instant messaging application.
The embodiment of the invention provides a method for labeling session information, which comprises the following steps:
obtaining session service data of instant messaging application, wherein the session service data comprises user dimension information and a login state identifier of a session user in the instant messaging application, and the user dimension information comprises information of at least one dimension of the session user in the instant messaging application;
according to the user dimension information, marking session information generated by the session user in the instant messaging application to obtain marked session information;
marking the login state identification based on a marking symbol corresponding to the login state identification to obtain a marked login state identification;
and generating session information marking data according to the marked session information and the marked login state identification, and sending the session information marking data to the instant messaging application so that the instant messaging application marks the session information of the target user according to the session information marking data.
Correspondingly, the embodiment of the present invention further provides a device for labeling session information, including:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring session service data of instant messaging application, the session service data comprises user dimension information and a login state identifier of a session user in the instant messaging application, and the user dimension information comprises information of at least one dimension of the session user in the instant messaging application;
the first labeling module is used for labeling the session information generated by the session user in the instant messaging application according to the user dimension information to obtain labeled session information;
the second labeling module is used for labeling the login state identifier based on a label symbol corresponding to the login state identifier to obtain a labeled login state identifier;
the generation module is used for generating session information labeling data according to the labeled session information and the labeled login state identifier;
and the sending module is used for sending the session information marking data to the instant messaging application so that the instant messaging application marks the session information of the target user according to the session information marking data.
Optionally, in some embodiments of the present application, the first labeling module includes:
the simulation submodule is used for simulating the session information generated by the session user in the instant messaging application to obtain simulated session information, and the simulated session information comprises a simulated session text and a simulated session text background;
the acquisition submodule is used for acquiring a session information tag corresponding to the user dimension information;
and the labeling submodule is used for labeling the simulation session information by using the session information label to obtain the labeled session information.
Optionally, in some embodiments of the present application, the labeling submodule includes:
the extraction unit is used for extracting a session text and a session text background generated by the session user in the instant messaging application from the simulated session information to obtain a simulated session text and a simulated session text background corresponding to the simulated session text;
a determining unit, configured to determine, according to the session information tag, a session text information tag corresponding to the simulated session text and a session text background tag corresponding to the simulated session text background;
the first labeling unit is used for labeling the simulation session text by using the session text information label;
and the second labeling unit is used for labeling the simulated session text background by using the session text background label.
Optionally, in some embodiments of the present application, the first labeling unit includes:
the calling subunit is used for calling the color marking data corresponding to the session text information label;
and the adding subunit is used for adding the color marking data to the text data of the simulated session text to obtain the marked session information.
Optionally, in some embodiments of the present application, the adding subunit is specifically configured to:
detecting a text type of the simulated session text;
when the text type is detected to be a first preset type, adding a preset key value pair to the text data corresponding to the simulated session text to obtain the labeled session information;
and when the text type is detected to be a second preset type, adding a preset text label to the text data corresponding to the simulated session text to obtain the labeled session information.
Optionally, in some embodiments of the present application, the second labeling module is specifically configured to:
acquiring a first label symbol corresponding to the online login state identifier and a second label symbol corresponding to the offline login state identifier;
marking the online login state identifier by using the first marking symbol to obtain a marked online login state identifier;
and marking the off-line login state identification by adopting the second marking symbol to obtain the marked off-line login state identification.
Optionally, in some embodiments of the present application, the generating module is specifically configured to:
determining a data structure type which can be identified by the instant messaging application according to the application type of the instant messaging application to obtain a target structure type;
and converting the marked session information and the marked login state identifier into data of a target structure type to obtain session information marking data.
After session service data of an instant messaging application are acquired, the session service data comprise user dimension information and login state identification of a session user in the instant messaging application, the user dimension information comprises information of at least one dimension of the session user in the instant messaging application, the session information generated in the instant messaging application by the session user is marked according to the user dimension information to obtain marked session information, then the login state identification is marked based on a mark symbol corresponding to the login state identification to obtain marked login state identification, and finally, session information marking data are generated according to the marked session information and the marked login state identification, and the session information marking data are issued to the instant messaging application so that the instant messaging application marks the session information of a target user according to the session information marking data . According to the session information labeling scheme provided by the application, the session information generated by the session user in the instant messaging application can be labeled according to the user dimension information, and the login state identification can be labeled, so that the subsequent labeling of the session information of the target user by the instant messaging application is facilitated, the display form of the session information is enriched, and the interaction mode in the instant messaging application is enriched.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a scene schematic diagram of a session information annotation method provided in an embodiment of the present application;
fig. 1b is a schematic flowchart of a session information annotation method provided in an embodiment of the present application;
fig. 2a is another schematic flow chart of a session information annotation method according to an embodiment of the present application;
fig. 2b is a schematic flowchart of a session information annotation method according to an embodiment of the present application;
fig. 2c is a schematic diagram illustrating a plain text label in the session information labeling method according to the embodiment of the present application;
fig. 2d is a schematic diagram illustrating a markdown text in the session information labeling method according to the embodiment of the present application;
fig. 2e is a schematic diagram of generating session information tagging data in the session information tagging method according to the embodiment of the present application;
fig. 2f is a schematic flow chart of markdown parsing in the instant messaging client;
fig. 3 is a schematic structural diagram of a session information annotation device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method and a device for labeling session information, electronic equipment and a storage medium.
The session information labeling device may be specifically integrated in a terminal or a server, and the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, or a vehicle only, but is not limited thereto. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like, wherein the terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
For example, referring to fig. 1a, the present application provides a session information tagging system, which includes a computer 10, a server 20, and a mobile phone 30, wherein the mobile phone 30 is installed with a client corresponding to an instant messaging application, before a user a communicates and interacts with other users through the instant messaging application in the mobile phone 30, the computer 10 can obtain session service data of the instant messaging application from the server 20, the session service data includes user dimension information and a login status identifier of a session user (i.e., user a) in the instant messaging application, the user dimension information includes information of at least one dimension of the session user in the instant messaging application, then the computer 10 tags session information generated by the session user in the instant messaging application according to the user dimension information to obtain tagged session information, and then the computer 10 tags the login status identifier based on a tag corresponding to the login status identifier, and finally, the computer 10 generates session information tagging data according to the tagged session information and the tagged login state identifier, and sends the session information tagging data to the instant messaging application in the mobile phone 30, so that the instant messaging application tags the session information of the target user according to the session information tagging data.
According to the session information labeling scheme provided by the application, the session information generated by the session user in the instant messaging application can be labeled according to the user dimension information, and the login state identification can be labeled, so that the subsequent labeling of the session information of the target user by the instant messaging application is facilitated, the display form of the session information is enriched, and the interaction mode in the instant messaging application is enriched.
The following are detailed below. It should be noted that the description sequence of the following embodiments is not intended to limit the priority sequence of the embodiments.
A method for labeling session information comprises the following steps: obtaining session service data of the instant messaging application, labeling session information generated by a session user in the instant messaging application according to user dimension information to obtain labeled session information, labeling a login state identifier based on a label symbol corresponding to the login state identifier to obtain a labeled login state identifier, generating session information labeling data according to the labeled session information and the labeled login state identifier, and sending the session information labeling data to the instant messaging application so that the instant messaging application labels the session information of a target user according to the session information labeling data.
Referring to fig. 1b, fig. 1b is a schematic flowchart illustrating a session information annotation method according to an embodiment of the present application. The specific flow of the session information labeling method can be as follows:
101. and acquiring session service data of the instant messaging application.
Instant Messaging (IM) is the most popular communication method in the internet, which allows two or more people to communicate text messages, files, voice and video in real time using a network. Specifically, the session service data of the instant messaging application can be acquired from the server, the session service data includes user dimension information and a login state identifier of a session user in the instant messaging application, and the user dimension information includes information of at least one dimension of the session user in the instant messaging application. The user dimension information refers to information related to the session user, and may include, for example: session user identification information (e.g., user identification number), user account type, and user rating, among others.
It is understood that the user dimension information may also include other information related to the user, and the login status identifier is used to identify the account login situation of the session user, such as offline, online, or abnormal, etc.
102. And marking the session information generated by the session user in the instant messaging application according to the user dimension information to obtain the marked session information.
Specifically, for example, session user identification information may be extracted from the user dimension information, and the identity corresponding to each session user in the instant messaging application may be determined according to the extracted session user identification information, for example, determining that the session user a is an administrator of the group H, the user B is a group owner of the group H, and the user C is a common member of the group H according to the extracted session user identification information, then labeling the session information generated by the user a, the user B, and the user C in the instant messaging application, respectively, to obtain the labeled session information, for example, labeling colors corresponding to the session texts generated by the user a, the user B, and the user C in the instant messaging application, labeling the session text generated by the user a in the instant messaging application as red, labeling the session text generated by the user B in the instant messaging application as yellow, and labeling the session text generated by the user a in the instant messaging application as blue.
Certainly, other information related to the session user may also be extracted from the user dimension information, and a session information tag corresponding to the extracted information is obtained, so as to implement tagging of the session information generated by the session user in the instant messaging application, that is, optionally, in some embodiments, the step "tagging the session information generated by the session user in the instant messaging application according to the user dimension information, so as to obtain tagged session information" may specifically include:
(11) simulating session information generated by a session user in instant messaging application to obtain simulated session information;
(12) acquiring a session information label corresponding to user dimension information;
(13) and labeling the simulation session information by using the session information label to obtain the labeled session information.
For example, specifically, the session information generated by the session user in the instant messaging application, such as the session text and the reference object text, may be simulated, for example, the simulated session user a may refer to the text "@ user B" of the session user B in the instant messaging application, and then label the reference object text "@ user B" according to the session information label, such as labeling the reference object text "@ user B" with color or with a highlighted font.
Optionally, in some embodiments, a session text background corresponding to the session text may also be labeled, that is, the step "labeling the simulated session information with the session information label to obtain the labeled session information" may specifically include:
(21) extracting a session text and a session text background generated by a session user in the instant messaging application from the simulated session information to obtain a simulated session text and a simulated session text background corresponding to the simulated session text;
(22) determining a session text information label corresponding to the simulated session text and a session text background label corresponding to the simulated session text background according to the session information label;
(23) the method further includes labeling the simulated session text with a session text information tag, and labeling the simulated session text background with a session text background tag.
The method includes the steps of labeling a simulation session text and a corresponding simulation session text background respectively by using a color labeling method, and it should be noted that in order to facilitate identification of the labeled session information after labeling, if the method of labeling is used, labeling the simulation session text and the corresponding simulation session text background respectively, the simulation session text and the corresponding simulation session text background can be labeled respectively by using different colors, so that identification of the labeled session information is facilitated after labeling.
Furthermore, color labeling data corresponding to the session text information tag can be called, and then the color labeling data is added to the text data of the simulated session text to obtain the labeled session information, for example, the color labeling data is added to a preset position of the text data to update the text data, so that the labeled simulated session text is realized.
In the present application, the types of the session text may include plain text and a lightweight markup language (Markdown) text, which is a lightweight markup language, and the originator is John Gruber (english). It allows one to write documents using a plain text format that is easy to read and write, and then convert to valid XHTML (or HTML) documents. It can be understood that, the manner of adding the color labeling data to the text data of the text of the simulated conversation is also different for different text types, so that, optionally, in some embodiments, the step "adding the color labeling data to the text data of the text of the simulated conversation to obtain the post-labeling conversation information" may specifically include:
(31) detecting a text type of the simulated session text;
(32) when the text type is detected to be a first preset type, adding a preset key value pair into text data corresponding to the simulated session text to obtain session information after marking;
(33) and when the text type is detected to be a second preset type, adding a preset text label in the text data corresponding to the simulated session text to obtain the session information after marking.
In the application, the first preset type is a plain text type, the second preset type is a markdown text type, and specifically, a key value may be added to an exchange format corresponding to text data to realize labeling of a simulated session text of the plain text type, for example, a JSON (JSON) is taken as an example, and the JSON is a lightweight data exchange format. It stores and represents data in a text format that is completely independent of the programming language, based on a subset of ECMAScript (js specification set by the european computer association). The compact and clear hierarchy makes JSON an ideal data exchange language. The method is easy for human reading and writing, and is also easy for machine analysis and generation, and the network transmission efficiency is effectively improved, for example, two additional key value pairs of 'color 1' and 'color 2' are added in JSON, the value is a '# 16 system value', the values are associated with the expressed color, and the simulation session text of the plain text type can be labeled with the preset color; for the markdown text, when the user sends the markdown text, the user can mark the analog session text of the markdown text type as the preset color only by wrapping the part needing the custom color in the message content by using the preset label and filling the corresponding text attribute.
In addition, for the labeling of the text background of the simulated conversation, the method of the foregoing embodiment can be referred to, and it should be noted that, in terms of product representation, the markdown text can be configured with not only the text color but also the background color. That is to say, for the color labeling of the markdown text, a part needing to define the color by user can be wrapped by using a predetermined label, and the corresponding background attribute is filled, so that the color labeling of the text background is realized.
103. And marking the login state identifier based on the label symbol corresponding to the login state identifier to obtain the marked login state identifier.
The login status identifier may record an online status, an offline status, or an abnormal status of a user account of the session user, and therefore, for different situations, the corresponding reference symbols are different, for example, for the online and offline situations, the reference symbol corresponding to the online login status identifier may be "/b", that is, the session text corresponding to the online user is marked with a bold mark, the reference symbol corresponding to the offline login status identifier may be "/grey", that is, the session text corresponding to the offline user is marked with gray, of course, the online and offline status identifiers may be marked in other ways, for example, the reference symbol corresponding to the online login status identifier is "0", the reference symbol corresponding to the offline login status identifier is "255", that is, the session text corresponding to the online user is black, and the session text corresponding to the offline user is white, therefore, it can be understood that, in some embodiments, the step "labeling the login state identifier based on the label symbol corresponding to the login state identifier to obtain the post-labeling login state identifier" may specifically include:
(41) acquiring a first label symbol corresponding to the online login state identifier and a second label symbol corresponding to the offline login state identifier;
(42) and marking the off-line login state identification by adopting a second label symbol to obtain the marked off-line login state identification.
There are many ways to label the login status identifier, and in addition to the foregoing, the login status identifier may be labeled in the form of a text or a character string, which is not described herein again.
104. And generating session information marking data according to the marked session information and the marked login state identification, and sending the session information marking data to the instant messaging application so that the instant messaging application marks the session information of the target user according to the session information marking data.
The data structures that different communication applications can recognize are different, and therefore, when generating the session information tagging data, it is necessary to determine the corresponding data structure type of the instant communication application, and then generate corresponding session information tagging data, which is convenient for the instant communication application to tag the session information of the target user, that is, optional, in some embodiments, the step "generating the session information tagging data according to the tagged session information and the tagged login status identifier" may specifically include:
(51) determining a data structure type which can be identified by the instant messaging application to obtain a target structure type;
(52) and converting the marked session information and the marked login state identifier into data of the target structure type to obtain session information marked data.
For example, the instant messaging application is an enterprise WeChat, and the data structure adopted by the instant messaging application is a protobuf-format data structure, so that the tagged session information and the tagged login state identifier need to be converted into protobuf-format data of the data structure to obtain session information tagged data, and then the session information tagged data is sent to the instant messaging application, so that the instant messaging application tags the session information of the target user according to the session information tagged data.
According to the embodiment of the application, after session service data of the instant messaging application is obtained, session information generated by a session user in the instant messaging application is marked according to user dimension information to obtain marked session information, then, a login state mark is marked based on a mark symbol corresponding to the login state mark to obtain a marked login state mark, finally, session information marking data are generated according to the marked session information and the marked login state mark, and the session information marking data are issued to the instant messaging application, so that the instant messaging application marks the session information of a target user according to the session information marking data. According to the session information labeling scheme provided by the application, the session information generated by the session user in the instant messaging application can be labeled according to the user dimension information, and the login state identification can be labeled, so that the subsequent labeling of the session information of the target user by the instant messaging application is facilitated, the display form of the session information is enriched, and the interaction mode in the instant messaging application is enriched.
The method according to the examples is further described in detail below by way of example.
In this embodiment, the session information tagging apparatus is specifically integrated in a terminal as an example.
Referring to fig. 2a, a method for labeling session information includes the following specific processes:
201. the terminal obtains the session service data of the instant communication application.
For example, specifically, the terminal may obtain session service data of the instant messaging application from the server, where the session service data includes user dimension information and a login status identifier of a session user in the instant messaging application, and the user dimension information includes information of at least one dimension of the session user in the instant messaging application.
202. And the terminal marks the session information generated by the session user in the instant messaging application according to the user dimension information to obtain the marked session information.
For example, specifically, the terminal may extract session user identification information from the user dimension information, determine an identity corresponding to each session user in the instant messaging application according to the extracted session user identification information, and then label the session information generated by the session user in the instant messaging application according to the determined identity, so as to obtain the labeled session information.
203. And the terminal marks the login state identifier based on the mark symbol corresponding to the login state identifier to obtain the marked login state identifier.
The login state identifier can record the online condition, the offline condition or the abnormal condition of the user account of the session user, so that the corresponding label symbols are different under different conditions, the terminal can label the login state identifier in the form of characters or character strings and can also label the login state identifier through different label symbols, and the session text of the user in the login state presents different colors.
204. And the terminal generates session information labeling data according to the labeled session information and the labeled login state identification, and transmits the session information labeling data to the instant messaging application, so that the instant messaging application labels the session information of the target user according to the session information labeling data.
The data structures that different communication applications can recognize are different, so that when the session information marking data is generated, the terminal needs to determine the corresponding data structure type of the instant communication application, and then generates the corresponding session information marking data, which is convenient for the instant communication application to mark the session information of the target user.
After the terminal of the embodiment of the application acquires the session service data of the instant messaging application, the terminal marks the session information generated by the session user in the instant messaging application according to the user dimension information to obtain the marked session information, then, the terminal marks the login state identifier based on the mark symbol corresponding to the login state identifier to obtain the marked login state identifier, finally, the terminal generates session information mark data according to the marked session information and the marked login state identifier, and transmits the session information mark data to the instant messaging application so that the instant messaging application marks the session information of the target user according to the session information mark data. According to the session information labeling scheme provided by the application, the session information generated by the session user in the instant messaging application can be labeled according to the user dimension information, and the login state identification can be labeled, so that the subsequent labeling of the session information of the target user by the instant messaging application is facilitated, the display form of the session information is enriched, and the interaction mode in the instant messaging application is enriched.
In order to facilitate understanding of the session information tagging method provided in the embodiment of the present application, please refer to fig. 2b, which specifically illustrates an example of tagging a session text of a robot in an enterprise WeChat background, where the robot (bot) is a virtual user supporting a custom access and provides a capability of sending and/or responding to a message to a real user. A bot message is a message sent by the robot. There are many types including plain text, markdown, pictures, link cards, etc.
The robot provides the capability of sending and responding messages for the user, and is suitable for various scenes such as automatic notification, automatic reply, content timing push and the like. In the above scenario, a user needs a strong and flexible text color customization capability, but in the existing scheme of enterprise WeChat, the @ member text only supports displaying blue, and the markdown text only supports displaying three built-in colors of green, gray and orange-red, which is not flexible enough, and it needs to be explained that the @ member text is a special text in the shape of "@ zhang" in a bot message, and an attribute page which can enter the member is clicked and has a special color. Both the plain text type bot message and the markdown type bot message contain such text.
Specifically, referring to fig. 2c, for the plain text conversation text, the background only needs to add two additional key value pairs, "atmecolor" and "atothercolor" in json sending the message, as shown by the mark in the figure, the value is the color indicated by the "# 16 scale value", and the color of the @ member text can be customized. "atmecolor" represents the @ member text color specifically configured for the currently logged-in user at the time this message is received. "atothercolor" represents the @ member text color configured for a non-currently logged-on user. For example, a message, "atmecolor" is configured red, "atherolor" is configured green, and @ Mingming and Xiaogguang and Xiaozhuang. When the xiaoming logs in the enterprise WeChat and sees the message, "@ xiaoming" is displayed in red, and "@ xiaogang" and "@ xiaozong" are displayed in green.
Referring to fig. 2d, for the session text of the markdown text, in terms of product representation, the markdown text may be configured with not only text color but also background color.
For a bot message, the @ member text color can only be configured globally, that is, all @ member texts of @ currently logged-on users in the message use "atmecolor", and all @ member texts of @ non-currently logged-on users in the message use "@ atotherecolor". Compared with @ member texts, markdown texts have greater flexibility, text color and background color can be defined for a certain segment in a message independently, various colors can be configured, and the markdown messages are very flexible. If the color is not filled in, the default text color is black which is globally uniform for the enterprise WeChat, and if the background color is not filled in, the default text color is no background color.
Further, after the session information is labeled and the bot message is sent through the interface, the enterprise wechat background converts the labeled session information into a message which can be identified by the enterprise wechat client according to the labeled session information and sends the message to the client, please refer to fig. 2e, the left part is the message to be sent which is customized by the enterprise wechat background and is filled in a json format, and the right part is the message structure used by the client and the protobuf format.
The 'markdown' field in json loads the main content of the message, where there are two areas where custom messages are inserted: the "content" field and the "attributes" field both support markdown syntax and custom color configuration for implementation of the present solution.
The "content" field indicates the body content of this message. The 'attributes' field is an array, which represents the attachment of the message, the attachment can be a piece of text content, or other forms, the figure is the attribute in the form of the text content related to the scheme, and the content in the text content attribute and the 'content' field has the same rendering capability and configuration capability. The "content" field would be mapped to the "content" field of the message and the text content attribute would be mapped to the "attribute textarea" structure and added as an object to the "attributes" field of the message.
The "atmecolor" field in json indicates the @ member text color of all @ currently logged-on users in this message, and "atherecolor" indicates the @ member text color of all @ non-currently logged-on users in this message, which are mapped to the "atmecolor" and "atherecolor" fields of the message, respectively.
After receiving the message, the client parses the message using a unified message parsing module, where the parsing includes parsing of a markdown syntax, and as shown in fig. 2f, the markdown parsing needs to go through 8 processing steps: the 6 specific grammars are parsed and output as HTML which is translated into renderable data structures. Here, the following description details the font color configuration parsing process related to the present solution: inputting a plain text to be parsed, using a regular expression "</? font [ ^ > ] [ ] > "traversal search font grammar in plain text, if there is matched word string, record its range x-y, utilize regular expression" < font? color [ \\\ "'] ([ ^ a \' ]? > "match and take out its" color "field, reuse regular expression" < font? backsground [ \\\\\ ([ \\' ]? And matching and taking out a background field, and finally inserting a label < style color ═ any 'background ═ any' > < style > before and after the x-y range, and outputting.
After all markdown grammars in the source text are converted into html format, each platform translates the markdown grammars into appropriate renderable data structures. The process of translation is to traverse the HTML tags and express the styles contained in the tags in renderable data structures. Using the iOS/Mac platform as an example, HTML would be translated into NSAttributedString. And after the message analysis is finished, the message is converted into a renderable data structure and is transmitted to the bubble assembly, the bubble renders the color of the corresponding part according to the information contained in the renderable data structure, and finally the color is displayed on a screen to finish the whole process. Rendering is realized by each platform, and on the iOS/Mac platform, rendering can be completed only by assigning the generated NSAttributedString to a component Label provided by the OS.
It should be noted that, in some embodiments, a user may label session information, for example, the user may label session information through a client corresponding to an instant messaging application, and the user may label a font color of the session information sent by the user as red, label a font color of the session information sent by a friend of the user as blue, and label only a font color of the session information sent by a specific friend or a background of the session information, so that a display form of the session information is enriched, and an interaction manner in the instant messaging application is enriched.
In addition, the client can label the session information based on the keywords, firstly, the client identifies the session text corresponding to the session information, detects whether the session text contains preset keywords, specifically, can identify the semantics of the session text by using a semantic analysis model, and then judges whether the session text contains the preset keywords based on the semantic identification result.
When the client detects that the session text contains the preset keyword, the client acquires keyword labeling information corresponding to the keyword, and specifically performs setting according to actual conditions, and details are not repeated herein, if the color of the keyword is labeled as yellow and/or the background corresponding to the keyword is labeled as purple, and the like.
In order to better implement the session information tagging method according to the embodiment of the present application, an embodiment of the present application further provides a device (for short, tagging device) for tagging session information based on the above. The meaning of the noun is the same as that in the above-mentioned session information tagging method, and specific implementation details can refer to the description in the method embodiment.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a session information annotation device according to an embodiment of the present application, where the annotation device may include an obtaining module 301, a first annotation module 302, a second annotation module 303, a generating module 304, and a sending module 305, and specifically may be as follows:
the obtaining module 301 is configured to obtain session service data of the instant messaging application.
For example, specifically, the obtaining module 301 may obtain session service data of the instant messaging application from the server, where the session service data includes user dimension information and a login status identifier of a session user in the instant messaging application, and the user dimension information includes information of at least one dimension of the session user in the instant messaging application.
The first labeling module 302 is configured to label, according to the user dimension information, session information generated by the session user in the instant messaging application, so as to obtain labeled session information.
For example, specifically, the first labeling module 302 may extract session user identification information from the user dimension information, the first labeling module 302 determines an identity corresponding to each session user in the instant messaging application according to the extracted session user identification information, and then the first labeling module 302 labels the session information generated by the session user in the instant messaging application according to the determined identity to obtain the labeled session information.
Optionally, in some embodiments, the first labeling module 302 may specifically include:
the simulation submodule is used for simulating session information generated by a session user in the instant messaging application to obtain simulated session information;
the acquisition submodule is used for acquiring a session information label corresponding to the user dimension information;
and the labeling submodule is used for labeling the simulation session information by using the session information label to obtain the labeled session information.
Optionally, in some embodiments, the labeling sub-module may specifically include:
the extraction unit is used for extracting the session text and the session text background generated by the session user in the instant messaging application from the simulated session information to obtain a simulated session text and a simulated session text background corresponding to the simulated session text;
the determining unit is used for determining a session text information label corresponding to the simulated session text and a session text background label corresponding to the simulated session text background according to the session information label;
the first labeling unit is used for labeling the simulation session text by using the session text information label;
and the second labeling unit is used for labeling the background of the simulated conversation text by using the background label of the conversation text.
Optionally, in some embodiments, the first labeling unit may specifically include:
the calling subunit is used for calling the color marking data corresponding to the session text information label;
and the adding subunit is used for adding the color marking data to the text data of the simulated session text to obtain the marked session information.
Optionally, in some embodiments, the adding subunit may specifically be configured to: detecting the text type of the simulated session text, and when the text type is detected to be a first preset type, adding a preset key value pair into text data corresponding to the simulated session text to obtain labeled session information; and when the text type is detected to be a second preset type, adding a preset text label in the text data corresponding to the simulated session text to obtain the session information after marking.
The second labeling module 303 is configured to label the login status identifier based on a label symbol corresponding to the login status identifier, so as to obtain the labeled login status identifier.
The login status identifier may record an online status, an offline status, or an abnormal status of a user account of the session user, so that, for different situations, corresponding labels are also different, and the second labeling module 303 may label the login status identifier in a form of a character or a string, or label the login status identifier with different labels, so that the session text of the user in the login status presents different colors.
Optionally, in some embodiments, the second labeling module 303 may be specifically configured to: and obtaining a first label symbol corresponding to the online login state identifier and a second label symbol corresponding to the offline login state identifier, labeling the online login state identifier by adopting the first label symbol to obtain a labeled online login state identifier, and labeling the offline login state identifier by adopting the second label symbol to obtain a labeled offline login state identifier.
The generating module 304 is configured to generate session information tagging data according to the tagged session information and the tagged login state identifier.
Since different communication applications can identify different data structures, when generating the session information tagging data, the generating module 304 needs to determine the data structure type corresponding to the instant communication application, and further generates the corresponding session information tagging data, so that the instant communication application can tag the session information of the target user conveniently.
Optionally, in some embodiments, the generating module 304 may specifically be configured to: and determining a data structure type which can be identified by the instant messaging application to obtain a target structure type, converting the marked session information and the marked login state identifier into data of the target structure type to obtain session information marked data.
The sending module 305 is configured to send the session information tagging data to the instant messaging application, so that the instant messaging application tags the session information of the target user according to the session information tagging data.
After the obtaining module 301 of this embodiment obtains session service data of an instant messaging application, the first labeling module 302 labels, according to user dimension information, session information generated by a session user in the instant messaging application to obtain labeled session information, then the second labeling module 303 labels, based on a label symbol corresponding to a login state identifier, a login state identifier after labeling, and finally the generating module 304 generates session information labeled data according to the labeled session information and the labeled login state identifier, and the sending module 305 sends the session information labeled data to the instant messaging application, so that the instant messaging application labels, according to the session information labeled data, the session information of a target user. According to the session information labeling scheme provided by the application, the session information generated by the session user in the instant messaging application can be labeled according to the user dimension information, and the login state identification can be labeled, so that the subsequent labeling of the session information of the target user by the instant messaging application is facilitated, the display form of the session information is enriched, and the interaction mode in the instant messaging application is enriched.
In addition, an electronic device according to an embodiment of the present application is further provided, as shown in fig. 4, which shows a schematic structural diagram of the electronic device according to an embodiment of the present application, and specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions as follows:
obtaining session service data of the instant messaging application, labeling session information generated by a session user in the instant messaging application according to user dimension information to obtain labeled session information, labeling a login state identifier based on a label symbol corresponding to the login state identifier to obtain a labeled login state identifier, generating session information labeling data according to the labeled session information and the labeled login state identifier, and sending the session information labeling data to the instant messaging application so that the instant messaging application labels the session information of a target user according to the session information labeling data.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
According to the embodiment of the application, after session service data of the instant messaging application is obtained, session information generated by a session user in the instant messaging application is marked according to user dimension information to obtain marked session information, then, a login state mark is marked based on a mark symbol corresponding to the login state mark to obtain a marked login state mark, finally, session information marking data are generated according to the marked session information and the marked login state mark, and the session information marking data are issued to the instant messaging application, so that the instant messaging application marks the session information of a target user according to the session information marking data. According to the session information labeling scheme provided by the application, the session information generated by the session user in the instant messaging application can be labeled according to the user dimension information, and the login state identification can be labeled, so that the subsequent labeling of the session information of the target user by the instant messaging application is facilitated, the display form of the session information is enriched, and the interaction mode in the instant messaging application is enriched.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the session information tagging methods provided in the present application. For example, the instructions may perform the steps of:
obtaining session service data of the instant messaging application, labeling session information generated by a session user in the instant messaging application according to user dimension information to obtain labeled session information, labeling a login state identifier based on a label symbol corresponding to the login state identifier to obtain a labeled login state identifier, generating session information labeling data according to the labeled session information and the labeled login state identifier, and sending the session information labeling data to the instant messaging application so that the instant messaging application labels the session information of a target user according to the session information labeling data.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any session information labeling method provided in the embodiments of the present application, beneficial effects that can be achieved by any session information labeling method provided in the embodiments of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The above detailed description is given to a session information labeling method, device, electronic device, and storage medium provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principle and implementation of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (15)

1. A method for labeling session information is characterized by comprising the following steps:
obtaining session service data of instant messaging application, wherein the session service data comprises user dimension information and a login state identifier of a session user in the instant messaging application, and the user dimension information comprises information of at least one dimension of the session user in the instant messaging application;
according to the user dimension information, marking session information generated by the session user in the instant messaging application to obtain marked session information;
marking the login state identification based on a marking symbol corresponding to the login state identification to obtain a marked login state identification;
and generating session information marking data according to the marked session information and the marked login state identification, and sending the session information marking data to the instant messaging application so that the instant messaging application marks the session information of the target user according to the session information marking data.
2. The method according to claim 1, wherein the labeling the session information generated by the session user in the instant messaging application according to the user dimension information to obtain labeled session information comprises:
simulating session information generated by the session user in the instant messaging application to obtain simulated session information;
acquiring a session information label corresponding to the user dimension information;
and labeling the simulation session information by using the session information label to obtain labeled session information.
3. The method of claim 2, wherein the tagging the simulation session information with the session information tag to obtain tagged session information comprises:
extracting a session text and a session text background generated by the session user in the instant messaging application from the simulated session information to obtain a simulated session text and a simulated session text background corresponding to the simulated session text;
determining a session text information label corresponding to the simulated session text and a session text background label corresponding to the simulated session text background according to the session information label;
labeling the simulated conversation text by using the conversation text information label, and;
and marking the simulated session text background by using the session text background label.
4. The method of claim 3, wherein said tagging the simulated conversational text with the conversational text information tag comprises:
calling color marking data corresponding to the conversation text information label;
and adding the color marking data to the text data of the simulated session text to obtain the marked session information.
5. The method of claim 4, wherein said adding said color labeling data to text data of said simulated conversation text to obtain post-labeling conversation information comprises:
detecting a text type of the simulated session text;
when the text type is detected to be a first preset type, adding a preset key value pair to the text data corresponding to the simulated session text to obtain the labeled session information;
and when the text type is detected to be a second preset type, adding a preset text label to the text data corresponding to the simulated session text to obtain the labeled session information.
6. The method according to any one of claims 1 to 5, wherein the labeling the login status identifier based on the label symbol corresponding to the login status identifier to obtain a labeled login status identifier comprises:
acquiring a first label symbol corresponding to the online login state identifier and a second label symbol corresponding to the offline login state identifier;
marking the online login state identifier by using the first marking symbol to obtain a marked online login state identifier;
and marking the off-line login state identification by adopting the second marking symbol to obtain the marked off-line login state identification.
7. The method according to any one of claims 1 to 5, wherein the generating session information tagging data according to the tagged session information and the tagged login state identifier comprises:
determining a data structure type which can be identified by the instant messaging application to obtain a target structure type;
and converting the marked session information and the marked login state identifier into data of a target structure type to obtain session information marking data.
8. A session information labeling apparatus, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring session service data of instant messaging application, the session service data comprises user dimension information and a login state identifier of a session user in the instant messaging application, and the user dimension information comprises information of at least one dimension of the session user in the instant messaging application;
the first labeling module is used for labeling the session information generated by the session user in the instant messaging application according to the user dimension information to obtain labeled session information;
the second labeling module is used for labeling the login state identifier based on a label symbol corresponding to the login state identifier to obtain a labeled login state identifier;
the generation module is used for generating session information labeling data according to the labeled session information and the labeled login state identifier;
and the sending module is used for sending the session information marking data to the instant messaging application so that the instant messaging application marks the session information of the target user according to the session information marking data.
9. The apparatus of claim 8, wherein the first labeling module comprises:
the simulation submodule is used for simulating the session information generated by the session user in the instant messaging application to obtain simulated session information, and the simulated session information comprises a simulated session text and a simulated session text background;
the acquisition submodule is used for acquiring a session information tag corresponding to the user dimension information;
and the labeling submodule is used for labeling the simulation session information by using the session information label to obtain the labeled session information.
10. The apparatus of claim 9, wherein the labeling submodule comprises:
the extraction unit is used for extracting a session text and a session text background generated by the session user in the instant messaging application from the simulated session information to obtain a simulated session text and a simulated session text background corresponding to the simulated session text;
a determining unit, configured to determine, according to the session information tag, a session text information tag corresponding to the simulated session text and a session text background tag corresponding to the simulated session text background;
the first labeling unit is used for labeling the simulation session text by using the session text information label;
and the second labeling unit is used for labeling the simulated session text background by using the session text background label.
11. The apparatus of claim 10, wherein the first labeling unit comprises:
the calling subunit is used for calling the color marking data corresponding to the session text information label;
and the adding subunit is used for adding the color marking data to the text data of the simulated session text to obtain the marked session information.
12. The apparatus according to claim 11, wherein the adding subunit is specifically configured to:
detecting a text type of the simulated session text;
when the text type is detected to be a first preset type, adding a preset key value pair to the text data corresponding to the simulated session text to obtain the labeled session information;
and when the text type is detected to be a second preset type, adding a preset text label to the text data corresponding to the simulated session text to obtain the labeled session information.
13. The apparatus according to any one of claims 8 to 12, wherein the second labeling module is specifically configured to:
acquiring a first label symbol corresponding to the online login state identifier and a second label symbol corresponding to the offline login state identifier;
marking the online login state identifier by using the first marking symbol to obtain a marked online login state identifier;
and marking the off-line login state identification by adopting the second marking symbol to obtain the marked off-line login state identification.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the session information annotation method according to any one of claims 1 to 7 when executing the program.
15. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, implements the steps of the session information annotation method according to any one of claims 1 to 7.
CN202110177480.9A 2021-02-07 2021-02-07 Session information labeling method and device, electronic equipment and storage medium Pending CN113590239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110177480.9A CN113590239A (en) 2021-02-07 2021-02-07 Session information labeling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110177480.9A CN113590239A (en) 2021-02-07 2021-02-07 Session information labeling method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113590239A true CN113590239A (en) 2021-11-02

Family

ID=78238082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110177480.9A Pending CN113590239A (en) 2021-02-07 2021-02-07 Session information labeling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113590239A (en)

Similar Documents

Publication Publication Date Title
CN105760534B (en) Data structure, hadoop cluster, server and its application method of customized serializability
CN109429522A (en) Voice interactive method, apparatus and system
CN108877782B (en) Speech recognition method and device
US20090055186A1 (en) Method to voice id tag content to ease reading for visually impaired
CN110609965B (en) Page display method, device and storage medium
CN107122398B (en) Data display chart generation method and system
CN112929253B (en) Virtual image interaction method and device
WO2007034829A1 (en) Video creating device and video creating method
CN113778419B (en) Method and device for generating multimedia data, readable medium and electronic equipment
CN115510347A (en) Presentation file conversion method and device, electronic equipment and storage medium
CN108306813B (en) Session message processing method, server and client
CN113535541A (en) Test method, test device, storage medium and computer equipment
CN117749899A (en) Protocol conversion framework, device communication method, device and computer storage medium
CN116701669A (en) Method, device, equipment and storage medium for generating multimedia content
CN113850898A (en) Scene rendering method and device, storage medium and electronic equipment
US10984383B2 (en) Book information collaboration system and method
CN114422468A (en) Message processing method, device, terminal and storage medium
CN109739504B (en) Method for automatically generating H5 service handling page according to background configuration
CN107248947A (en) Expression processing method and processing device, computer equipment and storage medium
CN113590239A (en) Session information labeling method and device, electronic equipment and storage medium
CN114595702A (en) Text translation model training method, text translation method and related device
CN109299240B (en) Chat robot knowledge display method and device
CN112818709A (en) Speech translation system and method for multi-user voice conference recording marks
CN114385946A (en) Data structure editing method and device, electronic equipment and storage medium
CN112199335A (en) Generation method and generation system of operation log

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40055751

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination