CN115291759A - Information processing method and device and electronic equipment - Google Patents

Information processing method and device and electronic equipment Download PDF

Info

Publication number
CN115291759A
CN115291759A CN202210901646.1A CN202210901646A CN115291759A CN 115291759 A CN115291759 A CN 115291759A CN 202210901646 A CN202210901646 A CN 202210901646A CN 115291759 A CN115291759 A CN 115291759A
Authority
CN
China
Prior art keywords
code
keyword
display
session
target code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210901646.1A
Other languages
Chinese (zh)
Inventor
蒋妍
李勇
张超
蒋程
齐鸿烨
王重
王润琼
张昂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202210901646.1A priority Critical patent/CN115291759A/en
Publication of CN115291759A publication Critical patent/CN115291759A/en
Priority to PCT/CN2023/109520 priority patent/WO2024022432A1/en
Pending legal-status Critical Current

Links

Images

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
    • 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
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/06Message adaptation to terminal or network requirements
    • H04L51/066Format adaptation, e.g. format conversion or compression
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/18Commands or executable codes

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The present disclosure provides an information processing method, an information processing apparatus, and an electronic device, wherein a specific embodiment of the method includes: receiving a target code segment sent into a first session; rendering and displaying the target code segment according to a first display style in a session interface of the first session; the session interface is a session interface corresponding to a first user, and the first user is a member in the first session; and in response to the switching operation of the first user on the displayed target code segment, rendering and displaying the target code segment according to a second display style in the session interface. The implementation method enables the user to switch the display style of the code segment in the session message in the session interface, thereby enriching the display effect of the code segment and improving the user experience.

Description

