WO2024022432A1 - Information processing methods and apparatus, and electronic device - Google Patents

Information processing methods and apparatus, and electronic device Download PDF

Info

Publication number
WO2024022432A1
WO2024022432A1 PCT/CN2023/109520 CN2023109520W WO2024022432A1 WO 2024022432 A1 WO2024022432 A1 WO 2024022432A1 CN 2023109520 W CN2023109520 W CN 2023109520W WO 2024022432 A1 WO2024022432 A1 WO 2024022432A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
display
target code
fragment
keyword
Prior art date
Application number
PCT/CN2023/109520
Other languages
French (fr)
Chinese (zh)
Inventor
蒋妍
李勇
王润琼
蒋程
张超
齐鸿烨
王重
张昂
Original Assignee
北京字跳网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202210899877.3A external-priority patent/CN115268890A/en
Priority claimed from CN202210901646.1A external-priority patent/CN115291759A/en
Application filed by 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2024022432A1 publication Critical patent/WO2024022432A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction 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

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to an information processing method, device and electronic equipment.
  • the present disclosure provides an information processing method, device and electronic equipment.
  • an information processing method including:
  • the target code fragment is rendered and displayed according to the first presentation style; wherein the session interface is the session interface corresponding to the first user, and the first user is the first user. members of the session;
  • the target code fragment is rendered and displayed according to a second presentation style.
  • an information processing method including:
  • the message input box In response to the user performing a preset operation on the message input box of the instant messaging client, the message input box enters the code input mode;
  • the target code fragment is displayed in the message input box according to a preset code display style.
  • an information processing device comprising:
  • a receiving module configured to receive the target code fragment sent to the first session
  • a display module configured to render and display the target code fragment according to a first display style in the session interface of the first session; wherein the session interface is a session interface corresponding to the first user, and the first user is stated members in the first session;
  • a switching module configured to render and display the target code fragment according to a second presentation style in the conversation interface in response to the first user's switching operation on the displayed target code fragment.
  • an information processing device comprising:
  • a control module configured to cause the message input box to enter the code input mode in response to the user performing a preset operation on the message input box of the instant messaging client;
  • An acquisition module used to acquire the target code fragment entered in the message input box
  • a display module configured to display the target code fragment in the message input box according to a preset code display style.
  • a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the first aspect or the second aspect is implemented.
  • an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the processor executes the program, the first aspect or the second aspect is implemented. any of the methods described.
  • Embodiments of the present disclosure provide an information processing method and device.
  • the code fragments in the conversation message are displayed in a code display style.
  • the user can display the code fragments in the conversation message in the conversation interface. Switch styles, thereby enriching the display effect of code snippets and improving user experience.
  • Embodiments of the present disclosure provide an information processing method and device.
  • the user performs a preset operation on the message input box of the instant messaging client, triggering the message input box of the instant messaging client to provide an editing area that supports the display function of code snippets, thereby
  • the code snippets entered in the message input box are displayed in the display style corresponding to the code, which enriches the display effect of the code snippets and improves the user experience.
  • Figure 1a is a schematic interface diagram of an instant messaging client according to an exemplary embodiment of the present disclosure
  • Figure 1b is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 1c is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 1d is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 1e is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 1f is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 1g is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 2 is a flow chart of an instant messaging client method according to an exemplary embodiment of the present disclosure
  • Figure 3a is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 3b is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 3c is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 3d is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 3e is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 3f is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 3g is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 4 is a flow chart of another instant messaging client method according to an exemplary embodiment of the present disclosure.
  • Figure 5 is a device block diagram of an instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 6 is a device block diagram of another instant messaging client according to an exemplary embodiment of the present disclosure.
  • Figure 7 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure.
  • Figure 8 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure.
  • Figure 9 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure.
  • first, second, third, etc. may be used in this disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other.
  • first information may also be called second information, and similarly, the second information may also be called first information.
  • word “if” as used herein may be interpreted as "when” or “when” or “in response to determining.”
  • code snippets In related technologies, users can directly input code snippets as text information into the input box of an instant messaging tool for editing, and send it to the conversation interface to share with friends.
  • code snippets have a unique display style, which is very different from ordinary text information, displaying code snippets in the style of text information cannot reflect the unique style of the code snippets, which increases the difficulty for users to read the code snippets. The display effect and user experience of code snippets are poor.
  • the present disclosure provides an information processing method.
  • the code fragments in the conversation message are displayed in a code display style.
  • the user can switch the display style of the code fragments in the conversation message in the conversation interface. This enriches the display effect of code snippets and improves user experience.
  • Figure 1a is a schematic interface diagram of an instant messaging client according to an exemplary embodiment.
  • the user's friend shares the code snippet with the user through an instant messaging client.
  • the user can open a conversation window with a friend in the instant messaging client, and the code snippet is displayed in the message box 101 of the conversation interface.
  • the message box 101 may be, for example, a content block created in the conversational interface that supports the code display function.
  • the selection toolbar may include a code language selection bar, a display theme selection bar, etc.
  • the message box can support the display styles of multiple code languages.
  • the user can select and switch the display style of the code language through the drop-down option of the code language selection bar 102 at the top of the message box.
  • the code snippet can be displayed in the message box in a display style unique to the target code language (because some code keywords may have different keyword types in different code languages, so they are highlighted The displayed keywords are also displayed in different colors).
  • the code language JAVA in the code language column
  • the code snippets are displayed in the content block in the display style corresponding to JAVA.
  • the user then switches the code language JAVA to the code language ABAP through the code language selection bar, and the display style of the code snippets in the content block is switched to the corresponding display style of ABAP.
  • the message box can also support multiple display themes.
  • Each display theme corresponds to a set of display styles.
  • Each set of display styles includes a background color of the message box and a font color corresponding to each keyword type. Therefore, keywords of the same type have the same font color under the same display theme, and different font colors under different display themes.
  • the user can select and switch the display theme through the drop-down option of the display theme selection bar 103 at the top of the message box.
  • the code snippet can be displayed in the message box in the display style corresponding to the target display theme. For example, if the user selects Topic 1 by displaying the topic, the code snippet will be displayed in the message box in the display style corresponding to Topic 1.
  • the user then switches theme 1 to theme 2 by displaying the theme selection bar, and then the display style of the code snippet in the message box is switched to the display style corresponding to theme 2.
  • the user can also switch the display style of the code fragment when editing the code fragment.
  • the user switches the display style of the code snippet in the message input box by selecting the code language.
  • the user switches the display style of the code snippet in the message input box by selecting the display theme.
  • the code fragment is displayed in a message box displayed on the session interface of the user who sent the message.
  • the user who sends the message can also switch the display style of the code snippet in the message box.
  • the user switches the display style of the code snippet in the message display box by selecting the code language.
  • the user switches the display style of the code snippet in the message display box by selecting the display theme.
  • the code fragments in the conversation message are displayed in the code display style.
  • the user can switch the display style of the code fragments in the conversation message in the conversation interface, thereby enriching the code.
  • the display effect of the fragments improves the user experience.
  • the instant messaging client supports the switching function of the display style of the code language, so that the user can switch the display style of the code snippet through the code language. This further enriches the display effect of code snippets and helps improve user experience.
  • the user can also switch the display theme of the code snippets in the instant messaging client session message, thereby further enriching the display effect of the code snippets and helping to improve the user experience.
  • FIG. 2 is a flow chart of an information processing method according to an exemplary embodiment. This method can be applied to terminal equipment.
  • a terminal device capable of installing an instant messaging application.
  • the terminal device may include but is not limited to mobile terminal devices such as smartphones, smart wearable devices, tablet computers, and the like. The method may include the following steps:
  • step 201 the target code fragment sent to the first session is received, and in step 202, in the session interface of the first session, the target code is rendered and displayed according to the first presentation style. fragment.
  • the first session is a session involving an instant messaging client.
  • the instant messaging client can be a third-party application installed on the terminal device.
  • the user can communicate with friends/group members in real time through the instant messaging client. session.
  • the session interface of the first session is the session interface corresponding to the first user, and the first user is a member of the first session.
  • the first user may be the sender or recipient of the target code fragment in the first session.
  • multiple code keywords in the target code fragment may be obtained and the first code language may be determined.
  • the preset plug-in can be any plug-in that is known in the art and may appear in the future and can realize the above functions, and the present disclosure is not limited to the specific type of the preset plug-in.
  • the code language selected by the user from the drop-down option of the code language selection bar can be obtained as the first code language.
  • the code language corresponding to the target code fragment may be determined based on the code keywords included in the identified target code fragment, and the code language corresponding to the target code fragment may be used as the first code language.
  • the code keyword X is a keyword unique to the C++ language. If the target code fragment contains If you include the code keyword X, you can determine that the code language corresponding to the target code fragment is C++ language.
  • code keyword Y is a keyword unique to C language and Java
  • code keyword Z is a keyword unique to JavaScript and Java.
  • the target code fragment includes code keyword Y and code keyword Z
  • the target can be determined
  • the code language corresponding to the code snippet is Java language. It should be noted that the above examples are only hypothetical situations for illustrating the principle, and the code keywords X, Y, and Z are only hypothetical keyword codes for examples, and are not actual keywords.
  • the first display style is determined based on the code keyword and the first code language.
  • the colors of the highlighted keywords are also different. Therefore, the keyword type corresponding to each code keyword included in the target code fragment can be determined based on the first code language, and the first display style is determined based on the keyword type corresponding to each code keyword.
  • the first display style may include the background color of the message box used to display the target code fragment and the font color corresponding to each code keyword.
  • each code keyword included in the target code fragment can be rendered according to its corresponding keyword type, and the target code fragment can be displayed.
  • the keyword type of code keyword A in C language is m
  • the keyword type in Java is n.
  • the color corresponding to keyword type m is red
  • the color corresponding to keyword type n is green. Therefore, it is determined that the target code fragment includes code keyword A. If the code language corresponding to the target code fragment is C language, it is determined that the keyword type of code keyword A is m. After rendering according to the color corresponding to the keyword type m, the code keyword A is displayed in red. If the code language corresponding to the target code fragment is the Java language, it is determined that the keyword type of the code keyword A is n. After rendering according to the color corresponding to keyword type n, code keyword A is displayed in green.
  • each display theme corresponds to a set of display styles
  • each set of display styles includes a background color of the message box and a font color corresponding to each keyword type. Therefore, keywords of the same type have the same font color under the same display theme, and different font colors under different display themes. Therefore, before determining the first display style, the first display theme for the code may be determined first. For example, the first display theme may be selected by the user from alternative display themes. Then, the first display style is determined based on the first display theme, the code keywords included in the target code piece, and the first code language.
  • the first display style may include a first background color of the message box used to display the target code fragment and a first font color corresponding to each code keyword.
  • the first display style can be determined based on the first display theme and the keyword type corresponding to each code keyword in the following manner: First, obtain the first Display the background color corresponding to the theme as the first background color. And obtain mapping information corresponding to the first display theme, where the mapping information includes mapping relationship information between keyword types and font colors. Finally, based on the mapping information and the keyword type corresponding to each code keyword, the first font color corresponding to each code keyword is determined.
  • mapping table including mapping information is generated in advance for display theme 1.
  • the mapping table records mapping relationship information between different keyword types and font colors (for example, keyword type 1 corresponds to color 1, and keyword type 2 corresponds to color 2. Correspondence, etc.).
  • the user selects display theme 1 from the alternative display themes.
  • each code keyword in the target code fragment can be obtained, and the first code language can be determined.
  • the color corresponding to the code keyword type is searched from the mapping table as the font color of the code keyword. It should be noted that if any code keyword does not have a corresponding keyword type in the first code language, the code keyword can be displayed as an ordinary text string.
  • step 203 in response to the first user's switching operation on the displayed target code fragment, in the conversation interface, the target code fragment is rendered and displayed according to the second presentation style.
  • the first user's switching operation on the displayed target code fragment may be an operation of switching the first code language to the second code language, wherein the second display style is determined based on the second code language, and the first The second display style includes a second font color corresponding to each code keyword.
  • the keyword type corresponding to each code keyword included in the target code fragment in the second code language can be determined.
  • the second font color corresponding to each code keyword is determined, thereby determining the second display style.
  • keyword types include a, b, and c
  • keyword type a corresponds to red
  • keyword type b corresponds to blue
  • keyword type c corresponds to green
  • the target code fragment includes code keywords A, B, C, D, E, and F.
  • the keyword type of keywords A, B, and C is a
  • the keyword type of keywords D, E, and F is for b. Therefore, when the target code fragment is displayed in the case of code language 1, the keywords A, B, and C are rendered in red, and the keywords D, E, and F are rendered in blue.
  • the user switches the code language from code language 1 to code language 2.
  • the keyword type of keywords A and B is a
  • the keyword type of keywords D and E is b
  • the keyword type of keywords C and F is The keyword type is c. Therefore, after switching to code language 2, keywords A and B are rendered in red, keywords D and E are rendered in blue, and keywords C and F are rendered in green.
  • the first user's switching operation on the displayed target code fragment may also be an operation of switching the first display theme to the second display theme, wherein the second display style is determined based on the second display theme.
  • the second display style includes the second font color corresponding to each code keyword. Specifically, after the first user switches the first display theme to the second display theme, the keyword type corresponding to each code keyword included in the target code fragment in the first code language can be determined. Then, according to the second display theme and the keyword type corresponding to each code keyword, the second font color corresponding to each code keyword is determined, thereby determining the second display style.
  • keyword types include a, b, and c.
  • keyword type a corresponds to red
  • keyword type b corresponds to blue
  • keyword type c corresponds to green
  • keyword type a corresponds to pink
  • keyword type b corresponds to purple
  • keyword type c corresponds to yellow
  • the target code fragment includes code keywords A, B, C, D, E, and F.
  • the keyword type of keywords A, B, and C is a
  • the keyword type of keywords D, E, and F is for b. Therefore, when the target code fragment is displayed in the case of code language 1 and display theme 1, the keywords A, B, and C are rendered in red, and the keywords D, E, and F are rendered in blue.
  • the keywords A, B, and C are rendered in pink
  • the keywords D, E, and F are rendered in purple.
  • the present disclosure provides an information processing method.
  • the code fragments in the conversation message are displayed in the code display style.
  • the user can display the code fragments in the conversation message in the conversation interface. Switch, thus enriching the display effect of code snippets and improving user experience.
  • Another information processing method provided by the present disclosure is that the user performs a preset operation on the message input box of the instant messaging client, triggering the message input box of the instant messaging client to provide an editing area that supports the display function of code snippets, thereby corresponding to the code
  • the display style displays the code snippets entered in the message input box, enriching the display effect of the code snippets and improving the user experience.
  • Figure 3a is a schematic interface diagram of another instant messaging client according to an exemplary embodiment.
  • the user needs to share the code snippet with friends through an instant messaging client.
  • the user can open a conversation window with a friend in the instant messaging client, and then perform a preset operation on the message input box 401 of the instant messaging client, thereby triggering the instant messaging client to provide the user with an editing area for code snippets.
  • the instant messaging client can be triggered to provide the user with an editing area for code snippets by clicking a preset shortcut key.
  • a content block that supports code editing and display functions can be created in the message input box, and the editing interface of the content block can be used as the editing area for code snippets. For example, if you directly click on the icon corresponding to the code, or click on the preset shortcut key, you can create a content block at the cursor position. For another example, if you select a character or string and then click the icon corresponding to the code, you can create a content block at the position of the selected character or string so that the selected character or string is in the content block.
  • Code snippets can be edited in the content block you create and displayed as code. For example, when displaying a code snippet, you can highlight some keywords in the code snippet, use different colors to display different types of keywords, and display the line number of the code snippet, etc.
  • FIG. 3b it is a schematic diagram of the interface of the instant messaging client after the user performs the preset operation.
  • the instant messaging client provides the user with a content block 404 of the code snippet in the message input box.
  • the editing tools may include the code language selection bar shown in Figure 3b, a line break switch button, a copy button, etc., as well as other common code editing tools not shown in the figure, etc.
  • users can enter code snippets in the content block for editing, and the code snippets in the content block can be displayed in a code-specific display manner.
  • the content block can support display styles of multiple code languages.
  • the user can select and switch the display style of the code language through the drop-down option 406 of the code language selection bar at the top of the editing area.
  • the code snippets in the content block can be displayed in a display style unique to the corresponding code language (because some code keywords included in the code snippets may have different keyword types in different code languages, so it is highly The highlighted keywords are also colored differently).
  • the content block also supports code language recognition and automatic switching of display styles. For example, Users can paste the written code snippet directly into the content block, or enter the code snippet through the keyboard in the content block. They can also enter the code snippet first, then select the code snippet and click the icon corresponding to the code, etc. If you paste the written code snippet directly into the content block, or enter the code snippet first, then select the code snippet and click the icon corresponding to the code, the code language of the pasted or selected code snippet can be automatically recognized, and the current display style will be automatically Switch to the display style corresponding to the code language.
  • the current display style can be automatically switched to the display style corresponding to the code language selected by the user. If the user does not select a code language, the current display style can be switched to the display style corresponding to the default code language.
  • a floating toolbar 407 for updating the style of characters or strings can pop up.
  • the floating toolbar 407 includes multiple buttons for adjusting styles. For example, you can include buttons to adjust font thickness, buttons to adjust font inclination, buttons to add strikethrough, and buttons to add underline, etc. You can use the buttons in the pop-up floating toolbar to update the style of the selected character or string. In another implementation, you can also directly use the style adjustment button in the fixed toolbar of the message input box to update the style of the selected character or string.
  • the user can also switch the current session window to another session window.
  • Figure 3f while the user was discussing code snippets with his friend Zhang San, he received an instant messaging message from his friend Li Si. The user can click on the avatar of friend John Doe to switch the session window to the conversation window of friend John Doe and have a conversation with friend John Doe. Then, click on the avatar of friend Zhang San to switch the session window back to the session window of friend Zhang San, and you can continue to edit the code snippets discussed with friend Zhang San.
  • the user when the user edits the target code snippet in the content block, the user can also mix the code snippet and the text content, that is, add text information through the message input box to comment and explain the code.
  • the user can edit the target code fragment in the content block.
  • the cursor used to indicate the input position can jump from the area of the content block. Go to the text input area below the content block.
  • the user can enter text content used to explain the target code fragment in the text input area below the content block, and the text content can be displayed in the message input box together with the target code fragment.
  • the text input area shown in Figure 3g is located below the content block. It can be understood that the text input area can also be located at other locations outside the content block, such as above the content block, or to the left of the content block, or to the content block.
  • the right side, etc., this embodiment is not limited in this aspect.
  • this solution takes the editing and display of code in the input box of the session message of the instant messaging client as an example.
  • this solution can also edit and display the code in the dynamic message input box of the instant messaging client or the comment message input box.
  • the specific process is similar to the above embodiment and will not be described again here.
  • the solution provided by this embodiment is that the user performs a preset operation on the message input box of the instant messaging client, triggering the message input box of the instant messaging client to provide an editing area that supports the display function of code snippets, thereby using the display style corresponding to the code to The code snippets entered in the message input box are displayed, which enriches the display effect of the code snippets and improves the user experience.
  • the message input box of the instant messaging client also has a code language recognition function, so that it can Automatically identify the code language based on the code snippets input by the user, and automatically switch the current display style to the display style corresponding to the code language. This provides conditions for improving the editing efficiency of code snippets and further improves user experience.
  • users can also update the style of the code in the message input box of the instant messaging client, thereby improving the flexibility of editing the code and further improving the user experience.
  • the user edits the target code snippet in the content block, he can also mix the code snippets and text content, and display the code snippets and text content at the same time in the message input box.
  • the user can input in the message input box.
  • FIG. 4 is a flowchart of another information processing method according to an exemplary embodiment. This method can be applied to terminal equipment.
  • a terminal device capable of installing an instant messaging application.
  • the terminal device may include but is not limited to mobile terminal devices such as smartphones, smart wearable devices, tablet computers, and the like.
  • the method may include the following steps:
  • step 501 in response to the user performing a preset operation on the message input box of the instant messaging client, the message input box enters the code input mode.
  • the instant messaging client can be a third-party application installed on the terminal device.
  • the user can have real-time conversations with friends/group members through the instant messaging client, and can also send public dynamic messages to friends/groups.
  • Group members can share and discuss, and they can also comment on dynamic messages sent by themselves or others.
  • the message input box of the instant messaging client can be an input box for conversation messages, dynamic messages, or comment messages.
  • the input box of the conversation message may be an input box used for editing conversation content during a real-time conversation.
  • the input box of the dynamic message can be an input box used to edit the published content when publishing a public dynamic message.
  • the input box for comment messages can be an input box used to edit the comment content when commenting on dynamic messages posted by yourself or others.
  • the user's preset operation on the message input box of the instant messaging client can be to directly click the icon corresponding to the code in the fixed toolbar corresponding to the message input box, or to press a preset shortcut key. You can also enter and select characters or strings in the message input box, and then click the icon corresponding to the code in the pop-up floating toolbar.
  • step 502 obtain the target code fragment entered in the message input box. And in step 503, the target code fragment is displayed in the message input box according to a preset code display style.
  • an independent content block to be edited can be created in the message input box.
  • This content block can support the editing and display of code snippets.
  • the user can Enter the code snippet.
  • the code snippet entered in the content block of the message input box can be obtained as the target code snippet, and the target code snippet can be displayed in the message input box according to the preset code display style. Wherein, the code keywords in the target code fragment are highlighted (for example, highlighted), and the code line numbers in the target code fragment are displayed.
  • multiple code keywords in the target code fragment can first be obtained.
  • multiple code keywords in the target code fragment can be identified through a preset plug-in (such as a code highlighting plug-in, etc.) .
  • the preset plug-in can be any plug-in that is known in the art and may appear in the future and can realize the above functions.
  • the present disclosure is not limited to the specific type of the preset plug-in.
  • determine the code language corresponding to the target code fragment In one implementation, the code language selected by the user from the drop-down option of the code language selection column can be obtained as the code language corresponding to the target code fragment.
  • the code language corresponding to the target code fragment can also be determined based on the code keywords included in the identified target code fragment.
  • the code keyword X is a keyword unique to the C++ language. If the target code fragment includes the code keyword X, it can be determined that the code language corresponding to the target code fragment is the C++ language.
  • code keyword Y is a keyword unique to C language and Java
  • code keyword Z is a keyword unique to JavaScript and Java. If the target code fragment includes code keyword Y and code keyword Z, the target can be determined
  • the code language corresponding to the code snippet is Java language. It should be noted that the above examples are only hypothetical situations for illustrating the principle, and the code keywords X, Y, and Z are only hypothetical keyword codes for examples, and are not actual keywords.
  • the keyword type corresponding to each code keyword included in the target code fragment can be determined based on the code language corresponding to the target code fragment.
  • each code keyword included in the target code fragment can be rendered according to its corresponding keyword type, and the target code fragment can be displayed.
  • the keyword type of code keyword A in C language is m
  • the keyword type in Java is n.
  • the color corresponding to keyword type m is red
  • the color corresponding to keyword type n is green. Therefore, it is determined that the target code fragment includes code keyword A. If the code language corresponding to the target code fragment is C language, it is determined that the keyword type of code keyword A is m.
  • the code keyword A After rendering according to the color corresponding to the keyword type m, the code keyword A is displayed in red. If the code language corresponding to the target code fragment is the Java language, it is determined that the keyword type of the code keyword A is n. After rendering according to the color corresponding to keyword type n, code keyword A is displayed in green.
  • the cursor used to indicate the input position can be used to jump to the content in the message input box.
  • the first switching operation may be an operation of clicking an area outside the content block, or an operation of clicking a preset shortcut key, etc. It can be understood that this embodiment does not limit the specific manner of the first switching operation.
  • code snippets can be edited while the cursor is in a content block. You can move the cursor to an area outside the content block in the message input box. When the cursor is located in an area outside the content block in the message input box, you can edit the text content in the message input box.
  • code snippets and text content can be displayed in the message input box at the same time.
  • the code snippet is located in the rectangular box corresponding to the content block
  • the text content is located outside the rectangular box corresponding to the content block.
  • code blocks and text messages can be mixed and edited, and code blocks and text messages can be sent simultaneously in a conversation message.
  • pictures/videos can also be input in the input box by pasting or dragging, so that the code blocks and pictures/videos can be mixed. row, that is, the open code block and pictures/videos can be sent in one message.
  • you can also implement code blocks, Text and pictures are the mixed editing of any two or more types in the video.
  • the first session window can be switched to a second session window different from the first session window, and when the user performs a third switching operation on the instant messaging client During the operation, the second session window is switched back to the first session window, and the user can still continue to display the target code fragment in the message input box.
  • Another information processing method provided by the present disclosure is that the user performs a preset operation on the message input box of the instant messaging client, triggering the message input box of the instant messaging client to provide an editing area that supports the display function of code snippets, thereby using the code corresponding to
  • the display style displays the code snippets entered in the message input box, enriching the display effect of the code snippets and improving the user experience.
  • the present disclosure also provides embodiments of an information processing apparatus.
  • FIG. 5 is a block diagram of an information processing device according to an exemplary embodiment of the present disclosure.
  • the device may include: a receiving module 301 , a display module 302 and a switching module 303 .
  • the receiving module 301 is used to receive the target code fragment sent to the first session.
  • the display module 302 is configured to render and display the target code fragment according to the first display style in the session interface of the first session.
  • the conversation interface is a conversation interface corresponding to the first user, and the first user is a member of the first conversation.
  • the switching module 303 is configured to render and display the target code fragment according to the second presentation style in the conversation interface in response to the first user's switching operation on the displayed target code fragment.
  • the device may include: an obtaining module and a determining module (not shown in the figure).
  • the obtaining module is used to obtain multiple code keywords in the target code fragment and determine the first code language before rendering and displaying the target code fragment according to the first display style.
  • the determining module is used to determine the first display style based on the above code keywords and the first code language.
  • the above-mentioned switching operation may include an operation of switching the first code language to the second code language, and the above-mentioned second display style is determined based on the second code language.
  • the acquisition module may obtain multiple code keywords in the target code fragment in the following manner: using a preset plug-in to identify the target code fragment and obtain multiple code keywords included in the target code fragment.
  • the determining module may include: a first sub-module and a second sub-module (not shown in the figure).
  • the first sub-module is used to determine the keyword type corresponding to each code keyword based on the first code language.
  • the second sub-module is used to determine the first display style based on the keyword type corresponding to each code keyword.
  • the device may also include: a theme determination module and a style determination module (not shown in the figure). Shows).
  • the theme determination module is used to determine the first display theme for the code before rendering and displaying the target code fragment according to the first display style.
  • the style determination module is used to determine the first display style based on the first display theme.
  • the switching operation includes switching the first display theme to the second display theme, and the second display style is determined based on the second display theme.
  • the style determination module is configured to obtain a plurality of code keywords in the target code fragment and determine the first code language. Based on the first code language, the keyword type corresponding to each code keyword is determined, and based on the first display theme and the keyword type corresponding to each code keyword, the first display style is determined.
  • the above-mentioned first display style includes a first background color of the message box used to display the target code fragment and a first font color corresponding to each code keyword.
  • the second determination sub-module determines the first display style based on the first display theme and the keyword types corresponding to each code keyword in the following manner: obtaining the background color corresponding to the first display theme as the first background color, and obtain mapping information corresponding to the first display theme.
  • the mapping information includes information on the mapping relationship between keyword types and font colors. Based on the mapping information and the keyword type corresponding to each code keyword, the first font color corresponding to each code keyword is determined.
  • the target code snippet is displayed in a content block created in the conversational interface.
  • displaying the target code fragment includes highlighting code keywords in the target code fragment and displaying code line numbers in the target code fragment.
  • FIG. 6 is a block diagram of another information processing device according to an exemplary embodiment of the present disclosure.
  • the device may include: a control module 601 , an acquisition module 602 and a display module 603 .
  • control module 601 is used to cause the message input box to enter the code input mode in response to the user performing a preset operation on the message input box of the instant messaging client.
  • the acquisition module 602 is used to acquire the target code fragment input in the above message input box.
  • the display module 603 is used to display the target code fragment in the above message input box according to a preset code display style.
  • control module 601 is configured to create a content block in the above message input box.
  • the acquisition module 602 is configured to: acquire the code fragment input in the content block of the message input box as the target code fragment.
  • the display module 603 may include: an acquisition sub-module, a determination sub-module and a display sub-module (not shown in the figure).
  • the acquisition sub-module is used to obtain multiple code keywords in the target code fragment.
  • the display sub-module is used to display the target code fragment in the content block based on the code keyword and the first code language.
  • the acquisition sub-module is configured to: use a preset plug-in to perform the target code snippet Identify and obtain multiple code keywords included in the target code fragment.
  • the determining sub-module is configured to identify the first code language based on a plurality of code keywords.
  • the display sub-module is configured to: determine the keyword type corresponding to each code keyword based on the first code language, and in the above content block, render and render based on the keyword type corresponding to the code keyword. Show the target code snippet.
  • the display module 603 displays the target code fragment in the following manner: highlighting the code keywords in the target code fragment and displaying the code line numbers in the target code fragment.
  • the user's preset operation on the message input box of the instant messaging client includes any of the following: the user triggers the control by sending a code block in the fixed toolbar of the message input box; the user selects After the input content in the message input box triggers the display of the floating input box, the code sending control in the floating input box is triggered.
  • the device may further include: a selection module, an operation module and an update module (not shown in the figure).
  • the selection module is used to determine the character or string selected by the user from the target code fragment.
  • the operation module is used to determine the user's operation on the character or string to update the pattern.
  • the update module is used to update the style of the character or string in response to the update style operation.
  • a formatting toolbar is displayed in the message input box.
  • the user's operations for updating the style on characters or strings include: after the user selects the character or string, select the format control corresponding to the style from the format toolbar.
  • the message input box of the instant messaging client includes: an input box for conversation messages, an input box for dynamic messages, or an input box for comment messages.
  • the device may further include: a first switching module, a text acquisition module and a text display module (not shown in the figure).
  • the first switching module is used to cause the cursor indicating the input position to jump to the message in response to the first switching operation performed by the user on the instant messaging client during the process of inputting or displaying the target code fragment in the message input box.
  • the text acquisition module is used to acquire the content input in the above-mentioned input area.
  • the input content includes one or more of text, picture, and video.
  • the text display module is used to display the target code snippet in the content block and at the same time display the above-mentioned input content in the above-mentioned input area.
  • the message input box is an input box of the first conversation window; the device may also include: a second switching module and a third switching module (not shown in the figure).
  • the second switching module is used to switch the first session window to the second session in response to the second switching operation performed by the user on the instant messaging client during the process of inputting or displaying the target code fragment in the message input box. window.
  • the third switching module is configured to switch the second session window back to the first session window in response to the user performing a third switching operation on the instant messaging client, and continue to display the target code fragment in the message input box.
  • the device embodiment since it basically corresponds to the method embodiment, please refer to the partial description of the method embodiment for relevant details.
  • the device embodiments described above are only illustrative.
  • the units described as separate components may or may not be physically separated.
  • the components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
  • FIG 7 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure.
  • the electronic device 910 includes a processor 911 and a memory 912, which can be used to implement a client or a server.
  • Memory 912 is used to non-transitoryly store computer-executable instructions (eg, one or more computer program modules).
  • the processor 911 is used to run the computer executable instructions. When the computer executable instructions are run by the processor 911, the computer executable instructions can perform one or more steps in the information processing method described above, thereby realizing the information processing described above. method.
  • Memory 912 and processor 911 may be interconnected by a bus system and/or other forms of connection mechanisms (not shown).
  • the processor 911 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units with data processing capabilities and/or program execution capabilities.
  • the central processing unit (CPU) may be of X86 or ARM architecture.
  • the processor 911 may be a general-purpose processor or a special-purpose processor and may control other components in the electronic device 910 to perform desired functions.
  • memory 912 may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
  • Volatile memory may include, for example, random access memory (RAM) and/or cache memory (cache), etc.
  • Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, and the like.
  • One or more computer program modules may be stored on a computer-readable storage medium, and the processor 911 may run one or more computer program modules to implement various functions of the electronic device 910 .
  • Various application programs and various data, as well as various data used and/or generated by the application programs, etc. can also be stored in the computer-readable storage medium.
  • FIG. 8 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure.
  • the electronic device 920 is, for example, suitable for implementing the information processing method provided by the embodiment of the present disclosure.
  • the electronic device 920 may be a terminal device or the like, and may be used to implement a client or a server.
  • the electronic device 920 may include, but is not limited to, a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (such as a vehicle-mounted navigation terminal), Mobile terminals such as wearable electronic devices and fixed terminals such as digital TVs, desktop computers, smart home devices, etc.
  • PDA personal digital assistant
  • PAD tablet computer
  • PMP portable multimedia player
  • a vehicle-mounted terminal such as a vehicle-mounted navigation terminal
  • Mobile terminals such as wearable electronic devices and fixed terminals such as digital TVs, desktop computers, smart home devices,
  • the electronic device 920 may include a processing device (such as a central processing unit, a graphics processor, etc.) 921, It can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 922 or the program loaded from the storage device 928 into the random access memory (RAM) 923. In the RAM 923, various programs and data required for the operation of the electronic device 920 are also stored.
  • the processing device 921, ROM 922 and RAM 923 are connected to each other through a bus 924.
  • An input/output (I/O) interface 925 is also connected to bus 924.
  • the following devices may be connected to the I/O interface 925: input devices 926 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 927 such as a computer; a storage device 928 including a magnetic tape, a hard disk, etc.; and a communication device 929.
  • the communication device 929 may allow the electronic device 920 to communicate wirelessly or wiredly with other electronic devices to exchange data.
  • FIG. 8 illustrates electronic device 920 having various means, it should be understood that implementation or provision of all illustrated means is not required and electronic device 920 may alternatively implement or be provided with more or fewer means.
  • the above-mentioned information processing method may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a non-transitory computer-readable medium, the computer program including program code for executing the above information processing method.
  • the computer program may be downloaded and installed from the network via communication device 929, or from storage device 928, or from ROM 922.
  • the processing device 921 When the computer program is executed by the processing device 921, the functions defined in the information processing method provided by the embodiments of the present disclosure can be realized.
  • Figure 9 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure.
  • the storage medium 930 may be a non-transitory computer-readable storage medium for storing non-transitory computer-executable instructions 931 .
  • the information processing method described in the embodiment of the present disclosure may be implemented.
  • the non-transitory computer-executable instructions 931 are executed by the processor, the method described above may be executed. one or more steps in the information processing method described above.
  • the storage medium 930 may be applied in the above-mentioned electronic device.
  • the storage medium 930 may include a memory in the electronic device.
  • the storage medium may include a memory card of a smartphone, a storage component of a tablet computer, a hard drive of a personal computer, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM), Portable compact disk read-only memory (CD-ROM), flash memory, or any combination of the above storage media can also be other suitable storage media.
  • RAM random access memory
  • ROM read only memory
  • EPROM erasable programmable read only memory
  • CD-ROM Portable compact disk read-only memory
  • flash memory or any combination of the above storage media can also be other suitable storage media.
  • the description of the storage medium 930 may refer to the description of the memory in the embodiment of the electronic device, and repeated descriptions will not be repeated.
  • the specific functions and technical effects of the storage medium 930 please refer to the above description of the information processing method, and will not be described again here.
  • a computer-readable medium may be a tangible medium that may contain or be stored for use by or in conjunction with an instruction execution system, apparatus, or device. program.
  • the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
  • the computer-readable storage medium may be, for example, but is not limited to: an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof.
  • Computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer magnetic Disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, Magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein.
  • Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.

