Method and device for upgrading multi-version compatible rich text system, equipment and medium

By acquiring the version data and style of the rich text data, rendering and editing it, the compatibility between the historical version data style and the current version data style after the rich text box is upgraded is achieved, thus solving the problem of inconsistent display effects.

CN115543382BActive Publication Date: 2026-02-24CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211249468.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-12
Publication Date
2026-02-24
Estimated Expiration
2042-10-12

AI Technical Summary

Technical Problem

During the upgrade process, existing rich text editors have difficulty maintaining compatibility between historical and current version data styles, resulting in inconsistent display effects.

Method used

By acquiring the version data and style of the rich text data, rendering the data in the current version of the rich text box according to the target style, and receiving the editing processing of the target object, the second version data is determined, thus achieving the compatibility and iterability of the text style.

Benefits of technology

After the rich text box was upgraded, historical rich text data is compatible with the data styles of historical versions and the current version, resolving the issue of inconsistent display effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115543382B_ABST
    Figure CN115543382B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a multi-version compatible rich text system upgrading method and device, equipment and medium, and belongs to the technical field of Internet. The method comprises the following steps: obtaining first rich text data; obtaining first version data and a first style of the first rich text data; rendering the first rich text data in a current version rich text box of a target object page according to the first style; determining a second style according to a default text style of the current version rich text box; receiving a target style selected by the target object from the first style and the second style, and performing editing processing on the first rich text data according to the target style to obtain second rich text data; determining second version data according to the target style, and adding the second version data to a version label of the second rich text data; and saving the second rich text data. The embodiment of the application can make the historical rich text data compatible with the historical version data style and the current version data style after the rich text box is upgraded.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet, and particularly relates to a multi-version compatible rich text system upgrading method and device, equipment and medium. BACKGROUND

[0002] The Multi-function Text Editor is an information organization tool that cannot be lacked in the content management system (CMS) system, the work order system, the process system, the knowledge media and the copywriting system of some new media of the present media. The Multi-function Text Editor often has a kind of innate ability for these content management systems, and for the developers and maintainers of the Multi-function Text Editor, it is not a small request for the development ability and the business understanding ability. Because according to the change of demand, various format requirements and operation requirements will appear continuously, such as in-line code format, support for checked forms and various forms supporting customized formulas.

[0003] There are very much data in enterprises. With the continuous upgrading of the Multi-function Text Editor, it is a great challenge for the development of enterprises to tools that the Multi-function Text Editor is embedded in the Graphical User Interface (GUI) project and the Web project to support the compatibility of old text data and rendering styles and continuously support new formats and styles. At present, the two are often incompatible. SUMMARY

[0004] The main purpose of the embodiment of the present application is to propose a multi-version compatible rich text system upgrading method and device, equipment and medium, which can make the historical rich text data compatible with the historical version data style and the current version data style after the upgrade of the rich text box.

[0005] To achieve the above purpose, the first aspect of the embodiment of the present application proposes a multi-version compatible rich text system upgrading method, which comprises the following steps:

[0006] obtaining first rich text data;

[0007] obtaining first version data and a first style of the first rich text data, wherein the first version data represents the version number of a historical version rich text box, and the first style represents the default text style of the historical version rich text box;

[0008] rendering the first rich text data in a current version rich text box of a target object page according to the first style;

[0009] determining a second style according to the default text style of the current version rich text box;

[0010] Receive the target style selected by the target object from the first style and the second style, and edit the first rich text data according to the target style to obtain the second rich text data;

[0011] The second version data is determined based on the target style, and the second version data is added to the version tag of the second rich text data;

[0012] Save the second rich text data.

[0013] In some embodiments, determining the second version data based on the target style includes:

[0014] If the target style is the first style, the second version data is obtained according to the version number of the historical rich text box;

[0015] If the target style is the second style, the second version data is obtained according to the version number of the current version of the rich text box.

[0016] In some embodiments, obtaining the first version data and the first style of the first rich text data includes:

[0017] Obtain the first version data from the version tag of the first rich text data;

[0018] Determine the first style corresponding to the first version of the data.

[0019] In some embodiments, rendering the first rich text data in the current version of the rich text box of the target object page according to the first style includes:

[0020] Retrieve the first style class object data corresponding to the first style from the server;

[0021] Adjust the text style of the first rich text data according to the first style class object data;

[0022] The first rich text data with adjusted text style is rendered in the current version rich text box of the target object page.

[0023] In some embodiments, after retrieving the first style class object data corresponding to the first style from the server, the method further includes:

[0024] If the first style class object data does not exist on the server, retrieve the second style class object data corresponding to the second style from the server.

[0025] Adjust the text style of the first rich text data according to the second style class object data.

[0026] In some embodiments, the second style class object data is obtained by the following steps:

[0027] In response to the editing operation of the target object, the first style class object data is edited to obtain the second style class object data;

[0028] Save the data of the second style class object to the server.

[0029] In some embodiments, the step of editing the first rich text data according to the target style to obtain the second rich text data includes:

[0030] Retrieve the target style class object data corresponding to the target style from the server;

[0031] Adjust the text style of the first rich text data according to the target style class object data to obtain intermediate rich text data;

[0032] In response to the editing operation of the target object, the intermediate rich text data is edited to obtain the second rich text data.

[0033] To achieve the above objectives, a second aspect of this application provides a multi-version compatible rich text system upgrade apparatus, the apparatus comprising:

[0034] The rich text data acquisition module is used to acquire the first rich text data;

[0035] The version acquisition module is used to acquire the first version data and the first style of the first rich text data. The first version data represents the version number of the historical version rich text box, and the first style represents the default text style of the historical version rich text box.

[0036] The rendering module is used to render the first rich text data in the current version of the rich text box of the target object page according to the first style;

[0037] The second style determination module is used to determine the second style based on the default text style of the current version of the rich text box;

[0038] The editing processing module is used to receive the target style selected by the target object from the first style and the second style, and to edit the first rich text data according to the target style to obtain the second rich text data;

[0039] A version compatibility processing module is used to determine the second version data according to the target style, and add the second version data to the version tag of the second rich text data;

[0040] The data storage module is used to store the second rich text data.

[0041] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the multi-version compatible rich text system upgrade method described in the first aspect.

[0042] To achieve the above objectives, a fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-version compatible rich text system upgrade method described in the first aspect.

[0043] This application proposes a multi-version compatible rich text system upgrade method, apparatus, device, and medium. By acquiring first rich text data, its first version data, and its first style, the version number of the corresponding historical rich text box and its default text style can be obtained. By rendering the first rich text data in the current version rich text box of the target object's page according to the first style, the data style of the historical version rich text box can be made compatible in the current version rich text box. A second style can be determined based on the default text style of the current version rich text box. By receiving the target style selected by the target object from the first and second styles and editing the first rich text data according to the target style to obtain the second rich text data, the compatibility and iterability of the rich text data's text styles can be achieved. The second version data can be determined based on the target style, and adding the second version data to the version tag of the second rich text data can solve the problem of incompatibility of the target style of the second rich text data after a rich text box update. The embodiments of this application enable historical rich text data to be compatible with both historical and current version data styles after a rich text box upgrade. Attached Figure Description

[0044] Figure 1 This is a flowchart of a multi-version compatible rich text system upgrade method provided in an embodiment of this application;

[0045] Figure 2 yes Figure 1 The flowchart of step S600 in the middle;

[0046] Figure 3 yes Figure 1 The flowchart of step S200 in the middle;

[0047] Figure 4 yes Figure 1 The flowchart of step S300 in the process;

[0048] Figure 5 yes Figure 4 A flowchart of another embodiment following step S310;

[0049] Figure 6 yes Figure 4 Flowchart for determining the data of the second style class object in the process;

[0050] Figure 7 yes Figure 1 The flowchart of step S500 in the middle;

[0051] Figure 8 This is a schematic diagram of the structure of the multi-version compatible rich text system upgrade device provided in the embodiments of this application;

[0052] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0054] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0056] First, let's analyze the terms used in this application:

[0057] An iframe is an HTML tag that acts as a document within a document, or a floating frame. The iframe element creates an inline frame (i.e., an inline frame) that contains another document.

[0058] The existing rich text box upgrade process is as follows: When the target object enters the target object page, a rich text box V1 is rendered. The web-side project obtains rich text data D1 via the HTTP protocol. The front-end JavaScript logic, through the DOM manipulation interface, writes the rich text data D1 into the View layer value space variable of the rich text box V1. At this time, the browser renders the rich text data D1 to the target object page through the rendering thread. The target object edits the content of the rich text data D1 in the rich text box V1, and after adjusting the appropriate text, spacing, and other styles S1, it obtains rich text data D2, and then saves the rich text data D2 to the server.

[0059] After the rich text box V1 is upgraded to rich text box V2, some styles and related data for rich text data are optimized (i.e., the default text style of rich text box V2 becomes S2). For example, the spacing between tags p is increased. So when rich text box V2 is opened again, after rich text data D2 is rendered on the rich text box V2 of the target object page, the text style of rich text data D2 will become S2, resulting in a display effect that is inconsistent with the previously saved rich text data D2.

[0060] Based on this, embodiments of this application provide a method, apparatus, device, and medium for upgrading a rich text system that is compatible with multiple versions, enabling historical rich text data to be compatible with both historical and current version data styles after the rich text box is upgraded.

[0061] The multi-version compatible rich text system upgrade method, apparatus, device, and medium provided in this application are specifically described through the following embodiments. First, the multi-version compatible rich text system upgrade method in this application is described.

[0062] The multi-version compatible rich text system upgrade method provided in this application relates to the field of Internet technology. This multi-version compatible rich text system upgrade method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the multi-version compatible rich text system upgrade method, but is not limited to the above forms.

[0063] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0064] Figure 1 This is an optional flowchart of the multi-version compatible rich text system upgrade method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S100 to S700.

[0065] Step S100: Obtain the first rich text data;

[0066] Step S200: Obtain the first version data and the first style of the first rich text data. The first version data represents the version number of the historical version rich text box, and the first style represents the default text style of the historical version rich text box.

[0067] Step S300: Render the first rich text data in the current version rich text box of the target object page according to the first style;

[0068] Step S400: Determine the second style based on the default text style of the current version of the rich text box;

[0069] Step S500: Receive the target style selected by the target object from the first style and the second style, and edit the first rich text data according to the target style to obtain the second rich text data;

[0070] Step S600: Determine the second version data according to the target style, and add the second version data to the version tag of the second rich text data;

[0071] Step S700: Save the second rich text data.

[0072] Steps S100 to S700 of this application embodiment involve obtaining first rich text data, first version data of the first rich text data, and a first style. This allows for the acquisition of the version number of the historical version rich text box corresponding to the first rich text data, as well as the default text style of the historical version rich text box. By rendering the first rich text data in the current version rich text box of the target object page according to the first style, the data style of the historical version rich text box can be made compatible in the current version rich text box. A second style can be determined based on the default text style of the current version rich text box. By receiving the target style selected by the target object from the first and second styles, and editing the first rich text data according to the target style to obtain the second rich text data, compatibility and iterability of the rich text data's text style can be achieved. The second version data can be determined based on the target style. Adding the second version data to the version tag of the second rich text data can solve the problem of incompatibility of the target style of the second rich text data after a rich text box update. This application embodiment enables historical rich text data to be compatible with both historical and current version data styles after a rich text box upgrade.

[0073] In step S100 of some embodiments, the first rich text data is obtained from the server by the Web client through the HTTP protocol.

[0074] In step S200 of some embodiments, the first version data is the version tag of the first rich text data that was added after the first rich text data was last edited. After the first rich text data is retrieved again, the first version data can be obtained from the version tag of the first rich text data. The first version data represents the version number of the historical version of the rich text box, while the first style represents the default text style of the historical version of the rich text box. Therefore, the corresponding first style can be determined based on the first version data, so that the data style of the historical version of the rich text box can be compatible in the current version of the rich text box.

[0075] In step S300 of some embodiments, the first style includes types such as font, color, character spacing, and line spacing. The specific style type can be determined according to actual needs and should not be regarded as a limitation of this application. Before the rich text box rendering mechanism, a strategy function is written with the first version data as input to obtain the first style class object data corresponding to the first style. Through lazy loading, it is written to the corresponding rich text root tag. When the current version of the rich text box is rendered, the first style class object data will be obtained and written into the DOM tree for further rendering. Thus, the first rich text data is rendered in the current version of the rich text box on the target object page according to the first style class object data.

[0076] In step S500 of some embodiments, when editing the first rich text data, in response to the target object's selection operation, a target style is selected from the first style and the second style. When the target object switches styles, the text style of the first rich text data changes in real time, and the target style is determined automatically based on the target object's satisfaction level. After determining the target style, the target style class object data corresponding to the target style is retrieved from the server. Then, the text style of the first rich text data is adjusted according to the target style class object data to obtain intermediate rich text data. In response to the target object's editing operation, the intermediate rich text data is edited to obtain the second rich text data. If the target object does not select to switch target styles, the first style is the default target style; if the target object determines the second style as the target style, the first style that has not been applied is also discarded, thus achieving sequential updates. It should be noted that the discarding mentioned above only means that the text style of the second rich text data is saved as the second style; the first style class object data corresponding to the first style is still stored on the server.

[0077] In step S600 of some embodiments, the target object can actively select a text style. If the final selected target style is the first style, then the text style of the final second rich text data will be the first style. The first style is the default text style of the historical version of the rich text box. In order to maintain the text style of the second rich text data as the first style when it is acquired and rendered again, the second version data is obtained according to the version number of the historical version of the rich text box. If the target style is the second style, then the text style of the final second rich text data will be the second style. The second style is the default text style of the current version of the rich text box. In order to maintain the text style of the second rich text data as the second style when it is acquired and rendered again, the second version data is obtained according to the version number of the current version of the rich text box. After obtaining the second version data, the second version data is added to the version tag of the second rich text data, which can solve the problem of incompatibility of the target style of the second rich text data after the rich text box is updated again.

[0078] In step S700 of some embodiments, the second rich text data is saved to the server so that the web application can retrieve the second rich text data from the server via the HTTP protocol the next time.

[0079] Please see Figure 2 In some embodiments, step S600 may include, but is not limited to, steps S610 to S620:

[0080] Step S610: If the target style is the first style, obtain the second version data based on the version number of the historical rich text box.

[0081] Step S620: If the target style is the second style, obtain the second version data according to the version number of the current rich text box.

[0082] In steps S610 to S620 of some embodiments, the target object can actively select a text style. If the final selected target style is the first style, then the text style of the final second rich text data will be the first style. The first style is the default text style of the historical version of the rich text box. In order to maintain the text style of the second rich text data as the first style when it is acquired and rendered again, the second version data is obtained according to the version number of the historical version of the rich text box. If the target style is the second style, then the text style of the final second rich text data will be the second style. The second style is the default text style of the current version of the rich text box. In order to maintain the text style of the second rich text data as the second style when it is acquired and rendered again, the second version data is obtained according to the version number of the current version of the rich text box. After obtaining the second version data, the second version data is added to the version tag of the second rich text data, which can solve the problem of incompatibility of the target style of the second rich text data after the rich text box is updated again.

[0083] Please see Figure 3 In some embodiments, step S200 may include, but is not limited to, steps S210 to S220:

[0084] Step S210: Obtain the first version data from the version tag of the first rich text data;

[0085] Step S220: Determine the first style corresponding to the first version data.

[0086] In step S210 of some embodiments, the first version data is the version tag of the first rich text data that was added after the first rich text data was edited last time. After the first rich text data is obtained again, the first version data can be obtained from the version tag of the first rich text data.

[0087] In step S220 of some embodiments, the first version data represents the version number of the historical version rich text box, and the first style represents the default text style of the historical version rich text box. Therefore, the corresponding first style can be determined according to the first version data, so that the data style of the historical version rich text box can be compatible in the current version rich text box.

[0088] Please see Figure 4 In some embodiments, step S300 may include, but is not limited to, steps S310 to S330:

[0089] Step S310: Retrieve the first style class object data corresponding to the first style from the server.

[0090] Step S320: Adjust the text style of the first rich text data according to the first style class object data;

[0091] Step S330: Render the first rich text data after adjusting the text style in the current version rich text box of the target object page.

[0092] In step S310 of some embodiments, for different versions of the rich text box, the style class object data corresponding to the default text style is incrementally modified according to the corresponding version. The style class object data corresponding to the default text style of each version of the rich text box is saved separately on the server side, ensuring that even if the entire version of the rich text box is taken offline and replaced by another rich text system, the text style of the historical rich text data can still be compatible with the historical rich text data when it is edited again through compatibility development.

[0093] In step S320 of some embodiments, the first style class object data includes data such as font, color, character spacing, and line spacing. The specific style class object data can be determined according to actual needs and should not be regarded as a limitation of this application.

[0094] In step S330 of some embodiments, before the rich text box rendering mechanism, a strategy function is written with the first version data as input to obtain the first style class object data corresponding to the first style. The data is then written to the corresponding rich text root tag through lazy loading. When the current version of the rich text box is rendered, the first style class object data will be obtained and written into the DOM tree for further rendering, thereby rendering the first rich text data after adjusting the text style in the current version of the rich text box of the target object page.

[0095] Please see Figure 5 Following step S310 in some embodiments, the multi-version compatible rich text system upgrade method further includes, but is not limited to, steps S301 to S302:

[0096] Step S301: If the first style class object data does not exist on the server, retrieve the second style class object data corresponding to the second style from the server.

[0097] Step S302: Adjust the text style of the first rich text data according to the second style class object data.

[0098] In steps S301 to S302 of some embodiments, when the first rich text data is being rendered for the first time, if there is no corresponding first style class object data for the first style, the strategy function will take the style class object data corresponding to the latest version, i.e., the second style class object data corresponding to the second style, when constructing, dynamically construct the style class object data of the first rich text data, and adjust the text style of the first rich text data according to the second style class object data, so as to render the first rich text data after adjusting the text style in the current version rich text box of the target object page.

[0099] Please see Figure 6 The second style class object data is obtained from steps S303 to S304, but is not limited to steps S303 to S304.

[0100] Step S303: In response to the editing operation of the target object, the data of the first style class object is edited to obtain the data of the second style class object;

[0101] Step S304: Save the second style class object data to the server.

[0102] In step S303 of some embodiments, for different versions of the rich text box, the style class object data corresponding to the default text style is incrementally modified according to the corresponding version. The simplest and most direct way is to modify it based on the original, that is, to edit the first style class object data to obtain the second style class object data. It should be noted that it is also possible to redefine it completely without modifying the first style class object data, which should not be regarded as a limitation of this application.

[0103] In step S304 of some embodiments, the style class object data corresponding to the default text style of each version of the rich text box is saved separately to the server side, ensuring that even if the rich text box of this version is taken offline and replaced by other rich text systems, the text style of the historical rich text data can be edited again through compatibility development to ensure compatibility with the historical rich text data.

[0104] Please see Figure 7 In some embodiments, step S500 may include, but is not limited to, steps S510 to S530:

[0105] Step S510: Retrieve the target style class object data corresponding to the target style from the server.

[0106] Step S520: Adjust the text style of the first rich text data according to the target style class object data to obtain the intermediate rich text data;

[0107] Step S530: In response to the editing operation of the target object, the intermediate rich text data is edited to obtain the second rich text data.

[0108] In step S510 of some embodiments, for different versions of the rich text box, the style class object data corresponding to the default text style is incrementally modified according to the corresponding version. The style class object data corresponding to the default text style of each version of the rich text box is saved separately on the server side, ensuring that even if the entire version of the rich text box is taken offline and replaced by another rich text system, the text style of the historical rich text data can still be compatible with the historical rich text data when it is edited again through compatibility development.

[0109] In steps S520 to S530 of some embodiments, when editing the first rich text data, in response to the target object's selection operation, a target style is selected from the first style and the second style. When the target object switches styles, the text style of the first rich text data changes in real time, and the target object decides on the target style based on its own satisfaction. After determining the target style, the text style of the first rich text data is adjusted according to the target style class object data to obtain intermediate rich text data. In response to the target object's editing operation, the intermediate rich text data is edited to obtain the second rich text data, which is then saved. If the target object does not select to switch target styles, the default target style is the first style; if the target object determines the second style as the target style, the first style that has not been applied will also be discarded, thus achieving sequential updates. It should be noted that the discarding mentioned above only means that the text style of the second rich text data is saved as the second style; the first style class object data corresponding to the first style is still stored on the server side.

[0110] In order to better demonstrate the advantages of the multi-version compatible rich text system upgrade method of this application embodiment, a specific example is given below. The multi-version compatible rich text system upgrade method of this application embodiment includes, but is not limited to, the following steps:

[0111] Step S100: Obtain the first rich text data;

[0112] Step S210: Obtain the first version data from the version tag of the first rich text data;

[0113] Step S220: Determine the first style corresponding to the first version data;

[0114] Step S310: Retrieve the first style class object data corresponding to the first style from the server.

[0115] Step S320: Adjust the text style of the first rich text data according to the first style class object data;

[0116] Step S301: If the first style class object data does not exist on the server, retrieve the second style class object data corresponding to the second style from the server.

[0117] Step S302: Adjust the text style of the first rich text data according to the second style class object data;

[0118] Step S330: Render the first rich text data after adjusting the text style in the current version rich text box of the target object page;

[0119] Step S400: Determine the second style based on the default text style of the current version of the rich text box;

[0120] Step S510: Retrieve the target style class object data corresponding to the target style from the server.

[0121] Step S520: Adjust the text style of the first rich text data according to the target style class object data to obtain the intermediate rich text data;

[0122] Step S530: In response to the editing operation of the target object, the intermediate rich text data is edited to obtain the second rich text data;

[0123] Step S610: If the target style is the first style, obtain the second version data based on the version number of the historical rich text box.

[0124] Step S620: If the target style is the second style, obtain the second version data according to the version number of the current rich text box;

[0125] Step S700: Save the second rich text data.

[0126] The multi-version compatible rich text system upgrade method, apparatus, device, and medium provided in this application embodiment obtains first rich text data, and obtains first version data and first style of the first rich text data. This allows for the acquisition of the version number of the corresponding historical version rich text box and the default text style of the historical version rich text box. By rendering the first rich text data in the current version rich text box of the target object page according to the first style, the data style of the historical version rich text box can be made compatible in the current version rich text box. A second style can be determined based on the default text style of the current version rich text box. By receiving the target style selected by the target object from the first and second styles, and editing the first rich text data according to the target style to obtain the second rich text data, the compatibility and iterable coexistence of the rich text data's text style can be achieved. The second version data can be determined based on the target style, and adding the second version data to the version tag of the second rich text data can solve the problem of incompatibility of the target style of the second rich text data after a rich text box update. This application embodiment enables historical rich text data to be compatible with both historical version data styles and current version data styles after a rich text box upgrade.

[0127] Please see Figure 8 This application also provides a multi-version compatible rich text system upgrade apparatus, which can implement the above-mentioned multi-version compatible rich text system upgrade method. The apparatus includes:

[0128] Rich text data acquisition module 801 is used to acquire the first rich text data;

[0129] Version acquisition module 802 is used to acquire the first version data and the first style of the first rich text data. The first version data represents the version number of the historical version rich text box, and the first style represents the default text style of the historical version rich text box.

[0130] Rendering module 803 is used to render the first rich text data in the current version of the rich text box of the target object page according to the first style;

[0131] The second style determination module 804 is used to determine the second style based on the default text style of the current version of the rich text box;

[0132] The editing processing module 805 is used to receive the target style selected by the target object from the first style and the second style, and to edit the first rich text data according to the target style to obtain the second rich text data.

[0133] Version compatibility processing module 806 is used to determine the second version data according to the target style and add the second version data to the version tag of the second rich text data;

[0134] Data storage module 807 is used to store the second rich text data.

[0135] The first rich text data is obtained from the server via HTTP in the web application. The first version data is the version tag added to the first rich text data after it was last edited. When the first rich text data is obtained again, the first version data can be retrieved from the version tag. The first version data represents the version number of the historical rich text box, while the first style represents the default text style of the historical rich text box. Therefore, the corresponding first style can be determined based on the first version data, thus ensuring that the data style of the historical rich text box is compatible in the current version of the rich text box.

[0136] The first style includes types such as font, color, character spacing, and line spacing. The specific style type can be determined according to actual needs and should not be regarded as a limitation of this application. Before the rich text box rendering mechanism, a strategy function was written, which takes the first version data as input, obtains the first style class object data corresponding to the first style, and writes it to the corresponding rich text root tag through lazy loading. When the current version of the rich text box is rendered, it will obtain the first style class object data and write it into the DOM tree for further rendering. Thus, the first rich text data is rendered in the current version of the rich text box on the target object page according to the first style class object data.

[0137] For different versions of rich text boxes, the style class object data corresponding to the default text style will be incrementally modified accordingly. The style class object data corresponding to the default text style of each version of the rich text box will be saved separately on the server side. This ensures that even if the entire version of the rich text box is taken offline and replaced by another rich text system, the text style of the historical rich text data can still be edited again through compatibility development.

[0138] When editing the first rich text data, in response to the target object's selection operation, a first style and a second style are chosen as the target style. As the target object switches styles, the text style of the first rich text data changes in real time, automatically determining the target style based on the target object's satisfaction. After determining the target style, the target style class object data corresponding to the target style is retrieved from the server. Then, the text style of the first rich text data is adjusted according to the target style class object data to obtain intermediate rich text data. In response to the target object's editing operation, the intermediate rich text data is edited to obtain the second rich text data. If the target object does not choose to switch target styles, the first style is the default target style; if the target object determines the second style as the target style, the first style that was not applied is also discarded, thus achieving sequential updates. It should be noted that the discarding mentioned above only means that the text style of the second rich text data is saved as the second style; the first style class object data corresponding to the first style is still stored on the server.

[0139] The target object can actively select a text style. If the final selected target style is the first style, then the text style of the final second rich text data will be the first style. The first style is the default text style of the historical rich text box. To ensure that the text style of the second rich text data remains the first style when it is fetched and rendered again, the second version data is obtained based on the version number of the historical rich text box. If the target style is the second style, then the final second rich text data will have the second style. The second style is the default text style of the current rich text box. To ensure that the text style of the second rich text data remains the second style when it is fetched and rendered again, the second version data is obtained based on the version number of the current rich text box. After obtaining the second version data, adding the second version data to the version tag of the second rich text data can resolve the issue of incompatibility of the target style of the second rich text data after subsequent rich text box updates.

[0140] The second rich text data is saved to the server so that the web application can retrieve it from the server via the HTTP protocol the next time.

[0141] The multi-version compatible rich text system upgrade device of this application embodiment acquires first rich text data through a rich text data acquisition module 801, and acquires first version data and a first style of the first rich text data through a version acquisition module 802. This allows obtaining the version number of the corresponding historical version rich text box and the default text style of the historical version rich text box. A rendering module 803 renders the first rich text data in the current version rich text box of the target object page according to the first style, ensuring compatibility of the data styles of historical version rich text boxes in the current version rich text box. A second style determination module 804 determines a second style based on the default text style of the current version rich text box. An editing processing module 805 receives the target style selected by the target object from the first and second styles, and edits the first rich text data according to the target style to obtain the second rich text data, achieving both text style compatibility and iterability of the rich text data. A version compatibility processing module 806 determines the second version data according to the target style and adds the second version data to the version tag of the second rich text data, resolving the problem of incompatibility of the target style of the second rich text data after a subsequent update of the rich text box. The embodiments of this application enable that, after the rich text box is upgraded, the historical rich text data is compatible with the historical version data style and the current version data style.

[0142] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned multi-version compatible rich text system upgrade method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0143] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0144] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0145] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 to execute the multi-version compatible rich text system upgrade method of the embodiments of this application.

[0146] The input / output interface 903 is used to implement information input and output;

[0147] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0148] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);

[0149] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0150] This application embodiment also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described multi-version compatible rich text system upgrade method.

[0151] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0152] The multi-version compatible rich text system upgrade method, apparatus, device, and medium provided in this application embodiment obtains first rich text data, and obtains first version data and first style of the first rich text data. This allows for the acquisition of the version number of the corresponding historical version rich text box and the default text style of the historical version rich text box. By rendering the first rich text data in the current version rich text box of the target object page according to the first style, the data style of the historical version rich text box can be made compatible in the current version rich text box. A second style can be determined based on the default text style of the current version rich text box. By receiving the target style selected by the target object from the first and second styles, and editing the first rich text data according to the target style to obtain the second rich text data, the compatibility and iterable coexistence of the rich text data's text style can be achieved. The second version data can be determined based on the target style, and adding the second version data to the version tag of the second rich text data can solve the problem of incompatibility of the target style of the second rich text data after a rich text box update. This application embodiment enables historical rich text data to be compatible with both historical version data styles and current version data styles after a rich text box upgrade.

[0153] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0154] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0155] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0156] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0157] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0158] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0159] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0160] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0161] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0162] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0163] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for upgrading a multi-version compatible rich text system, characterized in that, The method includes: Retrieve the first rich text data; Obtain the first version data and the first style of the first rich text data. The first version data represents the version number of the historical version rich text box, and the first style represents the default text style of the historical version rich text box. Render the first rich text data in the current version of the rich text box on the target object page according to the first style; The second style is determined based on the default text style of the current version of the rich text box; Receive the target style selected by the target object from the first style and the second style; Retrieve the target style class object data corresponding to the target style from the server; Adjust the text style of the first rich text data according to the target style class object data to obtain intermediate rich text data; In response to the editing operation of the target object, the intermediate rich text data is edited to obtain the second rich text data; The second version data is determined based on the target style, and the second version data is added to the version tag of the second rich text data; Save the second rich text data.

2. The method according to claim 1, characterized in that, The step of determining the second version data based on the target style includes: If the target style is the first style, the second version data is obtained according to the version number of the historical rich text box; If the target style is the second style, the second version data is obtained according to the version number of the current version of the rich text box.

3. The method according to claim 1, characterized in that, The step of obtaining the first version data and the first style of the first rich text data includes: Obtain the first version data from the version tag of the first rich text data; Determine the first style corresponding to the first version of the data.

4. The method according to claim 1 or 2, characterized in that, The step of rendering the first rich text data in the current version of the rich text box on the target object page according to the first style includes: Retrieve the first style class object data corresponding to the first style from the server; Adjust the text style of the first rich text data according to the first style class object data; The first rich text data with adjusted text style is rendered in the current version rich text box of the target object page.

5. The method according to claim 4, characterized in that, After retrieving the first style class object data corresponding to the first style from the server, the method further includes: If the first style class object data does not exist on the server, retrieve the second style class object data corresponding to the second style from the server. Adjust the text style of the first rich text data according to the second style class object data.

6. The method according to claim 5, characterized in that, The second style class object data is obtained through the following steps: In response to the editing operation of the target object, the first style class object data is edited to obtain the second style class object data; Save the data of the second style class object to the server.

7. A multi-version compatible rich text system upgrade device, characterized in that, The device includes: The rich text data acquisition module is used to acquire the first rich text data; The version acquisition module is used to acquire the first version data and the first style of the first rich text data. The first version data represents the version number of the historical version rich text box, and the first style represents the default text style of the historical version rich text box. The rendering module is used to render the first rich text data in the current version of the rich text box of the target object page according to the first style; The second style determination module is used to determine the second style based on the default text style of the current version of the rich text box; The editing processing module is used to receive the target style selected by the target object from the first style and the second style, retrieve the target style class object data corresponding to the target style from the server, adjust the text style of the first rich text data according to the target style class object data to obtain intermediate rich text data, and in response to the editing operation of the target object, perform editing processing on the intermediate rich text data to obtain the second rich text data. A version compatibility processing module is used to determine the second version data according to the target style, and add the second version data to the version tag of the second rich text data; The data storage module is used to store the second rich text data.

8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the multi-version compatible rich text system upgrade method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the multi-version compatible rich text system upgrade method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Rich text editing method and system

    CN105843787A

  • Method and system for inserting and viewing dynamic content

    CN107229626A