Interface updating method and device
By obtaining message content and templates from the server in the instant messaging chat application and rendering them dynamically in the graphical user interface, the problem of message template update complexity is solved, and template updates are achieved without restarting and updating, simplifying the process.
Patent Information
- Application Number
- CN202010787041.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-07
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2040-08-07
AI Technical Summary
The update of message templates in existing instant messaging chat applications is complicated, and requires repackaging and application updates, resulting in a cumbersome process.
By obtaining messages containing message content and message templates from the server, using the communication bridge between the native component and the web browsing component, the message content and message templates are forwarded to the web browsing component, and dynamically rendered in the graphical user interface, avoiding the application Program restart and update.
Implement seamless updates of message templates, reduce update complexity, simplify the process, and avoid the steps of application redevelopment and deployment.
Smart Images

Figure CN112286598B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to computer technology, and more particularly to an interface updating method and device. Background Art
[0002] In the chat interface of the current instant messaging (IM) chat application, the left side displays the content of received messages, and the right side displays the content of sent messages.
[0003] When realizing the display of message content, the prior art usually packages the message templates and applications corresponding to various message types together in advance. After the application is started, the corresponding message template is matched according to the message type of the message content to be displayed, and the message content is filled into the corresponding message template, thereby realizing the display of the message content.
[0004] However, if the message template needs to be updated, the updated message template and the application need to be repackaged and released, and the application needs to be updated and restarted. Therefore, the existing technology has high complexity in updating the message template. Summary of the invention
[0005] The embodiments of the present application provide an interface updating method and device to overcome the problem of high complexity in updating message templates.
[0006] In a first aspect, an embodiment of the present application provides an interface updating method, comprising:
[0007] Acquire a first message from a server, wherein the first message includes message content and a message template corresponding to the message content;
[0008] Based on the message content and the message template, the message content is displayed in a graphical user interface of an application according to the message template.
[0009] In one possible design, the application includes a native component and a web browsing webview component.
[0010] In a possible design, after obtaining the first message from the server, the method further includes:
[0011] Parsing the first message to obtain the message content and the message template;
[0012] Establishing a communication bridge between the native component and the webview component;
[0013] The native component forwards the message content and the message template to the webview component through the communication bridge.
[0014] In a possible design, displaying the message content according to the message template in a graphical user interface of an application according to the message content and the message template includes:
[0015] The webview component renders according to the message content and the message template, and displays the message content according to the message template in the graphical user interface of the application.
[0016] In one possible design, the first message also includes a message type corresponding to the message content;
[0017] The method further comprises:
[0018] The message type corresponding to the message content and the message template corresponding to the message content are associated and saved in the application.
[0019] In a possible design, the message template includes a Hypertext Markup Language HTML tag and tag content corresponding to the HTML tag.
[0020] In a second aspect, an embodiment of the present application provides an interface updating device, including:
[0021] An acquisition module, configured to acquire a first message from a server, wherein the first message includes message content and a message template corresponding to the message content;
[0022] A display module is used to display the message content according to the message template in a graphical user interface of an application program based on the message content and the message template.
[0023] In one possible design, the application includes a native component and a web browsing webview component.
[0024] In one possible design, the apparatus further includes: a processing module;
[0025] The processing module is used for parsing the first message after acquiring the first message from the server to obtain the message content and the message template;
[0026] Establishing a communication bridge between the native component and the webview component;
[0027] The native component forwards the message content and the message template to the webview component through the communication bridge.
[0028] In a possible design, the display module is specifically used for:
[0029] The webview component renders according to the message content and the message template, and displays the message content according to the message template in the graphical user interface of the application.
[0030] In one possible design, the first message also includes a message type corresponding to the message content;
[0031] The processing module is also used for:
[0032] The message type corresponding to the message content and the message template corresponding to the message content are associated and saved in the application.
[0033] In a possible design, the message template includes a Hypertext Markup Language HTML tag and tag content corresponding to the HTML tag.
[0034] In a third aspect, an embodiment of the present application provides an interface updating device, including:
[0035] Memory, used to store programs;
[0036] A processor is used to execute the program stored in the memory. When the program is executed, the processor is used to execute the method described in the first aspect and any one of the various possible designs of the first aspect.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any one of the various possible designs of the first aspect.
[0038] The embodiment of the present application provides an interface update method and device, the method comprising: obtaining a first message from a server, wherein the first message includes message content and a message template corresponding to the message content. According to the message content and the message template, the message content is displayed in a graphical user interface of the application according to the message template. When the message template needs to be updated, a first message including the message content and the message template corresponding to the message content is obtained from the server, and the message content is displayed in the graphical user interface according to the message template, so that the message template can be updated without restarting and updating the application, which effectively reduces the complexity of updating the message template. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0040] Figure 1 A schematic diagram of a chat interface drawn for the native interface provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of an implementation method of a message template provided in an embodiment of the present application;
[0042] Figure 3 A system diagram of an interface updating method provided in an embodiment of the present application;
[0043] Figure 4 A flowchart of an interface updating method provided in one embodiment of the present application;
[0044] Figure 5 A flowchart of an interface updating method provided by another embodiment of the present application;
[0045] Figure 6 A schematic diagram of updating a message template provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of the structure of an interface updating device provided in an embodiment of the present application;
[0047] Figure 8 A schematic diagram of the hardware structure of the interface update device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] First combine Figure 1 Introduce the chat interface. Figure 1 A schematic diagram of a chat interface drawn for a native interface provided in an embodiment of the present application, such as Figure 1 As shown:
[0050] In the chat interface of the IM chat application, the left side of the interface can display the message content received by the application, and the right side of the interface can display the message content sent by the application. The message content can be of various types, for example, Figure 1 The text messages, voice messages, video messages, file messages, etc. shown in the figure, wherein each type of message content may correspond to its own message template, and the message template is used to indicate the display mode of the message content.
[0051] For example, a message template may indicate the length of a dialog box that displays the message content, the width of the dialog box, the color of the dialog box, the border shadow of the dialog box, the position where the message content in the dialog box is displayed, etc. It can be understood that each message type corresponds to its own message template. This embodiment does not limit the specific implementation method of the message template of each message type, and it can be designed according to actual needs.
[0052] Usually, before displaying the message content, the IM chat application needs to edit the message templates of various message types in advance, and package the edited message templates with the application program and publish them together with the application program.
[0053] After the application is started and enters the chat interface, if there is message content that needs to be displayed, the message templates corresponding to each message type are matched in the application according to the message type corresponding to the message content that needs to be displayed, and the message content is filled into the corresponding message template, thereby realizing the display of the message content.
[0054] Combine the following Figure 2 In a specific example, a possible implementation method of filling the message content into the corresponding message template is introduced. Figure 2 A schematic diagram of an implementation method of a message template provided in an embodiment of the present application.
[0055] See also Figure 2 , assuming that the message content currently to be displayed includes a text message, after entering the current chat interface, a message template for the text message can be obtained, and the message template can indicate, for example, the display length, width, text position, text font, and text size of the text message, and assuming that the message content of the text message currently to be displayed is "show you a video", "what video", thereby obtaining Figure 2 Text messages 201 and 202 are displayed.
[0056] And, assuming that the message content currently to be displayed also includes a video message, after entering the current chat interface, a message template for the video message can be obtained, and the message template can, for example, indicate the display length, width, displayed image frame, displayed pause symbol, etc. of the video message, thereby obtaining Figure 2Video message 203 displayed.
[0057] And, assuming that the message content currently to be displayed also includes a voice message, after entering the current chat interface, a message template for the voice message can be obtained, and the message template can, for example, indicate the display length, width, displayed voice symbols, displayed voice length, etc. of the voice message, thereby obtaining Figure 2 A voice message 204 is shown displayed.
[0058] Above Figure 2 A possible implementation method of message templates for text messages, video messages, and voice messages is introduced. In the actual implementation process, message templates corresponding to various message types can be selected according to actual needs. This embodiment does not limit the specific implementation method of the message template.
[0059] The implementation method of the chat interface in the prior art introduced above can be called native interface drawing. In the implementation method of native interface drawing, if the message template needs to be updated, such as adding a message template of a new message type, or replacing a message template of a message type, it is necessary to re-develop the application, package the updated message template and the application together, and deploy them to the channel.
[0060] Meanwhile, after the new message template is packaged and released together with the application, the application must be updated and restarted before the new message template can be applied. Therefore, in the implementation of the prior art, the complexity of updating the message template is relatively high.
[0061] Based on the problems in the prior art, the present application proposes the following technical ideas: as introduced above, when the message template needs to be updated, the application needs to be redeveloped, packaged, and deployed. At the same time, the application also needs to be updated and restarted. These are the inherent shortcomings of native interface drawing. However, Hypertext Markup Language (HTML) pages can overcome the above shortcomings. HTML pages can be published in real time without packaging during version iteration. Therefore, if the message template is updated based on HTML tags, the complexity of the update can be effectively reduced.
[0062] The method provided by the present application is introduced below in conjunction with specific embodiments. Figure 3 The following is an introduction to the interface update system involved in this application. Figure 3 A system diagram of the interface updating method provided in the embodiment of the present application, such as Figure 3 As shown, the system includes: a server 301 and an application 302 .
[0063] The server 301 and the application 302 can interact, and the interaction method can be, for example, a wireless network, which can be a 2G network, a 3G network, a 4G network or a 5G network, a wireless fidelity (Wireless Fidelity, referred to as WIFI) network, etc. The embodiment of the present application does not limit the specific type or form of interaction, as long as it can realize the function of interaction between the server and the terminal.
[0064] In one possible implementation, the application 302 is typically run on a terminal device held by a user, where the terminal device may be, for example, a computer device, a tablet computer, or a mobile phone (or a "cellular" phone), etc. The terminal device may also be a portable, pocket-sized, handheld, or computer-built-in mobile device or device, without particular limitation herein.
[0065] In this embodiment, application 102 can be, for example, an IM application, which is used to implement the logical functions of sending and receiving messages, interface display, or receiving user-triggered operation instructions, etc. The embodiment of the present application does not limit the specific implementation method of application 302. Those skilled in the art can understand that the specific implementation method of application 302 can be set as needed.
[0066] Currently, the page of an application can be a native page, or an HTML page, or a hybrid page of the two. Among them, a native page refers to a page written in a native language, an HTML page refers to a page written in HTML language, and a hybrid page refers to a combination of the two pages.
[0067] like Figure 2 As shown, the application 302 in the present application may include a native component and a web view (webview) component, wherein the native component may be used to display a native page and a portion of a hybrid page, and the web view component may be used to display an HTML page and a portion of a hybrid page.
[0068] Among them, the server 301 can receive messages or data sent by the application 302, and perform related storage and processing operations, wherein the processing operation can be, for example, forwarding the message sent by the application 302 to the corresponding application, thereby realizing the sending of the message; or the server 301 can also receive instructions sent by the application 302, and perform corresponding processing according to logical judgment. The server 301 can also send instructions to the application 302, and the application 302 performs related operations such as instruction execution. The embodiment of the present application also does not impose any special restrictions on the implementation method of the server 301.
[0069] Based on the above-mentioned system, Figure 4A detailed introduction to the interface update method provided by the embodiments of the present application is given. Figure 4 It is a flowchart of the interface update method provided by one of the embodiments of the present application.
[0070] As Figure 4 shown, the method includes:
[0071] S401. Obtain a first message from a server, where the first message includes a message content and a message template corresponding to the message content.
[0072] In this embodiment, the application can obtain messages from the server. In a possible implementation manner, the application can receive the first message from the server to obtain the first message; alternatively, the application can also actively pull the first message from the server to obtain the first message. This embodiment does not limit the specific implementation manner of obtaining the first message, and it can be selected according to actual needs.
[0073] Among them, the first message includes a message content and a message template corresponding to the message content. The message template in this embodiment includes HTML tags and tag contents corresponding to the HTML tags. An exemplary implementation can be:
[0074] <html tag>
[0075] Color;
[0076] Length;
[0077] Width;
[0078] < / html tag>
[0079] Among them, the HTML tag can be used to indicate the type of the message. For example, if the above HTML tag corresponds to a text message, then the above message template is the message template of the text message. The above HTML tag includes a tag head and a tag tail, and the part between the tag head and the tag tail is the tag content. The tag content is used to indicate the specific display manner of the message content. For example, the tag content can include the color, length, width, etc. of the message content display, or can also include content such as font and size. This embodiment does not limit the specific implementation manner of the message template, and it can be set and selected according to actual needs.
[0080] It can be understood that in this embodiment, when the message template needs to be updated, the first message will include both the message content and the message template corresponding to the message content; if the message template does not need to be updated currently, the first message obtained by the application can only include the message content, and at this time, the application can obtain the message template corresponding to the message content from the local.
[0081] There are multiple possible implementations for updating the message template. In one possible implementation, when a message template of a certain message type needs to be modified, the first message includes the message content and the corresponding message template;
[0082] In another possible implementation, when a certain message type and its corresponding message template need to be added, the message content and the corresponding message template may be included in the first message.
[0083] S402: Display the message content according to the message template in a graphical user interface of the application program based on the message content and the message template.
[0084] The message template in this embodiment is used to indicate the display style of the message content. The application can display the message content according to the message template in the graphical user interface of the application based on the message content and the message template, so that when the message template needs to be updated, it can be directly and dynamically updated and displayed without updating and restarting the application.
[0085] The specific implementation method of the message template may be selected according to actual needs, and this embodiment does not limit the implementation method of the message template.
[0086] The interface update method provided in the embodiment of the present application includes: obtaining a first message from a server, wherein the first message includes message content and a message template corresponding to the message content. Based on the message content and the message template, the message content is displayed in the graphical user interface of the application according to the message template. When the message template needs to be updated, a first message including the message content and the message template corresponding to the message content is obtained from the server, and the message content is displayed in the graphical user interface according to the message template, so that the message template can be updated without restarting and updating the application, which effectively reduces the complexity of the message template update.
[0087] Based on the above embodiments, the interface updating method provided by the present application is further described in detail below in conjunction with a specific embodiment. Figure 5 A flowchart of an interface updating method provided by another embodiment of the present application is shown in FIG. Figure 5 As shown, the method includes:
[0088] S501. Obtain a first message from a server, wherein the first message includes message content and a message template corresponding to the message content.
[0089] The implementation of S501 is the same as that of S401, and will not be described in detail here.
[0090] S502: Parse the first message to obtain message content and message template.
[0091] In this embodiment, the message content and the message template corresponding to the message content may be packaged together, and after obtaining the first message, the application may parse the first message to obtain the message content and the message template.
[0092] S503: Establish a communication bridge between the native component and the webview component.
[0093] Based on the above introduction, it can be determined that the application in this embodiment includes native components and webview components, wherein the messages and data received by the application will first reach the native components, and the message template in this embodiment includes HTML tags and tag content, which needs to be processed by the webview component to display the message content.
[0094] Therefore, in this embodiment, a communication bridge is established between the native component and the webview component so that the native component and the webview component can communicate with each other.
[0095] S504. The native component forwards the message content and message template to the webview component through the communication bridge.
[0096] Among them, the native component can forward the parsed message content and message template to the webview component through the communication bridge, so that the webview component can display the message content according to the message template.
[0097] S505 . The webview component renders according to the message content and the message template, and displays the message content according to the message template in the graphical user interface of the application.
[0098] Among them, the webview component can process HTML tags and tag contents, so the webview component can render according to the message content and the message template, thereby displaying the message content according to the message template in the graphical user interface of the application.
[0099] In a possible implementation, the webview component can be rendered according to the message content and the message template, and dynamically generate a dialog box in the graphical user interface of the application, wherein the dialog box includes the message content displayed according to the message template.
[0100] Alternatively, the message content may be displayed in a form other than a dialog box according to the message template. This embodiment does not impose any particular limitation on the specific implementation method of displaying the message content, as long as the message content is displayed according to the instructions of the message template.
[0101] The interface update method provided in the embodiment of the present application includes: obtaining a first message from a server, wherein the first message includes a message content and a message template corresponding to the message content. Parsing the first message to obtain the message content and the message template. Establishing a communication bridge between the native component and the webview component. The native component forwards the message content and the message template to the webview component through the communication bridge. The webview component renders according to the message content and the message template, and displays the message content according to the message template in the graphical user interface of the application. By establishing a communication bridge between the native component and the webview component, the parsed message content and the message template can be forwarded to the webview component, so that the webview component can render according to the message template and the message content, and display the message content, wherein the message template in HTML format can be dynamically updated, and the webview component ensures that the message template in HTML format can be displayed in the graphical user interface, thereby ensuring the feasibility of the interface update method of the present application, so as to effectively reduce the complexity of message template updates.
[0102] Based on the above embodiments, the first message in the embodiments of the present application may also include a message type. In one possible implementation method, the message type may include: text, voice, video, hyperlink, file, picture, mini program, etc. In the actual implementation process, the implementation method of the message type can be expanded according to actual needs. Any type of message that can be sent through an IM chat application can be used as a message type in this embodiment.
[0103] The interface updating method provided by the present application may also include:
[0104] The message type corresponding to the message content and the message template corresponding to the message content are associated and saved in the application.
[0105] In one possible implementation, if the message type is a newly added message type, the message type and the corresponding message template can be directly stored in the application, so that when a message of this message type is subsequently obtained again, the message template can be directly obtained locally to display the message content.
[0106] In another possible implementation, if the message content is an existing message type, that is, the current update of the message template is a replacement of the original message template, the message type and message template can be associated and stored in the application, and the original message template corresponding to the message type can be overwritten, so that the message content can be displayed according to the updated message template subsequently.
[0107] In this embodiment, by associating the message type and the message template and saving them in the application, the updated message template can be stored, and the message content can be displayed according to the updated message template later.
[0108] Based on the above embodiments, Figure 6 Taking a specific chat process as an example, the interface update method provided in the embodiment of the present application is introduced. Figure 6 A schematic diagram of updating a message template provided in an embodiment of the present application.
[0109] It is understandable that when an application is first released, a basic HTML resource file will be packaged locally. The HTML resource file may include at least one basic message type and the message templates corresponding to these basic message types, and will be released together with the application. Therefore, in this embodiment, for basic message types, if there is no need to update the corresponding message templates, the corresponding message templates can be obtained from the local computer to display the message content. For example, Figure 6 Text messages, voice messages, file messages, etc. can be displayed directly.
[0110] Assuming that there is a new message type and the server has configured a corresponding message template for the message type, the application can obtain a first message from the server, which includes message content and a message template. The application parses the obtained first message to obtain the message content and the message template.
[0111] Because the message template is parsed, it can be determined that the message template needs to be updated. Therefore, the application establishes a communication bridge between the native component and the webview component, and forwards the message content and message template to the webview component. The webview component can render according to the message content and message template, so that the message content is displayed in the graphical user interface according to the message template. For example, Figure 6 The dialog box shown in 601 in FIG.
[0112] The above-mentioned receiving of the first message is performed according to the message content and the message template, so as to realize the updating of the message template and display the message content according to the updated message template. Because the html tag can support dynamic embedding, the above-mentioned process is performed during the sending and receiving process of the application program. Therefore, there is no need to re-develop, package, and update the application program. Therefore, the interface updating method provided in this embodiment can render any complex interface effects without the user's perception, as long as the message template and the message content can be obtained in time in the chat interface. The whole process does not require the user to perform additional operations, thereby reducing the complexity of updating the message template.
[0113] Figure 7 This is a schematic diagram of the structure of the interface updating device provided in the embodiment of the present application. Figure 7 As shown, the device 70 includes: an acquisition module 701 , a display module 702 and a processing module 703 .
[0114] The acquisition module 701 is used to acquire a first message from a server, wherein the first message includes message content and a message template corresponding to the message content;
[0115] The display module 702 is used to display the message content according to the message template in the graphical user interface of the application program based on the message content and the message template.
[0116] In one possible design, the application includes a native component and a web browsing webview component.
[0117] In one possible design, the apparatus further includes: a processing module 703;
[0118] The processing module 703 is used for parsing the first message after acquiring the first message from the server to obtain the message content and the message template;
[0119] Establishing a communication bridge between the native component and the webview component;
[0120] The native component forwards the message content and the message template to the webview component through the communication bridge.
[0121] In a possible design, the display module 702 is specifically used for:
[0122] The webview component renders according to the message content and the message template, and displays the message content according to the message template in the graphical user interface of the application.
[0123] In one possible design, the first message also includes a message type corresponding to the message content;
[0124] The processing module 703 is further used for:
[0125] The message type corresponding to the message content and the message template corresponding to the message content are associated and saved in the application.
[0126] In a possible design, the message template includes a Hypertext Markup Language HTML tag and tag content corresponding to the HTML tag.
[0127] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0128] Figure 8 A schematic diagram of the hardware structure of the interface update device provided in the embodiment of the present application, such as Figure 8 As shown, the interface updating device 80 of this embodiment includes: a processor 801 and a memory 802;
[0129] Memory 802, used to store computer-executable instructions;
[0130] The processor 801 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the interface updating method in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0131] Optionally, the memory 802 may be independent or integrated with the processor 801 .
[0132] When the memory 802 is independently provided, the interface updating device further includes a bus 803 for connecting the memory 802 and the processor 801 .
[0133] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the interface update method executed by the above interface update device is implemented.
[0134] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0135] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application.
[0136] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0137] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0138] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0139] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0140] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An interface updating method, applied to an application, characterized in that: include: Obtaining a first message from a server, wherein the first message includes message content and a message template corresponding to the message content, and the application includes a native component and a webview component; Establishing a communication bridge between the native component and the webview component; The native component forwards the message content and the message template to the webview component through the communication bridge; The webview component renders according to the message content and the message template, and displays the message content according to the message template in the graphical user interface of the application.
2. The method according to claim 1, characterized in that After obtaining the first message from the server, the method further includes: The first message is parsed to obtain the message content and the message template.
3. The method according to claim 1, characterized in that The first message also includes a message type corresponding to the message content; The method further comprises: The message type corresponding to the message content and the message template corresponding to the message content are associated and saved in the application.
4. The method according to any one of claims 1 to 3, characterized in that: The message template includes a hypertext markup language HTML tag and tag content corresponding to the HTML tag.
5. An interface updating device, characterized in that: include: An acquisition module, configured to acquire a first message from a server, wherein the first message includes message content and a message template corresponding to the message content; A display module, used for rendering according to the message content and the message template through a webview component, and displaying the message content according to the message template in a graphical user interface of an application; Wherein, the application includes a native component and a web browsing webview component; The device further comprises: a processing module; The processing module is further used to establish a communication bridge between the native component and the webview component; The native component forwards the message content and the message template to the webview component through the communication bridge.
6. The device according to claim 5, characterized in that The device further comprises: a processing module; The processing module is used to parse the first message after acquiring the first message from the server to obtain the message content and the message template.
7. The device according to claim 6, characterized in that The first message also includes a message type corresponding to the message content; The processing module is also used for: The message type corresponding to the message content and the message template corresponding to the message content are associated and saved in the application.
8. The device according to any one of claims 5 to 7, characterized in that: The message template includes a hypertext markup language HTML tag and tag content corresponding to the HTML tag.
9. An interface updating device, characterized in that: include: Memory, used to store programs; A processor, configured to execute the program stored in the memory; when the program is executed, the processor is configured to execute the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Electronic device, method for dynamically configuring message display mode, and storage medium
CN108924030A
Page display method and device and storage medium
CN110609965A