Abstract

Provided in the present disclosure are information processing methods and apparatus, and an electronic device. A specific embodiment of the methods comprises: receiving a target code snippet sent to a first session (201); in a session interface of the first session, rendering and displaying the target code snippet according to a first display style (202), the session interface being a session interface corresponding to a first user, and the first user being a member in the first session; and in response to a switching operation by the first user on the displayed target code snippet, rendering and displaying the target code snippet in the session interface according to a second display style (203). In the embodiment, the user can switch in the session interface the display styles of the code snippet in a session message, thus enriching the display effects of the code snippet, and improving user experience.

Description

信息处理方法、装置及电子设备Information processing methods, devices and electronic equipment
本申请要求于2022年7月28日递交的中国专利申请第202210901646.1号以及于2022年7月28日递交的中国专利申请第202210899877.3号的优先权,上述中国专利申请的全文以引用的方式并入以作为本申请的一部分。This application claims priority from Chinese Patent Application No. 202210901646.1 submitted on July 28, 2022 and Chinese Patent Application No. 202210899877.3 submitted on July 28, 2022. The full text of the above Chinese patent application is incorporated by reference. as part of this application.
技术领域Technical field
本公开涉及计算机技术领域,特别涉及一种信息处理方法、装置及电子设备。The present disclosure relates to the field of computer technology, and in particular to an information processing method, device and electronic equipment.
背景技术Background technique
随着计算机软件技术的不断发展,越来越多的人在工作和学习中需要编写代码程序,人们对代码进行共享的需求也越来越大。目前,随着线上沟通模式的推广,人们更希望将代码程序通过即时通讯工具与同事或同学进行分享和讨论。一般来说,用户可以直接将代码片段作为普通文本信息,通过即时通讯工具的输入框中进行编辑,并发送到会话界面和好友共享。但是,由于代码片段具有独特的样式,与普通文本信息具有很大的区别,因此,将代码片段作为普通文本信息进行展示的效果和用户体验均较差。With the continuous development of computer software technology, more and more people need to write code programs in their work and study, and people's demand for code sharing is also increasing. At present, with the promotion of online communication mode, people prefer to share and discuss code programs with colleagues or classmates through instant messaging tools. Generally speaking, users can directly use code snippets as ordinary text messages, edit them in the input box of the instant messaging tool, and send them to the conversation interface to share with friends. However, since code snippets have a unique style that is very different from ordinary text information, displaying code snippets as ordinary text information has a poor effect and user experience.
发明内容Contents of the invention
本公开提供一种信息处理方法、装置及电子设备。The present disclosure provides an information processing method, device and electronic equipment.
根据第一方面,提供一种信息处理方法,所述方法包括:According to a first aspect, an information processing method is provided, the method including:
接收向第一会话中发送的目标代码片段;Receive the target code fragment sent to the first session;
在所述第一会话的会话界面中,按照第一展示样式渲染并展示所述目标代码片段;其中,所述会话界面是第一用户对应的会话界面,所述第一用户是所述第一会话中的成员;In the session interface of the first session, the target code fragment is rendered and displayed according to the first presentation style; wherein the session interface is the session interface corresponding to the first user, and the first user is the first user. members of the session;
响应于所述第一用户对展示的所述目标代码片段的切换操作,在所述会话界面中,按照第二展示样式渲染并展示所述目标代码片段。In response to the first user's switching operation on the displayed target code fragment, in the conversation interface, the target code fragment is rendered and displayed according to a second presentation style.
根据第二方面,提供一种信息处理方法,所述方法包括:According to a second aspect, an information processing method is provided, the method including:
响应于用户针对即时通讯客户端的消息输入框进行预设操作,使所述消息输入框进入代码输入模式;In response to the user performing a preset operation on the message input box of the instant messaging client, the message input box enters the code input mode;
获取在所述消息输入框中输入的目标代码片段;Obtain the target code fragment entered in the message input box;
在所述消息输入框中按照预设的代码显示样式展示所述目标代码片段。The target code fragment is displayed in the message input box according to a preset code display style.
根据第三方面,提供一种信息处理装置,所述装置包括:According to a third aspect, an information processing device is provided, the device comprising:
接收模块,用于接收向第一会话中发送的目标代码片段;A receiving module, configured to receive the target code fragment sent to the first session;
展示模块,用于在所述第一会话的会话界面中,按照第一展示样式渲染并展示所述目标代码片段;其中,所述会话界面是第一用户对应的会话界面,所述第一用户是所述 第一会话中的成员;A display module configured to render and display the target code fragment according to a first display style in the session interface of the first session; wherein the session interface is a session interface corresponding to the first user, and the first user is stated members in the first session;
切换模块,用于响应于所述第一用户对展示的所述目标代码片段的切换操作,在所述会话界面中,按照第二展示样式渲染并展示所述目标代码片段。A switching module, configured to render and display the target code fragment according to a second presentation style in the conversation interface in response to the first user's switching operation on the displayed target code fragment.
根据第四方面,提供一种信息处理装置,所述装置包括:According to a fourth aspect, an information processing device is provided, the device comprising:
控制模块,用于响应于用户针对即时通讯客户端的消息输入框进行预设操作,使所述消息输入框进入代码输入模式;A control module configured to cause the message input box to enter the code input mode in response to the user performing a preset operation on the message input box of the instant messaging client;
获取模块,用于获取在所述消息输入框中输入的目标代码片段;An acquisition module, used to acquire the target code fragment entered in the message input box;
展示模块,用于在所述消息输入框中按照预设的代码显示样式展示所述目标代码片段。A display module, configured to display the target code fragment in the message input box according to a preset code display style.
根据第五方面,提供一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面或第二方面中任一项所述的方法。According to a fifth aspect, a computer-readable storage medium is provided, the storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the first aspect or the second aspect is implemented.
根据第六方面,提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现第一方面或第二方面中任一项所述的方法。According to a sixth aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the first aspect or the second aspect is implemented. any of the methods described.
本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
本公开的实施例提供的一种信息处理方法及装置,在会话界面中,以代码的展示样式对会话消息中的代码片段进行展示,用户可以在会话界面中对会话消息中的代码片段的展示样式进行切换,从而丰富了代码片段的显示效果,提升了用户体验。Embodiments of the present disclosure provide an information processing method and device. In the conversation interface, the code fragments in the conversation message are displayed in a code display style. The user can display the code fragments in the conversation message in the conversation interface. Switch styles, thereby enriching the display effect of code snippets and improving user experience.
本公开的实施例提供的一种信息处理方法及装置,通过用户对即时通讯客户端的消息输入框进行预设操作,触发即时通讯客户端的消息输入框提供支持代码片段的展示功能的编辑区域,从而以代码对应的显示样式对在消息输入框中输入的代码片段进行展示,丰富了代码片段的显示效果,提升了用户体验。Embodiments of the present disclosure provide an information processing method and device. The user performs a preset operation on the message input box of the instant messaging client, triggering the message input box of the instant messaging client to provide an editing area that supports the display function of code snippets, thereby The code snippets entered in the message input box are displayed in the display style corresponding to the code, which enriches the display effect of the code snippets and improves the user experience.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.
附图说明Description of drawings
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of this specification more clearly, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the embodiments recorded in this specification. , for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exerting creative labor.
图1a是本公开根据一示例性实施例示出的一种即时通信客户端的界面示意图;Figure 1a is a schematic interface diagram of an instant messaging client according to an exemplary embodiment of the present disclosure;
图1b是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 1b is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图1c是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 1c is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图1d是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 1d is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图1e是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 1e is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图1f是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图; Figure 1f is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图1g是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 1g is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图2是本公开根据一示例性实施例示出的一种即时通信客户端的方法的流程图;Figure 2 is a flow chart of an instant messaging client method according to an exemplary embodiment of the present disclosure;
图3a是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 3a is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图3b是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 3b is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图3c是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 3c is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图3d是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 3d is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图3e是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 3e is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图3f是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 3f is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图3g是本公开根据一示例性实施例示出的另一种即时通信客户端的界面示意图;Figure 3g is a schematic interface diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图4是本公开根据一示例性实施例示出的另一种即时通信客户端的方法的流程图;Figure 4 is a flow chart of another instant messaging client method according to an exemplary embodiment of the present disclosure;
图5是本公开根据一示例性实施例示出的一种即时通信客户端的装置框图;Figure 5 is a device block diagram of an instant messaging client according to an exemplary embodiment of the present disclosure;
图6是本公开根据一示例性实施例示出的另一种即时通信客户端的装置框图;Figure 6 is a device block diagram of another instant messaging client according to an exemplary embodiment of the present disclosure;
图7是本公开一些实施例提供的一种电子设备的示意框图;Figure 7 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure;
图8是本公开一些实施例提供的另一种电子设备的示意框图;Figure 8 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure;
图9是本公开一些实施例提供的一种存储介质的示意图。Figure 9 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described The embodiments are only some of the embodiments of this specification, but not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of protection of this specification.
下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with aspects of the disclosure as detailed in the appended claims.
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure, the singular forms "a," "the" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present disclosure, the first information may also be called second information, and similarly, the second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to determining."
随着计算机软件技术的不断发展,越来越多的人在工作和学习中需要编写代码程序, 人们对代码进行共享的需求也越来越大。目前,随着线上沟通模式的推广,人们更希望将代码程序通过即时通讯工具与同事或同学进行分享和讨论。With the continuous development of computer software technology, more and more people need to write code programs in their work and study. There is also an increasing need for people to share code. At present, with the promotion of online communication mode, people prefer to share and discuss code programs with colleagues or classmates through instant messaging tools.
在相关技术中,用户可以直接将代码片段作为文本信息,输入至即时通讯工具的输入框中进行编辑,并发送到会话界面和好友共享。但是,由于代码片段具有独特的展示样式,与普通文本信息有很大的区别,按照文本信息的样式展示代码片段则无法体现出代码片段的独特的样式,增加了用户对代码片段阅读的障碍,代码片段的显示效果和用户体验较差。In related technologies, users can directly input code snippets as text information into the input box of an instant messaging tool for editing, and send it to the conversation interface to share with friends. However, since code snippets have a unique display style, which is very different from ordinary text information, displaying code snippets in the style of text information cannot reflect the unique style of the code snippets, which increases the difficulty for users to read the code snippets. The display effect and user experience of code snippets are poor.
本公开提供的一种信息处理的方法,在会话界面中,以代码的展示样式对会话消息中的代码片段进行展示,用户可以在会话界面中对会话消息中的代码片段的展示样式进行切换,从而丰富了代码片段的显示效果,提升了用户体验。The present disclosure provides an information processing method. In the conversation interface, the code fragments in the conversation message are displayed in a code display style. The user can switch the display style of the code fragments in the conversation message in the conversation interface. This enriches the display effect of code snippets and improves user experience.
下面将结合具体的实施例对本公开进行详细描述。The present disclosure will be described in detail below with reference to specific embodiments.
图1a为根据一示例性实施例示出的一种即时通信客户端的界面示意图。如图1a所示,例如,用户的好友将代码片段通过即时通讯客户端分享给用户。该用户可以打开即时通讯客户端中与好友的会话窗口,在会话界面的消息框101中展示有该代码片段。其中,该消息框101例如可以是在会话界面中创建的一个支持代码展示功能的内容块。可以在该内容块中以代码的展示样式展示代码片段。例如,在展示代码片段时,可以对代码片段中的部分关键字高亮显示,并采用不同颜色显示不同类型的关键字,以及显示代码片段的行号等。在消息框101的顶端,具有针对代码的选择工具栏。例如,选择工具栏可以包括代码语言选择栏和显示主题选择栏等。Figure 1a is a schematic interface diagram of an instant messaging client according to an exemplary embodiment. As shown in Figure 1a, for example, the user's friend shares the code snippet with the user through an instant messaging client. The user can open a conversation window with a friend in the instant messaging client, and the code snippet is displayed in the message box 101 of the conversation interface. The message box 101 may be, for example, a content block created in the conversational interface that supports the code display function. You can display code snippets in this content block in a code presentation style. For example, when displaying a code snippet, you can highlight some keywords in the code snippet, use different colors to display different types of keywords, and display the line number of the code snippet, etc. At the top of message box 101, there is a selection toolbar for code. For example, the selection toolbar may include a code language selection bar, a display theme selection bar, etc.
具体来说,消息框可以支持多种代码语言的展示样式,如图1b所示,用户可以通过消息框顶端的代码语言选择栏102的下拉选项,选择并切换代码语言的展示样式。在选择目标代码语言之后,代码片段在消息框中,可以以目标代码语言特有的展示样式进行展示(因为某些代码关键字,在不同代码语言下所对应的关键字类型可能不同,因此高亮显示的关键字的颜色也不相同)。例如,用户通过代码语言选择栏代码语言JAVA,则代码片段在内容块中以JAVA对应的展示样式进行展示。用户再通过代码语言选择栏将代码语言JAVA切换成代码语言ABAP,则代码片段在内容块中的展示样式切换成ABAP对应的展示样式。Specifically, the message box can support the display styles of multiple code languages. As shown in Figure 1b, the user can select and switch the display style of the code language through the drop-down option of the code language selection bar 102 at the top of the message box. After selecting the target code language, the code snippet can be displayed in the message box in a display style unique to the target code language (because some code keywords may have different keyword types in different code languages, so they are highlighted The displayed keywords are also displayed in different colors). For example, if the user selects the code language JAVA in the code language column, the code snippets are displayed in the content block in the display style corresponding to JAVA. The user then switches the code language JAVA to the code language ABAP through the code language selection bar, and the display style of the code snippets in the content block is switched to the corresponding display style of ABAP.
可选地,消息框中还可以支持多种显示主题,每种显示主题对应一套展示样式,每套展示样式包括一种消息框的背景颜色以及各个关键字类型对应的字体颜色。因此,同一类型的关键字在相同显示主题下的字体颜色相同,在不同显示主题下的字体颜色不同。如图1c所示,用户可以通过消息框顶端的显示主题选择栏103的下拉选项,选择并切换显示主题。在选择目标显示主题之后,代码片段在消息框中,可以以目标显示主题对应的展示样式进行展示。例如,用户通过显示主题选择主题1,则代码片段在消息框中以主题1对应的展示样式进行展示。用户再通过显示主题选择栏将主题1切换成主题2,则代码片段在消息框中的展示样式切换成主题2对应的展示样式。Optionally, the message box can also support multiple display themes. Each display theme corresponds to a set of display styles. Each set of display styles includes a background color of the message box and a font color corresponding to each keyword type. Therefore, keywords of the same type have the same font color under the same display theme, and different font colors under different display themes. As shown in Figure 1c, the user can select and switch the display theme through the drop-down option of the display theme selection bar 103 at the top of the message box. After selecting the target display theme, the code snippet can be displayed in the message box in the display style corresponding to the target display theme. For example, if the user selects Topic 1 by displaying the topic, the code snippet will be displayed in the message box in the display style corresponding to Topic 1. The user then switches theme 1 to theme 2 by displaying the theme selection bar, and then the display style of the code snippet in the message box is switched to the display style corresponding to theme 2.
以上实例是以接收消息的用户为例进行的示例性说明,对于发送消息的用户来说, 在发送消息的用户的客户端上,在会话界面的消息输入框中,用户在编辑代码片段时,也可以对代码片段的展示样式进行切换。如图1d所示,为用户通过选择代码语言切换消息输入框中代码片段的展示样式。如图1e所示,为用户通过选择显示主题切换消息输入框中代码片段的展示样式。另外,在包括代码片段的消息发送成功之后,在发送消息的用户的会话界面显示的消息框中展示有代码片段。发送消息的用户也可以对消息框中代码片段的展示样式进行切换。如图1f所示,为用户通过选择代码语言切换消息显示框中代码片段的展示样式。如图1g所示,为用户通过选择显示主题切换消息显示框中代码片段的展示样式。The above example is an illustrative explanation taking the user who receives the message as an example. For the user who sends the message, On the client of the user who sent the message, in the message input box of the conversation interface, the user can also switch the display style of the code fragment when editing the code fragment. As shown in Figure 1d, the user switches the display style of the code snippet in the message input box by selecting the code language. As shown in Figure 1e, the user switches the display style of the code snippet in the message input box by selecting the display theme. In addition, after the message including the code fragment is successfully sent, the code fragment is displayed in a message box displayed on the session interface of the user who sent the message. The user who sends the message can also switch the display style of the code snippet in the message box. As shown in Figure 1f, the user switches the display style of the code snippet in the message display box by selecting the code language. As shown in Figure 1g, the user switches the display style of the code snippet in the message display box by selecting the display theme.
本实施例提供的方案,在会话界面中,以代码的展示样式对会话消息中的代码片段进行展示,用户可以在会话界面中对会话消息中的代码片段的展示样式进行切换,从而丰富了代码片段的显示效果,提升了用户体验。In the solution provided by this embodiment, in the conversation interface, the code fragments in the conversation message are displayed in the code display style. The user can switch the display style of the code fragments in the conversation message in the conversation interface, thereby enriching the code. The display effect of the fragments improves the user experience.
进一步地,即时通讯客户端支持代码语言的展示样式的切换功能,从而使用户能够通过代码语言对代码片段的展示样式进行切换。从而进一步丰富了代码片段的显示效果,有助于提升了用户体验。Furthermore, the instant messaging client supports the switching function of the display style of the code language, so that the user can switch the display style of the code snippet through the code language. This further enriches the display effect of code snippets and helps improve user experience.
再进一步地,用户还可以对即时通讯客户端会话消息中的代码片段切换显示主题,从而进一步丰富了代码片段的显示效果,有助于提升用户体验。Furthermore, the user can also switch the display theme of the code snippets in the instant messaging client session message, thereby further enriching the display effect of the code snippets and helping to improve the user experience.
下面将结合具体的实施例对本公开进行详细描述。The present disclosure will be described in detail below with reference to specific embodiments.
图2为根据一示例性实施例示出的一种信息处理方法的流程图。该方法可以应用于终端设备中。在本实施例中,为了便于理解,结合能够安装即时通讯应用程序的终端设备来举例说明。本领域技术人员可以理解,该终端设备可以包括但不限于诸如智能手机的移动终端设备、智能穿戴式设备、平板电脑等等。该方法可以包括以下步骤:FIG. 2 is a flow chart of an information processing method according to an exemplary embodiment. This method can be applied to terminal equipment. In this embodiment, for ease of understanding, an example is given with reference to a terminal device capable of installing an instant messaging application. Those skilled in the art can understand that the terminal device may include but is not limited to mobile terminal devices such as smartphones, smart wearable devices, tablet computers, and the like. The method may include the following steps:
如图2所示,在步骤201中,接收向第一会话中发送的目标代码片段,以及在步骤202中,在第一会话的会话界面中,按照第一展示样式渲染并展示所述目标代码片段。As shown in Figure 2, in step 201, the target code fragment sent to the first session is received, and in step 202, in the session interface of the first session, the target code is rendered and displayed according to the first presentation style. fragment.
在本实施例中,第一会话为即时通讯客户端中涉及的会话,即时通讯客户端可以是安装于终端设备的第三方应用程序,用户可以通过即时通讯客户端与好友/群组成员进行实时会话。第一会话的会话界面是第一用户对应的会话界面,第一用户是第一会话中的成员。该第一用户可以是第一会话中目标代码片段的发送者,也可以是接收者。In this embodiment, the first session is a session involving an instant messaging client. The instant messaging client can be a third-party application installed on the terminal device. The user can communicate with friends/group members in real time through the instant messaging client. session. The session interface of the first session is the session interface corresponding to the first user, and the first user is a member of the first session. The first user may be the sender or recipient of the target code fragment in the first session.
具体来说,在按照第一展示样式渲染并展示目标代码片段之前,首先,可以先获取目标代码片段中的多个代码关键字,并确定第一代码语言。可以使用预设插件(如代码高亮插件等)对目标代码片段进行识别,得到目标代码片段包括的多个代码关键字。可以理解,该预设插件可以是本领域中已知的以及将来可能出现的任何能够实现上述功能的插件,本公开对该预设插件的具体类型方面不限定。Specifically, before rendering and displaying the target code fragment according to the first display style, first, multiple code keywords in the target code fragment may be obtained and the first code language may be determined. You can use a preset plug-in (such as a code highlighting plug-in, etc.) to identify the target code fragment and obtain multiple code keywords included in the target code fragment. It can be understood that the preset plug-in can be any plug-in that is known in the art and may appear in the future and can realize the above functions, and the present disclosure is not limited to the specific type of the preset plug-in.
在一种实现方式中,可以获取用户从代码语言选择栏的下拉选项中选择的代码语言作为第一代码语言。在另一种实现方式中,还可以根据识别出的目标代码片段中包括的代码关键字,确定目标代码片段对应的代码语言,将目标代码片段对应的代码语言作为第一代码语言。例如,代码关键字X为C++语言特有的关键字,如果目标代码片段中包 括代码关键字X,则可以确定目标代码片段对应的代码语言为C++语言。又例如,代码关键字Y为C语言和Java特有的关键字,代码关键字Z为JavaScript和Java特有的关键字,如果目标代码片段中包括代码关键字Y和代码关键字Z,则可以确定目标代码片段对应的代码语言为Java语言。需要说明的是,上述举例仅是为说明原理而假设的情况,代码关键字X、Y和Z也仅是为举例而假设的关键字代号,并非实际的关键字。In one implementation, the code language selected by the user from the drop-down option of the code language selection bar can be obtained as the first code language. In another implementation, the code language corresponding to the target code fragment may be determined based on the code keywords included in the identified target code fragment, and the code language corresponding to the target code fragment may be used as the first code language. For example, the code keyword X is a keyword unique to the C++ language. If the target code fragment contains If you include the code keyword X, you can determine that the code language corresponding to the target code fragment is C++ language. For another example, code keyword Y is a keyword unique to C language and Java, and code keyword Z is a keyword unique to JavaScript and Java. If the target code fragment includes code keyword Y and code keyword Z, the target can be determined The code language corresponding to the code snippet is Java language. It should be noted that the above examples are only hypothetical situations for illustrating the principle, and the code keywords X, Y, and Z are only hypothetical keyword codes for examples, and are not actual keywords.
接着,再基于代码关键字以及第一代码语言,确定第一展示样式。在本实施例中,由于某些代码关键字在不同的代码语言下所对应的关键字类型可能不同,因此,突出显示的关键字的颜色也不相同。所以,可以基于第一代码语言,确定目标代码片段包括的每个代码关键字所对应的关键字类型,并根据每个代码关键字所对应的关键字类型确定第一展示样式。其中,该第一展示样式可以包括用于展示目标代码片段的消息框的背景颜色以及各个代码关键字对应的字体颜色。Then, the first display style is determined based on the code keyword and the first code language. In this embodiment, since some code keywords may have different keyword types in different code languages, the colors of the highlighted keywords are also different. Therefore, the keyword type corresponding to each code keyword included in the target code fragment can be determined based on the first code language, and the first display style is determined based on the keyword type corresponding to each code keyword. The first display style may include the background color of the message box used to display the target code fragment and the font color corresponding to each code keyword.
在展示目标代码片段时,可以对目标代码片段包括的每个代码关键字,按照其对应的关键字类型进行渲染,并展示目标代码片段。例如,代码关键字A在C语言中的关键字类型为m,在Java中的关键字类型为n,关键字类型m对应的颜色为红色,关键字类型n对应的颜色为绿色。因此,确定目标代码片段包括代码关键字A,如果目标代码片段对应的代码语言为C语言,则确定代码关键字A的关键字类型为m。按照关键字类型m对应的颜色进行渲染之后,代码关键字A显示为红色。如果目标代码片段对应的代码语言为Java语言,则确定代码关键字A的关键字类型为n。按照关键字类型n对应的颜色进行渲染之后,代码关键字A显示为绿色。When displaying the target code fragment, each code keyword included in the target code fragment can be rendered according to its corresponding keyword type, and the target code fragment can be displayed. For example, the keyword type of code keyword A in C language is m, and the keyword type in Java is n. The color corresponding to keyword type m is red, and the color corresponding to keyword type n is green. Therefore, it is determined that the target code fragment includes code keyword A. If the code language corresponding to the target code fragment is C language, it is determined that the keyword type of code keyword A is m. After rendering according to the color corresponding to the keyword type m, the code keyword A is displayed in red. If the code language corresponding to the target code fragment is the Java language, it is determined that the keyword type of the code keyword A is n. After rendering according to the color corresponding to keyword type n, code keyword A is displayed in green.
可选地,可以预先设定多个显示主题,每个显示主题对应一套展示样式,每套展示样式包括一种消息框的背景颜色以及各个关键字类型对应的字体颜色。因此,同一类型的关键字在相同显示主题下的字体颜色相同,在不同显示主题下的字体颜色不同。因此,在确定第一展示样式之前,可以先确定针对代码的第一显示主题。例如,可以由用户从备选显示主题中选择第一显示主题。然后,再基于第一显示主题、目标代码片包括的代码关键字以及第一代码语言,确定第一展示样式。Optionally, multiple display themes can be preset, each display theme corresponds to a set of display styles, and each set of display styles includes a background color of the message box and a font color corresponding to each keyword type. Therefore, keywords of the same type have the same font color under the same display theme, and different font colors under different display themes. Therefore, before determining the first display style, the first display theme for the code may be determined first. For example, the first display theme may be selected by the user from alternative display themes. Then, the first display style is determined based on the first display theme, the code keywords included in the target code piece, and the first code language.
具体地,第一展示样式可以包括用于展示目标代码片段的消息框的第一背景颜色以及各个代码关键字对应的第一字体颜色。在基于第一代码语言,确定各个代码关键字对应的关键字类型之后,可以通过如下方式基于第一显示主题和各个代码关键字对应的关键字类型,确定第一展示样式:首先,获取第一显示主题对应的背景颜色作为第一背景颜色。并获取第一显示主题对应的映射信息,该映射信息包括关键字类型与字体颜色的映射关系信息。最后,基于该映射信息以及各个代码关键字对应的关键字类型,确定各个代码关键字对应的第一字体颜色。Specifically, the first display style may include a first background color of the message box used to display the target code fragment and a first font color corresponding to each code keyword. After determining the keyword type corresponding to each code keyword based on the first code language, the first display style can be determined based on the first display theme and the keyword type corresponding to each code keyword in the following manner: First, obtain the first Display the background color corresponding to the theme as the first background color. And obtain mapping information corresponding to the first display theme, where the mapping information includes mapping relationship information between keyword types and font colors. Finally, based on the mapping information and the keyword type corresponding to each code keyword, the first font color corresponding to each code keyword is determined.
例如,预先针对显示主题1生成了包括映射信息的映射表,映射表中记录有不同关键字类型与字体颜色的映射关系信息(如关键字类型1与颜色1对应,关键字类型2与颜色2对应等)。用户从备选显示主题中选中了显示主题1,首先,可以获取目标代码片段中的各个代码关键字,并确定第一代码语言。然后,确定各个代码关键字在第一代码 语言下所对应的关键字类型。最后,针对各个代码关键字,根据该代码关键字所对应的关键字类型,从映射表中查找该代码关键字类型对应的颜色作为该代码关键字的字体颜色。需要说明的是,如果任一代码关键字在第一代码语言下没有对应的关键字类型,则可以将该代码关键字作为普通的文本字符串进行展示。For example, a mapping table including mapping information is generated in advance for display theme 1. The mapping table records mapping relationship information between different keyword types and font colors (for example, keyword type 1 corresponds to color 1, and keyword type 2 corresponds to color 2. Correspondence, etc.). The user selects display theme 1 from the alternative display themes. First, each code keyword in the target code fragment can be obtained, and the first code language can be determined. Then, identify each code keyword in the first code Keyword type corresponding to the language. Finally, for each code keyword, according to the keyword type corresponding to the code keyword, the color corresponding to the code keyword type is searched from the mapping table as the font color of the code keyword. It should be noted that if any code keyword does not have a corresponding keyword type in the first code language, the code keyword can be displayed as an ordinary text string.
在步骤203中,响应于第一用户对展示的目标代码片段的切换操作,在会话界面中,按照第二展示样式渲染并展示目标代码片段。In step 203, in response to the first user's switching operation on the displayed target code fragment, in the conversation interface, the target code fragment is rendered and displayed according to the second presentation style.
在一种实现方式中,第一用户对展示的目标代码片段的切换操作可以是将第一代码语言切换为第二代码语言的操作,其中,第二展示样式基于第二代码语言而确定,第二展示样式包括各个代码关键字对应的第二字体颜色。具体来说,在第一用户将第一代码语言切换为第二代码语言之后,可以确定目标代码片段包括的各个代码关键字在第二代码语言下所对应的关键字类型。再根据各个代码关键字所对应的关键字类型,确定各个代码关键字对应的第二字体颜色,从而确定第二展示样式。In one implementation, the first user's switching operation on the displayed target code fragment may be an operation of switching the first code language to the second code language, wherein the second display style is determined based on the second code language, and the first The second display style includes a second font color corresponding to each code keyword. Specifically, after the first user switches the first code language to the second code language, the keyword type corresponding to each code keyword included in the target code fragment in the second code language can be determined. Then, according to the keyword type corresponding to each code keyword, the second font color corresponding to each code keyword is determined, thereby determining the second display style.
例如,关键字类型包括a、b、c,关键字类型a对应于红色,关键字类b对应于蓝色,关键字类型c对应于绿色。目标代码片段包括代码关键字A、B、C、D、E、F,在代码语言1下,关键字A、B、C的关键字类型为a,关键字D、E、F的关键字类型为b。因此,在代码语言1的情况下展示目标代码片段时,将关键字A、B、C渲染成红色,将关键字D、E、F渲染成蓝色。用户将代码语言由代码语言1切换成代码语言2,在代码语言2下,关键字A、B的关键字类型为a,关键字D、E的关键字类型为b,关键字C、F的关键字类型为c。因此,在切换代码语言2之后,将关键字A、B渲染成红色,将关键字D、E渲染成蓝色,将关键字C、F渲染成绿色。For example, keyword types include a, b, and c, keyword type a corresponds to red, keyword type b corresponds to blue, and keyword type c corresponds to green. The target code fragment includes code keywords A, B, C, D, E, and F. Under code language 1, the keyword type of keywords A, B, and C is a, and the keyword type of keywords D, E, and F is for b. Therefore, when the target code fragment is displayed in the case of code language 1, the keywords A, B, and C are rendered in red, and the keywords D, E, and F are rendered in blue. The user switches the code language from code language 1 to code language 2. Under code language 2, the keyword type of keywords A and B is a, the keyword type of keywords D and E is b, and the keyword type of keywords C and F is The keyword type is c. Therefore, after switching to code language 2, keywords A and B are rendered in red, keywords D and E are rendered in blue, and keywords C and F are rendered in green.
在另一种实现方式中,第一用户对展示的目标代码片段的切换操作还可以是将第一显示主题切换为第二显示主题的操作,其中,第二展示样式基于第二显示主题而确定,第二展示样式包括各个代码关键字对应的第二字体颜色。具体来说,在第一用户将第一显示主题切换为第二显示主题之后,可以确定目标代码片段包括的各个代码关键字在第一代码语言下所对应的关键字类型。再根据第二显示主题以及各个代码关键字所对应的关键字类型,确定各个代码关键字对应的第二字体颜色,从而确定第二展示样式。In another implementation, the first user's switching operation on the displayed target code fragment may also be an operation of switching the first display theme to the second display theme, wherein the second display style is determined based on the second display theme. , the second display style includes the second font color corresponding to each code keyword. Specifically, after the first user switches the first display theme to the second display theme, the keyword type corresponding to each code keyword included in the target code fragment in the first code language can be determined. Then, according to the second display theme and the keyword type corresponding to each code keyword, the second font color corresponding to each code keyword is determined, thereby determining the second display style.
例如,关键字类型包括a、b、c,在显示主题一下,关键字类型a对应于红色,关键字类b对应于蓝色,关键字类型c对应于绿色。在显示主题二下,关键字类型a对应于粉色,关键字类b对应于紫色,关键字类型c对应于黄色。目标代码片段包括代码关键字A、B、C、D、E、F,在代码语言1下,关键字A、B、C的关键字类型为a,关键字D、E、F的关键字类型为b。因此,在代码语言1和显示主题一的情况下展示目标代码片段时,将关键字A、B、C渲染成红色,将关键字D、E、F渲染成蓝色。用户将显示主题由显示主题一切换成显示主题二之后,将关键字A、B、C渲染成粉色,将关键字D、E、F渲染成紫色。For example, keyword types include a, b, and c. When displaying the topic, keyword type a corresponds to red, keyword type b corresponds to blue, and keyword type c corresponds to green. Under display theme two, keyword type a corresponds to pink, keyword type b corresponds to purple, and keyword type c corresponds to yellow. The target code fragment includes code keywords A, B, C, D, E, and F. Under code language 1, the keyword type of keywords A, B, and C is a, and the keyword type of keywords D, E, and F is for b. Therefore, when the target code fragment is displayed in the case of code language 1 and display theme 1, the keywords A, B, and C are rendered in red, and the keywords D, E, and F are rendered in blue. After the user changes the display theme from display theme to display theme two, the keywords A, B, and C are rendered in pink, and the keywords D, E, and F are rendered in purple.
本公开提供的一种信息处理方法,在会话界面中,以代码的展示样式对会话消息中的代码片段进行展示,用户可以在会话界面中对会话消息中的代码片段的展示样式进行 切换,从而丰富了代码片段的显示效果,提升了用户体验。The present disclosure provides an information processing method. In the conversation interface, the code fragments in the conversation message are displayed in the code display style. The user can display the code fragments in the conversation message in the conversation interface. Switch, thus enriching the display effect of code snippets and improving user experience.
本公开提供的另一种信息处理的方法,通过用户对即时通讯客户端的消息输入框进行预设操作,触发即时通讯客户端的消息输入框提供支持代码片段的展示功能的编辑区域,从而以代码对应的显示样式对在消息输入框中输入的代码片段进行展示,丰富了代码片段的显示效果,提升了用户体验。Another information processing method provided by the present disclosure is that the user performs a preset operation on the message input box of the instant messaging client, triggering the message input box of the instant messaging client to provide an editing area that supports the display function of code snippets, thereby corresponding to the code The display style displays the code snippets entered in the message input box, enriching the display effect of the code snippets and improving the user experience.
下面将结合具体的实施例对本公开进行详细描述。The present disclosure will be described in detail below with reference to specific embodiments.
图3a为根据一示例性实施例示出的另一种即时通信客户端的界面示意图。如图3a所示,例如,用户需要将代码片段通过即时通讯客户端分享给好友。该用户可以打开即时通讯客户端中与好友的会话窗口,然后,对即时通讯客户端的消息输入框401进行预设操作,从而触发即时通讯客户端向用户提供代码片段的编辑区域。Figure 3a is a schematic interface diagram of another instant messaging client according to an exemplary embodiment. As shown in Figure 3a, for example, the user needs to share the code snippet with friends through an instant messaging client. The user can open a conversation window with a friend in the instant messaging client, and then perform a preset operation on the message input box 401 of the instant messaging client, thereby triggering the instant messaging client to provide the user with an editing area for code snippets.
在一种实现方式中,可以通过直接点击消息输入框401的固定工具栏402中代码对应的图标403,从而触发即时通讯客户端向用户提供代码片段的编辑区域。在另一种实现方式中,还可在消息输入框中输入任意字符或字符串,选中输入的字符或字符串,弹出悬浮工具栏(图中未示出),点击悬浮工具栏中代码对应的图标,从而触发即时通讯客户端向用户提供代码片段的编辑区域。在又一种实现方式中,还可以通过点击预设的快捷键,从而触发即时通讯客户端向用户提供代码片段的编辑区域。In one implementation, you can directly click the icon 403 corresponding to the code in the fixed toolbar 402 of the message input box 401 to trigger the instant messaging client to provide the user with an editing area for the code snippet. In another implementation, you can also enter any character or string in the message input box, select the entered character or string, a floating toolbar will pop up (not shown in the figure), and click the code corresponding to the floating toolbar. icon, thereby triggering the instant messaging client to provide the user with an editing area for the code snippet. In yet another implementation, the instant messaging client can be triggered to provide the user with an editing area for code snippets by clicking a preset shortcut key.
具体地,在检测到用户的预设操作之后,可以在消息输入框中创建一个支持代码编辑和展示功能的内容块,将该内容块的编辑界面作为代码片段的编辑区域。例如,若直接点击代码对应的图标,或者点击预设的快捷键,可以在光标位置处创建一个内容块。又例如,若选中字符或字符串之后点击代码对应的图标,可以在选中的字符或字符串的位置处创建一个内容块,使选中的字符或字符串在内容块中。可以在创建的该内容块中编辑代码片段,并以代码的展示方式展示代码片段。例如,在展示代码片段时,可以对代码片段中的部分关键字高亮显示,并采用不同颜色显示不同类型的关键字,以及显示代码片段的行号等。Specifically, after detecting the user's preset operation, a content block that supports code editing and display functions can be created in the message input box, and the editing interface of the content block can be used as the editing area for code snippets. For example, if you directly click on the icon corresponding to the code, or click on the preset shortcut key, you can create a content block at the cursor position. For another example, if you select a character or string and then click the icon corresponding to the code, you can create a content block at the position of the selected character or string so that the selected character or string is in the content block. Code snippets can be edited in the content block you create and displayed as code. For example, when displaying a code snippet, you can highlight some keywords in the code snippet, use different colors to display different types of keywords, and display the line number of the code snippet, etc.
如图3b所示,为用户进行预设操作之后的即时通讯客户端的界面示意图。即时通讯客户端在消息输入框中向用户提供代码片段的内容块404。在内容块404的顶端,具有针对代码的编辑工具405。例如,编辑工具可以包括图3b中示出的代码语言选择栏,换行切换按钮和复制按钮等,以及其它图中未示出的常用代码编辑工具等。如图3c所示,用户可以在内容块中输入代码片段进行编辑,而代码片段在内容块中,可以以代码特有的展示方式进行展示。As shown in Figure 3b, it is a schematic diagram of the interface of the instant messaging client after the user performs the preset operation. The instant messaging client provides the user with a content block 404 of the code snippet in the message input box. At the top of the content block 404, there are editing tools 405 for the code. For example, the editing tools may include the code language selection bar shown in Figure 3b, a line break switch button, a copy button, etc., as well as other common code editing tools not shown in the figure, etc. As shown in Figure 3c, users can enter code snippets in the content block for editing, and the code snippets in the content block can be displayed in a code-specific display manner.
可选地,内容块可以支持多种代码语言的显示样式,如图3d所示,用户可以通过编辑区域顶端的代码语言选择栏的下拉选项406,选择并切换代码语言的显示样式。具体地,代码片段在内容块中,可以以相应的代码语言特有的显示样式进行展示(因为代码片段包括的某些代码关键字,在不同代码语言下所对应的关键字类型可能不同,因此高亮显示的关键字的颜色也不相同)。Optionally, the content block can support display styles of multiple code languages. As shown in Figure 3d, the user can select and switch the display style of the code language through the drop-down option 406 of the code language selection bar at the top of the editing area. Specifically, the code snippets in the content block can be displayed in a display style unique to the corresponding code language (because some code keywords included in the code snippets may have different keyword types in different code languages, so it is highly The highlighted keywords are also colored differently).
进一步可选地,内容块还支持代码语言的识别及显示样式的自动切换的功能。例如, 用户可以将编写好的代码片段直接粘贴入内容块中,也可以在内容块中通过键盘输入代码片段,还可以先输入代码片段,再选中代码片段点击代码对应的图标等。如果将编写好的代码片段直接粘贴入内容块中,或者先输入代码片段,再选中代码片段点击代码对应的图标,则可以自动识别粘贴或选中的代码片段的代码语言,并将当前显示样式自动切换为该代码语言对应的显示样式。如果在内容块中通过键盘输入代码片段,可以将当前显示样式自动切换为用户选择的代码语言对应的显示样式。若用户未选择代码语言,则可以将当前显示样式切换为默认的代码语言对应的显示样式。Further optionally, the content block also supports code language recognition and automatic switching of display styles. For example, Users can paste the written code snippet directly into the content block, or enter the code snippet through the keyboard in the content block. They can also enter the code snippet first, then select the code snippet and click the icon corresponding to the code, etc. If you paste the written code snippet directly into the content block, or enter the code snippet first, then select the code snippet and click the icon corresponding to the code, the code language of the pasted or selected code snippet can be automatically recognized, and the current display style will be automatically Switch to the display style corresponding to the code language. If you enter a code snippet through the keyboard in the content block, the current display style can be automatically switched to the display style corresponding to the code language selected by the user. If the user does not select a code language, the current display style can be switched to the display style corresponding to the default code language.
另外,在内容块选中字符或字符串后,可以对选中的字符或字符串更新样式。在一种实现方式中,如图3e所示,可以弹出用于对字符或字符串的样式进行更新的悬浮工具栏407,悬浮工具栏407中包括多个调整样式的按钮。例如,可以包括调整字体粗细的按钮,调整字体倾斜的按钮,添加删除线的按钮以及添加下划线的按钮等。可以利用弹出的悬浮工具栏中的按钮,对选中的字符或字符串更新样式。在另一种实现方式中,也可以直接利用消息输入框的固定工具栏中调整样式的按钮,对选中的字符或字符串更新样式。In addition, after selecting a character or string in the content block, you can update the style of the selected character or string. In one implementation, as shown in Figure 3e, a floating toolbar 407 for updating the style of characters or strings can pop up. The floating toolbar 407 includes multiple buttons for adjusting styles. For example, you can include buttons to adjust font thickness, buttons to adjust font inclination, buttons to add strikethrough, and buttons to add underline, etc. You can use the buttons in the pop-up floating toolbar to update the style of the selected character or string. In another implementation, you can also directly use the style adjustment button in the fixed toolbar of the message input box to update the style of the selected character or string.
可选地,用户在内容块中编辑目标代码片段的过程中,还可以将当前会话窗口切换至其它会话窗口。如图3f所示,用户在和好友张三讨论代码片段的过程中,接到好友李四的即时通讯消息。用户可以通过点击好友李四的头像,将会话窗口切换至好友李四的会话窗口,并与好友李四进行会话。然后,再通过点击好友张三的头像,以将会话窗口切换回好友张三的会话窗口,并可以继续编辑和好友张三讨论的代码片段。Optionally, while the user is editing the target code fragment in the content block, the user can also switch the current session window to another session window. As shown in Figure 3f, while the user was discussing code snippets with his friend Zhang San, he received an instant messaging message from his friend Li Si. The user can click on the avatar of friend John Doe to switch the session window to the conversation window of friend John Doe and have a conversation with friend John Doe. Then, click on the avatar of friend Zhang San to switch the session window back to the session window of friend Zhang San, and you can continue to edit the code snippets discussed with friend Zhang San.
可选地,用户在内容块中编辑目标代码片段的过程中,还可以进行代码片段和文本内容的混排,即通过消息输入框加入文本信息,以便对代码进行注释和说明。如图3g所示,用户可以在内容块中编辑目标代码片段,当用户点击内容块之外的区域,或者点击预设的快捷键时,用于指示输入位置的光标可以从内容块的区域跳转至内容块下方的文本输入区域。用户可以在内容块下方的文本输入区域输入用于解释说明目标代码片段的文本内容,该文本内容可以和目标代码片段一起显示于消息输入框中。图3g示出的文本输入区域位于内容块下方,可以理解,文本输入区域也可以位于内容块之外的其它位置,例如位于内容块的上方,或者位于内容块的左侧,或者位于内容块的右侧等,本实施例对此方面不限定。Optionally, when the user edits the target code snippet in the content block, the user can also mix the code snippet and the text content, that is, add text information through the message input box to comment and explain the code. As shown in Figure 3g, the user can edit the target code fragment in the content block. When the user clicks an area outside the content block, or clicks a preset shortcut key, the cursor used to indicate the input position can jump from the area of the content block. Go to the text input area below the content block. The user can enter text content used to explain the target code fragment in the text input area below the content block, and the text content can be displayed in the message input box together with the target code fragment. The text input area shown in Figure 3g is located below the content block. It can be understood that the text input area can also be located at other locations outside the content block, such as above the content block, or to the left of the content block, or to the content block. The right side, etc., this embodiment is not limited in this aspect.
需要说明的是,以上以在即时通讯客户端的会话消息的输入框中编辑和展示代码为例,对本方案进行说明。实际上,本方案还可以在即时通讯客户端的动态消息的输入框,或者评论消息的输入框中编辑和展示代码,具体过程和上述实施例类似,在此不再赘述。It should be noted that the above description of this solution takes the editing and display of code in the input box of the session message of the instant messaging client as an example. In fact, this solution can also edit and display the code in the dynamic message input box of the instant messaging client or the comment message input box. The specific process is similar to the above embodiment and will not be described again here.
本实施例提供的方案,通过用户对即时通讯客户端的消息输入框进行预设操作,触发即时通讯客户端的消息输入框提供支持代码片段的展示功能的编辑区域,从而以代码对应的显示样式对在消息输入框中输入的代码片段进行展示,丰富了代码片段的显示效果,提升了用户体验。The solution provided by this embodiment is that the user performs a preset operation on the message input box of the instant messaging client, triggering the message input box of the instant messaging client to provide an editing area that supports the display function of code snippets, thereby using the display style corresponding to the code to The code snippets entered in the message input box are displayed, which enriches the display effect of the code snippets and improves the user experience.
进一步地,即时通讯客户端的消息输入框还具有代码语言的识别功能,从而能够根 据用户输入的代码片段自动识别代码语言,并将当前显示样式自动切换为该代码语言对应的显示样式。从而为提高代码片段的编辑效率提供了条件,并进一步提升了用户体验。Furthermore, the message input box of the instant messaging client also has a code language recognition function, so that it can Automatically identify the code language based on the code snippets input by the user, and automatically switch the current display style to the display style corresponding to the code language. This provides conditions for improving the editing efficiency of code snippets and further improves user experience.
再进一步地,用户还可以对即时通讯客户端的消息输入框中的代码更新样式,从而提升了编辑代码的灵活性,进一步提升了用户体验。Furthermore, users can also update the style of the code in the message input box of the instant messaging client, thereby improving the flexibility of editing the code and further improving the user experience.
又进一步地,由于用户在内容块中编辑目标代码片段的过程中,可以将当前会话窗口切换至其它会话窗口,再切换回当前会话窗口,并能继续编辑目标代码片段,从而使得用户的操作更加方便,进一步提升了用户体验。Furthermore, while the user is editing the target code snippet in the content block, he or she can switch the current session window to another session window, then switch back to the current session window, and continue editing the target code snippet, thus making the user's operation more convenient. Convenience further enhances user experience.
又进一步地,用户在内容块中编辑目标代码片段的过程中,还可以进行代码片段和文本内容的混排,在消息输入框中同时展示代码片段和文本内容,用户可以在消息输入框中输入目标代码片段以及输入针对目标代码片段进行的说明内容。从而使得用户的操作更加方便和灵活,进一步提升了用户体验。Furthermore, when the user edits the target code snippet in the content block, he can also mix the code snippets and text content, and display the code snippets and text content at the same time in the message input box. The user can input in the message input box. Target code snippet and enter a description of the target code snippet. This makes the user's operation more convenient and flexible, further improving the user experience.
图4为根据一示例性实施例示出的另一种信息处理方法的流程图。该方法可以应用于终端设备中。在本实施例中,为了便于理解,结合能够安装即时通讯应用程序的终端设备来举例说明。本领域技术人员可以理解,该终端设备可以包括但不限于诸如智能手机的移动终端设备、智能穿戴式设备、平板电脑等等。该方法可以包括以下步骤:Figure 4 is a flowchart of another information processing method according to an exemplary embodiment. This method can be applied to terminal equipment. In this embodiment, for ease of understanding, an example is given with reference to a terminal device capable of installing an instant messaging application. Those skilled in the art can understand that the terminal device may include but is not limited to mobile terminal devices such as smartphones, smart wearable devices, tablet computers, and the like. The method may include the following steps:
如图4所示,在步骤501中,响应于用户针对即时通讯客户端的消息输入框进行预设操作,使消息输入框进入代码输入模式。As shown in Figure 4, in step 501, in response to the user performing a preset operation on the message input box of the instant messaging client, the message input box enters the code input mode.
在本实施例中,即时通讯客户端可以是安装于终端设备的第三方应用程序,用户可以通过即时通讯客户端与好友/群组成员进行实时会话,也可以发送公开的动态消息与好友/群组成员进行分享和讨论,还可以对自己或他人发送的动态消息进行评论等。In this embodiment, the instant messaging client can be a third-party application installed on the terminal device. The user can have real-time conversations with friends/group members through the instant messaging client, and can also send public dynamic messages to friends/groups. Group members can share and discuss, and they can also comment on dynamic messages sent by themselves or others.
即时通讯客户端的消息输入框可以是会话消息的输入框,也可以是动态消息的输入框,还可以是评论消息的输入框。其中,会话消息的输入框可以是实时会话时,用于编辑会话内容的输入框。动态消息的输入框可以是发布公开的动态消息时,用于编辑发布内容的输入框。评论消息的输入框可以是对自己或他人发布的动态消息进行评论时,用于编辑评论内容的输入框。The message input box of the instant messaging client can be an input box for conversation messages, dynamic messages, or comment messages. The input box of the conversation message may be an input box used for editing conversation content during a real-time conversation. The input box of the dynamic message can be an input box used to edit the published content when publishing a public dynamic message. The input box for comment messages can be an input box used to edit the comment content when commenting on dynamic messages posted by yourself or others.
在本实施例中,用户对即时通讯客户端的消息输入框进行的预设操作可以是直接点击消息输入框对应的固定工具栏中代码所对应的图标,也可以是按动预设的快捷键,还可以是在消息输入框中输入并选中字符或字符串,再点击弹出的悬浮工具栏中代码对应的图标。In this embodiment, the user's preset operation on the message input box of the instant messaging client can be to directly click the icon corresponding to the code in the fixed toolbar corresponding to the message input box, or to press a preset shortcut key. You can also enter and select characters or strings in the message input box, and then click the icon corresponding to the code in the pop-up floating toolbar.
在步骤502中,获取在该消息输入框中输入的目标代码片段。以及在步骤503中,在消息输入框中按照预设的代码显示样式展示目标代码片段。In step 502, obtain the target code fragment entered in the message input box. And in step 503, the target code fragment is displayed in the message input box according to a preset code display style.
在本实施例中,在检测到上述预设操作之后,可以在消息输入框中创建一个独立的待编辑的内容块,该内容块能够支持代码片段的编辑和展示,用户可以在该内容块中输入代码片段。可以获取在消息输入框的内容块中输入的代码片段,作为目标代码片段,并在消息输入框中按照预设的代码显示样式展示目标代码片段。其中,突出显示(例如高亮展示)目标代码片段中的代码关键字,并展示目标代码片段中的代码行号。 In this embodiment, after detecting the above preset operation, an independent content block to be edited can be created in the message input box. This content block can support the editing and display of code snippets. The user can Enter the code snippet. The code snippet entered in the content block of the message input box can be obtained as the target code snippet, and the target code snippet can be displayed in the message input box according to the preset code display style. Wherein, the code keywords in the target code fragment are highlighted (for example, highlighted), and the code line numbers in the target code fragment are displayed.
具体来说,在展示目标代码片段时,首先可以获取目标代码片段中的多个代码关键字,例如可以通过预设插件(如代码高亮插件等)识别目标代码片段中的多个代码关键字。可以理解,该预设插件可以是本领域中已知的以及将来可能出现的任何能够实现上述功能的插件,本公开对该预设插件的具体类型方面不限定。然后,确定目标代码片段对应的代码语言。在一种实现方式中,可以获取用户从代码语言选择栏的下拉选项中选择的代码语言作为目标代码片段对应的代码语言。Specifically, when displaying the target code fragment, multiple code keywords in the target code fragment can first be obtained. For example, multiple code keywords in the target code fragment can be identified through a preset plug-in (such as a code highlighting plug-in, etc.) . It can be understood that the preset plug-in can be any plug-in that is known in the art and may appear in the future and can realize the above functions. The present disclosure is not limited to the specific type of the preset plug-in. Then, determine the code language corresponding to the target code fragment. In one implementation, the code language selected by the user from the drop-down option of the code language selection column can be obtained as the code language corresponding to the target code fragment.
在另一种实现方式中,由于不同的代码语言中具有一些特有的代码关键字,因此,还可以根据识别出的目标代码片段中包括的代码关键字,确定目标代码片段对应的代码语言。例如,代码关键字X为C++语言特有的关键字,如果目标代码片段中包括代码关键字X,则可以确定目标代码片段对应的代码语言为C++语言。又例如,代码关键字Y为C语言和Java特有的关键字,代码关键字Z为JavaScript和Java特有的关键字,如果目标代码片段中包括代码关键字Y和代码关键字Z,则可以确定目标代码片段对应的代码语言为Java语言。需要说明的是,上述举例仅是为说明原理而假设的情况,代码关键字X、Y和Z也仅是为举例而假设的关键字代号,并非实际的关键字。In another implementation manner, since different code languages have some unique code keywords, the code language corresponding to the target code fragment can also be determined based on the code keywords included in the identified target code fragment. For example, the code keyword X is a keyword unique to the C++ language. If the target code fragment includes the code keyword X, it can be determined that the code language corresponding to the target code fragment is the C++ language. For another example, code keyword Y is a keyword unique to C language and Java, and code keyword Z is a keyword unique to JavaScript and Java. If the target code fragment includes code keyword Y and code keyword Z, the target can be determined The code language corresponding to the code snippet is Java language. It should be noted that the above examples are only hypothetical situations for illustrating the principle, and the code keywords X, Y, and Z are only hypothetical keyword codes for examples, and are not actual keywords.
由于某些代码关键字在不同的代码语言下所对应的关键字类型可能不同,因此,突出显示的关键字的颜色也不相同。所以,可以基于目标代码片段对应的代码语言,确定目标代码片段包括的每个代码关键字所对应的关键字类型。在该内容块中,可以对目标代码片段包括的每个代码关键字,按照其对应的关键字类型进行渲染,并展示目标代码片段。例如,代码关键字A在C语言中的关键字类型为m,在Java中的关键字类型为n,关键字类型m对应的颜色为红色,关键字类型n对应的颜色为绿色。因此,确定目标代码片段包括代码关键字A,如果目标代码片段对应的代码语言为C语言,则确定代码关键字A的关键字类型为m。按照关键字类型m对应的颜色进行渲染之后,代码关键字A显示为红色。如果目标代码片段对应的代码语言为Java语言,则确定代码关键字A的关键字类型为n。按照关键字类型n对应的颜色进行渲染之后,代码关键字A显示为绿色。Since some code keywords may correspond to different keyword types in different code languages, the colors of highlighted keywords are also different. Therefore, the keyword type corresponding to each code keyword included in the target code fragment can be determined based on the code language corresponding to the target code fragment. In this content block, each code keyword included in the target code fragment can be rendered according to its corresponding keyword type, and the target code fragment can be displayed. For example, the keyword type of code keyword A in C language is m, and the keyword type in Java is n. The color corresponding to keyword type m is red, and the color corresponding to keyword type n is green. Therefore, it is determined that the target code fragment includes code keyword A. If the code language corresponding to the target code fragment is C language, it is determined that the keyword type of code keyword A is m. After rendering according to the color corresponding to the keyword type m, the code keyword A is displayed in red. If the code language corresponding to the target code fragment is the Java language, it is determined that the keyword type of the code keyword A is n. After rendering according to the color corresponding to keyword type n, code keyword A is displayed in green.
可选地,在消息输入框中输入或展示目标代码片段的过程中,响应于用户针对即时通讯客户端进行的第一切换操作,可以使用于指示输入位置的光标跳转至消息输入框中内容块之外的输入区域。该第一切换操作可以是点击内容块之外的区域的操作,或者点击预设的快捷键的操作等,可以理解,本实施例对该第一切换操作的具体方式方面不限定。具体来说,在光标位于内容块中时,可以进行代码片段的编辑。可以将光标移至消息输入框中内容块之外的区域,当光标位于消息输入框中内容块之外的区域时,可以在消息输入框中进行文本内容的编辑。并且,代码片段和文本内容可以同时展示在消息输入框中,例如,代码片段位于内容块对应的矩形框中,文本内容位于内容块对应的矩形框之外。这样可以实现代码块和文本信息的混排编辑,进而实现在一条会话消息中同时发送代码块和文本消息。在其它实施例中,当光标位于消息输入框中的内容块之外的区域时,还可以在输入框中以粘贴或拖拽方式输入图片/视频,这样可以实现代码块和图片/视频的混排,即在一条消息中可以发送开码块和图片/视频。当然,也可以实现代码块、 文本、图片是视频中的任意两种或多种的混排编辑。Optionally, during the process of inputting or displaying the target code fragment in the message input box, in response to the user's first switching operation on the instant messaging client, the cursor used to indicate the input position can be used to jump to the content in the message input box. Input area outside the block. The first switching operation may be an operation of clicking an area outside the content block, or an operation of clicking a preset shortcut key, etc. It can be understood that this embodiment does not limit the specific manner of the first switching operation. Specifically, code snippets can be edited while the cursor is in a content block. You can move the cursor to an area outside the content block in the message input box. When the cursor is located in an area outside the content block in the message input box, you can edit the text content in the message input box. Moreover, code snippets and text content can be displayed in the message input box at the same time. For example, the code snippet is located in the rectangular box corresponding to the content block, and the text content is located outside the rectangular box corresponding to the content block. In this way, code blocks and text messages can be mixed and edited, and code blocks and text messages can be sent simultaneously in a conversation message. In other embodiments, when the cursor is located in an area outside the content block in the message input box, pictures/videos can also be input in the input box by pasting or dragging, so that the code blocks and pictures/videos can be mixed. row, that is, the open code block and pictures/videos can be sent in one message. Of course, you can also implement code blocks, Text and pictures are the mixed editing of any two or more types in the video.
进一步可选地,在用户针对即时通讯客户端进行第二切换操作时,可以将第一会话窗口切换至不同于第一会话窗口的第二会话窗口,在用户针对即时通讯客户端进行第三切换操作时,将第二会话窗口切换回第一会话窗口,用户仍然可以在消息输入框中继续展示目标代码片段。Further optionally, when the user performs a second switching operation on the instant messaging client, the first session window can be switched to a second session window different from the first session window, and when the user performs a third switching operation on the instant messaging client During the operation, the second session window is switched back to the first session window, and the user can still continue to display the target code fragment in the message input box.
本公开提供的另一种信息处理方法,通过用户对即时通讯客户端的消息输入框进行预设操作,触发即时通讯客户端的消息输入框提供支持代码片段的展示功能的编辑区域,从而以代码对应的显示样式对在消息输入框中输入的代码片段进行展示,丰富了代码片段的显示效果,提升了用户体验。Another information processing method provided by the present disclosure is that the user performs a preset operation on the message input box of the instant messaging client, triggering the message input box of the instant messaging client to provide an editing area that supports the display function of code snippets, thereby using the code corresponding to The display style displays the code snippets entered in the message input box, enriching the display effect of the code snippets and improving the user experience.
应当注意,尽管在上述实施例中,以特定顺序描述了本公开实施例的方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。相反,流程图中描绘的步骤可以改变执行顺序。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。It should be noted that although in the above embodiments, the operations of the methods of the embodiments of the present disclosure are described in a specific order, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed. to achieve the desired results. Instead, the steps depicted in a flowchart can be executed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be broken down into multiple steps for execution.
与前述信息处理方法实施例相对应,本公开还提供了信息处理装置的实施例。Corresponding to the foregoing information processing method embodiments, the present disclosure also provides embodiments of an information processing apparatus.
如图5所示,图5是本公开根据一示例性实施例示出的一种信息处理装置的框图,该装置可以包括:接收模块301,展示模块302和切换模块303。As shown in FIG. 5 , FIG. 5 is a block diagram of an information processing device according to an exemplary embodiment of the present disclosure. The device may include: a receiving module 301 , a display module 302 and a switching module 303 .
其中,接收模块301,用于接收向第一会话中发送的目标代码片段。Among them, the receiving module 301 is used to receive the target code fragment sent to the first session.
展示模块302,用于在第一会话的会话界面中,按照第一展示样式渲染并展示目标代码片段。其中,该会话界面是第一用户对应的会话界面,第一用户是第一会话中的成员。The display module 302 is configured to render and display the target code fragment according to the first display style in the session interface of the first session. The conversation interface is a conversation interface corresponding to the first user, and the first user is a member of the first conversation.
切换模块303,用于响应于第一用户对展示的目标代码片段的切换操作,在该会话界面中,按照第二展示样式渲染并展示目标代码片段。The switching module 303 is configured to render and display the target code fragment according to the second presentation style in the conversation interface in response to the first user's switching operation on the displayed target code fragment.
在一些实施方式中,该装置可以包括:获取模块和确定模块(图中未示出)。In some implementations, the device may include: an obtaining module and a determining module (not shown in the figure).
其中,获取模块,用于在按照第一展示样式渲染并展示目标代码片段之前,获取目标代码片段中的多个代码关键字,并确定第一代码语言。Wherein, the obtaining module is used to obtain multiple code keywords in the target code fragment and determine the first code language before rendering and displaying the target code fragment according to the first display style.
确定模块,用于基于上述代码关键字以及第一代码语言,确定第一展示样式。The determining module is used to determine the first display style based on the above code keywords and the first code language.
在另一些实施方式中,上述切换操作可以包括将第一代码语言切换为第二代码语言的操作,上述第二展示样式基于第二代码语言而确定。In other implementations, the above-mentioned switching operation may include an operation of switching the first code language to the second code language, and the above-mentioned second display style is determined based on the second code language.
在另一些实施方式中,获取模块可以通过如下方式获取目标代码片段中的多个代码关键字:使用预设插件对目标代码片段进行识别,得到目标代码片段包括的多个代码关键字。In other implementations, the acquisition module may obtain multiple code keywords in the target code fragment in the following manner: using a preset plug-in to identify the target code fragment and obtain multiple code keywords included in the target code fragment.
在另一些实施方式中,确定模块可以包括:第一子模块和第二子模块(图中未示出)。In other implementations, the determining module may include: a first sub-module and a second sub-module (not shown in the figure).
其中,第一子模块,用于基于第一代码语言,确定各个代码关键字对应的关键字类型。Among them, the first sub-module is used to determine the keyword type corresponding to each code keyword based on the first code language.
第二子模块,用于基于各个代码关键字对应的关键字类型,确定第一展示样式。The second sub-module is used to determine the first display style based on the keyword type corresponding to each code keyword.
在另一些实施方式中,该装置还可以包括:主题确定模块和样式确定模块(图中未 示出)。In other embodiments, the device may also include: a theme determination module and a style determination module (not shown in the figure). Shows).
其中,主题确定模块,用于在按照第一展示样式渲染并展示所述目标代码片段之前,确定针对代码的第一显示主题。Wherein, the theme determination module is used to determine the first display theme for the code before rendering and displaying the target code fragment according to the first display style.
样式确定模块,用于基于第一显示主题,确定第一展示样式。The style determination module is used to determine the first display style based on the first display theme.
在另一些实施方式中,上述切换操作包括将第一显示主题切换为第二显示主题的操作,上述第二展示样式基于第二显示主题而确定。In other embodiments, the switching operation includes switching the first display theme to the second display theme, and the second display style is determined based on the second display theme.
在另一些实施方式中,样式确定模块被配置用于:获取目标代码片段中的多个代码关键字,并确定第一代码语言。基于第一代码语言,确定各个代码关键字对应的关键字类型,基于第一显示主题和各个代码关键字对应的关键字类型,确定第一展示样式。In other implementations, the style determination module is configured to obtain a plurality of code keywords in the target code fragment and determine the first code language. Based on the first code language, the keyword type corresponding to each code keyword is determined, and based on the first display theme and the keyword type corresponding to each code keyword, the first display style is determined.
在另一些实施方式中,上述第一展示样式包括用于展示目标代码片段的消息框的第一背景颜色以及各个代码关键字对应的第一字体颜色。In other implementations, the above-mentioned first display style includes a first background color of the message box used to display the target code fragment and a first font color corresponding to each code keyword.
在另一些实施方式中,第二确定子模块通过如下方式基于第一显示主题和各个代码关键字对应的关键字类型,确定第一展示样式:获取第一显示主题对应的背景颜色作为第一背景颜色,以及获取第一显示主题对应的映射信息。该映射信息包括关键字类型与字体颜色的映射关系的信息。基于该映射信息以及各个代码关键字对应的关键字类型,确定各个代码关键字对应的第一字体颜色。In other embodiments, the second determination sub-module determines the first display style based on the first display theme and the keyword types corresponding to each code keyword in the following manner: obtaining the background color corresponding to the first display theme as the first background color, and obtain mapping information corresponding to the first display theme. The mapping information includes information on the mapping relationship between keyword types and font colors. Based on the mapping information and the keyword type corresponding to each code keyword, the first font color corresponding to each code keyword is determined.
在另一些实施方式中,目标代码片段展示在创建于会话界面中的内容块中。In other embodiments, the target code snippet is displayed in a content block created in the conversational interface.
在另一些实施方式中,展示目标代码片段包括,突出显示目标代码片段中的代码关键字,并展示目标代码片段中的代码行号。In other implementations, displaying the target code fragment includes highlighting code keywords in the target code fragment and displaying code line numbers in the target code fragment.
如图6所示,图6是本公开根据一示例性实施例示出的另一种信息处理装置的框图,该装置可以包括:控制模块601,获取模块602和展示模块603。As shown in FIG. 6 , FIG. 6 is a block diagram of another information processing device according to an exemplary embodiment of the present disclosure. The device may include: a control module 601 , an acquisition module 602 and a display module 603 .
其中,控制模块601,用于响应于用户针对即时通讯客户端的消息输入框进行预设操作,使消息输入框进入代码输入模式。Among them, the control module 601 is used to cause the message input box to enter the code input mode in response to the user performing a preset operation on the message input box of the instant messaging client.
获取模块602,用于获取在上述消息输入框中输入的目标代码片段。The acquisition module 602 is used to acquire the target code fragment input in the above message input box.
展示模块603,用于在上述消息输入框中按照预设的代码显示样式展示目标代码片段。The display module 603 is used to display the target code fragment in the above message input box according to a preset code display style.
在一些实施方式中,控制模块601被配置用于,在上述消息输入框中创建内容块。In some implementations, the control module 601 is configured to create a content block in the above message input box.
其中,获取模块602被配置用于:获取在消息输入框的内容块中输入的代码片段,作为目标代码片段。Wherein, the acquisition module 602 is configured to: acquire the code fragment input in the content block of the message input box as the target code fragment.
在另一些实施方式中,展示模块603可以包括:获取子模块,确定子模块和展示子模块(图中未示出)。In other implementations, the display module 603 may include: an acquisition sub-module, a determination sub-module and a display sub-module (not shown in the figure).
其中,获取子模块,用于获取目标代码片段中的多个代码关键字。Among them, the acquisition sub-module is used to obtain multiple code keywords in the target code fragment.
确定子模块,用于确定目标代码片段对应的第一代码语言。Determine the sub-module for determining the first code language corresponding to the target code fragment.
展示子模块,用于基于代码关键字以及第一代码语言,在内容块中展示目标代码片段。The display sub-module is used to display the target code fragment in the content block based on the code keyword and the first code language.
在另一些实施方式中,获取子模块被配置用于:使用预设插件对目标代码片段进行 识别,得到目标代码片段包括的多个代码关键字。In other implementations, the acquisition sub-module is configured to: use a preset plug-in to perform the target code snippet Identify and obtain multiple code keywords included in the target code fragment.
在另一些实施方式中,确定子模块被配置用于:基于多个代码关键字识别第一代码语言。In other embodiments, the determining sub-module is configured to identify the first code language based on a plurality of code keywords.
在另一些实施方式中,展示子模块被配置用于:基于第一代码语言,确定每个代码关键字对应的关键字类型,在上述内容块中,基于代码关键字对应的关键字类型渲染并展示目标代码片段。In other embodiments, the display sub-module is configured to: determine the keyword type corresponding to each code keyword based on the first code language, and in the above content block, render and render based on the keyword type corresponding to the code keyword. Show the target code snippet.
在另一些实施方式中,展示模块603通过如下方式展示目标代码片段:突出显示目标代码片段中的代码关键字,并展示目标代码片段中的代码行号。In other implementations, the display module 603 displays the target code fragment in the following manner: highlighting the code keywords in the target code fragment and displaying the code line numbers in the target code fragment.
在另一些实施方式中,用户针对即时通讯客户端的消息输入框进行预设操作包括如下中的任一种:用户对消息输入框的固定工具栏中的代码块发送控件的触发操作;用户通过选中消息输入框中的已输入内容触发显示悬浮输入框后,触发悬浮输入框中的代码发送控件。In other embodiments, the user's preset operation on the message input box of the instant messaging client includes any of the following: the user triggers the control by sending a code block in the fixed toolbar of the message input box; the user selects After the input content in the message input box triggers the display of the floating input box, the code sending control in the floating input box is triggered.
在另一些实施方式中,该装置还可以包括:选择模块,操作模块和更新模块(图中未示出)。In other embodiments, the device may further include: a selection module, an operation module and an update module (not shown in the figure).
其中,选择模块,用于确定用户从目标代码片段中选中的字符或字符串。Among them, the selection module is used to determine the character or string selected by the user from the target code fragment.
操作模块,用于确定用户针对字符或字符串进行的更新样式的操作。The operation module is used to determine the user's operation on the character or string to update the pattern.
更新模块,用于响应于该更新样式的操作,更新字符或字符串的样式。The update module is used to update the style of the character or string in response to the update style operation.
在另一些实施方式中,在消息输入框中显示有格式工具栏。用户针对字符或字符串进行的更新样式的操作包括:用户选中字符或字符串后,从格式工具栏选择样式对应的格式控件。In other implementations, a formatting toolbar is displayed in the message input box. The user's operations for updating the style on characters or strings include: after the user selects the character or string, select the format control corresponding to the style from the format toolbar.
在另一些实施方式中,即时通讯客户端的消息输入框包括:会话消息的输入框,或者动态消息的输入框,或者评论消息的输入框。In other implementations, the message input box of the instant messaging client includes: an input box for conversation messages, an input box for dynamic messages, or an input box for comment messages.
在另一些实施方式中,该装置还可以包括:第一切换模块,文本获取模块和文本展示模块(图中未示出)。In other embodiments, the device may further include: a first switching module, a text acquisition module and a text display module (not shown in the figure).
其中,第一切换模块,用于在消息输入框中输入或展示目标代码片段的过程中,响应于用户针对即时通讯客户端进行的第一切换操作,使用于指示输入位置的光标跳转至消息输入框中内容块之外的输入区域。Among them, the first switching module is used to cause the cursor indicating the input position to jump to the message in response to the first switching operation performed by the user on the instant messaging client during the process of inputting or displaying the target code fragment in the message input box. The input area outside the content block in the input box.
文本获取模块,用于获取在上述输入区域输入的内容,该输入的内容包括文本、图片、视频中的一种或多种。The text acquisition module is used to acquire the content input in the above-mentioned input area. The input content includes one or more of text, picture, and video.
文本展示模块,用于在内容块中展示目标代码片段的同时,在上述输入区域展示上述输入的内容。The text display module is used to display the target code snippet in the content block and at the same time display the above-mentioned input content in the above-mentioned input area.
在另一些实施方式中,该消息输入框为第一会话窗口的输入框;该装置还可以包括:第二切换模块和第三切换模块(图中未示出)。In other embodiments, the message input box is an input box of the first conversation window; the device may also include: a second switching module and a third switching module (not shown in the figure).
其中,第二切换模块,用于在该消息输入框中输入或展示目标代码片段的过程中,响应于用户针对即时通讯客户端进行的第二切换操作,将第一会话窗口切换至第二会话窗口。 Wherein, the second switching module is used to switch the first session window to the second session in response to the second switching operation performed by the user on the instant messaging client during the process of inputting or displaying the target code fragment in the message input box. window.
第三切换模块,用于响应于用户针对即时通讯客户端进行第三切换操作,将第二会话窗口切换回第一会话窗口,并在消息输入框中继续展示目标代码片段。The third switching module is configured to switch the second session window back to the first session window in response to the user performing a third switching operation on the instant messaging client, and continue to display the target code fragment in the message input box.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本公开实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, please refer to the partial description of the method embodiment for relevant details. The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
图7为本公开一些实施例提供的一种电子设备的示意框图。如图7所示,该电子设备910包括处理器911和存储器912,可以用于实现客户端或服务器。存储器912用于非瞬时性地存储有计算机可执行指令(例如一个或多个计算机程序模块)。处理器911用于运行该计算机可执行指令,该计算机可执行指令被处理器911运行时可以执行上文所述的信息处理方法中的一个或多个步骤,进而实现上文所述的信息处理方法。存储器912和处理器911可以通过总线系统和/或其它形式的连接机构(未示出)互连。Figure 7 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure. As shown in Figure 7, the electronic device 910 includes a processor 911 and a memory 912, which can be used to implement a client or a server. Memory 912 is used to non-transitoryly store computer-executable instructions (eg, one or more computer program modules). The processor 911 is used to run the computer executable instructions. When the computer executable instructions are run by the processor 911, the computer executable instructions can perform one or more steps in the information processing method described above, thereby realizing the information processing described above. method. Memory 912 and processor 911 may be interconnected by a bus system and/or other forms of connection mechanisms (not shown).
例如,处理器911可以是中央处理单元(CPU)、图形处理单元(GPU)或者具有数据处理能力和/或程序执行能力的其它形式的处理单元。例如,中央处理单元(CPU)可以为X86或ARM架构等。处理器911可以为通用处理器或专用处理器,可以控制电子设备910中的其它组件以执行期望的功能。For example, the processor 911 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units with data processing capabilities and/or program execution capabilities. For example, the central processing unit (CPU) may be of X86 or ARM architecture. The processor 911 may be a general-purpose processor or a special-purpose processor and may control other components in the electronic device 910 to perform desired functions.
例如,存储器912可以包括一个或多个计算机程序产品的任意组合,计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。非易失性存储器例如可以包括只读存储器(ROM)、硬盘、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、闪存等。在计算机可读存储介质上可以存储一个或多个计算机程序模块,处理器911可以运行一个或多个计算机程序模块,以实现电子设备910的各种功能。在计算机可读存储介质中还可以存储各种应用程序和各种数据以及应用程序使用和/或产生的各种数据等。For example, memory 912 may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and/or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, and the like. One or more computer program modules may be stored on a computer-readable storage medium, and the processor 911 may run one or more computer program modules to implement various functions of the electronic device 910 . Various application programs and various data, as well as various data used and/or generated by the application programs, etc. can also be stored in the computer-readable storage medium.
需要说明的是,本公开的实施例中,电子设备910的具体功能和技术效果可以参考上文中关于信息处理方法的描述,此处不再赘述。It should be noted that in the embodiment of the present disclosure, for the specific functions and technical effects of the electronic device 910, reference can be made to the above description of the information processing method, which will not be described again here.
图8为本公开一些实施例提供的另一种电子设备的示意框图。该电子设备920例如适于用来实施本公开实施例提供的信息处理方法。电子设备920可以是终端设备等,可以用于实现客户端或服务器。电子设备920可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)、可穿戴电子设备等等的移动终端以及诸如数字TV、台式计算机、智能家居设备等等的固定终端。需要注意的是,图8示出的电子设备920仅仅是一个示例,其不会对本公开实施例的功能和使用范围带来任何限制。Figure 8 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure. The electronic device 920 is, for example, suitable for implementing the information processing method provided by the embodiment of the present disclosure. The electronic device 920 may be a terminal device or the like, and may be used to implement a client or a server. The electronic device 920 may include, but is not limited to, a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (such as a vehicle-mounted navigation terminal), Mobile terminals such as wearable electronic devices and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. It should be noted that the electronic device 920 shown in FIG. 8 is only an example, which does not bring any limitations to the functions and scope of use of the embodiments of the present disclosure.
如图8所示,电子设备920可以包括处理装置(例如中央处理器、图形处理器等)921, 其可以根据存储在只读存储器(ROM)922中的程序或者从存储装置928加载到随机访问存储器(RAM)923中的程序而执行各种适当的动作和处理。在RAM 923中,还存储有电子设备920操作所需的各种程序和数据。处理装置921、ROM 922以及RAM 923通过总线924彼此相连。输入/输出(I/O)接口925也连接至总线924。As shown in Figure 8, the electronic device 920 may include a processing device (such as a central processing unit, a graphics processor, etc.) 921, It can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 922 or the program loaded from the storage device 928 into the random access memory (RAM) 923. In the RAM 923, various programs and data required for the operation of the electronic device 920 are also stored. The processing device 921, ROM 922 and RAM 923 are connected to each other through a bus 924. An input/output (I/O) interface 925 is also connected to bus 924.
通常,以下装置可以连接至I/O接口925:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置926;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置927;包括例如磁带、硬盘等的存储装置928;以及通信装置929。通信装置929可以允许电子设备920与其他电子设备进行无线或有线通信以交换数据。虽然图8示出了具有各种装置的电子设备920,但应理解的是,并不要求实施或具备所有示出的装置,电子设备920可以替代地实施或具备更多或更少的装置。Generally, the following devices may be connected to the I/O interface 925: input devices 926 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 927 such as a computer; a storage device 928 including a magnetic tape, a hard disk, etc.; and a communication device 929. The communication device 929 may allow the electronic device 920 to communicate wirelessly or wiredly with other electronic devices to exchange data. Although FIG. 8 illustrates electronic device 920 having various means, it should be understood that implementation or provision of all illustrated means is not required and electronic device 920 may alternatively implement or be provided with more or fewer means.
例如,根据本公开的实施例,上述信息处理方法可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包括用于执行上述信息处理方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置929从网络上被下载和安装,或者从存储装置928安装,或者从ROM922安装。在该计算机程序被处理装置921执行时,可以实现本公开实施例提供的信息处理方法中限定的功能。For example, according to embodiments of the present disclosure, the above-mentioned information processing method may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product including a computer program carried on a non-transitory computer-readable medium, the computer program including program code for executing the above information processing method. In such embodiments, the computer program may be downloaded and installed from the network via communication device 929, or from storage device 928, or from ROM 922. When the computer program is executed by the processing device 921, the functions defined in the information processing method provided by the embodiments of the present disclosure can be realized.
图9为本公开一些实施例提供的一种存储介质的示意图。例如,如图9所示,存储介质930可以为非暂时性计算机可读存储介质,用于存储非暂时性计算机可执行指令931。当非暂时性计算机可执行指令931由处理器执行时可以实现本公开实施例所述的信息处理方法,例如,当非暂时性计算机可执行指令931由处理器执行时,可以执行根据上文所述的信息处理方法中的一个或多个步骤。Figure 9 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure. For example, as shown in FIG. 9 , the storage medium 930 may be a non-transitory computer-readable storage medium for storing non-transitory computer-executable instructions 931 . When the non-transitory computer-executable instructions 931 are executed by the processor, the information processing method described in the embodiment of the present disclosure may be implemented. For example, when the non-transitory computer-executable instructions 931 are executed by the processor, the method described above may be executed. one or more steps in the information processing method described above.
例如,该存储介质930可以应用于上述电子设备中,例如,该存储介质930可以包括电子设备中的存储器。For example, the storage medium 930 may be applied in the above-mentioned electronic device. For example, the storage medium 930 may include a memory in the electronic device.
例如,存储介质可以包括智能电话的存储卡、平板电脑的存储部件、个人计算机的硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、闪存、或者上述存储介质的任意组合,也可以为其他适用的存储介质。For example, the storage medium may include a memory card of a smartphone, a storage component of a tablet computer, a hard drive of a personal computer, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM), Portable compact disk read-only memory (CD-ROM), flash memory, or any combination of the above storage media can also be other suitable storage media.
例如,关于存储介质930的说明可以参考电子设备的实施例中对于存储器的描述,重复之处不再赘述。存储介质930的具体功能和技术效果可以参考上文中关于信息处理方法的描述,此处不再赘述。For example, the description of the storage medium 930 may refer to the description of the memory in the embodiment of the electronic device, and repeated descriptions will not be repeated. For the specific functions and technical effects of the storage medium 930, please refer to the above description of the information processing method, and will not be described again here.
需要说明的是,在本公开的上下文中,计算机可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是,但不限于:电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁 盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that in the context of the present disclosure, a computer-readable medium may be a tangible medium that may contain or be stored for use by or in conjunction with an instruction execution system, apparatus, or device. program. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but is not limited to: an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer magnetic Disk, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, Magnetic storage device, or any suitable combination of the above. In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device . Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the above.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common common sense or customary technical means in the technical field that are not disclosed in the disclosure. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。 It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended claims.