Information processing method and device and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an information processing method and apparatus, and an electronic device.
Background
With the continuous development of computer software technology, more and more people need to write code programs in work and study, and the demand of people for sharing codes is also increasing. At present, with the popularization of the on-line communication mode, people hope to share and discuss the code program with colleagues or classmates through the instant messaging tool. Generally, the user can directly take the code segment as common text information, edit the common text information in an input box of the instant messaging tool, and send the common text information to the conversation interface and the friend to share. However, since the code segment has a unique style and is greatly different from the common text message, the effect of displaying the code segment as the common text message and the user experience are poor.
Disclosure of Invention
The disclosure provides an information processing method and device and an electronic device.
According to a first aspect, there is provided an information processing method, the method comprising:
receiving a target code segment sent into a first session;
rendering and displaying the target code segment according to a first display style in a session interface of the first session; the conversation interface is a conversation interface corresponding to a first user, and the first user is a member in the first conversation;
and in response to the switching operation of the first user on the displayed object code segment, rendering and displaying the object code segment according to a second display style in the session interface.
According to a second aspect, there is provided an information processing apparatus, the apparatus comprising:
the receiving module is used for receiving the target code segment sent to the first session;
the display module is used for rendering and displaying the target code segment according to a first display style in a session interface of the first session; the conversation interface is a conversation interface corresponding to a first user, and the first user is a member in the first conversation;
and the switching module is used for rendering and displaying the target code segment according to a second display style in the session interface in response to the switching operation of the first user on the displayed target code segment.
According to a third aspect, there is provided a computer readable storage medium, storing a computer program which, when executed by a processor, implements the method of any of the first aspects above.
According to a fourth aspect, there is provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the first aspects when executing the program.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the information processing method and device provided by the embodiment of the disclosure, the code segments in the session message are displayed in the session interface in the display style of the codes, and the user can switch the display style of the code segments in the session message in the session interface, so that the display effect of the code segments is enriched, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and it is obvious for a person skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1a is an interface schematic diagram of an instant messaging client shown in accordance with an exemplary embodiment of the present disclosure;
FIG. 1b is an interface schematic diagram of another instant messaging client shown in accordance with an exemplary embodiment of the present disclosure;
FIG. 1c is an interface schematic diagram of another instant messaging client shown in accordance with an exemplary embodiment of the present disclosure;
FIG. 1d is an interface schematic diagram of another instant messaging client shown in accordance with an exemplary embodiment of the present disclosure;
FIG. 1e is an interface schematic diagram of another instant messaging client shown in accordance with an exemplary embodiment of the present disclosure;
FIG. 1f is an interface schematic diagram of another instant messaging client shown in accordance with an exemplary embodiment of the present disclosure;
FIG. 1g is an interface schematic diagram of another instant messaging client shown in accordance with an exemplary embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating a method of an instant messaging client in accordance with an exemplary embodiment of the present disclosure;
FIG. 3 is an apparatus block diagram of an instant messaging client shown in accordance with an exemplary embodiment of the present disclosure;
fig. 4 is a schematic block diagram of an electronic device provided by some embodiments of the present disclosure;
FIG. 5 is a schematic block diagram of another electronic device provided by some embodiments of the present disclosure;
fig. 6 is a schematic diagram of a storage medium provided by some embodiments of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the 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", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
With the continuous development of computer software technology, more and more people need to write code programs in work and study, and the demand of people for sharing codes is also increasing. At present, with the popularization of the on-line communication mode, people hope to share and discuss the code program with colleagues or classmates through the instant messaging tool.
In the related technology, a user can directly input the code segment as text information into an input box of the instant messaging tool for editing, and send the text information to a conversation interface and the friend for sharing. However, since the code segment has a unique display style, which is greatly different from the common text message, displaying the code segment according to the style of the text message cannot embody the unique style of the code segment, which increases the reading barrier of the code segment for the user, and has poor display effect and user experience of the code segment.
According to the information processing method, the code segments in the session message are displayed in the session interface in the code display style, and a user can switch the display style of the code segments in the session message in the session interface, so that the display effect of the code segments is enriched, and the user experience is improved.
The present disclosure will be described in detail with reference to specific examples.
Fig. 1a is a schematic interface diagram of an instant messaging client according to an exemplary embodiment. As shown in fig. 1a, for example, a friend of a user shares a code segment to the user through an instant messaging client. The user can open a conversation window with the friend in the instant messaging client, and the code segment is displayed in a message box 101 of a conversation interface. The message box 101 may be, for example, a content block supporting a code display function created in the session interface. The code snippet may be presented in the presentation style of the code in the content block. For example, when the code segment is presented, part of keywords in the code segment may be highlighted, different types of keywords may be displayed in different colors, and the line number of the code segment may be displayed. At the top of the message box 101, there is a selection toolbar for the code. For example, the selection tool bar may include a code language selection bar and a display theme selection bar, among others.
Specifically, the message box may support presentation styles of multiple code languages, and as shown in fig. 1b, the user may select and switch the presentation style of the code language through a pull-down option of the code language selection bar 102 at the top of the message box. After the target code language is selected, the code fragments can be displayed in a display style specific to the target code language in the message frame (because some code keywords may have different corresponding keyword types under different code languages, and therefore, the highlighted keywords have different colors). For example, if the user selects the bar code language JAVA through the code language, the code segment is displayed in the content block in a display style corresponding to the JAVA. And the user switches the code language JAVA to the code language ABAP through the code language selection bar, and then the display style of the code segments in the content blocks is switched to the display style corresponding to the ABAP.
Optionally, multiple display themes may also be supported in the message frame, each display theme corresponds to a set of display styles, and each set of display styles includes a background color of the message frame and a font color corresponding to each keyword type. Therefore, the font color of the keywords of the same type under the same display theme is the same, and the font color under different display themes is different. As shown in fig. 1c, the user can select and switch the display theme through a drop-down option of the display theme selection bar 103 at the top of the message box. After the target display theme is selected, the code segment may be displayed in a display style corresponding to the target display theme in the message frame. For example, if the user selects theme 1 by displaying the theme, the code segment is displayed in the message frame in the display style corresponding to theme 1. And switching the theme 1 into the theme 2 through the display theme selection bar by the user, and switching the display style of the code segment in the message frame into the display style corresponding to the theme 2.
The above example is an exemplary illustration of a user receiving a message, and for a user sending a message, on a client of the user sending the message, in a message input box of a session interface, the user may switch the presentation style of the code segment when editing the code segment. As shown in fig. 1c, the presentation style of the code segment in the message input box is switched by selecting the code language for the user. As shown in fig. 1d, the display style of the code segment in the message input box is switched by selecting the display theme for the user. In addition, after the message including the code segment is successfully sent, the code segment is displayed in a message frame displayed in a conversation interface of a user who sends the message. The user sending the message can also switch the presentation style of the code segment in the message frame. As shown in fig. 1e, the presentation style of the code fragment in the frame is displayed for the user by selecting the code language switching message. As shown in fig. 1f, the display style of the code segment in the display frame of the theme shift message is displayed for the user by selecting.
According to the scheme provided by the embodiment, the code segments in the session message are displayed in the session interface in the code display style, and a user can switch the display style of the code segments in the session message in the session interface, so that the display effect of the code segments is enriched, and the user experience is improved.
Furthermore, the instant messaging client supports the switching function of the display style of the code language, so that a user can switch the display style of the code segment through the code language. Therefore, the display effect of the code segments is further enriched, and the user experience is favorably improved.
Furthermore, the user can switch the display theme of the code segments in the session message of the instant messaging client, so that the display effect of the code segments is further enriched, and the user experience is favorably improved.
The present disclosure will be described in detail with reference to specific examples.
FIG. 2 is a flow chart illustrating an information processing method according to an example embodiment. The method can be applied to terminal equipment. In this embodiment, for convenience of understanding, the description is given by referring to a terminal device capable of installing an instant messaging application. Those skilled in the art will appreciate that the terminal device may include, but is not limited to, a mobile terminal device such as a smartphone, a smart wearable device, a tablet computer, and the like. The method may comprise the steps of:
as shown in fig. 2, in step 201, an object code segment sent to a first session is received, and in step 202, the object code segment is rendered and presented in a first presentation style in a session interface of the first session.
In this embodiment, the first session is a session related to an instant messaging client, the instant messaging client may be a third-party application installed in the terminal device, and the user may perform a real-time session with the friend/group member through the instant messaging client. The session interface of the first session is a session interface corresponding to a first user, and the first user is a member in the first session. The first user may be the sender or the recipient of the target code segment in the first session.
Specifically, before rendering and presenting the target code segment according to the first presentation style, first, a plurality of code keywords in the target code segment may be obtained, and the first code language may be determined. The target code segment can be identified by using a preset plug-in (such as a code highlight plug-in) to obtain a plurality of code keywords included by the target code segment. It is to be understood that the default plug-in may be any plug-in known in the art and that may appear in the future that is capable of performing the above-described functions, and the present disclosure is not limited by the particular type of the default plug-in.
In one implementation, a code language selected by a user from a drop-down option of a code language selection field may be obtained as the first code language. In another implementation manner, the code language corresponding to the target code fragment may also be determined according to the code keyword included in the identified target code fragment, and the code language corresponding to the target code fragment is taken as the first code language. For example, the code keyword X is a keyword specific to the C + + language, and if the code keyword X is included in the target code fragment, it may be determined that the code language corresponding to the target code fragment is the C + + language. For another example, the code keyword Y is a keyword specific to C language and Java, and the code keyword Z is a keyword specific to JavaScript and Java, and if the code keyword Y and the code keyword Z are included in the target code segment, it may be determined that the code language corresponding to the target code segment is Java. It should be noted that the above example is merely assumed to illustrate the principle, and the code keywords X, Y and Z are also merely keyword codes assumed for the example, and are not actual keywords.
Then, based on the code keyword and the first code language, the first display style is determined. In this embodiment, since the types of keywords corresponding to some code keywords in different code languages may be different, the color of the highlighted keyword is also different. Therefore, based on the first code language, the keyword type corresponding to each code keyword included in the target code segment may be determined, and the first presentation style may be determined according to the keyword type corresponding to each code keyword. The first presentation style may include a background color of a message box for presenting the target code segment and a font color corresponding to each code keyword.
When the target code segment is displayed, each code keyword included in the target code segment may be rendered according to the keyword type corresponding to the code keyword, and the target code segment is displayed. For example, the keyword type of the code keyword a in C language is m, the keyword type in Java is n, the color corresponding to the keyword type m is red, and the color corresponding to the keyword type n is green. Therefore, the target code segment is determined to include the code keyword a, and if the code language corresponding to the target code segment is C language, the keyword type of the code keyword a is determined to be m. And after rendering is carried out according to the color corresponding to the keyword type m, the code keyword A is displayed in red. And if the code language corresponding to the target code segment is Java, determining that the keyword type of the code keyword A is n. And after rendering is carried out according to the color corresponding to the keyword type n, the code keyword A is displayed in green.
Optionally, a plurality of display themes may be preset, each display theme corresponding to a set of display styles, each set of display styles including a background color of the message frame and a font color corresponding to each keyword type. Therefore, the font color of the keywords of the same type under the same display theme is the same, and the font color under different display themes is different. Accordingly, a first display theme for the code may be determined prior to determining the first presentation style. For example, the first display theme may be selected by the user from the alternative display themes. Then, based on the first display theme, the code keyword included in the target code sheet, and the first code language, the first display style is determined.
Specifically, the first presentation style may include a first background color of a message box for presenting the target code segment 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 may be determined based on the first display theme and the keyword type corresponding to each code keyword in the following manner: first, a background color corresponding to a first display theme is acquired as a first background color. And acquiring mapping information corresponding to the first display theme, wherein the mapping information comprises mapping relation information of the type of the keyword and the color of the font. And finally, determining the first font color corresponding to each code keyword based on the mapping information and the keyword type corresponding to each code keyword.
For example, a mapping table including mapping information is generated in advance for the display subject 1, and mapping relationship information of different key types and font colors is recorded in the mapping table (for example, the key type 1 corresponds to the color 1, the key type 2 corresponds to the color 2, and the like). When the user selects the display theme 1 from the alternative display themes, first, each code keyword in the target code segment may be acquired, and the first code language may be determined. Then, the keyword type corresponding to each code keyword in the first code language is determined. And finally, aiming at each code keyword, searching the color corresponding to the code keyword type from the mapping table according to the keyword type corresponding to the code keyword to be used 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 may be presented as a common text string.
In step 203, in response to the switching operation of the first user on the displayed target code segment, the target code segment is rendered and displayed according to the second display style in the session interface.
In one implementation, the switching operation of the first user on the displayed target code segment may be an operation of switching the first code language to a second code language, where the second display style is determined based on the second code language, and 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 types corresponding to the respective code keywords included in the target code segment in the second code language may be determined. And determining a second font color corresponding to each code keyword according to the keyword type corresponding to each code keyword, thereby determining a second display style.
For example, the keyword types include a, b, c, the keyword type a corresponds to red, the keyword type b corresponds to blue, and the keyword type c corresponds to green. The target code fragment comprises code keywords A, B, C, D, E, F, and under the code language 1, the keyword type of the keyword A, B, C is a, and the keyword type of the keyword D, E, F is b. Therefore, when the target code fragment is displayed in the case of code language 1, the keyword A, B, C is rendered red, and the keyword D, E, F is rendered blue. The user switches the code language from the code language 1 to the code language 2, and under the code language 2, the keyword type of the keyword A, B is a, the keyword type of the keyword D, E is b, and the keyword type of the keyword C, F is c. Therefore, after switching code language 2, keyword A, B is rendered red, keyword D, E is rendered blue, and keyword C, F is rendered green.
In another implementation manner, the switching operation of the first user on the displayed target code segment may also be an operation of switching the first display theme to a second display theme, where the second display style is determined based on the second display theme, and the second display style includes a 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 segment in the first code language may be determined. And determining a second font color corresponding to each code keyword according to the second display theme and the keyword type corresponding to each code keyword, thereby determining a second display style.
For example, the keyword types include a, b, and c, and in the display theme, the keyword type a corresponds to red, the keyword type b corresponds to blue, and the 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 comprises code keywords A, B, C, D, E, F, and under the code language 1, the keyword type of the keyword A, B, C is a, and the keyword type of the keyword D, E, F is b. Thus, when the target code fragment is presented in code language 1 and with theme one displayed, keyword A, B, C is rendered red and keyword D, E, F is rendered blue. After the user switches the display theme from display theme to display theme two, the keyword A, B, C is rendered pink, and the keyword D, E, F is rendered purple.
According to the information processing method, the code segments in the session message are displayed in the session interface in the code display style, and a user can switch the display style of the code segments in the session message in the session interface, so that the display effect of the code segments is enriched, and the user experience is improved.
It should be noted that although in the above embodiments, the operations of the methods of the embodiments of the present disclosure have been described in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Rather, the steps depicted in the flowcharts may change the order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
Corresponding to the information processing method embodiment, the disclosure also provides an embodiment of the information processing device.
As shown in fig. 3, fig. 3 is a block diagram of an information processing apparatus shown in the present disclosure according to an exemplary embodiment, the apparatus may include: a receiving module 301, a presentation module 302 and a switching module 303.
The receiving module 301 is configured to receive a target code segment sent to a first session.
And the presentation module 302 is configured to render and present the target code segment according to the first presentation style in the session interface of the first session. The session interface is a session interface corresponding to a first user, and the first user is a member in a first session.
And the switching module 303 is configured to render and display the target code segment according to the second display style in the session interface in response to a switching operation of the first user on the displayed target code segment.
In some embodiments, the apparatus may comprise: an acquisition module and a determination module (not shown in the figure).
The obtaining module is used for obtaining a plurality of code keywords in the target code segment and determining a first code language before the target code segment is rendered and displayed according to the first display style.
And the determining module is used for determining the first display style based on the code keyword and the first code language.
In some embodiments, the switching operation may include switching the first code language to a second code language, and the second presentation style is determined based on the second code language.
In other embodiments, the obtaining module may obtain the plurality of code keywords in the target code segment by: and identifying the target code segment by using a preset plug-in to obtain a plurality of code keywords included by the target code segment.
In other embodiments, the determining module may include: a first sub-module and a second sub-module (not shown).
The first submodule is used for determining the keyword type corresponding to each code keyword based on the first code language.
And the second submodule is used for determining the first display style based on the keyword type corresponding to each code keyword.
In other embodiments, the apparatus may further comprise: a theme determination module and a style determination module (not shown).
The theme determining module is used for determining a first display theme aiming at the code before the target code segment is rendered and displayed according to the first display style.
And the style determining module is used for determining a first display style based on the first display theme.
In other embodiments, the switching operation includes an operation of switching the first display theme to a second display theme, and the second presentation style is determined based on the second display theme.
In other embodiments, the style determination module is configured to: a plurality of code keywords in the target code segment are obtained, and a first code language is determined. And determining a keyword type corresponding to each code keyword based on the first code language, and determining a first display style based on the first display theme and the keyword type corresponding to each code keyword.
In some other embodiments, the first display style includes a first background color of a message frame for displaying the target code segment and a first font color corresponding to each code keyword.
In other embodiments, the second determining sub-module determines the first presentation style based on the first display theme and the keyword type corresponding to each code keyword by: and acquiring a background color corresponding to the first display theme as a first background color, and acquiring mapping information corresponding to the first display theme. The mapping information includes information of the mapping relationship between the keyword type and the font color. And determining the first font color corresponding to each code keyword based on the mapping information and the keyword type corresponding to each code keyword.
In other embodiments, the target code snippet is exposed in a content block created in the conversation interface.
In other embodiments, exposing the target code snippet includes highlighting a code keyword in the target code snippet and exposing a code line number in the target code snippet.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present disclosure. One of ordinary skill in the art can understand and implement it without inventive effort.
Fig. 4 is a schematic block diagram of an electronic device provided in some embodiments of the present disclosure. As shown in fig. 4, the electronic device 910 includes a processor 911 and a memory 912, and can be used to implement a client or a server. The memory 912 is used to non-transitory store computer-executable instructions (e.g., one or more computer program modules). The processor 911 is configured to execute the computer-executable instructions, and when the computer-executable instructions are executed by the processor 911, the computer-executable instructions can perform one or more steps of the information processing method described above, thereby implementing the information processing method described above. The memory 912 and the processor 911 may be interconnected by a bus system and/or other form of connection mechanism (not shown).
For example, the processor 911 may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU) or other form of processing unit having data processing capabilities and/or program execution capabilities. For example, the Central Processing Unit (CPU) may be an X86 or ARM architecture or the like. The processor 911 may be a general-purpose processor or a special-purpose processor that may control other components within the electronic device 910 to perform desired functions.
For example, memory 912 may include any combination of one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory can include, for example, random Access Memory (RAM), cache memory (or the like). The non-volatile memory may include, for example, read Only Memory (ROM), a hard disk, an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), USB memory, flash memory, and the like. One or more computer program modules may be stored on the computer-readable storage medium and executed by processor 911 to implement various functions of electronic device 910. Various applications and various data, as well as various data used and/or generated by the applications, and the like, may also be stored in the computer-readable storage medium.
It should be noted that, in the embodiment of the present disclosure, reference may be made to the above description on the information processing method for specific functions and technical effects of the electronic device 910, and details are not described here again.
Fig. 5 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, mobile terminals such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), a wearable electronic device, and the like, and fixed terminals such as a digital TV, a desktop computer, a smart home device, and the like. It should be noted that the electronic device 920 shown in fig. 5 is only an example, and does not bring any limitation to the functions and the scope of the application of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 920 may include a processing device (e.g., central processing unit, graphics processor, etc.) 921 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 922 or a program loaded from a storage device 928 into a Random Access Memory (RAM) 923. The RAM 923 stores various programs and data necessary for the operation of the electronic device 920. The processing device 921, the ROM922, and the RAM 923 are connected to each other via a bus 924. An input/output (I/O) interface 925 is also connected to bus 924.
Generally, the following devices may be connected to I/O interface 925: input devices 926 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 927 including, for example, a Liquid Crystal Display (LCD), speaker, vibrator, etc.; storage devices 928 including, for example, magnetic tape, hard disk, etc.; and a communication device 929. The communication device 929 may allow the electronic device 920 to communicate wirelessly or by wire with other electronic devices to exchange data. While fig. 5 illustrates an electronic device 920 having various means, it is to be understood that not all illustrated means are required to be implemented or provided, and that the electronic device 920 may alternatively be implemented or provided with more or less means.
For example, according to an embodiment of the present disclosure, the above-described information processing method may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program comprising program code for performing the above-described information processing method. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 929, or installed from the storage device 928, or installed from the ROM 922. When the computer program is executed by the processing device 921, the functions defined in the information processing method provided by the embodiment of the present disclosure can be implemented.
Fig. 6 is a schematic diagram of a storage medium according to some embodiments of the present disclosure. For example, as shown in fig. 6, 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 embodiments of the present disclosure may be implemented when the non-transitory computer-executable instructions 931 are executed by a processor, for example, one or more steps in the information processing method according to the above may be performed when the non-transitory computer-executable instructions 931 are executed by a processor.
For example, the storage medium 930 may be applied to the electronic device described above, and for example, the storage medium 930 may include a memory in the electronic device.
For example, the storage medium may include a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), a flash memory, or any combination of the above, as well as other suitable storage media.
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 are omitted. Specific functions and technical effects of the storage medium 930 may refer to the above description about the information processing method, which is not described herein again.
In the context of this disclosure, a computer-readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. 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 electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport 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 appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (15)

