Courseware beautifying processing method and device and electronic equipment

By converting the courseware to json format and automatically beautify it, the existing courseware beautification method is solved, and efficient and automated courseware beautification effect is achieved.

CN119808722APending Publication Date: 2025-04-11GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311307933.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-10
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing courseware beautification methods consume a lot of time and rely on labor, resulting in inefficiency and different beautification effects.

Method used

By converting the courseware to json format, preprocessing, adjusting the background image, collecting and analyzing the courseware page information, and beautifying the courseware file according to this information, and finally saving the beautified courseware file in xml format.

Benefits of technology

The automated courseware beautification process has been realized, which significantly reduces the time and manual participation required for beautification, and improves the aesthetics and orderliness of the courseware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808722A_ABST
    Figure CN119808722A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a courseware beautifying processing method and device and electronic equipment. According to the method, courseware is converted into a courseware file which is more convenient to process in a json format, the courseware file is preprocessed, then a background image of a courseware page in the courseware file is adjusted, courseware page information of the courseware page is automatically collected and analyzed, and the courseware page is beautified according to the courseware page information, so that the courseware page is beautified. According to the method, the courseware page looks more organized and layered, then the beautified courseware file is post-processed and stored as the xml file, in the process, a teacher only needs to provide the courseware in the original xml format, courseware beautification can be automatically completed, operation is easy, the requirements for courseware beautification experience and design understanding of the teacher are not high, and the method is suitable for popularization and application. And popularization and use are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a courseware beautification processing method, device and electronic equipment. Background Art

[0002] With the development of the Internet, teachers' lesson preparation has become more intelligent. For example, some slide courseware is used to guide teaching. A high-quality courseware not only needs to have rigorous course design and high-quality course content, but also reasonable typesetting, suitable fonts and interesting pictures can help students concentrate and improve classroom efficiency. At present, the production methods of slide courseware include teachers' independent production and teachers' selection of different courseware pages from different courseware to form a complete courseware. After making a courseware, it is usually necessary to beautify the courseware. The current courseware beautification method is usually manual, which not only consumes a lot of time, but also different people have different understandings of beautification. It requires considerable courseware production experience, otherwise it is difficult to beautify a beautiful courseware. Summary of the invention

[0003] The implementation method of the present application mainly solves the technical problem that the existing courseware beautification method consumes a lot of time.

[0004] In order to solve the above technical problems, a technical solution adopted in the implementation mode of the present application is: to provide a courseware beautification processing method, comprising:

[0005] Convert the courseware into a courseware file in json format and preprocess the courseware file;

[0006] Adjust the background image of the courseware page in the courseware file;

[0007] Collect and analyze courseware page information of courseware pages;

[0008] Beautify the courseware page according to the courseware page information;

[0009] Post-process the beautified courseware file and save it as an XML file.

[0010] Optionally, the preprocessing of the courseware file includes:

[0011] Mark and avoid special courseware pages, which are courseware pages that do not participate in beautification processing;

[0012] Adding page categories to the courseware page, wherein the page categories include home page, last page or content page;

[0013] The elements in the courseware page are numbered.

[0014] Optionally, adjusting the background image of a courseware page in the courseware file includes:

[0015] Select the background image that appears most frequently on the first page, last page, or content page as the background image for all courseware pages, or;

[0016] Select the background image that appears most frequently in the content pages as the background image for all content pages, and select the background image for the first or last page as the background image for the first and last pages.

[0017] Optionally, the collecting and analyzing the courseware page information of the courseware page includes:

[0018] Get the location information and content information of the text box in each courseware page;

[0019] analyzing the location information and the content information to screen out candidate titles;

[0020] The main title is determined according to the number of characters, font size and symbols of the candidate titles.

[0021] Optionally, the obtaining of the position information and content information of the text box in each courseware page includes:

[0022] Obtaining the text content of each text box in the courseware page as content information;

[0023] Get the bbox(x, y, w, h) parameters of the text box as position information, where x is the horizontal coordinate of the upper left corner of the text box, y is the vertical coordinate of the upper left corner of the text box, w is the horizontal length of the text box, and h is the vertical length of the text box.

[0024] Optionally, the analyzing the location information and the content information to screen out candidate titles includes:

[0025] The text box with less words than the preset title word count and the smallest y value is used as the top text box;

[0026] Traverse all text boxes on the current courseware page;

[0027] If the difference between the y value of the text box and the y value of the top text box is greater than a preset difference, it is considered that the text box is not a candidate title.

[0028] Optionally, the analyzing the location information and the content information to screen out candidate titles includes:

[0029] Traverse all text boxes on the current courseware page;

[0030] Calculate the vertical overlap between the text box and the adjacent text box in combination with the h value;

[0031] Determine whether the vertical overlap is less than a first preset threshold, and if so, use the text box as a candidate title;

[0032] If not, determining whether there are at least two adjacent text boxes whose corresponding vertical overlap is less than a second preset threshold, and if so, considering that the text box is not a candidate title, wherein the second preset threshold is greater than the first preset threshold;

[0033] If not, then the horizontal overlap between the text box and the adjacent text box is calculated in combination with the w value;

[0034] Determine whether the horizontal overlap is less than a third preset threshold, and if so, use the text box as a candidate title;

[0035] If not, determine whether the number of text words in the adjacent text box below the text box is greater than the preset number of text words. If so, use the text box as a candidate title.

[0036] Optionally, determining the main title according to the text, font size and symbols of the candidate title includes:

[0037] Calculating a length score according to the absolute value of the difference between the number of words in the candidate title and the standard number of words, wherein the larger the absolute value of the difference is, the lower the length score is;

[0038] Calculating a font size score according to a difference between the font size of the candidate title and the standard font size, wherein the larger the difference is, the higher the font size score is;

[0039] Calculating a symbol score according to the number of symbols in the candidate title, wherein the greater the number of symbols, the lower the symbol score;

[0040] The sum of the length score, the font size score and the symbol score is calculated, and the candidate title corresponding to the largest sum is recorded as the large title.

[0041] Optionally, the collecting and analyzing the courseware page information of the courseware page further includes: determining a secondary title according to the content information, wherein the determining the secondary title according to the content information includes:

[0042] The text box with less words than the preset title word count and a number at the beginning of the sentence or a colon or question mark at the end of the sentence is used as a secondary title;

[0043] The text box with more words in the content information on each page of the courseware is used as the main text;

[0044] It is determined whether the similarity between the text box and the text is less than a fourth preset threshold; if so, the text box is used as a secondary title.

[0045] Optionally, the beautifying the courseware page according to the courseware page information includes:

[0046] If the courseware page contains special elements, the font and size of the text box are beautified;

[0047] If the courseware page does not contain a template, the courseware template is matched according to the features of the courseware page, wherein the features include text features, picture features and layout features.

[0048] Optionally, matching the courseware template according to the feature of the courseware page includes:

[0049] Analyze the number of main headings and sub-headings contained in the courseware page to obtain the text features;

[0050] Analyze whether there is any irrelevant illustration on the courseware page to obtain the image feature, and if so, delete the irrelevant illustration;

[0051] Analyzing the positional relationship of text boxes in the courseware page to obtain the layout features;

[0052] Matching a courseware template according to the feature, and if a courseware template is matched, beautifying the courseware page according to the courseware template;

[0053] If no courseware template is found, the font and size of the text box will be beautified.

[0054] Optionally, the post-processing of the beautified courseware file and saving it as an XML file includes:

[0055] Adjusting the order of elements according to the element numbers of the courseware page;

[0056] Deleting the element number;

[0057] The beautified json format data is converted into xml format and saved as an xml file.

[0058] In order to solve the above technical problems, another technical solution adopted in the embodiment of the present application is to provide a courseware beautification processing device, comprising:

[0059] A preprocessing module, used for converting the courseware into a courseware file in json format and preprocessing the courseware file;

[0060] A background adjustment module, used for adjusting the background image of the courseware page in the courseware file;

[0061] A courseware analysis module, used for collecting and analyzing courseware page information of courseware pages;

[0062] A beautification processing module, used for beautifying the courseware page according to the courseware page information;

[0063] The post-processing module is used to post-process the beautified courseware files and save them as XML files.

[0064] In order to solve the above technical problems, another technical solution adopted in the embodiment of the present application is: to provide an electronic device, including:

[0065] At least one processor and a memory, wherein a program is stored in the memory. When the program is executed by the at least one processor, the program enables the electronic device to execute the above-mentioned courseware beautification processing method.

[0066] Different from the related art, the embodiment of the present application provides a courseware beautification processing method, device and electronic device. The method converts the courseware into a courseware file in a json format that is more convenient to process, pre-processes the courseware file, and then adjusts the background image of the courseware page in the courseware file, automatically collects and analyzes the courseware page information of the courseware page, and beautifies the courseware page according to the courseware page information, so that the courseware page appears more organized and more layered, and then post-processes the beautified courseware file and saves it as an xml file. The process only requires the teacher to provide the original xml format courseware, and the courseware beautification can be automatically completed. It is not only simple to operate, but also does not require the teacher's own courseware beautification experience and design understanding, and is suitable for promotion and use. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0068] Figure 1 It is a flow chart of a courseware beautification processing method provided in an embodiment of the present application;

[0069] Figure 2 It is a structural schematic diagram of a courseware beautification processing device provided in an embodiment of the present application;

[0070] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0072] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device schematic diagram or the order in the flow chart.

[0073] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.

[0074] The embodiment of the present application provides a courseware beautification method to solve the shortcomings of the existing courseware beautification methods. Specifically, the existing courseware beautification methods are usually mainly manual, which not only consumes a lot of time, but also different people have different understandings of beautification, and requires considerable courseware production experience. Otherwise, it is difficult to beautify a beautiful and practical courseware. Based on this, the embodiment of the present application proposes the following solution:

[0075] This application embodiment is explained using Chinese courseware as an example. Figure 1 The present application embodiment provides a courseware beautification processing method, including:

[0076] S11, convert the courseware into a courseware file in json format, and pre-process the courseware file. It should be noted that xml, as a meta-markup language, allows program developers to formulate markup languages ​​suitable for the actual needs of various industries according to the rules provided by it. Based on its versatility, many courseware production platforms currently generate courseware that supports xml format, such as seewo whiteboard. In the embodiment of this application, seewo whiteboard is taken as an example. Suppose that a teacher makes a courseware through seewo whiteboard, and it is currently necessary to beautify the courseware. First, the courseware is formatted and then the courseware file is pre-processed. In the embodiment of this application, the courseware xml file is converted into json format content. json, as a lightweight data exchange format, is easy to read and write and occupies little bandwidth, and supports multiple languages ​​such as C; C#; ColdFusion; Java; Perl; PHP; Python; Ruby, etc., which is convenient for server-side parsing.

[0077] Specifically, preprocessing the courseware file includes:

[0078] S111, mark and avoid special courseware pages, which are courseware pages that do not participate in beautification. When converting the format of the courseware, the category of each courseware page can be identified. For example, in order to facilitate the activity page for classroom interaction between teachers and students, this type of courseware page has a field marked as activity, and these courseware pages belong to special courseware pages that do not need to beautify. In some embodiments, when making courseware in XML format, the teacher will mark these courseware pages that do not need to beautify. When the marked field is identified during the format conversion process, these special courseware pages can be automatically identified and eliminated so that they do not participate in the beautification process later.

[0079] S112, adding page categories to the courseware page, the page categories including home page, end page or content page. Usually, the text and picture content of the home page and the end page is less, while the text and picture content of the content page is more. Based on this, in the courseware beautification processing method provided in the embodiment of the present application, the division of the home page, the end page and the content page is mainly used to beautify the beautiful scenery of the courseware.

[0080] S113, elements in the courseware page are numbered. In some cases, in order to achieve a better classroom demonstration effect, teachers may display some text boxes or picture frames in a superimposed manner in the order of display time when making teaching courseware. In this case, elements in each page of courseware pages can be numbered, so that the element order of the courseware page can be restored according to the element number after the courseware is beautified, so as to avoid the beautification process changing the element order to destroy the classroom demonstration effect. For example, there are element 1 (text box), element 2 (a certain symbol) and element 3 (picture frame) in a page of courseware page. It is assumed that the display order arranged according to time is: first display element 1 (text box) in the upper half of the display interface, then display element 2 (a certain symbol) in the lower half of the interface, and then display element 3 (picture frame) in the upper half of the display interface to cover element 1 (text box). Based on this, the courseware beautification processing method provided in the embodiment of the present application needs to be numbered for these three elements, so as to facilitate the subsequent beautification process to restore the element order after the end, so as to avoid the situation that the order of the elements is adjusted in a disorderly manner during the beautification process, resulting in an impact on the classroom demonstration effect.

[0081] It is understandable that when making XML courseware, the elements contained in each page of the courseware will be marked in the XML file, such as text boxes, picture boxes, special symbols (such as arrows) or shapes. When converting to JSON format courseware, these elements will also be read, which is convenient for subsequent courseware beautification.

[0082] S12, adjust the background image of the courseware page in the courseware file. According to the division of the home page, the last page and the content page in the above steps, the following background image selection modes are provided in the embodiment of the present application: Mode 1: Get the background image of the home page, and use the background image of the home page as the background image of all courseware pages; Mode 2: Select the background image of the last page, and use the background image of the last page as the background image of all courseware pages; Mode 3: Select the background image that appears most times in all courseware pages, and use it as the background image of all courseware pages; Mode 4: Select the background image that appears most times in the content page as the background image of all content pages, and select the background image of the home page or the last page as the background image of the home page and the last page. After selecting the background image according to any of the above modes, traverse all courseware pages and replace the background image. Users can pre-set or independently select the background image selection mode according to actual needs.

[0083] S13, collecting and analyzing the courseware page information of the courseware page. Specifically, the collecting and analyzing the courseware page information of the courseware page includes:

[0084] S131, obtain the position information and content information of the text box in each courseware page. In the process of traversing all courseware pages, obtain the text content of each text box in the courseware page as content information, and the text content includes the number of words, font and symbol information. Obtain the bbox (x, y, w, h) parameters of the text box as position information, wherein x is the horizontal coordinate of the upper left corner of the text box, y is the vertical coordinate of the upper left corner of the text box, w is the horizontal length of the text box, and h is the vertical length of the text box. In this way, the information of all text boxes in the courseware page can be obtained, which is convenient for the subsequent selection of titles, and then convenient for typesetting and beautification of the format.

[0085] S132. Analyze the location information and the content information to filter out candidate titles. Taking the beautification of Chinese courseware as an example in the embodiment of the present application, the process of filtering titles is explained below. In some embodiments, if it is for different types of courseware, the title filtering conditions can be adjusted appropriately. First, the text box with less than the preset title word count, for example, less than 10 words, and the smallest y value is used as the top text box, recorded as top_text. Taking the beautification of Chinese courseware as an example, the embodiment of the present application provides several title filtering methods.

[0086] Combine the top text box to preliminarily filter out some text boxes. Traverse all text boxes on the current courseware page. In the current courseware page, if the difference between the y value of the text box and the y value of the top text box top_text is greater than the preset difference, it is considered that the text box is not a candidate title. For example, the preset difference can be set to 20xp. If the y value of the text box differs from the y value of top_text by more than 20 pixels, it is determined that the text box is not a candidate title, and some text boxes are filtered out through this step.

[0087] For Chinese courseware, the following screening conditions can also be set: determine whether the content of the text box does not contain pinyin, whether the number of words is less than 10 (or other preset title word count), whether the text box is located in the 1 / 3 area on the left side of the courseware page, whether the text font size is greater than or equal to 128 (or other preset title font size), and whether the number of spaces is less than 4 (or other preset number of spaces). If there is a text box that meets the above conditions at the same time, the text box is used as a candidate title to filter out text boxes that do not meet any of the conditions. It should be noted that the above screening condition examples take the beautification processing of Chinese courseware as an example. In some embodiments, if it is for different types of courseware, the candidate title screening conditions can be appropriately adjusted. For example, for English courseware, the screening condition of determining whether the content of the text box does not contain pinyin is obviously not applicable, and other appropriate title screening conditions can be set.

[0088] In some embodiments, after the above-mentioned preliminary screening steps, the candidate titles can be screened out by calculating the text box overlap. Specifically, the vertical overlap between the text box and the adjacent text box is calculated in combination with the h value, that is, the vertical overlap h_iou between the height of the text box and other text boxes in the current courseware page is calculated, and it is determined whether the vertical overlap is less than the first preset threshold. If so, the text box is used as a candidate title. For example, assuming that the first preset threshold is 0.5, if the h_iou of the current text box and other text boxes is less than 0.5, the text box is judged to be a candidate title.

[0089] If not, it is determined whether there are at least two adjacent text boxes whose corresponding vertical overlap is less than a second preset threshold, and if so, it is considered that the text box is not a candidate title, wherein the second preset threshold is greater than the first preset threshold. For example, assuming that the second preset threshold is 0.8, if there are more than 2 text boxes with h_iou greater than 0.8 with a certain text box, it is considered that the number of text boxes parallel to this text box exceeds 2, and the text box is determined not to be a candidate title, and then the text box is filtered out.

[0090] If the number of text boxes with h_iou greater than 0.8 as compared to a certain text box is less than or equal to 2, continue to filter in combination with the w value, as follows: If not, calculate the horizontal overlap between the text box and the adjacent text box in combination with the w value; determine whether the horizontal overlap is less than the third preset threshold, and if so, use the text box as a candidate title. Specifically, calculate the horizontal overlap between the text box and the adjacent text box in combination with the w value, that is, calculate the horizontal overlap w_iou between the width of the text box and other text boxes in the current courseware page, determine whether the horizontal overlap is less than the third preset threshold, and if so, use the text box as a candidate title. For example, assuming the third preset threshold is 0.5, if the w_iou of the current text box and other text boxes is less than 0.5, then the text box is determined to be a candidate title.

[0091] If not, it is determined whether the number of words in the text box adjacent to the text box below the text box is greater than the preset number of words in the text. If so, the text box is used as a candidate title. For example, assuming that the preset number of words in the text is 30, if the w_iou between a text box and other text boxes is greater than 0.5, but the line immediately below it is a large paragraph of text with more than 30 words, then this text box is also used as a candidate title. It can be understood that through the above-mentioned candidate title screening method, there are cases where there are no candidate titles in some courseware pages, which is in line with the actual courseware layout.

[0092] S133, determining the main title according to the number of words, font size and symbols of the candidate titles. After selecting several candidate titles through the above steps, continue to determine a text box from these candidate titles as the main title, specifically:

[0093] S1331. Calculate the length score according to the absolute value of the difference between the number of words in the candidate title and the standard number of words, wherein the larger the absolute value of the difference is, the lower the length score is. For example, assuming the standard number of words is 5, the length score corresponding to the candidate title is calculated by the following formula: 1-abs(length-N) / N, N=5, that is, the more the number of words in the candidate title deviates from 5, the lower the length score is.

[0094] S1332: Calculate a font size score according to the difference between the font size of the candidate title and the standard font size, wherein the larger the difference is, the higher the font size score is. For example, assuming the standard font size is 20, the more the font size of the text in the current text box exceeds 20, the higher the font size score is, that is, the larger the font size is, the higher the font size score is.

[0095] S1333. Calculate the symbol score according to the number of symbols in the candidate title, wherein the larger the number of symbols, the lower the symbol score. For example, the number of Chinese characters in the current text box can be scored, while symbols and English are not scored. Assuming that the number of Chinese characters in a text box is 7, and the number of symbols (including symbols such as periods, commas, or English letters) is 3, then the symbol score of the text box is 7; assuming that the number of Chinese characters in another text box is 10, and the number of symbols (including symbols such as periods, commas, or English letters) is 0, then the symbol score of the text box is 10.

[0096] S1334, calculating the sum of the length score, the font size score and the symbol score, and recording the candidate title corresponding to the largest sum as the main title. Calculating the total score of each candidate title in the current courseware page by adding them together, and taking the one with the highest total score as the main title.

[0097] S134, determine the secondary title according to the content information. In some embodiments, in order to make the courseware display more organized and beautiful, the secondary title can be determined after the main title is determined. The embodiment of the present application provides the following method to determine the secondary title.

[0098] Specifically, a text box with less words than the preset title and a number at the beginning of the sentence or a colon or question mark at the end of the sentence can be used as a secondary title. For example, assuming the preset title has 10 words, if the current text box has 9 words and there is a "?" at the end of the sentence, the text box will be recorded as a secondary title.

[0099] The secondary title can also be determined by analyzing the difference with the main text. Specifically, the text box with more words in the content information on each page of the courseware page can be used as the main text; determine whether the similarity between the text box and the main text is less than the fourth preset threshold, and if so, use the text box as the secondary title. For example, assuming that the fourth preset threshold is 0.2, and there are three text boxes on the current page, use text box a with the most words as the main text, and analyze the similarity between the other two text boxes (text box b and text box c) and text box a in turn. If the similarity between text box c and text box a is lower than 0.2, then text box c is recorded as the secondary title; if the similarity between text box c and text box b and text box a is higher than 0.2, it is considered that there is no secondary title in the current courseware page.

[0100] The similarity analysis can be performed by comparing the foreground color, background color, text color, font style, etc. of the text. The greater the difference between the text in the current text box and the text in the main body, the lower the similarity.

[0101] S14, the courseware page is beautified according to the courseware page information. Since the elements in each courseware page are numbered in the preprocessing process, the elements contained in each courseware page can be obtained. If tpye='NO_ELEMENT' or similar fields are identified by json in the current courseware page, it means that there are no elements in the courseware page, and the background image has been unified in the aforementioned steps, and there is no need to beautify the fields. If tpye='WITH_SPECIAL_ELEMENT' or similar fields are identified by json in the current courseware page, it means that the courseware page contains special elements (such as arrows or shapes). In addition to the background image unification in the aforementioned steps, it is only necessary to beautify the font and font size of the text box, unify the font and font size, and do not need to adjust the element position. If tpye='TO_TEMPLATES' or similar fields are identified by json in the current courseware page, it means that the current courseware page does not contain a template, and the template needs to be matched for beautification.

[0102] Among them, the courseware template can be matched according to the characteristics of the courseware page, wherein the characteristics include text characteristics, picture characteristics and layout characteristics. Specifically: analyze the number of large titles and sub-titles contained in the courseware page to obtain the text characteristics, for example, the current courseware page contains a large title, a sub-title and two texts, all in the form of text boxes. Analyze whether there are irrelevant illustrations on the courseware page to obtain the picture characteristics, if so, delete the irrelevant illustrations, for example, the current courseware page may have illustrations (in the form of picture boxes), in which case the percentage of blank pixels occupying the entire picture can be analyzed to determine whether it is an irrelevant illustration, if it is lower than the percentage threshold, it is determined to be an irrelevant illustration and deleted. Analyze the positional relationship of the text box in the courseware page to obtain the layout characteristics, for example, the overlap degree iou of the text box and the valid picture box in the w and h directions can be calculated, and then determine whether the layout characteristics of the current courseware page belong to the top-bottom structure, the left-right structure, or other special structures.

[0103] Match the courseware template according to the features, and if a courseware template is matched, beautify the courseware page according to the courseware template. For example, assuming that the current courseware page contains a large title, a secondary title, and two texts, and there are no pictures, and its layout structure is a top-bottom structure, then match it with a courseware template with the same features, and fill the content into the template to complete the beautification of the courseware page. If no suitable courseware template is matched, the font and size of the beautified text box only need to be unified in the font, size, and background image, so that the courseware page appears more organized and more layered.

[0104] It is understandable that the courseware template can be a courseware template with a designed typesetting and layout pre-stored in the system template library, which can be uploaded to the system by experienced designers and opened to the template library after approval for selection by the template matching program.

[0105] S15, post-processing the courseware file after beautification and saving it as an XML file. After all courseware pages have been beautified, post-processing the courseware file is performed. For example, the order of elements in the courseware page needs to be adjusted according to the element number, and the order of elements in the original courseware is restored to avoid the beautification process changing the order of elements and affecting the classroom demonstration effect, and the element number is deleted after the adjustment is completed. After the adjustment is completed, the json format data after the beautification can be converted into an XML format and saved as an XML file, ending the beautification of the entire courseware and outputting the beautified courseware file.

[0106] The courseware beautification method provided in the embodiment of the present application converts the courseware into a courseware file in a json format that is more convenient to process, pre-processes the courseware file, and then adjusts the background image of the courseware page in the courseware file, automatically collects and analyzes the courseware page information of the courseware page, and beautifies the courseware page according to the courseware page information, so that the courseware page appears more organized and layered, and then post-processes the beautified courseware file and saves it as an xml file. The process only requires the teacher to provide the original xml format courseware, and can automatically complete the courseware beautification. It is not only simple to operate, but also does not require the teacher's own courseware beautification experience and design understanding to be high, and is suitable for popularization and use.

[0107] See also Figure 2 The embodiment of the present application provides a courseware beautification processing device 200, including a preprocessing module 21, a background adjustment module 22, a courseware analysis module 23, a beautification processing module 24 and a post-processing module 25. Among them, the preprocessing module 21 can convert the courseware into a courseware file in json format and pre-process the courseware file. The background adjustment module 22 can adjust the background image of the courseware page in the courseware file. The courseware analysis module 23 can collect and analyze the courseware page information of the courseware page. The beautification processing module 24 can beautify the courseware page according to the courseware page information. The post-processing module 25 can post-process the courseware file after beautification and save it as an xml file.

[0108] It should be noted that the above-mentioned courseware beautification processing device can execute the courseware beautification processing method provided in the embodiment of this application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the courseware beautification processing device, please refer to the courseware beautification processing method provided in the embodiment of this application.

[0109] like Figure 3 As shown, the electronic device 300 includes: one or more processors 31 and a memory 32, Figure 3 A processor 31 is taken as an example.

[0110] The processor 31 and the memory 32 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.

[0111] The memory 32 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the courseware beautification processing method in the embodiment of the present invention. The processor 31 executes various functional applications and data processing of the solid-state drive by running the non-volatile software programs, instructions and modules stored in the memory 32, that is, implements the courseware beautification processing method in the above method embodiment.

[0112] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 32 may optionally include a memory remotely arranged relative to the processor 31.

[0113] The one or more modules are stored in the memory 32, and when executed by the one or more processors 31, the courseware beautification processing method in any of the above method embodiments is executed, for example, the above described Figure 1 The method steps in .

[0114] The above product can execute the courseware beautification processing method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the courseware beautification processing method provided in the embodiment of the present application.

[0115] It is understandable that the above described device or equipment embodiments are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0116] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A courseware beautification method, characterized in that: include: Convert the courseware into a courseware file in json format and preprocess the courseware file; Adjust the background image of the courseware page in the courseware file; Collect and analyze courseware page information of courseware pages; Beautify the courseware page according to the courseware page information; Post-process the beautified courseware file and save it as an XML file.

2. The method according to claim 1, characterized in that: The preprocessing of the courseware file comprises: Mark and avoid special courseware pages, which are courseware pages that do not participate in beautification processing; Adding page categories to the courseware page, wherein the page categories include home page, last page or content page; The elements in the courseware page are numbered.

3. The method according to claim 2, characterized in that The adjusting of the background image of the courseware page in the courseware file comprises: Select the background image that appears most frequently on the first page, last page, or content page as the background image for all courseware pages, or; Select the background image that appears most frequently in the content pages as the background image for all content pages, and select the background image for the first or last page as the background image for the first and last pages.

4. The method according to claim 2, characterized in that: The courseware page information collected and analyzed includes: Get the location information and content information of the text box in each courseware page; analyzing the location information and the content information to screen out candidate titles; The main title is determined according to the number of characters, font size and symbols of the candidate titles.

5. The method according to claim 4, characterized in that The obtaining of the position information and content information of the text box in each courseware page includes: Obtaining the text content of each text box in the courseware page as content information; Get the bbox(x, y, w, h) parameters of the text box as position information, where x is the horizontal coordinate of the upper left corner of the text box, y is the vertical coordinate of the upper left corner of the text box, w is the horizontal length of the text box, and h is the vertical length of the text box.

6. The method according to claim 5, characterized in that The analyzing the location information and the content information to screen out candidate titles includes: The text box with a smaller number of words than the preset title and the smallest y value is used as the top text box; Traverse all text boxes on the current courseware page; If the difference between the y value of the text box and the y value of the top text box is greater than a preset difference, it is considered that the text box is not a candidate title.

7. The method according to claim 5, characterized in that The analyzing the location information and the content information to screen out candidate titles includes: Traverse all text boxes on the current courseware page; Calculate the vertical overlap between the text box and the adjacent text box in combination with the h value; Determine whether the vertical overlap is less than a first preset threshold, and if so, use the text box as a candidate title; If not, determining whether there are at least two adjacent text boxes whose corresponding vertical overlap is less than a second preset threshold, and if so, considering that the text box is not a candidate title, wherein the second preset threshold is greater than the first preset threshold; If not, then the horizontal overlap between the text box and the adjacent text box is calculated in combination with the w value; Determine whether the horizontal overlap is less than a third preset threshold, and if so, use the text box as a candidate title; If not, determine whether the number of text words in the adjacent text box below the text box is greater than the preset number of text words. If so, use the text box as a candidate title.

8. The method according to claim 4, characterized in that Determining the main title according to the text, font size and symbols of the candidate title includes: Calculating a length score according to the absolute value of the difference between the number of words in the candidate title and the standard number of words, wherein the larger the absolute value of the difference is, the lower the length score is; Calculating a font size score according to a difference between the font size of the candidate title and the standard font size, wherein the larger the difference is, the higher the font size score is; Calculating a symbol score according to the number of symbols in the candidate title, wherein the greater the number of symbols, the lower the symbol score; The sum of the length score, the font size score and the symbol score is calculated, and the candidate title corresponding to the largest sum is recorded as the large title.

9. The method according to claim 4, characterized in that The collecting and analyzing the courseware page information of the courseware page also includes: determining a secondary title according to the content information, wherein the determining the secondary title according to the content information includes: The text box with less words than the preset title word count and a number at the beginning of the sentence or a colon or question mark at the end of the sentence is used as a secondary title; The text box with more words in the content information described on each page of the courseware page is used as the main text; It is determined whether the similarity between the text box and the text is less than a fourth preset threshold; if so, the text box is used as a secondary title.

10. The method according to claim 2, characterized in that The beautifying the courseware page according to the courseware page information includes: If the courseware page contains special elements, the font and size of the text box are beautified; If the courseware page does not contain a template, the courseware template is matched according to the features of the courseware page, wherein the features include text features, picture features and layout features.

11. The method according to claim 10, characterized in that The matching of courseware templates according to the characteristics of the courseware page includes: Analyze the number of main headings and sub-headings contained in the courseware page to obtain the text features; Analyze whether there is any irrelevant illustration on the courseware page to obtain the image feature, and if so, delete the irrelevant illustration; Analyzing the positional relationship of text boxes in the courseware page to obtain the layout features; Matching a courseware template according to the feature, and if a courseware template is matched, beautifying the courseware page according to the courseware template; If no courseware template is found, the font and size of the text box will be beautified.

12. The method according to claim 2, characterized in that: The post-processing of the beautified courseware file and saving it as an XML file includes: Adjusting the order of elements according to the element numbers of the courseware page; Deleting the element number; The beautified json format data is converted into xml format and saved as an xml file.

13. A courseware beautification processing device, characterized in that: include: A preprocessing module, used for converting the courseware into a courseware file in json format and preprocessing the courseware file; A background adjustment module, used for adjusting the background image of the courseware page in the courseware file; A courseware analysis module, used for collecting and analyzing courseware page information of courseware pages; A beautification processing module, used for beautifying the courseware page according to the courseware page information; The post-processing module is used to post-process the beautified courseware files and save them as XML files.

14. An electronic device, characterized in that: include: At least one processor and a memory, wherein a program is stored in the memory, and when the program is executed by the at least one processor, the program enables the electronic device to execute the courseware beautification processing method according to any one of claims 1 to 12.