Claims (29)

  1. 一种信息处理方法,所述方法包括:An information processing method, the method includes:
    接收向第一会话中发送的目标代码片段;Receive the target code fragment sent to the first session;
    在所述第一会话的会话界面中,按照第一展示样式渲染并展示所述目标代码片段;其中,所述会话界面是第一用户对应的会话界面,所述第一用户是所述第一会话中的成员;In the session interface of the first session, the target code fragment is rendered and displayed according to the first presentation style; wherein the session interface is the session interface corresponding to the first user, and the first user is the first user. members in the session;
    响应于所述第一用户对展示的所述目标代码片段的切换操作,在所述会话界面中,按照第二展示样式渲染并展示所述目标代码片段。In response to the first user's switching operation on the displayed target code fragment, in the conversation interface, the target code fragment is rendered and displayed according to a second presentation style.
  2. 根据权利要求1所述的方法,其中,在按照第一展示样式渲染并展示所述目标代码片段之前,还包括:The method according to claim 1, wherein before rendering and displaying the target code fragment according to the first display style, it further includes:
    获取所述目标代码片段中的多个代码关键字,并确定第一代码语言;Obtain multiple code keywords in the target code fragment and determine the first code language;
    基于所述代码关键字以及所述第一代码语言,确定所述第一展示样式。The first display style is determined based on the code keyword and the first code language.
  3. 根据权利要求2所述的方法,其中,所述切换操作包括将所述第一代码语言切换为第二代码语言的操作;所述第二展示样式基于所述第二代码语言而确定。The method of claim 2, wherein the switching operation includes an operation of switching the first code language to a second code language; the second presentation style is determined based on the second code language.
  4. 根据权利要求2或3所述的方法,其中,所述获取待所述目标代码片段中的多个代码关键字,包括:使用预设插件对所述目标代码片段进行识别,得到所述目标代码片段包括的多个代码关键字。The method according to claim 2 or 3, wherein said obtaining a plurality of code keywords in the target code fragment includes: using a preset plug-in to identify the target code fragment to obtain the target code Multiple code keywords included in the snippet.
  5. 根据权利要求2-4中任一项所述的方法,其中,所述基于所述代码关键字以及所述第一代码语言,确定所述第一展示样式,包括:The method according to any one of claims 2-4, wherein determining the first display style based on the code keyword and the first code language includes:
    基于所述第一代码语言,确定各个代码关键字对应的关键字类型;Based on the first code language, determine the keyword type corresponding to each code keyword;
    基于所述各个代码关键字对应的关键字类型,确定第一展示样式。Based on the keyword type corresponding to each code keyword, a first display style is determined.
  6. 根据权利要求1-5中任一项所述的方法,其中,在按照第一展示样式渲染并展示所述目标代码片段之前,还包括:The method according to any one of claims 1-5, wherein before rendering and displaying the target code fragment according to the first display style, it further includes:
    确定针对代码的第一显示主题;Determine the first display theme for the code;
    基于所述第一显示主题,确定所述第一展示样式。The first display style is determined based on the first display theme.
  7. 根据权利要求6所述的方法,其中,所述切换操作包括将所述第一显示主题切换为第二显示主题的操作;所述第二展示样式基于所述第二显示主题而确定。The method of claim 6, wherein the switching operation includes an operation of switching the first display theme to a second display theme; the second display style is determined based on the second display theme.
  8. 根据权利要求6或7所述的方法,其中,所述基于所述第一显示主题,确定所述第一展示样式,包括:The method according to claim 6 or 7, wherein determining the first display style based on the first display theme includes:
    获取所述目标代码片段中的多个代码关键字,并确定第一代码语言;Obtain multiple code keywords in the target code fragment and determine the first code language;
    基于所述第一代码语言,确定各个代码关键字对应的关键字类型;Based on the first code language, determine the keyword type corresponding to each code keyword;
    基于所述第一显示主题和所述各个代码关键字对应的关键字类型,确定第一展示样式。A first display style is determined based on the first display theme and the keyword type corresponding to each code keyword.
  9. 根据权利要求8所述的方法,其中,所述第一展示样式包括用于展示所述目标代码片段的消息框的第一背景颜色以及所述各个代码关键字对应的第一字体颜色。 The method according to claim 8, wherein the first display style includes a first background color of a message box used to display the target code fragment and a first font color corresponding to each code keyword.
  10. 根据权利要求9所述的方法,其中,所述基于所述第一显示主题和所述各个代码关键字对应的关键字类型,确定第一展示样式,包括:The method according to claim 9, wherein determining the first display style based on the first display theme and the keyword type corresponding to each code keyword includes:
    获取所述第一显示主题对应的背景颜色作为所述第一背景颜色;以及Obtain the background color corresponding to the first display theme as the first background color; and
    获取所述第一显示主题对应的映射信息;所述映射信息包括关键字类型与字体颜色的映射关系的信息;Obtain mapping information corresponding to the first display theme; the mapping information includes information on the mapping relationship between keyword types and font colors;
    基于所述映射信息以及所述各个代码关键字对应的关键字类型,确定所述各个代码关键字对应的第一字体颜色。Based on the mapping information and the keyword type corresponding to each code keyword, the first font color corresponding to each code keyword is determined.
  11. 根据权利要求1-10中任一项所述的方法,其中,所述目标代码片段展示在创建于所述会话界面中的内容块中。The method of any one of claims 1-10, wherein the target code fragment is presented in a content block created in the conversational interface.
  12. 根据权利要求1-11中任一项所述的方法,其中,所述展示所述目标代码片段包括,突出显示所述目标代码片段中的代码关键字,并展示所述目标代码片段中的代码行号。The method according to any one of claims 1-11, wherein said displaying the target code fragment includes highlighting code keywords in the target code fragment and displaying code in the target code fragment Line number.
  13. 一种信息处理方法,所述方法包括:An information processing method, the method includes:
    响应于用户针对即时通讯客户端的消息输入框进行预设操作,使所述消息输入框进入代码输入模式;In response to the user performing a preset operation on the message input box of the instant messaging client, the message input box enters the code input mode;
    获取在所述消息输入框中输入的目标代码片段;Obtain the target code fragment entered in the message input box;
    在所述消息输入框中按照预设的代码显示样式展示所述目标代码片段。The target code fragment is displayed in the message input box according to a preset code display style.
  14. 根据权利要求13所述的方法,其中,The method of claim 13, wherein:
    所述使所述消息输入框进入代码输入模式,包括:在所述消息输入框中创建内容块;Said causing the message input box to enter the code input mode includes: creating a content block in the message input box;
    所述获取在所述消息输入框中输入的目标代码片段,包括:获取在所述消息输入框的所述内容块中输入的代码片段,作为目标代码片段。The obtaining the target code fragment input in the message input box includes: obtaining the code fragment input in the content block of the message input box as the target code fragment.
  15. 根据权利要求14所述的方法,其中,所述在所述消息输入框中按照预设的代码显示样式展示所述目标代码片段,包括:The method according to claim 14, wherein displaying the target code fragment in the message input box according to a preset code display style includes:
    获取所述目标代码片段中的多个代码关键字;Obtain multiple code keywords in the target code fragment;
    确定所述目标代码片段对应的第一代码语言;Determine the first code language corresponding to the target code fragment;
    基于所述代码关键字以及所述第一代码语言,在所述内容块中展示所述目标代码片段。Based on the code keyword and the first code language, the target code fragment is displayed in the content block.
  16. 根据权利要求15所述的方法,其中,所述获取所述目标代码片段中的多个代码关键字,包括:使用预设插件对所述目标代码片段进行识别,得到所述目标代码片段包括的多个代码关键字。The method according to claim 15, wherein obtaining multiple code keywords in the target code fragment includes: using a preset plug-in to identify the target code fragment, and obtaining the code keywords included in the target code fragment. Multiple code keywords.
  17. 根据权利要求15或16所述的方法,其中,所述确定所述目标代码片段对应的第一代码语言,包括:基于所述多个代码关键字识别所述第一代码语言。The method according to claim 15 or 16, wherein the determining the first code language corresponding to the target code fragment includes: identifying the first code language based on the plurality of code keywords.
  18. 根据权利要求15-17中任一项所述的方法,其中,所述基于所述代码关键字以及所述第一代码语言,在所述内容块中展示所述目标代码片段,包括:The method according to any one of claims 15-17, wherein displaying the target code fragment in the content block based on the code keyword and the first code language includes:
    基于所述第一代码语言,确定每个所述代码关键字对应的关键字类型;Based on the first code language, determine the keyword type corresponding to each of the code keywords;
    在所述内容块中,基于所述代码关键字对应的关键字类型渲染并展示所述目标代码 片段。In the content block, the target code is rendered and displayed based on the keyword type corresponding to the code keyword. fragment.
  19. 根据权利要求14-18中任一项所述的方法,其中,在所述消息输入框中输入或展示所述目标代码片段的过程中,所述方法还包括:The method according to any one of claims 14 to 18, wherein during the process of inputting or displaying the target code fragment in the message input box, the method further includes:
    响应于用户针对即时通讯客户端进行的第一切换操作,使用于指示输入位置的光标跳转至所述消息输入框中所述内容块之外的输入区域;In response to the user's first switching operation on the instant messaging client, causing the cursor used to indicate the input position to jump to an input area outside the content block in the message input box;
    获取在所述输入区域输入的内容;所述输入的内容包括文本、图片、视频中的一种或多种;以及Obtain the content input in the input area; the input content includes one or more of text, pictures, and videos; and
    在所述内容块中展示所述目标代码片段的同时,在所述输入区域展示所述输入的内容。While the target code fragment is displayed in the content block, the input content is displayed in the input area.
  20. 根据权利要求13-19中任一项所述的方法,其中,所述展示所述目标代码片段包括,突出显示所述目标代码片段中的代码关键字,并展示所述目标代码片段中的代码行号。The method according to any one of claims 13-19, wherein said displaying the target code fragment includes highlighting code keywords in the target code fragment and displaying code in the target code fragment Line number.
  21. 根据权利要求13-20中任一项所述的方法,其中,用户针对即时通讯客户端的消息输入框进行预设操作包括如下中的任一种:The method according to any one of claims 13-20, wherein the user's preset operation on the message input box of the instant messaging client includes any of the following:
    用户对所述消息输入框的固定工具栏中的代码块发送控件的触发操作;The user sends a trigger operation of the control to the code block in the fixed toolbar of the message input box;
    用户通过选中所述消息输入框中的已输入内容触发显示悬浮输入框后,触发悬浮输入框中的代码发送控件。After the user triggers the display of the floating input box by selecting the input content in the message input box, the code sending control in the floating input box is triggered.
  22. 根据权利要求13-21中任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 13-21, wherein the method further includes:
    确定用户从所述目标代码片段中选中的字符或字符串;Determine the character or string selected by the user from the target code fragment;
    响应于用户针对所述字符或字符串进行的更新样式的操作,更新所述字符或字符串的样式。In response to a user's operation of updating the style on the character or string, the style of the character or string is updated.
  23. 根据权利要求22所述的方法,其中,在所述消息输入框中显示有格式工具栏;The method according to claim 22, wherein a format toolbar is displayed in the message input box;
    所述用户针对所述字符或字符串进行的更新样式的操作包括:用户选中字符或字符串后,从所述格式工具栏选择样式对应的格式控件。The user's operation of updating the style on the character or string includes: after the user selects the character or string, select the format control corresponding to the style from the format toolbar.
  24. 根据权利要求13-23中任一项所述的方法,其中,所述即时通讯客户端的消息输入框包括:会话消息的输入框,或者动态消息的输入框,或者评论消息的输入框。The method according to any one of claims 13 to 23, wherein the message input box of the instant messaging client includes: an input box for conversation messages, an input box for dynamic messages, or an input box for comment messages.
  25. 根据权利要求13-24中任一项所述的方法,其中,所述消息输入框为第一会话窗口的消息输入框;在所述消息输入框中输入或展示所述目标代码片段的过程中,所述方法还包括:The method according to any one of claims 13-24, wherein the message input box is a message input box of the first conversation window; during the process of inputting or displaying the target code fragment in the message input box , the method also includes:
    响应于用户针对即时通讯客户端进行的第二切换操作,将所述第一会话窗口切换至第二会话窗口;In response to the second switching operation performed by the user on the instant messaging client, switching the first session window to the second session window;
    响应于用户针对即时通讯客户端进行第三切换操作,将所述第二会话窗口切换回所述第一会话窗口,并在所述消息输入框中继续展示所述目标代码片段。In response to the user performing a third switching operation on the instant messaging client, the second session window is switched back to the first session window, and the target code fragment is continued to be displayed in the message input box.
  26. 一种信息处理装置,所述装置包括:An information processing device, the device includes:
    接收模块,用于接收向第一会话中发送的目标代码片段;A receiving module, configured to receive the target code fragment sent to the first session;
    展示模块,用于在所述第一会话的会话界面中,按照第一展示样式渲染并展示所述 目标代码片段;其中,所述会话界面是第一用户对应的会话界面,所述第一用户是所述第一会话中的成员;A display module, configured to render and display the first display style in the session interface of the first session. Target code snippet; wherein the conversation interface is a conversation interface corresponding to the first user, and the first user is a member of the first conversation;
    切换模块,用于响应于所述第一用户对展示的所述目标代码片段的切换操作,在所述会话界面中,按照第二展示样式渲染并展示所述目标代码片段。A switching module configured to render and display the target code fragment according to a second presentation style in the conversation interface in response to the first user's switching operation on the displayed target code fragment.
  27. 一种信息处理装置,所述装置包括:An information processing device, the device includes:
    控制模块,用于响应于用户针对即时通讯客户端的消息输入框进行预设操作,使所述消息输入框进入代码输入模式;A control module configured to cause the message input box to enter the code input mode in response to the user performing a preset operation on the message input box of the instant messaging client;
    获取模块,用于获取在所述消息输入框中输入的目标代码片段;An acquisition module, used to acquire the target code fragment entered in the message input box;
    展示模块,用于在所述消息输入框中按照预设的代码显示样式展示所述目标代码片段。A display module, configured to display the target code fragment in the message input box according to a preset code display style.
  28. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令所述计算机执行权利要求1-25中任一项所述的方法。A computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to perform the method described in any one of claims 1-25.
  29. 一种电子设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-25中任一项所述的方法。 An electronic device includes a memory and a processor. The memory stores executable code. When the processor executes the executable code, it implements the method described in any one of claims 1-25.
PCT/CN2023/109520 2022-07-28 2023-07-27 Information processing methods and apparatus, and electronic device WO2024022432A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210899877.3A CN115268890A (en) 2022-07-28 2022-07-28 Information processing method and device and electronic equipment
CN202210901646.1A CN115291759A (en) 2022-07-28 2022-07-28 Information processing method and device and electronic equipment
CN202210899877.3 2022-07-28
CN202210901646.1 2022-07-28

Publications (1)

Publication Number Publication Date
WO2024022432A1 true WO2024022432A1 (en) 2024-02-01

Family

ID=89705437

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/109520 WO2024022432A1 (en) 2022-07-28 2023-07-27 Information processing methods and apparatus, and electronic device

Country Status (1)

Country Link
WO (1) WO2024022432A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140006937A1 (en) * 2012-06-29 2014-01-02 Nokia Corporation Character function user interface
CN106775777A (en) * 2017-01-22 2017-05-31 合网络技术(北京)有限公司 Content interaction method and device
CN109271168A (en) * 2018-08-09 2019-01-25 上海鲸鱼机器人科技有限公司 A kind of code conversion method, device and equipment, storage medium
CN109840110A (en) * 2019-01-29 2019-06-04 腾讯科技(深圳)有限公司 For handling the method, apparatus, equipment and readable storage medium storing program for executing of code message
CN112764734A (en) * 2021-01-26 2021-05-07 维沃移动通信有限公司 Code editing assisting method and device and electronic equipment
CN115268890A (en) * 2022-07-28 2022-11-01 北京字跳网络技术有限公司 Information processing method and device and electronic equipment
CN115291759A (en) * 2022-07-28 2022-11-04 北京字跳网络技术有限公司 Information processing method and device and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140006937A1 (en) * 2012-06-29 2014-01-02 Nokia Corporation Character function user interface
CN106775777A (en) * 2017-01-22 2017-05-31 合网络技术(北京)有限公司 Content interaction method and device
CN109271168A (en) * 2018-08-09 2019-01-25 上海鲸鱼机器人科技有限公司 A kind of code conversion method, device and equipment, storage medium
CN109840110A (en) * 2019-01-29 2019-06-04 腾讯科技(深圳)有限公司 For handling the method, apparatus, equipment and readable storage medium storing program for executing of code message
CN112764734A (en) * 2021-01-26 2021-05-07 维沃移动通信有限公司 Code editing assisting method and device and electronic equipment
CN115268890A (en) * 2022-07-28 2022-11-01 北京字跳网络技术有限公司 Information processing method and device and electronic equipment
CN115291759A (en) * 2022-07-28 2022-11-04 北京字跳网络技术有限公司 Information processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US11784841B2 (en) Presenting participant reactions within a virtual conferencing system
EP2699029B1 (en) Method and device for providing a message function
JP7065740B2 (en) Application function information display method, device, and terminal device
US11943072B2 (en) Providing a room preview within a virtual conferencing system
WO2023066297A1 (en) Message processing method and apparatus, and device and storage medium
KR20140144104A (en) Electronic apparatus and Method for providing service thereof
WO2022212391A1 (en) Presenting participant conversations within virtual conferencing system
EP4336846A1 (en) Audio sharing method and apparatus, device, and medium
CN113010698B (en) Multimedia interaction method, information interaction method, device, equipment and medium
WO2023071917A1 (en) Virtual object interaction method and device, and storage medium and computer program product
EP4124052A1 (en) Video production method and apparatus, and device and storage medium
EP4336355A1 (en) Interaction method and apparatus, medium, and electronic device
WO2023134419A1 (en) Information interaction method and apparatus, and device and storage medium
WO2022095746A1 (en) Information inputting method, cloud input method system, and client
CN111459586A (en) Remote assistance method, device, storage medium and terminal
JP2023539815A (en) Minutes interaction methods, devices, equipment and media
CN108449255B (en) Comment interaction method and equipment, client device and electronic equipment
WO2020244564A1 (en) Method and device for displaying group of contacts to be mentioned, terminal apparatus, and storage medium
US20170185422A1 (en) Method and system for generating and controlling composite user interface control
US10965629B1 (en) Method for generating imitated mobile messages on a chat writer server
EP2838225A1 (en) Message based conversation function execution method and electronic device supporting the same
JP2019102001A (en) Program, information processing method, and information processing device
WO2018010319A1 (en) Method and apparatus for displaying application function
WO2024037480A1 (en) Interaction method and apparatus, electronic device, and storage medium
WO2023221791A1 (en) Chat channel display method and apparatus, device, readable storage medium, and product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23845639

Country of ref document: EP

Kind code of ref document: A1