CN113885757B - Message processing method, device, equipment and storage medium - Google Patents
Message processing method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN113885757B CN113885757B CN202111233787.2A CN202111233787A CN113885757B CN 113885757 B CN113885757 B CN 113885757B CN 202111233787 A CN202111233787 A CN 202111233787A CN 113885757 B CN113885757 B CN 113885757B
- Authority
- CN
- China
- Prior art keywords
- message
- session
- card
- target
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 43
- 238000000034 method Methods 0.000 claims abstract description 67
- 230000006870 function Effects 0.000 claims abstract description 35
- 230000004044 response Effects 0.000 claims description 29
- 238000012545 processing Methods 0.000 claims description 27
- 238000004590 computer program Methods 0.000 claims description 10
- 238000013507 mapping Methods 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 claims description 4
- 238000012423 maintenance Methods 0.000 abstract description 10
- 238000010586 diagram Methods 0.000 description 22
- 230000003993 interaction Effects 0.000 description 22
- 230000008569 process Effects 0.000 description 12
- 238000006243 chemical reaction Methods 0.000 description 10
- 230000002452 interceptive effect Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 7
- 230000008719 thickening Effects 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000010365 information processing Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/541—Client-server
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Information Transfer Between Computers (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a message processing method, a device, equipment and a storage medium, wherein the method comprises the following steps: responding to a first triggering operation of a user on a message card sending function, displaying a message input area on a current interface, acquiring a first message input by the user in the message input area, wherein the first message is input according to a grammar format of a preset lightweight markup language or according to a grammar format of a preset natural language, the first message comprises attribute information of a plurality of entities forming the message card, responding to a second triggering operation of the user on sending the first message to a first target session, sending the first message to a server, generating the message card according to the first message by the server, and sending the message card to a target client corresponding to the user in the first target session. Therefore, the message card can be quickly sent to the target session selected by the user, the learning threshold is low, and the maintenance is simple.
Description
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a message.
Background
With the rapid development of the internet, users can use communication applications (such as instant messaging applications or other communication applications) installed in terminal devices to perform interactions of various types of messages, such as text, pictures, audio/video, and message cards. The message card is a message displayed in a card form, can be combined with contents such as pictures and texts, has graphic layout capability, and can be used for displaying rich text contents more structurally and can be additionally provided with interaction components such as skip buttons and selectors.
How to provide a message card sending method with low learning threshold and simple maintenance, so that a user can send a message card to a session selected by the user quickly is a problem to be solved.
Disclosure of Invention
The application provides a message processing method, a device, equipment and a storage medium, which are used for providing a message card sending method with low learning threshold and simple maintenance, so that a user can quickly send a message card to a target session selected by the user.
In a first aspect, the present application provides a message processing method, where the method is applied to a client, the method includes:
Responding to a first triggering operation of a user on a message sending card function, and displaying a message input area on a current interface;
acquiring a first message input by the user in the message input area, wherein the first message is input according to a grammar format of a preset lightweight markup language or according to a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming a message card;
and responding to a second triggering operation of the user for sending the first message to a first target session, sending the first message to a server, generating a message card according to the first message by the server, and sending the message card to a target client corresponding to the user in the first target session.
In a second aspect, the present application provides a message processing method, the method being applied to a server, the method comprising:
receiving a first message sent by a client, wherein the format of the first message is a grammar format of a preset lightweight markup language or a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming a message card;
And generating a message card according to the first message, and sending the message card to a target client corresponding to the user in the first target session.
In a third aspect, the present application provides a message processing apparatus comprising:
the display module is used for responding to the first triggering operation of the user on the function of sending the message card and displaying the message input area on the current interface;
the information card comprises an acquisition module, a message card and a message processing module, wherein the acquisition module is used for acquiring a first message input by a user in the message input area, the first message is input according to a grammar format of a preset lightweight markup language or according to a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming the message card;
the sending module is used for responding to the second triggering operation of the user for sending the first message to the first target session, sending the first message to a server, generating a message card according to the first message by the server, and sending the message card to a target client corresponding to the user in the first target session.
In a fourth aspect, the present application provides a message processing apparatus comprising:
The receiving module is used for receiving a first message sent by the client, wherein the format of the first message is a grammar format of a preset lightweight markup language or a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming a message card;
the generation module is used for generating a message card according to the first message;
and the sending module is used for sending the message card to a target client corresponding to the user in the first target session.
In a fifth aspect, the present application provides a terminal device, including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the message processing method of the first aspect or any of the possible implementations of the first aspect via execution of the executable instructions.
In a sixth aspect, the present application provides a server comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the message processing method of the second aspect or any of the possible embodiments of the second aspect via execution of the executable instructions.
In a seventh aspect, an embodiment of the present application provides a computer readable storage medium, on which a computer program is stored, the computer program implementing the first aspect or each possible implementation manner of the second aspect or any one of the possible implementation manners of the second aspect or each possible implementation manner of the second aspect when executed by a processor.
In an eighth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed by a processor, implements the message processing method of the first aspect or each possible implementation manner of the second aspect or any one of the second aspect.
The method, the device, the equipment and the storage medium for processing the message provided by the application have the advantages that after responding to the first triggering operation of a user on the function of sending the message card, the message input area is displayed on the current interface, the client acquires the first message input by the user in the message input area, the first message is input according to the grammar format of the preset lightweight markup language or is input according to the grammar format of the preset natural language, the client sends the first message to the server after responding to the second triggering operation of the user on the function of sending the first message to the first target session, wherein the first message comprises attribute information of a plurality of entities forming the message card, and the server generates the message card according to the first message and sends the message card to the target client corresponding to the user in the first target session. Therefore, the message card can be quickly sent to the target session selected by the user, the threshold for learning the lightweight markup language or the natural language is low for the user, the method is convenient and quick, the first message of the message card generated by the user only needs to comprise attribute information of a plurality of entities forming the message card, the required code is short, and the maintenance is simple.
Drawings
Fig. 1 is a schematic diagram of an application scenario of a message processing method according to an embodiment of the present application;
FIG. 2 is an interactive flow chart of a message processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a message input area in a session window interface of a first session in a message processing method according to an embodiment of the present application;
fig. 4 is a schematic diagram of a message input area in an interface of a first application in a message processing method according to an embodiment of the present application;
FIG. 5 is an interactive flow chart of a message processing method according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an interface in a message processing method according to an embodiment of the present application;
fig. 7 is an interface schematic diagram in a message processing method according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an interface in a message processing method according to an embodiment of the present application;
FIG. 9 is an interactive flow chart of a message processing method according to an embodiment of the present application;
fig. 10 is a schematic diagram of a message input area in an interface of a first application in a message processing method according to an embodiment of the present application;
FIG. 11 is an interactive flowchart of a message processing method according to an embodiment of the present application;
Fig. 12 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings. The embodiments described below by referring to the drawings are illustrative and intended to explain the present application and should not be construed as limiting the application.
The terms first and second and the like in the description, the claims and the drawings of embodiments of the application are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the application described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
1. And a session is established by two or more users performing instant messaging, such as user A and user B through respective instant messaging clients via an instant messaging server, or such as user A and multiple users through respective instant messaging clients via an instant messaging server, wherein any one end of the instant messaging can initiate establishment and withdrawal of the session.
2. The message card is a message displayed in a card form, and can be combined with contents such as pictures, texts, links, interaction components and the like, wherein the interaction components comprise jump buttons, selection buttons and the like, and have graphic layout capability, so that the message card can display rich text contents more structurally. For example, the message card may correspond to a display area in the session window, for example, may be a rectangular display area, where the content to be displayed by the message card is displayed. In the embodiment of the present application, the entities forming the message card may include, for example, a title, a text, a link, an interaction component, a picture, a separator, remark information, etc., and taking the above entities as an example, attribute information of each entity is shown in the following table one:
List one
In the related art, when a message card needs to be sent, a user can input a JSON code for generating the message card according to a specific JSON grammar format through a message card setting tool provided by an open platform, the open platform can display the JSON code of the message card to be generated and a message card preview to be generated on a current interface, and if the message card preview to be generated is not intended by the user, the user can input or modify the JSON code again. However, in the above method, the user needs to grasp the JSON grammar to transmit the message card desired by the user, and the learning threshold is high for the user, and the JSON code for generating the message card is long, which is troublesome to maintain.
In order to solve the problem, the embodiments of the present application provide a message processing method, apparatus, device, and storage medium, where after responding to a first trigger operation of a user on a function of sending a message card, a message input area is displayed on a current interface by a client, the client obtains a first message input by the user in the message input area, the first message is input according to a syntax format of a preset lightweight markup language or is input according to a syntax format of a preset natural language, and after responding to a second trigger operation of the user on sending the first message to a first target session, the client sends the first message to a server, where the first message includes attribute information of a plurality of entities forming the message card, and the server generates a message card according to the first message and sends the message card to a target client corresponding to the user in the first target session. Therefore, when a user needs to send a message card to a first target session, the user only needs to input a first message comprising attribute information of a plurality of entities forming the message card in a message input area displayed by a client according to a preset grammar format of a lightweight markup language or a preset grammar format of a natural language, after triggering to send the first message to the first target session, the server can send the message card corresponding to the first message input by the user to the first target session, and for the user, the threshold for learning the lightweight markup language or the natural language is low, the method is convenient and quick, the first message of the user generated message card only needs to comprise the attribute information of the plurality of entities forming the message card, the required code is short, and the maintenance is simple.
Next, an application scenario according to an embodiment of the present application is illustrated.
The message processing method provided by the embodiment of the application can be at least applied to the following application scenes, and is explained below with reference to the accompanying drawings.
Fig. 1 is a schematic view of an application scenario of a message processing method according to an embodiment of the present application, as shown in fig. 1, a first terminal device 10 and a second terminal device 20 communicate with a server 30 through a network, where the first terminal device 10 and the second terminal device 20 may be clients with a function of sending a message card, for example, an instant messaging application may be installed, and the instant messaging application has a function of sending a message card. The first terminal device 10 may perform instant communication with other terminal devices, for example, with the second terminal device 20, through the server 30. The user using the first terminal device 10 needs to send a message card to the user using the second terminal device 20, the user operates the first terminal device 10, for example, opens a client having a function of sending the message card, the first terminal device 10 responds to a first trigger operation of the user for sending the message card, a message input area is displayed on a current interface, then the user inputs a first message in the message input area according to a preset grammar format of a lightweight markup language or according to a preset grammar format of a natural language, the first terminal device 10 obtains the first message input by the user in the message input area, the first terminal device 10 responds to a second trigger operation of the user for sending the first message to a first target session, the first message is sent to the server 30, the server 30 generates a message card according to the first message and sends the message card to a target client corresponding to the user in the first target session, and the terminal device where the target client is located is the second terminal device 20. After receiving the message card, the second terminal device 20 displays the message card in the first target session. Optionally, the terminal device where the target client is located may also be the first terminal device 10. The first terminal device 10 and the second terminal device 20 may be a personal computer, a notebook computer, an intelligent terminal, a tablet computer, a portable wearable device, etc., and the server 30 may be an independent server or a server cluster formed by a plurality of servers.
The following describes the technical scheme of the present application and how the technical scheme of the present application solves the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is an interaction flow chart of a message processing method according to an embodiment of the present application, as shown in fig. 2, the method of this embodiment may include:
and S101, the client side responds to a first triggering operation of the user on the function of sending the message card, and displays a message input area on the current interface.
Specifically, in the embodiment of the application, when a user needs to send a message card, three alternative interaction modes exist, the first mode is to open an instant messaging application to send a first message in a grammar format of a preset lightweight markup language directly with a chat robot, the second mode is to open an applet to submit the first message in the grammar format of the preset lightweight markup language through an input box of the applet, and the third mode is to open a cloud document to input and submit the first message in the grammar format of the preset lightweight markup language or the first message in the grammar format of the preset natural language, so that the message card corresponding to the first message can be sent to a first target session selected by the user.
In the first interaction mode, the first message is input according to a preset grammar format of a lightweight markup language, the first triggering operation includes an operation of opening a first session where the chat robot is located, the chat robot has a message card sending function, and the message input area is a message input area in a session window interface of the first session. Or the first triggering operation comprises an operation of creating a second session, wherein the members in the second session comprise chat robots, and the message input area is a message input area in a session window interface of the second session.
Fig. 3 is a schematic diagram of a message input area in a session window interface of a first session in a message processing method according to an embodiment of the present application, where, as shown in fig. 3, the message input area is a message input area in the session window interface of the first session, and a user may click a button shown in fig. 3 to expand the message input area, so that the user may input the first message conveniently.
In the second interaction mode, the opening applet submits a first message in a grammar format of a preset lightweight markup language through an input box of the applet, and at this time, the first triggering operation includes an operation of opening a first application having a message card sending function, and the message input area is a message input area in an interface of the first application. As an example, fig. 4 is a schematic diagram of a message input area in an interface of a first application in a message processing method according to an embodiment of the present application, as shown in fig. 4, where a user enters a brocade application by opening a workbench on the left side, and a description of the brocade application is displayed on the interface of the brocade application as shown in fig. 4, "the brocade is a tool … for simply and efficiently sending a message card," where the usage description may include an input grammar format description of the first message, for example, a grammar format description of a lightweight markup language, and what kind of message card is required to be sent by the user in a display mode may be input according to the grammar format description of the lightweight markup language. A message input area is displayed below the interface of the brocade application, where a user may input a first message.
In the third interaction mode, that is, opening the cloud document to input and submit the first message in the grammar format of the preset lightweight markup language or the first message in the grammar format of the preset natural language, the first triggering operation includes an operation of opening the first application with the message card sending function, and the message input area is a message input area in the interface of the first application. The first application at this time may be a brocade application, and the cloud document may be opened when the brocade application is opened, and the message input area is the display page of the cloud document, where the user may input the first message in the message input area, and the cloud document may support the user to input the first message in the syntax format of the preset lightweight markup language or the first message in the syntax format of the preset natural language.
S102, the client acquires a first message input by a user in a message input area, wherein the first message is input according to a grammar format of a preset lightweight markup language or according to a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming a message card.
Specifically, the user inputs a first message in the message input area, and the client may acquire the first message, where the first message includes attribute information of a plurality of entities that compose the message card, and in this embodiment, optionally, the entities that compose the message card may include, for example, a title, a text, a link, an interaction component, a picture, a separator, and remark information, where attribute information of each entity is as shown in the above table, and the interaction component includes, for example, a skip button, a selection button, and so on. The plurality of entities may include at least two of a title, text, a link, an interactive component, a picture, a separator, and remark information.
S103, the client side responds to a second triggering operation of the user for sending the first message to the first target session, and sends the first message to the server.
S104, the server receives the first message sent by the client, generates a message card according to the first message, and sends the message card to a target client corresponding to the user in the first target session.
Specifically, in the first interaction manner, the first target session is the first session or the second session, and the step of sending, by the client, the first message to the server in S103 may specifically include: the client sends a first message and an identification of the first target session to the server. Accordingly, S104 may specifically be: and the server generates a message card according to the first message and sends the message card to a target client corresponding to the user in the first target session according to the identification of the first target session.
Optionally, in the first interaction manner, as an implementation manner, after the client sends the first message and the identifier of the first target session to the server, the method may further include: and the client receives the message card sent by the server and displays the message card in the first session or the second session. Therefore, in the first interaction mode, the user can send the first message input according to the grammar format of the preset lightweight markup language to the chat robot with the message card sending function in the conversation, namely the message card required by the user can be received in the conversation, the user can further forward the message card or perform other processing, such as forwarding to other conversations, and the message card can be conveniently and rapidly sent.
Optionally, in the first interaction manner described above, as another implementation manner, the session identifier of the first target session may be carried in the first message, that is, the user needs to send the message card to the first target session, the session identifier of the first target session may be directly carried in the first message, when the first message is sent to the server, the session identifier of the first target session is also sent to the server together, and the server may directly generate the message card according to the first message, and send the message card to the target client corresponding to the user in the first target session according to the identifier of the first target session carried by the first message.
In the embodiment of the present application, the first session, the second session or the first target session may be a single session (i.e. single chat) or group chat, the session identifier may be a name of the session (e.g. a name of a group chat is XX group), and the first target session may be a target user, where the session identifier of the first target session may be an identifier of the target user (e.g. a name of the target user), for example, may be a name of the target user in an address book stored in the client.
Optionally, in this embodiment, after S104, it may further include:
The server sends a response message to the client that the message card has been sent to the first target session. Accordingly, the method of the present embodiment may further include: the client presents the response message in either the first session or the second session. The response message is displayed in the first target session through the client, so that the user can know that the message card is sent to the first target session.
In the first interaction manner, optionally, in S103, the client responds to a second triggering operation of the user to send the first message to the first target session, where the second triggering operation may be, for example, an operation that the user triggers the first message to be sent in the first session or the second session, for example, the user clicks a send button displayed on the session interface, or the user clicks an "enter" key on the keyboard.
In the second interaction manner, optionally, in S103, the response to the second triggering operation of the user to send the first message to the first target session by the client may be: in response to a user clicking on a send button displayed in an interface of the first application, such as the send button shown in fig. 4, a first target session candidate is displayed in the interface of the first application, the first target session candidate including an identification of at least one candidate session, and in response to a user selecting the identification of the first target session from the first target session candidates and determining a send operation. Accordingly, in S103, the client sends the first message to the server, which may specifically be that the client sends the first message and the identifier of the first target session to the server.
In the second interaction manner, optionally, the message card may further carry indication information, where the indication information is used to indicate that the message card is from the first application. Since the message card is sent by the applet to a target session with the user identity, the message card may, for example, carry indication information (e.g., add a remark information) at the bottom of the message card, and the indication information may, for example, be "from the application brocade".
In the third interaction manner, optionally, the session identifier of the first target session may be carried in the first message, and the response to the second triggering operation of the user to send the first message to the first target session in S103 may be: in response to a user clicking on a send button displayed in an interface of the first application.
In an embodiment of the present application, further, as an implementation manner, the server in S104 generates a message card according to the first message, and sends the message card to a target client corresponding to the user in the first target session, which may specifically include:
s1041, the server analyzes the first message to obtain second information, wherein the second information comprises a plurality of entities forming the message card and attribute information of each entity in the plurality of entities.
When the format of the first message is a grammar format of a preset lightweight markup language, the server analyzes the first message to obtain second information, which may be specifically: and matching the first message according to a preset regular expression of each entity to obtain a plurality of entities forming the message card and attribute information of each entity in the plurality of entities.
The format of the first message is a preset grammar format of natural language, and the server analyzes the first message to obtain second information, which may be specifically: converting the first message into a first message in the grammar format of the lightweight markup language according to a mapping relation between the pre-stored grammar format of the natural language and the grammar format of the lightweight markup language, and matching the first message in the grammar format of the lightweight markup language according to a preset regular expression of each entity to obtain a plurality of entities forming a message card and attribute information of each entity in the plurality of entities.
In one embodiment, the server parses the first message to obtain the second information, or may parse the first message into an Abstract Syntax Tree (AST) by using a syntax analysis method, and then obtain the plurality of entities forming the message card and attribute information (i.e. the second information) of each of the plurality of entities according to the abstract syntax tree.
S1042, the server converts the second information into the third information in JSON grammar format.
In one implementation manner, the second information is converted into the third information in JSON syntax format, which specifically may be:
converting the attribute information of each entity into information in a JSON grammar format, filling the converted information in the JSON grammar format into a corresponding position of a JSON code used for generating a message card to obtain a first JSON code, and determining the first JSON code as third information.
For example, taking an entity as a header, the regular expression in the first message for matching the header is: "/? ([ ζ/n ], [? N? /
For example, the first message entered by the user is: epidemic situation 2021-10-11
The first message indicates that the content behind # is the title content, where a space behind # is provided, and in this embodiment, the title color and the title content may be distinguished by the space, that is, the content in front of the space is the title color, the content behind the space is the title content, and if there is no content in front of the space, the title color is the default color.
Matching the first message using the regular expression for matching the title described above may result in the title content being "today's epidemic 2021-10-11", and the second message may be in the form of a key-value pair, e.g., the second message is the title content (content): epidemic situation 2021-10-11 today.
The server converts the second information into third information in JSON syntax format, for example, the third information after converting the second information in the example is:
wherein, the default title is black in the above example, optionally, the user may also input the color of the title, for example, the first message input by the user is:
# red today epidemic 2021-10-11
The content following the first message # is the title color and the title content, and in this embodiment, the title color and the title content may be distinguished by a space following red, that is, the content preceding the space is the title color and the content following the space is the title content.
Matching the first message using the regular expression for matching the title described above may result in a title color of red and a title content of "today's epidemic 2021-10-11", and the second message may be in the form of a key-value pair, e.g., the second message is a title color: red; title content (content): epidemic situation 2021-10-11 today.
The server converts the second information into third information in JSON syntax format, for example, the third information after converting the second information in the example is:
for another example, the titles include a primary title and a secondary title, the secondary title may input # secondary title content when a user inputs, and a regular expression of the secondary title may be, for example: # -, # -, and x)/.
For example, the text may be directly input during input, and the display format of the text may also be input, where the display format includes a normal, bold, italic, and the like, and taking three types of display formats including a normal, bold, and italic as examples, when the user inputs, for example, the text is "yesterday new 29", the display format of the text is normal when the text is directly input-yesterday new 29 indicates that the display format of the text is bold when the text is input-yesterday new 29 indicates that the display format of the text is italic.
For another example, where the entity is a link, the link may be entered upon user input: [ Link document ] (Link Address), the regular expression of the link can be, for example: (|b (: [ p|d ])
For another example, when the entity is a picture, the picture may be input when the user inputs: the following is carried out [ Picture remark ] (Picture Address or image_key), the regular expression of a picture can be, for example: (|b (: [ p|d ])
For another example, when the entity is an emoticon (Lark Emoji), the emoticon may be entered upon user input: the regular expression of [ smile ] emoticons may be, for example: /([ (
For another example, when the entity is a jump button, the jump button may be entered upon user input:
The following is carried out b [ button display content ] (button link address), or:
the following is carried out P [ button display content ] (button link address), or:
the following is carried out b, d [ button display content ] (button link address).
Wherein-! b indicates that the button display color is normal (e.g. black), +|! The display color of the p indication button is blue! The display color of the d-indication button is red, and the display color can comprise the color of the display font of the button and the color of the frame of the button.
For another example, where the entity is a separator, the separator may be entered upon user input: - - -. The regular expression of the separator may be, for example: /- - -/
For another example, when the first message carries a user identifier, i.e. the entity is a user identifier, for example @ user a, the user may input:
user a, wherein user a is a user-selected session member name;
or the user may input: @ou_e1a9c51398886db71273161493495, wherein ou_e1a9c51398886db71273161493495 is the identity of user a.
The regular expression of the user identification may be, for example:
<at(?:.*?+open_id="(.*?)"|+(user_id=".*?)"?.*?)*(?:>.*?<\/at>|\/>)|(?:(@[^'"]*)?)
optionally, the user identifier may also be @ owner, and the corresponding user input may be: the @ all, regular expression is the same as the single user identified regular expression described above.
Alternatively, the entity may also be a small icon located at a certain preset position (e.g. right side) of the message card, for example, the small icon may be entered when the user enters: the following is carried out extra, img [ picture remark ] (picture address or image_key).
The regular expression of the small icon may be, for example:
(!extra:(?:img|b(?:utton)?(?:\:(p|d))?)\[)(.*?)\]\((.*?)\)
optionally, the entity may also be remark information, for example, the remark information may be entered when the user enters:
--note--
remark content
--note-end—
Optionally, in this embodiment, the message card may support multiple languages, for example, support chinese, english, japanese, etc., where the languages are also attribute information of titles or texts, for example, the three languages may be respectively input when the user inputs:
zh_cn# Chinese title
Text of text
en_us#English Title
content
jajp# Japanese title
Text of text
It should be noted that the regular expression of each entity is merely exemplary, and the regular expression of each entity may also be in other forms, which is not limited in this embodiment, and the entity of the message card may also add other entities.
S1043, the server calls the open platform according to the third information and the identification of the first target session, so that the open platform generates a message card according to the third information and sends the message card to a target client corresponding to the user in the first target session.
Specifically, the third information is a JSON code for generating a message card, and the open platform may directly generate the message card according to the JSON code for generating the message card and send the message card to the target client corresponding to the user in the first target session.
In the embodiment of the present application, optionally, the first message may further carry an output format indication of the message card, where the output format is used for generating, by the server, output format information corresponding to the indication according to the first message, where the output format includes any one of JSON format, message card format, narrow-format message card format, rich text message format, pure text message format, and original output format. For example, output formats respectively corresponding to JSON format, message card format, narrow message card format, rich text message format, plain text message format, and as-received output format are indicated as: json, card, ncard, post, text, raw, carrying any output format indication in the first message, and generating corresponding output format information by the server according to the indication. Therefore, the format of the message card is richer and diversified.
Further, in an implementation manner, the message processing method provided in this embodiment may also support the inter-conversion of different output formats, where format inter-conversion may solve the problem of circulation and secondary processing of message cards between different users. For example, in one practical use scenario, a user finds that a message card of a crowd of people is particularly exquisite, and wants to know how to make, and also wants to send such an exquisite card. The card can be quickly converted into a brocade book body by using the format for mutual conversion, and then the card can be sent out after being processed and modified.
The format conversion can be implemented in the first interaction mode, that is, the instant messaging application is opened to directly interact with the chat robot, and in order to implement format conversion, the method of the embodiment may further include:
s105, the server sends the target message card and the identification of the second target session to the client.
And S106, the client displays the target message card in the second target session.
And S107, the client responds to a third triggering operation of the user for sending the target message card to the chat robot, and the chat robot has a message card sending function and sends the target message card and the identification of the second target session to the server.
S108, the server analyzes the target message card to obtain a second message, wherein the format of the second message is a grammar format of a preset lightweight markup language.
Specifically, the server analyzes the target message card to obtain the second message, which can be understood as an inverse process of generating the message card according to the message input by the user, specifically can be:
and calling the open platform according to the target message card to obtain a second JSON code corresponding to the target message card, and converting the grammar format of the lightweight markup language of the second JSON code according to the pre-stored JSON code for generating the message card and a preset regular expression of each entity to obtain a second message.
S109, the server sends a second message to the client.
Therefore, the client can obtain the second message corresponding to the message card, namely the message in the grammar format of the lightweight markup language, and in the embodiment of the application, the message in the grammar format of the lightweight markup language is called as a brocade body, if the user also wants to obtain the JSON code corresponding to the brocade body, the JSON code corresponding to the brocade body can be sent to the chat robot after carrying the output format indication JSON in the brocade body, and the JSON code corresponding to the brocade body can be obtained.
In this embodiment, the mutual conversion of 4 output formats may be supported, and the 4 output formats may be JSON, a message card, a brocade book body and a brocade book, where the brocade book is information corresponding to the message card in a cloud document format, that is, information in a preset natural language grammar format.
In one usage scenario, for example, the user a generates a message card through a cloud document, and sends the message card to the group session one, where the format conversion process is brocade book body JSON message card.
For example, the user B sees the message card sent by the user a in the first group session, and hopes to be used after modification, and then forwards the message card to the chat robot, and the chat robot returns the analysis result of the message card, wherein the format conversion process is that the message card- > brocade book body.
In another usage scenario, for example, when the user C sees a message card, and wants to use the message card after modification, the message card can be forwarded to the chat robot, and the chat robot returns the analysis result of the card, where the format conversion process is that of the message card- > brocade book body. Then, the user C modifies the brocade book body into the content wanted by the user and then regenerates the content to be sent out by the card, wherein the format conversion process is brocade book body- > JSON- > message card.
In another use scenario, for example, the user D wants to obtain JSON data of the brocade body, can carry an output format instruction JSON at the end of the brocade body, and then send the brocade body to the chat robot to obtain the JSON corresponding to the brocade body.
Optionally, in this embodiment, the message card may be sent at a fixed time, for example, in cooperation with a quick-click timing reminding chat robot, for example, a brocade body is set: the/sd set timing "0.10.lam" # blue "the write daily_n_good, the write daily_max.
In this embodiment, since the first message input by the user is input according to the preset grammar format of the lightweight markup language or according to the preset grammar format of the natural language, the grammar is simple, the learning threshold for the user is lower, the number of code lines is reduced by 90% compared with JSON codes, and the maintenance is simple. In the first interaction mode, the user can directly interact with the chat robot to send the message card, the user can use the message card without registering an application, the use environment is flexible, the message card can be obtained or sent through the conversation with the chat robot, and the message card can be used anytime and anywhere.
According to the message processing method provided by the embodiment, when a user needs to send the message card to the first target session, the user only needs to input the first message comprising the attribute information of a plurality of entities forming the message card in the message input area displayed by the client according to the grammar format of the preset lightweight markup language or the grammar format of the preset natural language, after triggering to send the first message to the first target session, the server can send the message card corresponding to the first message input by the user to the first target session, and for the user, the threshold for learning the lightweight markup language or the natural language is low, the method is convenient and quick, the first message of the user generated message card only needs to comprise the attribute information of the plurality of entities forming the message card, the required code is short, and the maintenance is simple.
The detailed procedure of the message processing method provided by the present application will be described below with reference to three specific embodiments.
Fig. 5 is an interactive flowchart of a message processing method according to an embodiment of the present application, where in this embodiment, when a user needs to send a message card, a first message in a syntax format of a preset lightweight markup language is sent by a chat robot and an instant messaging application is opened directly. As shown in fig. 5, the method of the present embodiment may include:
S201, the client side responds to a first triggering operation of a user on the function of sending the message card, and displays a message input area on a current interface.
The first triggering operation is an operation of opening a first session where the chat robot is located, the chat robot has a message card sending function, and the message input area is a message input area in a session window interface of the first session. Or the first triggering operation is an operation of creating a second session, wherein the members in the second session comprise chat robots, and the message input area is a message input area in a session window interface of the second session. The first session is described below as an example.
S202, the client acquires a first message input by a user in a message input area, wherein the first message is input according to a grammar format of a preset lightweight markup language, and the first message comprises attribute information of a plurality of entities forming a message card.
Fig. 6 is an interface schematic diagram in a message processing method according to an embodiment of the present application, where, as shown in fig. 6, a first message input by a user in a message input area is: # red which is the card title
This is the text content
* Thickening ×
---
The following is carried out b [ jump platform A name ] (https:// www.xxxxx.com)
The first message is input according to a grammar format of a preset lightweight markup language, and the first message comprises a card title, text content, separators and skip buttons which form a message card. Optionally, if the first message includes a link (e.g., link https:// www.xxxxx.com of the jump platform), the client may also display the content of the link preview when displaying the first message in the first session, such as "brief introduction of jump platform xxxxxx" below the split line shown in fig. 6, so that the user can easily understand more content.
S203, the client responds to a second triggering operation of the user for sending the first message to the first session, and the first message and the identification of the first session are sent to the server.
In this embodiment, the second triggering operation may be, for example, an operation that the user triggers to send the first message in the first session or the second session, for example, the user clicks a send button displayed on the session interface, or the user clicks an "enter" key on the keyboard.
S204, the server generates a message card according to the first message and sends the message card to the client.
Specifically, the process of the server generating the message card according to the first message and sending the message card to the client may be referred to the description in the embodiment shown in fig. 2, which is not repeated herein.
S205, the client displays the message card in the first session.
As shown in fig. 6, the card title of the displayed message card is red, the message card has a button of the jump platform a displayed thereon, and if the user clicks the button, the page can jump to the detail page of the jump platform a.
In this embodiment, optionally, when the client sends the first message in S203, the identifier of the target session may be carried in the first message, so that the message card may be directly sent to the target session.
At this time, S203 may specifically be:
s203', the client side responds to a second triggering operation of the user for sending the first message to the target session, and the first message is sent to the server, wherein the first message carries the identification of the target session.
Correspondingly, S204 is S204', where the server receives the first message sent by the client, generates a message card according to the first message, and sends the message card to the target client corresponding to the user in the target session.
S205', the server transmits a response message to the client that the message card has been transmitted to the target session.
S206', the client presents the response message in the first session.
Fig. 7 is an interface schematic diagram in a message processing method according to an embodiment of the present application, where, as shown in fig. 7, a first message input by a user in a message input area is: user identification=identification 1
# red which is the card title
This is the text content
* Thickening ×
---
The following is carried out b [ jump platform A name ] (https:// www.xxxxx.com)
The first message is input according to a grammar format of a preset lightweight markup language, and the first message comprises a card title, text content, separators and skip buttons which form a message card. The first message carries the identifier of the target session, as shown in fig. 7, where the identifier of the target session is a user identifier=identifier 1.
As shown in fig. 7, after the server sends the message card to the target session, a response message (reply user a: user identification=identification 1 … has been sent to user 1 in fig. 7) is sent to the client, which displays the response message in the first session.
Fig. 8 is an interface schematic diagram in a message processing method according to an embodiment of the present application, where, as shown in fig. 8, a first message input by a user in a message input area is: user identifier=session identifier 1
# red which is the card title
This is the text content
* Thickening ×
---
The following is carried out b [ jump platform A name ] (https:// www.xxxxx.com)
The first message is input according to a grammar format of a preset lightweight markup language, and the first message comprises a card title, text content, separators and skip buttons which form a message card. The first message carries the identifier of the target session, as shown in fig. 8, where the identifier of the target session is a user identifier=session identifier 1, and the session identifier 1 may be the identifier of the group chat session or the identifier of the single chat session.
As shown in fig. 8, after the server sends the message card to the target session, a response message (reply user a: user identification=session identification 1 … has been sent to session 1 in fig. 8) that the message card has been sent to the target session is sent to the client, and the client displays the response message in the first session.
In the embodiment, the user can directly interact with the chat robot to send the message card, the user can use the message card without registering the application, the use environment is flexible, the message card can be obtained or sent through the conversation with the chat robot, and the message card can be used anytime and anywhere. The required codes are short and the maintenance is simple.
Fig. 9 is an interactive flowchart of a message processing method according to an embodiment of the present application, where in this embodiment, when a user needs to send a message card, an applet is opened to submit a first message in a syntax format of a preset lightweight markup language through an input box of the applet. As shown in fig. 9, the method of the present embodiment may include:
and S301, the client side responds to a first triggering operation of the user on the function of sending the message card, and displays a message input area on the current interface.
In this embodiment, the first triggering operation is an operation of opening a first application having a message card sending function, and the message input area is a message input area in an interface of the first application. Fig. 10 is a schematic diagram of a message input area in an interface of a first application in a message processing method according to an embodiment of the present application, as shown in fig. 10, where a user opens a workbench on the left side to enter a brocade application, and a profile of the brocade application is displayed on the interface of the brocade application as shown in fig. 10, "the brocade is a tool … for simply and efficiently sending a message card", and the usage description may include an input grammar format description of the first message, for example, a grammar format description of a lightweight markup language, and the user needs to send which message card of a display style, and input a corresponding message according to the grammar format description of the lightweight markup language. A message input area is displayed below the interface of the brocade application, where a user may input a first message.
S302, the client acquires a first message input by a user in a message input area, wherein the first message is input according to a grammar format of a preset lightweight markup language, and the first message comprises attribute information of a plurality of entities forming a message card.
For example, the first message entered by the user shown in FIG. 10 is: # red which is the card title
This is the text content
* Thickening ×
---
The following is carried out b [ jump platform A name ] (https:// www.xxxxx.com)
S303, the client responds to the operation of clicking a sending button displayed in the interface of the first application by a user, and displays a first target session candidate on the interface of the first application, wherein the first target session candidate comprises at least one candidate session identifier.
For example, the user clicks the send button shown in fig. 10, and the client displays the first target session candidate.
S304, the client responds to the operation that the user selects the identification of the first target session from the first target session candidates and determines to send, and sends the first message and the identification of the first target session to the server.
S305, the server generates a message card according to the first message, and sends the message card to a target client corresponding to the user in the first target session according to the identification of the first target session.
Specifically, the process of the server generating the message card according to the first message and sending the message card to the target client corresponding to the user in the target session may be referred to the description in the embodiment shown in fig. 2, which is not repeated herein.
Taking the first message shown in fig. 10 as an example, a message card that the server generates and sends to the first target session according to the first message is shown in the right diagram in fig. 10.
In this embodiment, optionally, the message card may further carry indication information, where the indication information is used to indicate that the message card is from the first application. Since the message card is sent by the applet to a target session with the user identity, the message card may, for example, carry indication information (e.g., add a remark information) at the bottom of the message card, and the indication information may, for example, be "from the application brocade".
In the embodiment, the user can submit the message in the grammar format of the preset lightweight markup language through the input box of the applet to send the message card, and the method is convenient and quick, flexible in use environment, short in required code and simple in maintenance.
Fig. 11 is an interactive flowchart of a message processing method according to an embodiment of the present application, where in this embodiment, when a user needs to send a message card, a cloud document is opened to input and submit a first message in a syntax format of a preset lightweight markup language or a first message in a syntax format of a preset natural language. As shown in fig. 11, the method of the present embodiment may include:
S401, the client side responds to a first triggering operation of the user on the function of sending the message card, and displays a message input area on the current interface.
In this embodiment, the first triggering operation is an operation of opening a first application having a message card sending function, and the message input area is a message input area in an interface of the first application. The first application at this time may be a brocade application, and the cloud document may be opened when the brocade application is opened, and the message input area is the display page of the cloud document, where the user may input the first message in the message input area, and the cloud document may support the user to input the first message in the syntax format of the preset lightweight markup language or the first message in the syntax format of the preset natural language.
S402, the client acquires a first message input by a user in a message input area, wherein the first message is input according to a preset grammar format of a lightweight markup language or a preset grammar format of a natural language, and the first message comprises attribute information of a plurality of entities forming a message card.
For example, the first message input by the user in the cloud document is: session identification for target sessions
# red which is the card title
This is the text content
* Thickening ×
---
The following is carried out b [ name of link corresponding webpage ] (https:// www.xxxxx.com)
The session identifier of the target session may be a group business card.
S403, the client transmits the first message and the identification of the target session to the server in response to the operation of clicking the transmission button displayed in the interface of the first application by the user.
Or, the client transmits the first message and the identification of the target session to the server in response to the operation of clicking the preview button displayed in the interface of the first application by the user.
S404, the server generates a message card according to the first message, and sends the message card to a target client corresponding to the user in the target session according to the identification of the target session.
Specifically, the process of the server generating the message card according to the first message and sending the message card to the target client corresponding to the user in the target session may be referred to the description in the embodiment shown in fig. 2, which is not repeated herein.
In this embodiment, if the format of the first message is a preset natural language grammar format, the server needs to convert the first message into the first message in the lightweight markup language grammar format according to the mapping relationship between the pre-stored natural language grammar format and the lightweight markup language grammar format, and then analyze the first message.
Illustratively, the mapping relationship between the grammar format of the natural language and the grammar format of the lightweight markup language (also referred to as brocade body) in the cloud document may include: the content of the H3 chapter is a message card title; the background color of the H3 chapter corresponds to the background color of the title of the message card; if the group business cards exist in the front H1 and H2 of the H3 section, the open_chat_id= [ group id ] in the corresponding brocade book body; the H4 chapter is a chapter title in the message card; 5. the links correspond to links in the brocade book body; 6. the pictures correspond to pictures in the brocade book body; 7. "|! The p button corresponds to a button in the brocade book body; 8. the separator corresponds to the separator in the brocade book body; 9. the bold and italics correspond to the bold and italic in the brocade book respectively.
In the embodiment, the user can send the message card by opening the cloud document to input and submit the message in the grammar format of the preset lightweight markup language or the message in the grammar format of the preset natural language, so that the method is convenient and quick, flexible in use environment, short in required code and simple in maintenance.
The following are embodiments of the apparatus of the present application that may be used to perform the above-described method embodiments of the present application. For details not disclosed in the embodiments of the device according to the application, reference is made to the above-described method embodiments of the application.
Fig. 12 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present application, and as shown in fig. 12, the apparatus of this embodiment may include: a display module 11, an acquisition module 12 and a transmission module 13, wherein,
the display module 11 is configured to display a message input area on a current interface in response to a first triggering operation of a user on a function of sending a message card;
the obtaining module 12 is configured to obtain a first message input by a user in the message input area, where the first message is input according to a syntax format of a preset lightweight markup language or according to a syntax format of a preset natural language, and the first message includes attribute information of a plurality of entities that compose a message card;
the sending module 13 is configured to send the first message to the server in response to a second triggering operation of the user for sending the first message to the first target session, and the server is configured to generate a message card according to the first message and send the message card to a target client corresponding to the user in the first target session.
Optionally, when the first message is input according to a syntax format of a preset lightweight markup language, the first triggering operation includes an operation of opening a first session where the chat robot is located, the chat robot has a message card sending function, and the message input area is a message input area in a session window interface of the first session;
Or,
the first triggering operation includes an operation of creating a second session, the members in the second session including chat robots, the message input area being a message input area in a session window interface of the second session.
Optionally, the first target session is a first session or a second session, and the sending module 13 is configured to:
and sending the first message and the identification of the first target session to a server, wherein the server is used for generating a message card according to the first message and sending the message card to a target client corresponding to a user in the first target session according to the identification of the first target session.
Optionally, the display module 11 is further configured to receive the message card sent by the server after the sending module 13 sends the first message and the identification of the first target session to the server, and display the message card in the first session or the second session.
Optionally, the session identifier of the first target session is carried in the first message, and the display module 11 is further configured to receive, after the sending module 13 sends the first message to the server, a response message sent by the server and sent to the first target session by the message card, and display the response message in the first session or the second session.
Optionally, the first triggering operation includes an operation of opening a first application having a message card sending function, and the message input area is a message input area in an interface of the first application.
Optionally, the sending module 13 is configured to display, on the interface of the application, a first target session candidate in response to an operation of clicking a sending button displayed on the interface of the first application by a user, where the first target session candidate includes an identifier of at least one candidate session;
an operation of selecting an identification of the first target session from the first target session candidates and determining a transmission in response to the user;
the first message and the identification of the first target session are sent to the server.
Optionally, the message card further carries indication information, where the indication information is used to indicate that the message card is from the first application.
Optionally, the session identifier of the first target session is carried in the first message, and the sending module 13 is configured to respond to an operation that the user clicks a send button displayed in the interface of the first application.
Optionally, the display module 11 is further configured to: receiving the identification of the target message card and a second target session sent by the server, and displaying the target message card in the second target session;
the sending module 13 is further configured to: responding to a third triggering operation of a user for sending the target message card to the chat robot, wherein the chat robot has a message card sending function, and sends the target message card and the identification of the second target session to a server, and the server is used for analyzing the target message card to obtain a second message, and the format of the second message is a grammar format of a preset lightweight mark language;
The display module 11 is also for: and receiving the second message sent by the server and displaying the second message in the second target session.
Optionally, the first message further carries an output format indication of the message card, and the output format is used for generating output format information corresponding to the indication according to the first message by the server, where the output format includes any one of JSON format, message card format, narrow-version message card format, rich text message format, plain text message format and original output format.
Optionally, the plurality of entities includes at least two of a title, text, a link, an interactive component, a picture, a separator, and remark information.
The device provided in the embodiment of the present application may execute the above method embodiment, and the specific implementation principle and technical effects of the device may be referred to the above method embodiment, and this embodiment is not described herein again.
Fig. 13 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present application, as shown in fig. 13, where the apparatus in this embodiment may include: the system comprises a receiving module 21, a generating module 22 and a sending module 23, wherein the receiving module 21 is used for receiving a first message sent by a client, the format of the first message is a grammar format of a preset lightweight markup language or a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming a message card;
The sending module 22 is configured to generate a message card according to the first message, and send the message card to a target client corresponding to the user in the first target session.
Optionally, the sending module 22 is configured to: analyzing the first message to obtain second information, wherein the second information comprises a plurality of entities forming a message card and attribute information of each entity in the plurality of entities;
converting the second information into third information in a JSON syntax format;
and calling the open platform according to the third information and the identification of the first target session, so that the open platform generates a message card according to the third information and sends the message card to a target client corresponding to the user in the first target session.
Optionally, the format of the first message is a syntax format of a preset lightweight markup language, and the sending module 22 is specifically configured to:
and matching the first message according to a preset regular expression of each entity to obtain a plurality of entities forming the message card and attribute information of each entity in the plurality of entities.
Optionally, the format of the first message is a preset natural language grammar format, and the sending module 22 is specifically configured to:
converting the first message into a first message in the grammar format of the lightweight markup language according to a mapping relation between the pre-stored grammar format of the natural language and the grammar format of the lightweight markup language;
According to a preset regular expression of each entity, matching the first message in the grammar format of the lightweight markup language to obtain a plurality of entities forming the message card and attribute information of each entity in the plurality of entities.
Optionally, the sending module 22 is specifically configured to:
converting attribute information of each entity into information in a JSON grammar format;
filling the converted JSON grammar format information into a corresponding position of a pre-stored JSON code for generating a message card to obtain a first JSON code;
the first JSON code is determined as the third information.
Optionally, the session identifier of the first target session is carried in the first message, and the sending module 22 is further configured to: and sending a response message which is sent to the first target session by the message card to the client.
Optionally, the receiving module 21 is further configured to: and receiving the identification of the first target session sent by the client.
Optionally, the receiving module 21 is further configured to: receiving the identification of the target message card and the second target session sent by the client;
the sending module 22 is further configured to: analyzing the target message card to obtain a second message, wherein the format of the second message is a grammar format of a preset lightweight markup language;
And sending a second message to the client.
Optionally, the sending module 22 is further configured to: calling an open platform according to the target message card to obtain a second JSON code corresponding to the target message card;
and converting the grammar format of the lightweight markup language of the second JSON code according to the pre-stored JSON code for generating the message card and the preset regular expression of each entity to obtain the second message.
The device provided in the embodiment of the present application may execute the above method embodiment, and the specific implementation principle and technical effects of the device may be referred to the above method embodiment, and this embodiment is not described herein again.
It should be noted that, it should be understood that the division of the modules of the above apparatus is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. And these modules may all be implemented in software in the form of calls by the processing element; or can be realized in hardware; the method can also be realized in a form of calling software by a processing element, and the method can be realized in a form of hardware by a part of modules. For example, the processing module may be a processing element that is set up separately, may be implemented in a chip of the above-mentioned apparatus, or may be stored in a memory of the above-mentioned apparatus in the form of program codes, and the functions of the above-mentioned processing module may be called and executed by a processing element of the above-mentioned apparatus. The implementation of the other modules is similar. In addition, all or part of the modules can be integrated together or can be independently implemented. The processing element here may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
For example, the modules above may be one or more integrated circuits configured to implement the methods above, such as: one or more specific integrated circuits (application specific integrated circuit, ASIC), or one or more microprocessors (digital signal processor, DSP), or one or more field programmable gate arrays (field programmable gate array, FPGA), or the like. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general purpose processor, such as a central processing unit (central processing unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.) means from one website, computer, server, or data center. Computer readable storage media can be any available media that can be accessed by a computer or data storage devices, such as servers, data centers, etc., that contain an integration of one or more available media. Usable media may be magnetic media (e.g., floppy disks, hard disks, magnetic tape), optical media (e.g., DVD), or semiconductor media (e.g., solid State Disk (SSD)), among others.
Fig. 14 is a schematic structural diagram of a terminal device according to an embodiment of the present application, as shown in fig. 14, the terminal device of this embodiment may include a processor 31 and a memory 32,
wherein the memory 33 is used for storing executable instructions of the processor 31.
The processor 31 is configured to execute the information processing method in the above-described method embodiment via execution of executable instructions.
Alternatively, the memory 32 may be separate or integrated with the processor 31.
When the memory 32 is a device independent from the processor 31, the terminal apparatus of the present embodiment may further include:
a bus 33 for connecting the memory 32 and the processor 31.
Optionally, the terminal device of the present embodiment may further include: a communication interface 34, the communication interface 34 being connectable with the processor 31 via a bus 33.
Fig. 15 is a schematic structural diagram of a server according to an embodiment of the present application, as shown in fig. 15, the server of the present embodiment may include a processor 41 and a memory 42,
wherein the memory 43 is used for storing executable instructions of the processor 41.
The processor 41 is configured to execute the information processing method in the above-described method embodiment via execution of executable instructions.
Alternatively, the memory 42 may be separate or integrated with the processor 41.
When the memory 42 is a device independent from the processor 41, the server of the present embodiment may further include:
a bus 43 for connecting the memory 42 and the processor 41.
Optionally, the server of the present embodiment may further include: a communication interface 44, the communication interface 44 being connectable with the processor 41 via the bus 43.
The present application also provides a computer-readable storage medium having stored therein computer-executable instructions which, when run on a computer, cause the computer to perform a message processing method as in the above embodiments.
The embodiments of the present application also provide a computer program product comprising a computer program which, when executed by a processor, implements the message processing method in the above embodiments.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.
Claims (15)
1. A method of message processing, the method being applied to a client, the method comprising:
responding to a first triggering operation of a user on a message sending card function, and displaying a message input area on a current interface;
acquiring a first message input by the user in the message input area, wherein the first message is input according to a grammar format of a preset lightweight markup language or according to a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming a message card;
responding to a second triggering operation of the user for sending the first message to a first target session, sending the first message to a server, generating a message card according to the first message by the server, and sending the message card to a target client corresponding to the user in the first target session;
When the first message is input according to a grammar format of a preset lightweight markup language, the first triggering operation comprises an operation of opening a first session where a chat robot is located, the chat robot has the message card sending function, and the message input area is a message input area in a session window interface of the first session;
or,
the first triggering operation comprises an operation of creating a second session, wherein members in the second session comprise the chat robot, and the message input area is a message input area in a session window interface of the second session;
the first target session is the first session or the second session, and the sending the first message to a server includes: the first message and the identification of the first target session are sent to the server, and the server is used for generating a message card according to the first message and sending the message card to a target client corresponding to a user in the first target session according to the identification of the first target session; receiving the message card sent by the server, and displaying the message card in the first session or the second session;
Or,
the first triggering operation comprises an operation of opening a first application with the message card sending function, and the message input area is a message input area in an interface of the first application;
the responding to the second triggering operation of the user on the first message sent to the first target session comprises the following steps: responsive to the user clicking a send button displayed in an interface of the first application, displaying a first target session candidate on the interface of the application, the first target session candidate including an identification of at least one candidate session; an operation of selecting an identification of a first target session from the first target session candidates and determining a transmission in response to the user;
the sending the first message to a server includes: and sending the first message and the identification of the first target session to the server.
2. The method of claim 1, wherein the session identification of the first target session is carried in the first message, and wherein after the first message is sent to a server, the method further comprises:
receiving a response message sent by the server, wherein the response message is sent to the first target session by the message card;
The response message is presented in the first session or the second session.
3. The method of claim 1, wherein the session identification of the first target session is carried in the first message, and wherein the responding to the second triggering operation by the user to send the first message to the first target session comprises:
and responding to the operation of clicking a sending button displayed in the interface of the first application by the user.
4. A method according to any one of claims 1-3, wherein the method further comprises:
receiving the identification of the target message card and the second target session sent by the server;
displaying the target message card in the second target session;
responding to a third triggering operation of the user for sending the target message card to a chat robot, wherein the chat robot has the message card sending function, and sends the target message card and the identification of the second target session to the server for the server to analyze the target message card to obtain a second message, and the format of the second message is the grammar format of the preset lightweight markup language;
And receiving the second message sent by the server, and displaying the second message in the second target session.
5. The method of claim 1, wherein the first message further carries an output format indication of a message card for the server to generate output format information corresponding to the indication from the first message, the output format including any one of JSON format, message card format, narrow message card format, rich text message format, plain text message format, and as-received output format.
6. A message processing method, wherein the method is applied to a server, the method comprising:
receiving a first message sent by a client, wherein the format of the first message is a grammar format of a preset lightweight markup language or a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming a message card;
generating a message card according to the first message, and sending the message card to a target client corresponding to a user in a first target session;
the method further comprises the steps of:
transmitting a response message which is transmitted to the first target session by the message card to the client, wherein a session identifier of the first target session is carried in the first message;
Or,
and receiving the identification of the first target session sent by the client.
7. The method of claim 6, wherein generating a message card from the first message and sending the message card to a target client corresponding to a user in the first target session comprises:
analyzing the first message to obtain second information, wherein the second information comprises a plurality of entities forming the message card and attribute information of each entity in the plurality of entities;
converting the second information into third information in a JSON grammar format;
and calling an open platform according to the third information and the identification of the first target session, so that the open platform generates a message card according to the third information and sends the message card to a target client corresponding to a user in the first target session.
8. The method of claim 7, wherein the format of the first message is a syntax format of a preset lightweight markup language, and the parsing the first message to obtain the second information includes:
matching the first message according to a preset regular expression of each entity to obtain a plurality of entities forming the message card and attribute information of each entity in the plurality of entities;
The format of the first message is a preset grammar format of natural language, and the analyzing the first message to obtain second information includes:
converting the first message into a first message in the grammar format of the lightweight markup language according to a pre-stored mapping relation between the grammar format of the natural language and the grammar format of the lightweight markup language;
and matching the first message in the grammar format of the lightweight markup language according to the preset regular expression of each entity to obtain a plurality of entities forming the message card and attribute information of each entity in the plurality of entities.
9. The method of claim 7, wherein converting the second information into the third information in JSON syntax format comprises:
converting the attribute information of each entity into information in a JSON grammar format;
filling the converted information in the JSON grammar format into a corresponding position of a pre-stored JSON code for generating a message card to obtain a first JSON code;
the first JSON code is determined as the third information.
10. The method of claim 6, wherein the method further comprises:
Receiving the identification of the target message card and the second target session sent by the client;
analyzing the target message card to obtain a second message, wherein the format of the second message is the grammar format of the preset lightweight markup language;
and sending the second message to the client.
11. The method of claim 10, wherein parsing the target message card to obtain a second message comprises:
calling an open platform according to the target message card to obtain a second JSON code corresponding to the target message card;
and converting the grammar format of the lightweight markup language of the second JSON code according to the pre-stored JSON code for generating the message card and the preset regular expression of each entity to obtain the second message.
12. A message processing apparatus, comprising:
the display module is used for responding to the first triggering operation of the user on the function of sending the message card and displaying the message input area on the current interface;
the information card comprises an acquisition module, a message card and a message processing module, wherein the acquisition module is used for acquiring a first message input by a user in the message input area, the first message is input according to a grammar format of a preset lightweight markup language or according to a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming the message card;
The sending module is used for responding to a second triggering operation of the user for sending the first message to a first target session, sending the first message to a server, generating a message card according to the first message by the server, and sending the message card to a target client corresponding to the user in the first target session;
when a first message is input according to a grammar format of a preset lightweight markup language, the first triggering operation comprises an operation of opening a first session where a chat robot is located, the chat robot has the message card sending function, and the message input area is a message input area in a session window interface of the first session;
or,
the first triggering operation comprises an operation of creating a second session, wherein members in the second session comprise the chat robot, and the message input area is a message input area in a session window interface of the second session;
the first target session is the first session or the second session, and the sending module is configured to: the first message and the identification of the first target session are sent to the server, and the server is used for generating a message card according to the first message and sending the message card to a target client corresponding to a user in the first target session according to the identification of the first target session; the display module is further configured to receive the message card sent by the server after the sending module sends the first message and the identifier of the first target session to the server, and display the message card in the first session or the second session;
Or,
the first triggering operation comprises an operation of opening a first application with the message card sending function, and the message input area is a message input area in an interface of the first application;
the sending module is used for responding to the operation of clicking a sending button displayed in the interface of the first application by the user, displaying a first target session candidate on the interface of the application, wherein the first target session candidate comprises at least one candidate session identifier, and responding to the operation of selecting the first target session identifier from the first target session candidates by the user and determining sending, and sending the first message and the first target session identifier to the server.
13. A message processing apparatus, comprising:
the receiving module is used for receiving a first message sent by the client, wherein the format of the first message is a grammar format of a preset lightweight markup language or a grammar format of a preset natural language, and the first message comprises attribute information of a plurality of entities forming a message card;
the sending module is used for generating a message card according to the first message and sending the message card to a target client corresponding to a user in a first target session;
The sending module is further configured to: transmitting a response message which is transmitted to the first target session by the message card to the client, wherein a session identifier of the first target session is carried in the first message;
or,
the receiving module is further configured to: and receiving the identification of the first target session sent by the client.
14. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the message processing method of any of claims 1-5 or 6-11 via execution of the executable instructions.
15. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the message processing method of any of claims 1-5 or 6-11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111233787.2A CN113885757B (en) | 2021-10-22 | 2021-10-22 | Message processing method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111233787.2A CN113885757B (en) | 2021-10-22 | 2021-10-22 | Message processing method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113885757A CN113885757A (en) | 2022-01-04 |
CN113885757B true CN113885757B (en) | 2023-11-07 |
Family
ID=79004352
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111233787.2A Active CN113885757B (en) | 2021-10-22 | 2021-10-22 | Message processing method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113885757B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114500641B (en) * | 2022-02-10 | 2024-08-06 | 阿里巴巴(中国)有限公司 | Message communication method, device and readable medium |
CN114900379B (en) * | 2022-04-28 | 2024-02-06 | 北京百度网讯科技有限公司 | Message notification method and device, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109873757A (en) * | 2019-03-29 | 2019-06-11 | 上海连尚网络科技有限公司 | Message display method, electronic equipment and readable medium for multi-conference |
CN110278144A (en) * | 2019-05-21 | 2019-09-24 | 北京字节跳动网络技术有限公司 | A kind of card message method, device, medium and electronic equipment |
CN112187395A (en) * | 2020-11-02 | 2021-01-05 | 上海欣诺通信技术股份有限公司 | Time synchronization method and device in distributed system |
CN112231463A (en) * | 2020-11-10 | 2021-01-15 | 腾讯科技(深圳)有限公司 | Session display method and device, computer equipment and storage medium |
CN112597767A (en) * | 2021-02-07 | 2021-04-02 | 全时云商务服务股份有限公司 | Card message customization management method and system and readable storage medium |
CN113364664A (en) * | 2020-03-05 | 2021-09-07 | 北京沃东天骏信息技术有限公司 | Instant messaging method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111857858A (en) * | 2019-04-30 | 2020-10-30 | 上海掌门科技有限公司 | Method and apparatus for processing information |
-
2021
- 2021-10-22 CN CN202111233787.2A patent/CN113885757B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109873757A (en) * | 2019-03-29 | 2019-06-11 | 上海连尚网络科技有限公司 | Message display method, electronic equipment and readable medium for multi-conference |
CN110278144A (en) * | 2019-05-21 | 2019-09-24 | 北京字节跳动网络技术有限公司 | A kind of card message method, device, medium and electronic equipment |
CN113364664A (en) * | 2020-03-05 | 2021-09-07 | 北京沃东天骏信息技术有限公司 | Instant messaging method and device |
CN112187395A (en) * | 2020-11-02 | 2021-01-05 | 上海欣诺通信技术股份有限公司 | Time synchronization method and device in distributed system |
CN112231463A (en) * | 2020-11-10 | 2021-01-15 | 腾讯科技(深圳)有限公司 | Session display method and device, computer equipment and storage medium |
CN112597767A (en) * | 2021-02-07 | 2021-04-02 | 全时云商务服务股份有限公司 | Card message customization management method and system and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113885757A (en) | 2022-01-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10289265B2 (en) | Capture and retrieval of a personalized mood icon | |
CN113885757B (en) | Message processing method, device, equipment and storage medium | |
US20210092082A1 (en) | Method, apparatus, and client for displaying media information, and method and apparatus for displaying graphical controls | |
US20090157223A1 (en) | Robot chatting system and method | |
CN105871690B (en) | Method and device for realizing instant messaging | |
WO2016148525A1 (en) | Method for searching for emoticon, and terminal | |
US9807143B2 (en) | Systems and methods for event routing and correlation | |
CN103530096A (en) | Remote control method, remote control equipment and display equipment | |
CN111756917A (en) | Information interaction method, electronic device and computer readable medium | |
CN112073307B (en) | Mail processing method, mail processing device, electronic equipment and computer readable medium | |
CN109474512B (en) | Background updating method for instant messaging, terminal equipment and storage medium | |
KR101406981B1 (en) | System and Method for Translating Messages of Multiple Languages | |
US20130035927A1 (en) | Display apparatus, control method and server thereof | |
CN111796745A (en) | Information transmitting method, information receiving method, information transmitting device, information receiving device, and storage medium | |
CN115600980A (en) | Method and device for sending message, electronic equipment and storage medium | |
CN109766315A (en) | Document presentation method and terminal, computer storage medium, computer equipment | |
CN103856395B (en) | A kind of method and system called good friend on webpage and discussed | |
CN110264035A (en) | Configuration method, device, terminal and the storage medium of workflow | |
CN104519118A (en) | Information processing terminal and control method therefor, system and control method therefor | |
CN110620841B (en) | Information processing method, multi-screen terminal and computer readable storage medium | |
KR101589150B1 (en) | Server, deivice and method for sending/receiving emphasized instant messages | |
US11012382B2 (en) | State display information transmission system using chatbot | |
CN111010335A (en) | Chat expression sending method and device, electronic equipment and medium | |
CN112995259B (en) | Business information pushing method, device, system, equipment and storage medium | |
CN116346759A (en) | Method, device, electronic equipment and medium for instant message presentation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |