Rich text processing method and device in native application program and electronic equipment

By preloading schedule page resources in native applications and rendering locally using rich text editors implemented by browser components, the problem of inefficient display of rich text on schedule pages in native applications is solved, and fast loading and diversified information display is achieved, providing offline access capabilities.

CN120011663APending Publication Date: 2025-05-16TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311526034.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The rich text display efficiency of schedule pages in native applications is low, the traditional H5 display process is cumbersome, and the page loading performance is poor.

Method used

By preloading the page resources corresponding to the schedule page to the local area and implementing a rich text editor based on the browser component. When the schedule page is a web page based on the hypertext markup language, the rich text editor is called for local rendering processing to obtain rich text rendering data for display.

Benefits of technology

It avoids the need to download page resources every time you access the schedule page, reduces network requests, improves the loading speed of schedule pages, improves the display efficiency of schedule rich text information in schedule pages, supports rich text display of pictures, files, and text, and provides offline access capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011663A_ABST
    Figure CN120011663A_ABST
Patent Text Reader

Abstract

The invention relates to a rich text processing method and device in a native application program and electronic equipment. The method comprises the steps that in response to a check request for a schedule page in a native application program, description information of a schedule is requested from an application background of the native application program, schedule description information which is returned by the application background and corresponds to the schedule page is obtained, and the schedule description information comprises schedule rich text information; under the condition that the schedule page is a webpage based on a hypertext markup language, calling a rich text editor, and performing local rendering processing on the schedule rich text information by the rich text editor based on local page resources to obtain rich text rendering data of the schedule page; the rich text editor is a component for realizing rich text rendering based on a browser component; and displaying the schedule rich text information in the schedule page based on the rich text rendering data. According to the technical scheme, the lightweight and display efficiency of rich text processing in the native application program can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software technology, and in particular to a method, device and electronic device for processing rich text in a native application. Background Art

[0002] The page display format of native applications is single. For example, the schedule page only supports the display of pure text information. Although the native page is displayed smoothly, the display format is not rich enough. In order to meet the richness of page presentation in native applications, related technologies sometimes choose to set the pages in native applications that need to display pictures as web pages, such as hypertext markup language H5 pages. However, the display process of traditional H5 is cumbersome and the page loading performance is poor, resulting in low display efficiency. Summary of the invention

[0003] The present application provides a method, device and electronic device for processing rich text in a native application, so as to at least solve the problem of how to improve the display efficiency of rich text in a native application in the related art. The technical solution of the present application is as follows:

[0004] According to a first aspect of an embodiment of the present application, a method for processing rich text in a native application is provided, comprising:

[0005] In response to a request to view a schedule page in a native application, requesting schedule description information from an application background of the native application, and obtaining schedule description information corresponding to the schedule page returned by the application background, wherein the schedule description information includes schedule rich text information;

[0006] In the case where the schedule page is a web page based on Hypertext Markup Language, a rich text editor is called, and the rich text editor performs local rendering processing on the schedule rich text information based on local page resources to obtain rich text rendering data of the schedule page; the rich text editor is a component that implements rich text rendering based on a browser component; the local page resources are page resources corresponding to the schedule page pre-loaded locally;

[0007] The schedule rich text information in the schedule page is displayed based on the rich text rendering data.

[0008] According to a second aspect of an embodiment of the present application, a rich text processing device in a native application is provided, including:

[0009] A page viewing module, configured to, in response to a request to view a schedule page in a native application, request schedule description information from an application background of the native application, and obtain schedule description information corresponding to the schedule page returned by the application background, wherein the schedule description information includes schedule rich text information;

[0010] A calling module, used for calling a rich text editor when the schedule page is a web page based on Hypertext Markup Language, and the rich text editor performs local rendering processing on the schedule rich text information based on local page resources to obtain rich text rendering data of the schedule page; the rich text editor is a component that implements rich text rendering based on a browser component; the local page resources are page resources corresponding to the schedule page pre-loaded locally;

[0011] A display module is used to display the schedule rich text information in the schedule page based on the rich text rendering data.

[0012] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method as described in any one of the above-mentioned first aspects.

[0013] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any method described in the first aspect of the embodiment of the present application.

[0014] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer instructions, which, when executed by a processor, enable a computer to execute any one of the methods described in the first aspect of the embodiment of the present application.

[0015] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0016] By preloading the page resources corresponding to the schedule page to the local computer and implementing a rich text editor based on the browser component, when the schedule page is a web page based on the hypertext markup language, the rich text editor is called and the rich text editor performs local rendering processing on the schedule rich text information based on the local page resources to obtain the rich text rendering data of the schedule page for displaying the schedule rich text information. The combination of the rich text editor based on the browser component and the local page resources is realized, so that it is possible to avoid the need to download page resources every time the schedule page is accessed, reduce network requests, and increase the loading speed of the schedule page, thereby improving the display efficiency of the schedule rich text information in the schedule page. Compared with the traditional H5, the smooth display of rich text in the lightweight native application can be realized, so that the diversity of information display forms of the schedule page can be improved, so that the schedule page can support rich text mixed with pictures, files, and texts, more clearly display the key information and arrangement structure of the text, and improve the editing and typesetting capabilities in the schedule; and the content of the schedule page can still be accessed without a network connection, providing the ability of offline access.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.

[0019] Figure 1 It is a schematic diagram of an application environment according to an exemplary embodiment.

[0020] Figure 2 The present invention is a flowchart of a method for processing rich text in a native application according to an exemplary embodiment.

[0021] Figure 3 The present invention is an interactive schematic diagram of rich text content display in a native application according to an exemplary embodiment.

[0022] Figure 4 The figure is a schematic diagram of a local page resource preloading process according to an exemplary embodiment.

[0023] Figure 5 The diagram is a functional architecture diagram of a rich text editor according to an exemplary embodiment.

[0024] Figure 6 The diagram is a schematic diagram showing a display method of a schedule page according to an exemplary embodiment.

[0025] Figure 7 The figure is a schematic diagram showing rendering of link information according to an exemplary embodiment.

[0026] Figure 8 The figure is a schematic diagram of a process of setting a text display style according to an exemplary embodiment.

[0027] Fig. 9 It is a block diagram of a rich text processing device in a native application according to an exemplary embodiment.

[0028] Fig.10 The invention is a block diagram of an electronic device for rich text processing in a native application program based on an exemplary embodiment.

[0029] Fig.11 The invention is a block diagram of an electronic device for rich text processing in a native application according to an exemplary embodiment. DETAILED DESCRIPTION

[0030] Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0031] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0032] In addition, in order to better illustrate the present application, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present application can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present application.

[0033] See also Figure 1 , Figure 1 A schematic diagram of an application system provided according to an embodiment of the present application is shown. The application system can be used in a rich text processing method in a native application of the present application. Figure 1 As shown, the application system may include at least a native application (referred to as Native) and a rich text editor, and the rich text editor may be implemented based on a browser component (such as WebView). Exemplarily, the rich text editor may be used for rendering rich text.

[0034] In the embodiment of the present application, the native application may be installed in a terminal, which may include a smart phone, a tablet computer, etc. In the embodiment of the present application, the operating system running on the terminal may include but is not limited to the Android system, the IOS system, etc. Accordingly, when the operating system running on the terminal is the Android system, the native application may refer to an application developed based on the Android system; when the operating system running on the terminal is the IOS system, the native application may refer to an application developed based on the IOS system.

[0035] In the embodiments of this specification, when viewing the schedule page of the native application, the native application and the rich text editor can be called to render and display the schedule rich text information in the schedule page and operate the corresponding page elements.

[0036] In addition, it should be noted that Figure 1 What is shown is merely one application environment of the rich text processing method in the native application provided by this application.

[0037] It should be noted that in the specific implementation of this application, user-related data is involved. When the following embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0038] Figure 2 The present invention is a flowchart of a method for processing rich text in a native application according to an exemplary embodiment. Figure 3 FIG. 1 is a schematic diagram showing an interaction of rich text content display in a native application according to an exemplary embodiment. Figure 2 and Figure 3 As shown, the rich text processing method in the native application may include the following steps.

[0039] In step S201, in response to a request to view a schedule page in a native application, a request is made to the application background of the native application for schedule description information, and the schedule description information corresponding to the schedule page returned by the application background is obtained. The schedule description information may include schedule rich text information.

[0040] In the embodiments of this specification, any installed native application can be started in the terminal, so that any page of the native application can be viewed in the native application. Exemplarily, the page in the native application can be a page based on Hypertext Markup Language (HTML), such as an H5 page; or it can be a non-H5 page, that is, a native page. For native pages, you can directly use the native application in combination with the application background to process and display the page. For the H5 page in the native application, you can use the rich text processing method in the native application of the embodiment of this specification for processing. Among them, it should be noted that the H5 page in the native application here can refer to the schedule page as an independent page based on H5 as a whole, or it can refer to the schedule rich text information in the schedule page as an embedded page based on H5 implementation, and this application is not limited to this.

[0041] In a possible implementation, after starting into the native application, different pages can be viewed in the native application. For example, when the calendar page is triggered, a request to view the calendar page in the native application can be generated. Accordingly, in response to the request to view the calendar page in the native application, see Figure 3 , you can request the description information of the schedule from the application background of the native application. So you can get the schedule description information corresponding to the schedule page returned by the application background, and the schedule description information can include rich text information of the schedule.

[0042] The schedule rich text information may refer to a schedule described in rich text. Rich text may refer to information embedded in text in various formats and styles, such as various fonts, colors, sizes, images, links, tables, videos, etc., which is not limited in this application.

[0043] In step S203, when the schedule page is a web page based on Hypertext Markup Language, a rich text editor is called, and the rich text editor performs local rendering processing on the schedule rich text information based on local page resources to obtain rich text rendering data of the schedule page; the rich text editor can be a component that implements rich text rendering based on a browser component.

[0044] In the embodiments of the present specification, it is possible to determine whether the schedule page is a web page based on Hypertext Markup Language, for example, to determine whether the schedule page is an H5 page. If it is an H5 page, that is, when the schedule page is a web page based on Hypertext Markup Language, a rich text editor can be called, and the rich text editor performs local rendering processing on the schedule rich text information based on local page resources to obtain rich text rendering data of the schedule page. Optionally, if it is not an H5 page, the rich text editor may not be called to render the schedule page, and the native method of the native application may be used to directly render and display the schedule page. Exemplarily, local page resources may include page materials, display styles, etc. corresponding to the schedule rich text information, which is not limited in this application.

[0045] For example, refer to Figure 3 In response to a request to view a schedule page in a native application, the application background of the native application can be requested for the description information of the schedule, and the schedule description information corresponding to the schedule page returned by the application background can be obtained. The schedule description information may include schedule rich text information. In addition, the application background can notify the rich text editor that there is a schedule rich text viewing event, and the rich text editor can perform initialization work, such as initializing the operating environment, etc. to prepare for rich text processing. The native application can submit the schedule rich text information to the rich text editor, and the rich text editor will perform local H5 rendering to render the rich text content and obtain rich text rendering data. After obtaining the rich text rendering data, the native application can be notified. Optionally, interactions and notifications of other events can also be performed, which are not limited in this application.

[0046] The local page resource can be a page resource corresponding to a schedule page pre-loaded locally. In an optional implementation, the method can also include a pre-loading process of the local page resource, so that when the page is viewed, the page resource already exists locally and can be loaded quickly, reducing waiting time and improving user experience. The specific pre-loading process can include the following steps:

[0047] When the native application is started, the local page resources are downloaded to the local computer and stored;

[0048] The browser component is called to read the local page resources into the memory; and the usage scenario of the native application is initialized according to the usage scenario set by the target account to obtain the scene rendering data; the target account may be the account that starts the native application. The usage scenario may include but is not limited to the usage language, environment, etc., and the environment may include daytime, nighttime, etc., which is not limited in the present disclosure.

[0049] Furthermore, the home page of the native application can be displayed based on the scene rendering data to achieve the purpose of entering the native application. After entering the native application, any page in the native application can be viewed, such as viewing the above schedule page.