1. An information processing method, the method comprising:
receiving a target code segment sent into a first session;
rendering and displaying the target code segment according to a first display style in a session interface of the first session; the session interface is a session interface corresponding to a first user, and the first user is a member in the first session;
and in response to the switching operation of the first user on the displayed target code segment, rendering and displaying the target code segment according to a second display style in the session interface.
2. The method of claim 1, wherein prior to rendering and rendering the target code segment in the first rendering style, further comprising:
acquiring a plurality of code keywords in the target code segment, and determining a first code language;
determining the first presentation style based on the code keyword and the first code language.
3. The method of claim 2, wherein the switching operation comprises 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. The method of claim 2, wherein the obtaining a plurality of code keywords to be in the target code snippet comprises: and identifying the target code segment by using a preset plug-in to obtain a plurality of code keywords included by the target code segment.
5. The method of claim 2, wherein the determining the first presentation style based on the code keyword and the first code language comprises:
determining a keyword type corresponding to each code keyword based on the first code language;
and determining a first display style based on the keyword type corresponding to each code keyword.
6. The method of claim 1, wherein prior to rendering and rendering the target code segment in the first rendering style, further comprising:
determining a first display theme for the code;
determining the first display style based on the first display theme.
7. The method according to claim 6, wherein the switching operation includes an operation of switching the first display theme to a second display theme; the second presentation style is determined based on the second display theme.
8. The method of claim 6, wherein the determining the first presentation style based on the first display theme comprises:
acquiring a plurality of code keywords in the target code segment, and determining a first code language;
determining a keyword type corresponding to each code keyword based on the first code language;
and determining a first display style based on the first display theme and the keyword type corresponding to each code keyword.
9. The method according to claim 8, wherein the first presentation style comprises a first background color of a message box for presenting the target code segment and a first font color corresponding to the respective code keyword.
10. The method of claim 9, wherein the determining a first presentation style based on the first display theme and the keyword type corresponding to each code keyword comprises:
acquiring a background color corresponding to the first display theme as the first background color; and
acquiring mapping information corresponding to the first display theme; the mapping information comprises information of the mapping relation between the keyword type and the font color;
and determining a first font color corresponding to each code keyword based on the mapping information and the keyword type corresponding to each code keyword.
11. The method of any of claims 1-10, wherein the target code snippet is presented in a content block created in the conversation interface.
12. The method of any of claims 1-10, wherein the exposing the target code snippet comprises highlighting a code keyword in the target code snippet and exposing a code line number in the target code snippet.
13. An information processing apparatus, the apparatus comprising:
the receiving module is used for receiving the target code segment sent to the first session;
the display module is used for rendering and displaying the target code segment in a session interface of the first session according to a first display style; the session interface is a session interface corresponding to a first user, and the first user is a member in the first session;
and the switching module is used for rendering and displaying the target code segment according to a second display style in the session interface in response to the switching operation of the first user on the displayed target code segment.
14. A computer-readable storage medium, having stored thereon a computer program which, when executed in a computer, causes the computer to carry out the method of any one of claims 1-12.
15. An electronic device comprising a memory having stored therein executable code and a processor that, when executing the executable code, implements the method of any of claims 1-12.
CN202210901646.1A 2022-07-28 2022-07-28 Information processing method and device and electronic equipment Pending CN115291759A (en)