[0050] Taking the native application as an application based on the Android operating system as an example, the H5 page resources can be included in the APK package (Android application package) when released. Figure 4 , when the native application starts, local resources can be directly loaded and the JS (JavaScript) environment can be initialized. For example, the H5 page resources in the package can be obtained and read into the memory. In this way, the local H5 page resources can be loaded, so that the usage scenario of the native application can be initialized according to the usage scenario. For example, the relevant tags in the local page resources can be replaced according to the usage scenario, such as replacing the language, color, etc. In this way, the replaced local H5 page resources can be rendered using WebView, and the scene rendering data can be obtained to be submitted to the native application for display. Optionally, the loading of local H5 page resources can be triggered by H5Loader (H5 loader), and H5 Loader can be used for code conversion. Exemplarily, it can belong to the logic layer in the rich text editor, which is not limited in this application.

[0051] In step S205, the schedule rich text information in the schedule page is displayed based on the rich text rendering data.

[0052] In the embodiments of the present specification, the native application may display the schedule rich text information in the schedule page based on the rich text rendering data, for example, displaying the rich text content, links, project numbers, etc. of the schedule rich text information.

[0053] In one possible implementation, referring to Figure 5 , the rich text editor may include a core layer, a logic layer, and an interaction layer. For example, the core layer may be based on WebView support, the logic layer may be used for bridge objects (JS Bridge) and H5 interaction processing, and the interaction layer may be used for screen adaptation, content rendering, and other processing. Based on this, the above-mentioned rich text processing method may also include calling a rich text editor to determine the display size of the schedule rich text information to adapt to the display screen; accordingly, the above-mentioned step of displaying the schedule rich text information in the schedule page based on the rich text rendering data may include: based on the determined display size and rich text rendering data, displaying the schedule rich text information in the schedule page, so that the display of the schedule rich text information in the schedule page can adapt to the current display screen.

[0054] In an optional implementation, the use of the rich text editor may include being independent of the schedule page or being embedded in the schedule page. For example, the rich text editor may be placed in an independent page, so that the schedule page to which the schedule rich text information belongs can be accessed as a whole page; or the rich text editor may be embedded in an existing page of a native application, and may automatically adapt to the size of the page, so that the schedule page to which the schedule rich text information belongs can be accessed as an embedded page. Accordingly, the above-mentioned display of the schedule rich text information in the schedule page based on the rich text rendering data may include: displaying the schedule rich text information in the schedule page based on the rich text rendering data in an independent page manner, for example Figure 6 As shown in the left figure of ; or, the schedule rich text information in the schedule page is displayed based on the rich text rendering data in an embedded page, such as Figure 6 As shown in the figure on the right.

[0055] By preloading the page resources corresponding to the schedule page to the local computer and implementing a rich text editor based on the browser component, when the schedule page is a web page based on the hypertext markup language, the rich text editor is called and the rich text editor performs local rendering processing on the schedule rich text information based on the local page resources to obtain the rich text rendering data of the schedule page for displaying the schedule rich text information. The combination of the rich text editor based on the browser component and the local page resources is realized, so that it is possible to avoid the need to download page resources every time the schedule page is accessed, reduce network requests, and increase the loading speed of the schedule page, thereby improving the display efficiency of the schedule rich text information in the schedule page. Compared with the traditional H5, the smooth display of rich text in the lightweight native application can be realized, so that the diversity of information display forms of the schedule page can be improved, so that the schedule page can support rich text mixed with pictures, files, and texts, more clearly display the key information and arrangement structure of the text, and improve the editing and typesetting capabilities in the schedule; and the content of the schedule page can still be accessed without a network connection, providing the ability of offline access.

[0056] Reference Figure 7 In a possible implementation, during the process of adding a schedule, information such as a link can be input. For the link information, the native application can identify the link and call the rich text editor for rendering through the JS Bridge (bridge object). Based on this, the above method can also include:

[0057] In response to the schedule adding request, the schedule page is switched to the input state display, that is, the state of editing the schedule. The application does not limit the specific display of the input state;

[0058] In the above-mentioned input state, in response to the input of link information, the rich text editor can be called through the bridge object to perform link type analysis on the link information to obtain the target link type corresponding to the link information, and the link information can be rendered based on the target link type to obtain link rendering data; further, the above-mentioned link information can be displayed according to the link rendering data.

[0059] As an example, the target link type may include a document link type and a common link type. The document link type may refer to a link represented by a text, and the common link type may refer to a link represented by a URL (uniform resource locator).

[0060] Optionally, when the target link type of the link information is a document link type, the rich text editor also needs to call back the native application to request the link document of the link information. Based on this, in the above-mentioned input state, in response to the input of the link information, the step of calling the rich text editor through the bridge object to analyze the link type of the link information to obtain the target link type corresponding to the link information, and rendering the link information based on the target link type to obtain link rendering data may include:

[0061] In the input state, in response to the input of link information, the rich text editor may be called by the bridge object to perform link type analysis on the link information to obtain a target link type corresponding to the link information; the target link type may include a document link type;

[0062] Furthermore, a request for the rich text editor to call back the link document based on the document link type may be received, and the link document corresponding to the link information may be returned to the rich text editor, so that the rich text editor renders the link document to obtain the link rendering data.

[0063] For example, refer to Figure 7 In the process of adding a schedule, you can enter information such as links. For the link information, the native application can identify the link and call the link setting interface, and notify the H5 link input through JS Bridge. Correspondingly, the rich text editor can parse the link, that is, parse the link information to obtain the target link type corresponding to the link information. If the target link type obtained by analysis is a document link type, the Native can be called back to request the link document, and Native obtains the name of the link document and other information. For example, you can request the link document corresponding to the link information from Native through JS Bridge. After Native obtains the link document, it can notify the rich text editor through JS Bridge, and the rich text editor renders the link document to obtain the above-mentioned link rendering data, for example Figure 7The rendered document block in .

[0064] In a possible implementation, the method may further include an operation on the display style of the input text in the schedule. Specifically, the method may further include the following steps:

[0065] In response to the schedule adding request, the schedule page is switched to input state display;

[0066] In the input state, in response to an instruction to operate the display style of the input text, the rich text editor is called through the bridge object to render the display style for the input text to obtain style rendering data;

[0067] This allows you to display input text based on style rendering data.

[0068] In the embodiment of the present specification, a new schedule can be added or an existing schedule can be edited on the schedule page. In this case, the schedule page can be switched to an input state display in which the content of the schedule can be entered. For example, after entering text, an operation to set the display style of the input text can be triggered. Accordingly, in response to an instruction to operate the display style of the input text, the rich text editor can be called through the bridge object to render the display style for the input text to obtain style rendering data. For example, referring to Figure 8 For example, to trigger the operation of setting the input text to bold font, Native can call the font setting interface and call the bold / number setting interface through JS Bridge to notify the rich text editor to set the corresponding font. H5 receives the notification of setting the corresponding font and can set the corresponding font to obtain the rendering data of the bold font, that is, the style rendering data. Optionally, the font setting status can be called back and the toolbar status can be set through JS Bridge to synchronize the toolbar status back to Native. For example, Figure 6 Add a shadow to the "B" in the toolbar state to indicate that the font is bold.

[0069] In a possible implementation, the rich text processing method may further include:

[0070] In response to an operation instruction on a page element in a schedule page, the operation instruction is parsed through a bridge object to obtain a native method parameter to be called;

[0071] The target operation corresponding to the operation instruction is performed on the page element according to the native method parameters. For example, a specific native method can be found according to the native method parameters, and the target operation corresponding to the operation instruction is performed based on the native method.

[0072] In the embodiments of this specification, the rendering of rich text requires the native application to call the rich text editor for rendering, and when the elements in the H5 page are operated, the H5 page needs to call the native application to respond to the operation. Based on this, when the page elements are operated, such as adding bullet points to the text, changing the text color to XX color, etc., an operation instruction for the text can be triggered. When H5 detects the operation instruction, it can notify the native application of the operation instruction. Accordingly, the native application responds to the operation instruction and can parse the operation instruction through the bridge object to obtain the native method parameters that need to be called, so that the target operation corresponding to the operation instruction can be performed on the page element according to the native method parameters, such as changing the text color to XX color, thereby improving the operation efficiency of the H5 page.

[0073] As an example, for calls from Web to Native, the Scheme approach can be adopted in the embodiments of this specification. For example, the Scheme can be triggered by the Web, and the native application parses the scheme through the JS Bridge to obtain parameters such as funcname (function name) and callbakcId (callback identifier) ​​of the method to be called, so that the corresponding native method can be found based on these parameters to execute the target operation corresponding to the operation instruction.

[0074] As an application example, taking the original application A of Android (hereinafter referred to as application A) as an example, application A can be downloaded and installed to the terminal, so that application A can be started. When the startup of application A is detected, the page resources of application A can be downloaded to the local page resources constituting application A, and the local page resources can be saved. Further, the browser component can be called to read the local page resources into the memory; and according to the set usage scenario (such as the language used, environment, etc.), the usage scenario of application A is initialized to obtain the scene rendering data. Further, the homepage of the native application can be displayed based on the scene rendering data to enter application A.

[0075] After entering application A, the rendering of rich text in the schedule page and the operation of page elements in the schedule page can be realized through mutual calls between application A and the rich text editor. For example, a request to view the schedule page in application A can be triggered, so that the description information of the schedule can be requested from the application background of application A, and the schedule description information corresponding to the schedule page returned by the application background can be obtained, and the schedule description information can include the schedule rich text information; further, in the case that the schedule page is an H5 page, the rich text editor can be called through JS Bridge, and the rich text editor can perform local rendering processing on the schedule rich text information based on local page resources to obtain the rich text rendering data of the schedule page. Next, application A can display the schedule rich text information in the schedule page based on the rich text rendering data.

[0076] Optionally, you can add a new schedule or re-edit the rich text information of the viewed schedule. For example, by adding a new schedule, you can enter the input state. In the input state, you can enter the input text that describes the schedule, set the display style of the input text, add bullet points, add links of document link type, etc. Application A can call the rich text editor through JSBridge to render the rich text accordingly, and obtain the corresponding rendering data and submit it to application A for display. Alternatively, when you want to modify the page elements in the schedule page, the call to application A can also be triggered by the H5 page. For example, after bolding the font, you can call the native method of application A to display the bold mark accordingly, such as adding a shadow under the bold mark, etc. This application is not limited to this.

[0077] In this way, by embedding the H5-based schedule page in the native application, the schedule page can support rich text mixed with pictures, files, and text, and more clearly display the key information and arrangement structure of the text, thereby improving the editing and typesetting capabilities in the schedule. In addition, it is set to pre-load the page resources corresponding to the schedule page to the local, and implement the rich text editor based on the browser component. In the case where the schedule page is a web page based on Hypertext Markup Language, the rich text editor is called and the rich text editor performs local rendering processing on the schedule rich text information based on the local page resources to obtain the rich text rendering data of the schedule page for the display of the schedule rich text information, thereby realizing the combination of the rich text editor based on the browser component and the local page resources, thereby avoiding the need to download page resources every time the schedule page is visited, reducing network requests, and improving the loading speed of the schedule page, thereby improving the display efficiency of the schedule rich text information in the schedule page of the native application in a lightweight manner.

[0078] Fig. 9 is a block diagram of a rich text processing device in a native application according to an exemplary embodiment. Fig. 9 , the device may include:

[0079] The page viewing module 901 is used to, in response to a request to view a schedule page in a native application, request schedule description information from an application background of the native application, and obtain schedule description information corresponding to the schedule page returned by the application background, wherein the schedule description information includes schedule rich text information;

[0080] The calling module 903 is used to call a rich text editor when the schedule page is a web page based on hypertext markup language, and the rich text editor performs local rendering processing on the schedule rich text information based on local page resources to obtain rich text rendering data of the schedule page; the rich text editor is a component that implements rich text rendering based on a browser component; the local page resources are page resources corresponding to the schedule page pre-loaded locally;

[0081] The display module 905 is used to display the schedule rich text information in the schedule page based on the rich text rendering data.

[0082] By preloading the page resources corresponding to the schedule page to the local computer and implementing a rich text editor based on the browser component, when the schedule page is a web page based on the hypertext markup language, the rich text editor is called and the rich text editor performs local rendering processing on the schedule rich text information based on the local page resources to obtain the rich text rendering data of the schedule page for displaying the schedule rich text information. The combination of the rich text editor based on the browser component and the local page resources is realized, so that it is possible to avoid the need to download page resources every time the schedule page is accessed, reduce network requests, and increase the loading speed of the schedule page, thereby improving the display efficiency of the schedule rich text information in the schedule page. Compared with the traditional H5, the smooth display of rich text in the lightweight native application can be realized, so that the diversity of information display forms of the schedule page can be improved, so that the schedule page can support rich text mixed with pictures, files, and texts, more clearly display the key information and arrangement structure of the text, and improve the editing and typesetting capabilities in the schedule; and the content of the schedule page can still be accessed without a network connection, providing the ability of offline access.

[0083] In a possible implementation, the rich text processing device may further include:

[0084] A switching display module, used for switching the schedule page to an input state display in response to a schedule adding request;

[0085] a link rendering module, configured to, in the input state, in response to input of link information, perform link type analysis on the link information by calling the rich text editor through a bridge object to obtain a target link type corresponding to the link information, and render the link information based on the target link type to obtain link rendering data;

[0086] A link display module is used to display the link information according to the link rendering data.

[0087] In a possible implementation, the link rendering module may include:

[0088] a link analysis unit, configured to, in the input state, in response to input of the link information, perform link type analysis on the link information by calling the rich text editor through the bridge object to obtain a target link type corresponding to the link information; the target link type includes a document link type;

[0089] The link rendering unit is used to receive a request from the rich text editor to call back a link document based on the document link type, and return the link document corresponding to the link information to the rich text editor, so that the rich text editor renders the link document to obtain the link rendering data.

[0090] In a possible implementation, the rich text processing device may further include:

[0091] The switching display module is used to switch the schedule page to an input state display in response to a schedule adding request;

[0092] a style rendering module, configured to, in the case of the input state, in response to an instruction to operate the display style of the input text, call the rich text editor through a bridge object to render the display style for the input text to obtain style rendering data;

[0093] A style display module is used to display the input text based on the style rendering data.

[0094] In a possible implementation, the rich text processing device may further include:

[0095] A page resource downloading module, used for downloading the local page resource to a local computer and storing the local page resource when the native application is started;

[0096] an initialization module, configured to call a browser component to read the local page resources into memory; and to initialize the usage scenario of the native application according to the usage scenario set by the target account to obtain scene rendering data; the target account is the account that starts the native application;

[0097] A home page display module is used to display the home page of the native application based on the scene rendering data.

[0098] In a possible implementation, the rich text processing device may further include:

[0099] An operation response module, used to respond to an operation instruction on a page element in the schedule page, parse the operation instruction through a bridge object, and obtain a native method parameter to be called;

[0100] The page element operation module is used to perform the target operation corresponding to the operation instruction on the page element according to the native method parameters.

[0101] In a possible implementation, the method further includes calling the rich text editor to determine the display size of the schedule rich text information to adapt to the display screen; accordingly, the display module 905 may include:

[0102] The first display unit is used to display the schedule rich text information in the schedule page based on the determined display size and the rich text rendering data.

[0103] In a possible implementation, the rich text editor may be used independently of the schedule page or embedded in the schedule page; accordingly, the display module 905 may include:

[0104] The second display unit is used to display the schedule rich text information in the schedule page based on the rich text rendering data in an independent page manner; or to display the schedule rich text information in the schedule page based on the rich text rendering data in an embedded page manner.

[0105] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0106] Fig.10 The block diagram of an electronic device for rich text processing in a native application is shown based on an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for rich text processing in a native application is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0107] Those skilled in the art will understand that Fig.10The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0108] Fig.11 is a block diagram of an electronic device for rich text processing in a native application according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig.11 As shown. The electronic device includes a processor, a memory and a network interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for rich text processing in a native application is implemented.

[0109] Those skilled in the art will understand that Fig.11 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0110] In an exemplary embodiment, an electronic device is also provided, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a rich text processing method in a native application as in an embodiment of the present application.

[0111] In an exemplary embodiment, a computer-readable storage medium is also provided, and when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the rich text processing method in the native application in the embodiment of the present application. The computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0112] In an exemplary embodiment, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the method for rich text processing in a native application in the embodiment of the present application.

[0113] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0114] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0115] It should be understood that the present application is not limited to the precise structures that have been 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 application is limited only by the appended claims.

Claims

1. A rich text processing method in a native application, characterized in that: include: In response to a request to view a schedule page in a native application, requesting schedule description information from an application background of the native application, and obtaining schedule description information corresponding to the schedule page returned by the application background, wherein the schedule description information includes schedule rich text information; In the case where the schedule page is a web page based on Hypertext Markup Language, a rich text editor is called, and the rich text editor performs local rendering processing on the schedule rich text information based on local page resources to obtain rich text rendering data of the schedule page; The rich text editor is a component that implements rich text rendering based on the browser component; The local page resource is a page resource corresponding to the schedule page pre-loaded locally; The schedule rich text information in the schedule page is displayed based on the rich text rendering data.

2. The method according to claim 1, characterized in that The method further comprises: In response to a schedule adding request, switching the schedule page to an input state display; In the case of the input state, in response to input of link information, the rich text editor is called through the bridge object to perform link type analysis on the link information to obtain a target link type corresponding to the link information, and the link information is rendered based on the target link type to obtain link rendering data; The link information is displayed according to the link rendering data.

3. The method according to claim 2, characterized in that In the case of the input state, in response to the input of link information, calling the rich text editor through the bridge object to perform link type analysis on the link information to obtain a target link type corresponding to the link information, and rendering the link information based on the target link type to obtain link rendering data, including: In the case of the input state, in response to the input of the link information, the rich text editor is called by the bridge object to perform link type analysis on the link information to obtain a target link type corresponding to the link information; the target link type includes a document link type; Upon receiving a request from the rich text editor to call back a link document based on the document link type, a link document corresponding to the link information is returned to the rich text editor, so that the rich text editor renders the link document to obtain the link rendering data.

4. The method according to claim 1, characterized in that: The method further comprises: In response to a schedule adding request, switching the schedule page to an input state display; In the case of the input state, in response to an instruction to operate the display style of the input text, calling the rich text editor through the bridge object to render the display style for the input text to obtain style rendering data; The input text is displayed based on the style rendering data.

5. The method according to claim 1, characterized in that The method further comprises: When the native application is started, downloading the local page resource to the local and storing the local page resource; Calling a browser component to read the local page resource into memory; and initializing the usage scenario of the native application according to the usage scenario set by the target account to obtain scene rendering data; the target account is the account that starts the native application; The homepage of the native application is displayed based on the scene rendering data.

6. The method according to claim 1 or 5, characterized in that: The method further comprises: In response to an operation instruction on a page element in the schedule page, the operation instruction is parsed through a bridge object to obtain a native method parameter to be called; The target operation corresponding to the operation instruction is performed on the page element according to the native method parameter.

7. The method according to claim 1, characterized in that The method further includes calling the rich text editor to determine the display size of the schedule rich text information to adapt to the display screen; accordingly, displaying the schedule rich text information in the schedule page based on the rich text rendering data includes: The schedule rich text information in the schedule page is displayed based on the determined display size and the rich text rendering data.

8. The method according to claim 1, characterized in that The rich text editor may be used independently of the schedule page or embedded in the schedule page; accordingly, displaying the schedule rich text information in the schedule page based on the rich text rendering data includes: Displaying the schedule rich text information in the schedule page based on the rich text rendering data in an independent page manner; Alternatively, the schedule rich text information in the schedule page is displayed based on the rich text rendering data in an embedded page manner.

9. A rich text processing device in a native application, characterized in that: include: A page viewing module, configured to, in response to a request to view a schedule page in a native application, request schedule description information from an application background of the native application, and obtain schedule description information corresponding to the schedule page returned by the application background, wherein the schedule description information includes schedule rich text information; A calling module, configured to call a rich text editor when the schedule page is a web page based on Hypertext Markup Language, and have the rich text editor perform local rendering processing on the schedule rich text information based on local page resources to obtain rich text rendering data of the schedule page; The rich text editor is a component that implements rich text rendering based on the browser component; The local page resource is a page resource corresponding to the schedule page pre-loaded locally; A display module is used to display the schedule rich text information in the schedule page based on the rich text rendering data.

10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the rich text processing method in a native application as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the rich text processing method in a native application as described in any one of claims 1 to 8.