Priority Applications (2)

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

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN115291759A true CN115291759A (en) 2022-11-04

Family

ID=83824922

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN115291759A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024022432A1 (en) * 2022-07-28 2024-02-01 北京字跳网络技术有限公司 Information processing methods and apparatus, and electronic device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6275223B1 (en) * 1998-07-08 2001-08-14 Nortel Networks Limited Interactive on line code inspection process and tool
CN101951350A (en) * 2010-10-20 2011-01-19 北京开心人信息技术有限公司 Page-based multi-person instant dialogue method and system
CN106775777A (en) * 2017-01-22 2017-05-31 合网络技术(北京)有限公司 Content interaction method and device
CN106951270A (en) * 2017-04-06 2017-07-14 腾讯科技(深圳)有限公司 A kind of code process method, system and server
CN107168606A (en) * 2017-05-12 2017-09-15 武汉斗鱼网络科技有限公司 Dialog control display methods, device and user terminal
US20180143809A1 (en) * 2016-11-21 2018-05-24 Sap Se Visual code editor for visually developing features in applications
CN110134579A (en) * 2019-01-18 2019-08-16 北京车和家信息技术有限公司 Code check method and apparatus
CN111796833A (en) * 2020-07-13 2020-10-20 携程计算机技术(上海)有限公司 Code language conversion method, system, equipment and storage medium
CN114461214A (en) * 2022-01-30 2022-05-10 中国农业银行股份有限公司 Page display method and device, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6275223B1 (en) * 1998-07-08 2001-08-14 Nortel Networks Limited Interactive on line code inspection process and tool
CN101951350A (en) * 2010-10-20 2011-01-19 北京开心人信息技术有限公司 Page-based multi-person instant dialogue method and system
US20180143809A1 (en) * 2016-11-21 2018-05-24 Sap Se Visual code editor for visually developing features in applications
CN106775777A (en) * 2017-01-22 2017-05-31 合网络技术(北京)有限公司 Content interaction method and device
CN106951270A (en) * 2017-04-06 2017-07-14 腾讯科技(深圳)有限公司 A kind of code process method, system and server
CN107168606A (en) * 2017-05-12 2017-09-15 武汉斗鱼网络科技有限公司 Dialog control display methods, device and user terminal
CN110134579A (en) * 2019-01-18 2019-08-16 北京车和家信息技术有限公司 Code check method and apparatus
CN111796833A (en) * 2020-07-13 2020-10-20 携程计算机技术(上海)有限公司 Code language conversion method, system, equipment and storage medium
CN114461214A (en) * 2022-01-30 2022-05-10 中国农业银行股份有限公司 Page display method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024022432A1 (en) * 2022-07-28 2024-02-01 北京字跳网络技术有限公司 Information processing methods and apparatus, and electronic device

Similar Documents

Publication Publication Date Title
CN110046021B (en) Page display method, device, system, equipment and storage medium
US20240202431A1 (en) Method and apparatus for displaying online document, and storage medium
CN109039857B (en) Method for providing message function and electronic device thereof
US11483264B2 (en) Information interaction method, apparatus, device, storage medium and program product
US11762931B2 (en) Feedback method and apparatus based on online document comment, and non-transitory computer-readable storage medium
CN112040330B (en) Video file processing method and device, electronic equipment and computer storage medium
CN109491742B (en) Page table rendering method and device
CN110058854B (en) Method, terminal device and computer-readable medium for generating application
CN113110829B (en) Multi-UI component library data processing method and device
CN108449255B (en) Comment interaction method and equipment, client device and electronic equipment
CN111367447A (en) Information display method and device, electronic equipment and computer readable storage medium
EP4404573A1 (en) Comment sharing method and apparatus, and electronic device
CN112328094A (en) Information input method, cloud input method system and client
CN114528816B (en) Collaborative editing information display method and device, electronic equipment and readable medium
CN115291759A (en) Information processing method and device and electronic equipment
CN113342330B (en) Front-end engineering generation method and device
CN115495175A (en) Picture display method and device, terminal equipment and computer medium
CN115268890A (en) Information processing method and device and electronic equipment
CN110069186B (en) Method and equipment for displaying operation interface of application
CN109947528B (en) Information processing method and device
CN109683726B (en) Character input method, character input device, electronic equipment and storage medium
CN112256370A (en) Information display method and device and electronic equipment
CN111399954A (en) Interface interaction method and device, storage medium and electronic equipment
CN116192789A (en) Cloud document processing method and device and electronic equipment
CN115981769A (en) Page display method, device, equipment, computer readable storage medium and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination