Method, device, electronic device and program product for detecting abnormal text display

By detecting the color fill rate and preset correspondence of the text bitmap, the display abnormality caused by the text bitmap obtained by the operating system's native interface is solved, and the text display abnormality detection and default font configuration on the application side are realized, which improves the display efficiency and accuracy.

CN114782557BActive Publication Date: 2024-12-20ALIBABA INNOVATION PRIVATE LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210283880.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-21
Publication Date
2024-12-20
Estimated Expiration
2042-03-21

AI Technical Summary

Technical Problem

Text bitmaps obtained in the native interface of the operating system of electronic devices are blurred or displayed incorrectly due to user settings changing or unsupported fonts, which are difficult to effectively detect and solve in the prior art.

Method used

By obtaining the color fill rate of the text bitmap, use the preset correspondence to determine whether text display abnormalities will occur, and configure the application to obtain the text bitmap in the default font, and periodically detect it to prevent abnormalities.

Benefits of technology

Simplify text abnormality detection, improve detection efficiency, effectively avoid text display abnormalities caused by user settings, and ensure the correctness and efficiency of text display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114782557B_ABST
    Figure CN114782557B_ABST
Patent Text Reader

Abstract

The disclosed embodiment discloses a method, device, electronic device and program product for detecting abnormal text display, the method comprising: obtaining a first text bitmap and a second text bitmap by using an operating system interface; the first text bitmap and the second text bitmap correspond to different texts respectively; determining the color fill rate of the first text bitmap and the second text bitmap respectively; determining whether an abnormality will occur when displaying text on the application end based on the color fill rate of the first text bitmap and the second text bitmap and a preset correspondence. The technical solution can detect whether an abnormality will occur when displaying text by using the color fill rate of the text bitmap, simplifies the detection method of abnormal text display, improves the detection efficiency of abnormal text display, and can effectively detect abnormal text display problems that may occur on the application end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image display technology, and in particular to a method, device, electronic device and program product for detecting abnormal text display. Background Art

[0002] With the development of technology, more and more application terminals have emerged. The application terminal runs on the operating system of the electronic device, and usually uses the native interface of the operating system to implement some functions. Taking the electronic map as an example, when displaying text, the electronic map can use the native interface of the operating system to obtain the corresponding text bitmap, and display the corresponding text on the electronic map based on the obtained text bitmap. However, the text bitmap obtained through the native interface of the operating system will change as the user changes the system settings. For example, the user can modify the system's default font to a color font through the setting interface provided by the operating system, or set it to add a font outline display mode. In this case, the electronic map uses the native interface of the operating system to obtain the text bitmap, and after the text bitmap is processed twice, there will be problems such as blurred text; and in some cases, when the user uses a special font through the setting interface provided by the operating system, the text bitmap obtained by the electronic map through the native interface of the operating system is wrong, because the operating system itself may not support this font.

[0003] Therefore, a solution needs to be proposed so that when the application side uses the native interface of the operating system to obtain the text bitmap, it can be detected in advance whether the text display abnormality will occur. Summary of the invention

[0004] Embodiments of the present disclosure provide a method, device, electronic device, and program product for detecting abnormal text display.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for detecting abnormal text display, which includes:

[0006] Acquire a first character bitmap and a second character bitmap by using an operating system interface; the first character bitmap and the second character bitmap correspond to different characters respectively;

[0007] respectively determining the color fill rates of the first character bitmap and the second character bitmap;

[0008] Based on the color filling rates of the first text bitmap and the second text bitmap and a preset corresponding relationship, it is determined whether an abnormality will occur when displaying text on the application end.

[0009] Further, respectively determining the color fill rates of the first text bitmap and the second text bitmap includes:

[0010] Counting a first pixel number of non-transparent pixels in the first text bitmap, and counting a second pixel number of non-transparent pixels in the second text bitmap;

[0011] determining a first fill rate of the first text bitmap based on a ratio of the first number of pixels to a total number of pixels in the first text bitmap;

[0012] A second fill rate of the second character bitmap is determined based on a ratio of the second number of pixels to a total number of pixels in the second character bitmap.

[0013] Further, determining whether an abnormality occurs when displaying text on the application end based on the color filling rates of the first text bitmap and the second text bitmap and a preset corresponding relationship includes:

[0014] When the first filling rate and the second filling rate are equal, or one of the first filling rate and the second filling rate is greater than or equal to a preset threshold, it is determined that an abnormality will occur in displaying text on the application end.

[0015] Furthermore, the method further comprises:

[0016] After determining that an abnormality occurs when displaying text on the application end, the application end is configured so that a text bitmap is subsequently obtained by specifying a default font.

[0017] Furthermore, the method further comprises:

[0018] After the application is started, the text display abnormality detection process is triggered periodically to detect whether there is any abnormality in the text display on the application.

[0019] Furthermore, before respectively determining the color filling rates of the first character bitmap and the second character bitmap, the method further includes:

[0020] When the first character bitmap and the second character bitmap are in a multi-channel mode, converting the first character bitmap and the second character bitmap into a single-channel grayscale image;

[0021] Determining the color fill rates of the first text bitmap and the second text bitmap respectively includes:

[0022] The color fill rate is determined based on the number of pixels with pixel values ​​greater than 0 in the single-channel grayscale images corresponding to the first text bitmap and the second text bitmap.

[0023] In a second aspect, an embodiment of the present invention provides a method for providing location-based services, comprising: using the method described in the first aspect to detect abnormal text display on an electronic map, and providing location-based services to the service object based on the detection results, wherein the location-based services include: one or more of navigation, map rendering, and route planning.

[0024] In a third aspect, an embodiment of the present invention provides a device for detecting abnormal text display, which includes:

[0025] An acquisition module is configured to acquire a first character bitmap and a second character bitmap using an operating system interface; the first character bitmap and the second character bitmap correspond to different characters respectively;

[0026] A first determining module is configured to determine the color filling rates of the first character bitmap and the second character bitmap respectively;

[0027] The second determination module is configured to determine whether an abnormality occurs when displaying text on the application side based on the color filling rates of the first text bitmap and the second text bitmap and a preset corresponding relationship.

[0028] In a fourth aspect, an embodiment of the present invention provides a location-based service providing device, comprising: using the device described in the third aspect to detect abnormal text display on an electronic map, and providing location-based services to the service object based on the detection results, wherein the location-based services include: one or more of navigation, map rendering, and route planning.

[0029] The functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions.

[0030] In one possible design, the structure of the above-mentioned device includes a memory and a processor, the memory is used to store one or more computer instructions that support the above-mentioned device to execute the above-mentioned corresponding method, and the processor is configured to execute the computer instructions stored in the memory. The above-mentioned device may also include a communication interface for the above-mentioned device to communicate with other devices or communication networks.

[0031] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described in any one of the above aspects.

[0032] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing computer instructions used by any of the above-mentioned devices, and when the computer instructions are executed by a processor, they are used to implement the method described in any of the above-mentioned aspects.

[0033] In a seventh aspect, an embodiment of the present disclosure provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, they are used to implement the method described in any of the above aspects.

[0034] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0035] In the process of detecting whether the text display is abnormal on the application side, the disclosed embodiment uses the operating system interface to obtain the first text bitmap and the second text bitmap, the first text bitmap and the second text bitmap correspond to different texts, and respectively determine the color fill rates of the first text bitmap and the second text bitmap, and then determine whether an abnormality occurs when the text is displayed on the application side based on the color fill rate and the preset corresponding relationship. The disclosed embodiment uses the color fill rate of the text bitmap to detect whether the text display is abnormal, simplifies the detection method of abnormal text display, improves the detection efficiency of abnormal text display, and can effectively detect abnormal text display problems that may occur on the application side.

[0036] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0038] Figure 1 A flow chart of a method for detecting abnormal text display according to an embodiment of the present disclosure is shown;

[0039] Figure 2 A schematic diagram of an application scenario in a navigation scenario according to an embodiment of the present disclosure is shown;

[0040] Figure 3 A structural block diagram of a device for detecting abnormal text display according to an embodiment of the present disclosure is shown;

[0041] Figure 4 It is a structural schematic diagram of an electronic device suitable for implementing the text display abnormality detection method and / or location-based service provision method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0042] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0043] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the specification, and do not exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.

[0044] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0045] The details of the embodiments of the present disclosure are described in detail below through specific examples.

[0046] Figure 1 FIG. 1 is a flow chart of a method for detecting abnormal text display according to an embodiment of the present disclosure. Figure 1 As shown, the method for detecting text display abnormality includes the following steps:

[0047] In step S101, a first character bitmap and a second character bitmap are acquired by using an operating system interface; the first character bitmap and the second character bitmap correspond to different characters respectively;

[0048] In step S102, color filling rates of the first character bitmap and the second character bitmap are determined respectively;

[0049] In step S103, it is determined whether an abnormality will occur when displaying text on the application side based on the color filling rates of the first text bitmap and the second text bitmap.

[0050] In this embodiment, the method is executed on an electronic device running an application terminal. The application terminal can be any application APP running on the electronic device, and the application terminal can display text on the application interface. The application terminal is installed on the electronic device, and during operation, the native interface provided by the operating system of the electronic device is used to obtain the text bitmap of the text to be displayed. In some embodiments, the application terminal can be an electronic map application terminal. Of course, it can be understood that the application terminal can also be other application terminals that obtain text bitmaps and display text by calling the native interface of the operating system.

[0051] As described in the background art, an operating system usually provides a system setting function, and a user can use the system setting function to change the system display font from the system default font to a personalized font, such as a color font, a font with an outline, etc. However, such a personalized font may not be recognized by the application end, so after the application end obtains the text bitmap of such a font using the native interface of the operating system, an abnormal display may occur, such as displaying a black square or a thick font, etc.

[0052] To solve this problem, two common solutions in the prior art are:

[0053] 1. Use pattern recognition to identify font display errors; however, this method has a complex algorithm, is difficult to implement, and requires reliance on artificial intelligence models, which will increase the size of the application installation package.

[0054] 2. Integrate built-in fonts in the application installation package. When the application displays text, it directly obtains the built-in fonts of the installation package instead of obtaining them through the native interface of the operating system. This method will also increase the size of the application installation package, and the need to manage built-in fonts will increase memory overhead, and this method cannot support multi-language environments.

[0055] To this end, the disclosed embodiment proposes a method for detecting abnormal text display. In the method, in the process of detecting whether an abnormality will occur in the display of text on the application end, the operating system is first used to obtain a first text bitmap and a second text bitmap, and the first text bitmap and the second text bitmap correspond to different texts; after obtaining the first text bitmap and the second text bitmap, the color fill rates of the first text bitmap and the second text bitmap are determined respectively. It should be noted that the text corresponding to the first text bitmap and the second text bitmap can include text in any language such as Chinese and English.

[0056] It is understandable that the color fill rate of the text bitmap is related to the pixels in the bitmap. Some pixels have color, while some pixels do not, that is, they are transparent. The color fill rate can be understood as the proportion of colored pixels in the total pixels.

[0057] After determining the color fill rates of the first and second text bitmaps, it can be determined whether an exception will occur when displaying the text bitmap obtained by the application end using the native interface of the operating system based on the color fill rates of the first and second text bitmaps.

[0058] For example, if the text bitmap obtained by using the native interface of the operating system is in the form of black squares, or the font is particularly thick, it can be considered that the text display is abnormal. The color fill rate of the text bitmap can reflect the two situations of black squares or particularly thick fonts. Therefore, through multiple tests, the corresponding relationship between abnormal situations such as black squares or particularly thick fonts and the color fill rate can be found, and based on the color fill rate, it can be determined whether an error will occur in displaying text on the application side.

[0059] Therefore, in some embodiments, a preset correspondence between color fill rate and text display abnormality can be established in advance, and based on the preset correspondence and the color fill rate of the two text bitmaps, it is determined whether an abnormality will occur when displaying the text bitmap obtained based on the native interface of the operating system on the application side.

[0060] It is understandable that the preset corresponding relationship may be different based on the difference between the selected first text bitmap and the second text bitmap, and may be preset according to actual application conditions, and no specific limitation is made here.

[0061] In the process of detecting whether the text display is abnormal on the application side, the disclosed embodiment uses the operating system interface to obtain the first text bitmap and the second text bitmap, the first text bitmap and the second text bitmap correspond to different texts, and respectively determine the color fill rates of the first text bitmap and the second text bitmap, and then determine whether an abnormality occurs when the text is displayed on the application side based on the color fill rate and the preset corresponding relationship. The disclosed embodiment uses the color fill rate of the text bitmap to detect whether the text display is abnormal, simplifies the detection method of abnormal text display, improves the detection efficiency of abnormal text display, and can effectively detect abnormal text display problems that may occur on the application side.

[0062] In an optional implementation of this embodiment, step S102, i.e., the step of respectively determining the color filling rates of the first text bitmap and the second text bitmap, further includes the following steps:

[0063] Counting a first pixel number of non-transparent pixels in the first text bitmap, and counting a second pixel number of non-transparent pixels in the second text bitmap;

[0064] determining a first fill rate of the first text bitmap based on a ratio of the first number of pixels to a total number of pixels in the first text bitmap;

[0065] A second fill rate of the second character bitmap is determined based on a ratio of the second number of pixels to a total number of pixels in the second character bitmap.

[0066] In this optional implementation, the color fill rate of the text bitmap can be understood as the proportion of the portion that can display color after displaying the text bitmap in the entire text bitmap, which can be determined based on the ratio of non-transparent pixels to total pixels. The specific calculation process is as follows:

[0067] The number of non-transparent pixels in the first text bitmap and the second text bitmap can be counted respectively to obtain a first pixel number and a second pixel number. Generally, the pixel value of a transparent pixel in a bitmap is 0, and the non-transparent pixel includes all pixels whose pixel value is not 0. The ratio of the first pixel number to the total number of pixels in the first text bitmap can be determined as a first fill rate, and the ratio of the second pixel number to the total number of pixels in the second text bitmap can be determined as a second fill rate.

[0068] In an optional implementation of this embodiment, step S103, i.e., the step of determining whether an abnormality occurs when displaying text on the application end based on the color filling rates of the first text bitmap and the second text bitmap and the preset corresponding relationship, further includes the following steps:

[0069] When the first filling rate and the second filling rate are equal, or one of the first filling rate and the second filling rate is greater than or equal to a preset threshold, it is determined that an abnormality will occur in displaying text on the application end.

[0070] In this optional implementation, the first character bitmap and the second character bitmap may correspond to two different characters, and the difference in the number of strokes of the two characters may be greater than or equal to a preset difference. For example, in some embodiments, the first character bitmap may select a character with more strokes, and the second character bitmap may select a character with fewer strokes, and the difference in the number of strokes between the character with more strokes and the character with fewer strokes is greater than or equal to a preset difference, which may be determined based on an empirical value.

[0071] One situation in which text display is abnormal is that the text bitmap obtained based on the native interface of the operating system is incorrect and appears in the form of a black square. In this case, the color fill rates of the first text bitmap and the second text bitmap corresponding to two different texts are the same. Therefore, a preset correspondence between the equal color fill rates of the first text bitmap and the second text bitmap and the abnormality in displaying text on the application side can be established in advance, and then based on the preset correspondence, it is determined whether an abnormality will occur in displaying text on the application side.

[0072] Another situation where text display is abnormal is that although the text bitmap obtained based on the native interface of the operating system can display the correct text, the font of the text bitmap may be thicker due to the user's personalized font setting through the system setting function, which may cause unclear display when displayed on the application side. In this case, the color fill rate of the text bitmap will be relatively high, and even the color fill rate of the text bitmap corresponding to the text with fewer strokes will be higher than the color fill rate under normal circumstances. Therefore, for this situation, the preset threshold value corresponding to the color fill rate can be determined in advance based on the empirical value, and a preset corresponding relationship can be established between the color fill rate corresponding to the first text bitmap or the second text bitmap being greater than or equal to the preset threshold and the abnormality of displaying the text on the application side, and then based on the preset corresponding relationship, it is determined whether the abnormality of displaying the text on the application side will occur.

[0073] When the first fill rate and the second fill rate actually calculated satisfy any one of the above-mentioned preset corresponding relationships, it can be determined that an abnormality will occur in displaying text on the application end; otherwise, when both the first fill rate and the second fill rate do not satisfy the above-mentioned two preset corresponding relationships, it can be determined that no abnormality will occur in displaying text on the application end.

[0074] In an optional implementation of this embodiment, the method further includes the following steps:

[0075] After determining that an abnormality occurs when displaying text on the application end, the application end is configured so that a text bitmap is subsequently obtained by specifying a default font.

[0076] In this optional implementation, for the case where the application uses the native interface of the operating system to obtain a text bitmap and displays text on the application interface, it can be determined in advance based on the above method proposed in the embodiment of the present disclosure whether abnormal text display will occur in the current scenario. If it is determined that abnormal text display will occur, the application can be set so that when the application subsequently uses the native interface of the operating system to obtain the text bitmap, it obtains the text bitmap corresponding to the default font by specifying it, rather than obtaining the personalized font set by the user. In this way, the problem of abnormal text display on the application side caused by the user setting a personalized font through the system setting function can be avoided.

[0077] In an optional implementation of this embodiment, the method further includes the following steps:

[0078] After the application is started, the text display abnormality detection process is triggered periodically to detect whether there is any abnormality in the text display on the application.

[0079] In this optional implementation, considering that the user may set a personalized font through the system setting function at any time, after the application is started, the above method proposed in the embodiment of the present disclosure can be periodically used to determine whether an abnormality occurs when displaying text on the application.

[0080] In some embodiments, the detection may be performed once at the beginning of the application startup, and then once every preset period. In this way, the abnormal display of text can be detected in a timely manner, and measures can be taken in time to solve the problem of abnormal text display. In addition, in this way, the personalized text display needs of users can be met as much as possible under the premise of providing the correct text display effect.

[0081] In an optional implementation of this embodiment, before step S102, i.e., the step of respectively determining the color filling rates of the first text bitmap and the second text bitmap, the method further includes the following steps:

[0082] When the first character bitmap and the second character bitmap are in a multi-channel mode, converting the first character bitmap and the second character bitmap into a single-channel grayscale image;

[0083] Step S102, i.e., the step of respectively determining the color filling rates of the first character bitmap and the second character bitmap, comprises:

[0084] The color fill rate is determined based on the number of pixels with pixel values ​​greater than 0 in the single-channel grayscale images corresponding to the first text bitmap and the second text bitmap.

[0085] In this optional implementation, on the one hand, in order to accurately count the color fill rate of the text bitmap, on the other hand, the text bitmap returned by the native interface of the operating system is usually processed secondary on the application side, for example, it will be converted into A8 format for display. When performing secondary processing, it is usually necessary to convert the multi-channel mode text bitmap into a single-channel grayscale image. Therefore, before determining the color fill rate of the first text bitmap and the second text bitmap, if the first text bitmap and the second text bitmap are in multi-channel mode, the embodiment of the present disclosure can first convert them into a single-channel grayscale image, and then count the pixel values ​​greater than 0 (the pixel values ​​greater than 0 are non-transparent pixels in the single-channel grayscale image), and then determine the color fill rate of the first text bitmap and the second text bitmap based on the statistical results. In this way, a more accurate color fill rate can be obtained.

[0086] According to a location-based service providing method according to an embodiment of the present disclosure, the location-based service providing method utilizes the above-mentioned text display anomaly detection method to detect text display anomalies on an electronic map, and provides location-based services to the service object based on the detection results, wherein the location-based services include: one or more of navigation, map rendering, and route planning.

[0087] In this embodiment, the location-based service provision method can be executed on a terminal, and the terminal can include a mobile phone, an iPad, a computer, a smart watch, a vehicle, etc. In the disclosed embodiment, after the electronic map application terminal is started, the above method can be used to detect whether an abnormal display will occur on the electronic map after the text bitmap is obtained based on the native interface provided by the operating system on the electronic device during the operation of the electronic map on the current electronic device. If an abnormal display occurs, the electronic map is configured to obtain a text bitmap of a specified default font from the native interface of the operating system when text needs to be displayed during subsequent map rendering, navigation, path planning, etc., and then display the text bitmap of the default font for display.

[0088] The service object may be a mobile phone, iPad, computer, smart watch, vehicle, robot, etc. When navigating, planning a route or rendering a road on a map for the service object, the above-mentioned text display abnormality detection method may be periodically started to detect whether abnormality will occur when displaying text on the electronic map. If abnormality occurs, and the electronic map is not configured to obtain the text bitmap in a specified default font, the electronic map is configured to obtain the text bitmap in a specified default font for display; and if the electronic map is configured to obtain the text bitmap in a specified default font, no configuration is performed on the electronic map; but if it is detected that no text display abnormality will occur, and the electronic map is configured to obtain the text bitmap in a specified default font, the configuration of the electronic map may be restored so that the electronic map directly obtains the text bitmap from the native interface of the operating system without specifying to obtain it in a default font.

[0089] Figure 2 FIG. 1 is a schematic diagram showing an application scenario in a navigation scenario according to an embodiment of the present disclosure. Figure 2As shown, an electronic map is installed on the mobile phone. The user has modified the font display on the mobile phone to display colored fonts. After the user starts the electronic map, according to the pre - configured settings, the interface of the Android system is called to obtain the first character bitmap corresponding to the character "的" and the second character bitmap corresponding to the character "一", and the color filling rates of the first character bitmap and the second character bitmap are calculated. Since the color filling rates corresponding to the first character bitmap and the second character bitmap are equal, it can be determined that there will be an abnormality in displaying characters on the electronic map. At this time, the configuration on the electronic map is modified so that the electronic map subsequently obtains character bitmaps in the specified default font.

[0090] Based on the current location of the mobile phone, the electronic map is displayed on the map interface, and the native interface of the Android system is called to obtain the character bitmap corresponding to the POI on the electronic map. When calling the native interface of the Android system, it is specified to obtain the character bitmap corresponding to the POI in the default font, and the obtained character bitmap is displayed on the electronic map. The character bitmap is displayed on the electronic map in the default font, rather than in colored fonts.

[0091] The following is an embodiment of the disclosed device, which can be used to execute the embodiment of the disclosed method.

[0092] Figure 3 The structural block diagram of a device for detecting abnormal character display according to an embodiment of the present disclosure is shown. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. As Figure 3 shown, the device for detecting abnormal character display includes:

[0093] An acquisition module 301, configured to obtain a first character bitmap and a second character bitmap by using an operating system interface; the first character bitmap and the second character bitmap respectively correspond to different characters;

[0094] A first determination module 302, configured to respectively determine the color filling rates of the first character bitmap and the second character bitmap;

[0095] A second determination module 303, configured to determine whether there will be an abnormality in displaying characters on the application side based on the color filling rates of the first character bitmap and the second character bitmap and a preset correspondence relationship.

[0096] In this embodiment, the device is executed on an electronic device running an application terminal. The application terminal can be any application APP running on the electronic device, and the application terminal can display text on the application interface. The application terminal is installed on the electronic device, and during operation, the native interface provided by the operating system of the electronic device is used to obtain the text bitmap of the text to be displayed. In some embodiments, the application terminal can be an electronic map application terminal. Of course, it can be understood that the application terminal can also be other application terminals that obtain text bitmaps and display text by calling the native interface of the operating system.

[0097] As described in the background art, an operating system usually provides a system setting function, and a user can use the system setting function to change the system display font from the system default font to a personalized font, such as a color font, a font with an outline, etc. However, such a personalized font may not be recognized by the application end, so after the application end obtains the text bitmap of such a font using the native interface of the operating system, an abnormal display may occur, such as displaying a black square or a thick font, etc.

[0098] To solve this problem, two common solutions in the prior art are:

[0099] 1. Use pattern recognition to identify font display errors; however, this method has a complex algorithm, is difficult to implement, and requires reliance on artificial intelligence models, which will increase the size of the application installation package.

[0100] 2. Integrate built-in fonts in the application installation package. When the application displays text, it directly obtains the built-in fonts of the installation package instead of obtaining them through the native interface of the operating system. This method will also increase the size of the application installation package, and the need to manage built-in fonts will increase memory overhead, and this method cannot support multi-language environments.

[0101] To this end, the embodiment of the present disclosure proposes a device for detecting abnormal text display. In the device, in the process of detecting whether abnormal text display occurs on the application end, the operating system is first used to obtain the first text bitmap and the second text bitmap, and the first text bitmap and the second text bitmap correspond to different texts; after obtaining the first text bitmap and the second text bitmap, the color filling rate of the first text bitmap and the second text bitmap is determined respectively. It should be noted that the text corresponding to the first text bitmap and the second text bitmap can include text in any language such as Chinese and English.

[0102] It is understandable that the color fill rate of the text bitmap is related to the pixels in the bitmap. Some pixels have color, while some pixels do not, that is, they are transparent. The color fill rate can be understood as the proportion of colored pixels in the total pixels.

[0103] After determining the color fill rates of the first and second text bitmaps, it can be determined whether an exception will occur when displaying the text bitmap obtained by the application end using the native interface of the operating system based on the color fill rates of the first and second text bitmaps.

[0104] For example, if the text bitmap obtained by using the native interface of the operating system is in the form of black squares, or the font is particularly thick, it can be considered that the text display is abnormal. The color fill rate of the text bitmap can reflect the two situations of black squares or particularly thick fonts. Therefore, through multiple tests, the corresponding relationship between abnormal situations such as black squares or particularly thick fonts and the color fill rate can be found, and based on the color fill rate, it can be determined whether an error will occur in displaying text on the application side.

[0105] Therefore, in some embodiments, a preset correspondence between color fill rate and text display abnormality can be established in advance, and based on the preset correspondence and the color fill rate of the two text bitmaps, it is determined whether an abnormality will occur when displaying the text bitmap obtained based on the native interface of the operating system on the application side.

[0106] It is understandable that the preset corresponding relationship may be different based on the difference between the selected first text bitmap and the second text bitmap, and may be preset according to actual application conditions, and no specific limitation is made here.

[0107] In the process of detecting whether text display is abnormal on the application side, the disclosed embodiment uses the operating system interface to obtain the first text bitmap and the second text bitmap, the first text bitmap and the second text bitmap correspond to different texts, and respectively determine the color fill rates of the first text bitmap and the second text bitmap, and then determine whether an abnormality occurs when the text is displayed on the application side based on the color fill rate and the preset corresponding relationship. The disclosed embodiment uses the color fill rate of the text bitmap to detect whether text display is abnormal, simplifies the detection method of abnormal text display, improves the detection efficiency of abnormal text display, and can effectively detect abnormal text display problems that may occur on the application side.

[0108] In an optional implementation of this embodiment, the first determining module includes:

[0109] a counting submodule, configured to count a first pixel number of non-transparent pixels in the first text bitmap, and to count a second pixel number of non-transparent pixels in the second text bitmap;

[0110] A first determining submodule is configured to determine a first fill rate of the first character bitmap based on a ratio of the first number of pixels to a total number of pixels in the first character bitmap;

[0111] The second determining submodule is configured to determine a second filling rate of the second text bitmap based on a ratio of the second number of pixels to a total number of pixels in the second text bitmap.

[0112] In this optional implementation, the color fill rate of the text bitmap can be understood as the proportion of the portion that can display color after displaying the text bitmap in the entire text bitmap, which can be determined based on the ratio of non-transparent pixels to total pixels. The specific calculation process is as follows:

[0113] The number of non-transparent pixels in the first text bitmap and the second text bitmap can be counted respectively to obtain a first pixel number and a second pixel number. Generally, the pixel value of a transparent pixel in a bitmap is 0, and the non-transparent pixel includes all pixels whose pixel value is not 0. The ratio of the first pixel number to the total number of pixels in the first text bitmap can be determined as a first fill rate, and the ratio of the second pixel number to the total number of pixels in the second text bitmap can be determined as a second fill rate.

[0114] In an optional implementation of this embodiment, the second determining module includes:

[0115] The third determining submodule is configured to determine that an abnormality will occur in displaying text on the application end when the first fill rate and the second fill rate are equal, or when one of the first fill rate and the second fill rate is greater than or equal to a preset threshold.

[0116] In this optional implementation, the first character bitmap and the second character bitmap may correspond to two different characters, and the difference in the number of strokes of the two characters may be greater than or equal to a preset difference. For example, in some embodiments, the first character bitmap may select a character with more strokes, and the second character bitmap may select a character with fewer strokes, and the difference in the number of strokes between the character with more strokes and the character with fewer strokes is greater than or equal to a preset difference, which may be determined based on an empirical value.

[0117] One situation in which text display is abnormal is that the text bitmap obtained based on the native interface of the operating system is incorrect and appears in the form of a black square. In this case, the color fill rates of the first text bitmap and the second text bitmap corresponding to two different texts are the same. Therefore, a preset correspondence between the equal color fill rates of the first text bitmap and the second text bitmap and the abnormality in displaying text on the application side can be established in advance, and then based on the preset correspondence, it is determined whether an abnormality will occur in displaying text on the application side.

[0118] Another situation where text display is abnormal is that although the text bitmap obtained based on the native interface of the operating system can display the correct text, the font of the text bitmap may be thicker due to the user's personalized font setting through the system setting function, which may cause unclear display when displayed on the application side. In this case, the color fill rate of the text bitmap will be relatively high, and even the color fill rate of the text bitmap corresponding to the text with fewer strokes will be higher than the color fill rate under normal circumstances. Therefore, for this situation, the preset threshold value corresponding to the color fill rate can be determined in advance based on the empirical value, and a preset corresponding relationship can be established between the color fill rate corresponding to the first text bitmap or the second text bitmap being greater than or equal to the preset threshold and the abnormality of displaying the text on the application side, and then based on the preset corresponding relationship, it is determined whether the abnormality of displaying the text on the application side will occur.

[0119] When the first fill rate and the second fill rate actually calculated satisfy any one of the above-mentioned preset corresponding relationships, it can be determined that an abnormality will occur in displaying text on the application end; otherwise, when both the first fill rate and the second fill rate do not satisfy the above-mentioned two preset corresponding relationships, it can be determined that no abnormality will occur in displaying text on the application end.

[0120] In an optional implementation of this embodiment, the device further includes:

[0121] The configuration module is configured to configure the application end after determining that an abnormality will occur in displaying text on the application end, so as to subsequently obtain a text bitmap by specifying a default font.

[0122] In this optional implementation, for the case where the application uses the native interface of the operating system to obtain a text bitmap and displays text on the application interface, it can be determined in advance based on the above-mentioned device proposed in the embodiment of the present disclosure whether abnormal text display will occur in the current scenario. If it is determined that abnormal text display will occur, the application can be set so that when the application subsequently uses the native interface of the operating system to obtain the text bitmap, it specifies to obtain the text bitmap corresponding to the default font instead of obtaining the personalized font set by the user. In this way, the problem of abnormal text display on the application side caused by the user setting a personalized font through the system setting function can be avoided.

[0123] In an optional implementation of this embodiment, the device further includes:

[0124] The detection trigger module is configured to periodically trigger the text display abnormality detection process after the application end is started, so as to detect whether there is any abnormality in the text display on the application end.

[0125] In this optional implementation, considering that the user may set a personalized font through the system setting function at any time, after the application is started, the above-mentioned device proposed in the embodiment of the present disclosure can be periodically used to determine whether an abnormality occurs in the text display on the application.

[0126] In some embodiments, the detection may be performed once at the beginning of the application startup, and then once every preset period. In this way, the abnormal display of text can be detected in a timely manner, and measures can be taken in time to solve the problem of abnormal text display. In addition, in this way, the personalized text display needs of users can be met as much as possible under the premise of providing the correct text display effect.

[0127] In an optional implementation of this embodiment, before the first determining module, the device further includes:

[0128] a conversion module, configured to convert the first character bitmap and the second character bitmap into a single-channel grayscale image when the first character bitmap and the second character bitmap are in a multi-channel mode;

[0129] The first determining module includes:

[0130] The fourth determination submodule is configured to determine the color fill rate based on the number of pixels with pixel values ​​greater than 0 in the single-channel grayscale images corresponding to the first text bitmap and the second text bitmap, respectively.

[0131] In this optional implementation, on the one hand, in order to accurately count the color fill rate of the text bitmap, on the other hand, the text bitmap returned by the native interface of the operating system is usually processed secondary on the application side, for example, it will be converted into A8 format for display. When performing secondary processing, it is usually necessary to convert the multi-channel mode text bitmap into a single-channel grayscale image. Therefore, before determining the color fill rate of the first text bitmap and the second text bitmap, if the first text bitmap and the second text bitmap are in multi-channel mode, the embodiment of the present disclosure can first convert them into a single-channel grayscale image, and then count the pixel values ​​greater than 0 (the pixel values ​​greater than 0 are non-transparent pixels in the single-channel grayscale image), and then determine the color fill rate of the first text bitmap and the second text bitmap based on the statistical results. In this way, a more accurate color fill rate can be obtained.

[0132] According to a location-based service providing device in one embodiment of the present disclosure, the location-based service providing device uses the above-mentioned text display anomaly detection device to detect text display anomalies on an electronic map, and provides location-based services to the service object based on the detection results. The location-based services include: navigation, map rendering, route planning or one or more thereof.

[0133] In this embodiment, the location-based service providing device can be executed on a terminal, and the terminal can include a mobile phone, an iPad, a computer, a smart watch, a vehicle, etc. In the disclosed embodiment, after the electronic map application terminal is started, the above device can be used to detect whether an abnormal display will occur on the electronic map after the text bitmap is obtained based on the native interface provided by the operating system on the electronic device during the operation of the electronic map on the current electronic device. If an abnormal display occurs, the electronic map is configured to obtain a text bitmap of a specified default font from the native interface of the operating system when text needs to be displayed during subsequent map rendering, navigation, path planning, etc., and then display the text bitmap of the default font for display.

[0134] The service object may be a mobile phone, iPad, computer, smart watch, vehicle, robot, etc. When navigating, planning a route or rendering a road on a map for the service object, the above-mentioned text display abnormality detection device may be periodically started to detect whether there will be abnormalities in displaying text on the electronic map. If an abnormality occurs, and the electronic map is not configured to obtain the text bitmap in a specified default font, the electronic map is configured to obtain the text bitmap in a specified default font for display; and if the electronic map is configured to obtain the text bitmap in a specified default font, no configuration is performed on the electronic map; but if it is detected that no text display abnormality will occur, and the electronic map is configured to obtain the text bitmap in a specified default font, the configuration of the electronic map may be restored so that the electronic map directly obtains the text bitmap from the native interface of the operating system without specifying to obtain it in a default font.

[0135] Figure 4 It is a structural schematic diagram of an electronic device suitable for implementing the text display abnormality detection method and / or location-based service provision method according to an embodiment of the present disclosure.

[0136] like Figure 4 As shown, the electronic device 400 includes a processing unit 401, which can be implemented as a processing unit such as a CPU, a GPU, an FPGA, and an NPU. The processing unit 401 can perform various processes in the embodiments of any of the above methods of the present disclosure according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 to a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0137] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.

[0138] In particular, according to an embodiment of the present disclosure, any method in the above referenced embodiment of the present disclosure may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing any method in the embodiment of the present disclosure. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from a removable medium 411.

[0139] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0140] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be arranged in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0141] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.

[0142] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A method for detecting abnormal text display. in, include: Using an operating system interface to obtain a first text bitmap and a second text bitmap; The first character bitmap and the second character bitmap correspond to different characters respectively; Determine the color filling rate of the first character bitmap and the second character bitmap respectively; the color filling rate is the proportion of colored pixels in the total number of pixels; Determining whether an abnormality will occur when displaying text on the application end based on the color filling rates of the first text bitmap and the second text bitmap and a preset corresponding relationship; The preset corresponding relationship is the relationship between the text display abnormality and the color filling rate of the first text bitmap and the second text bitmap.

2. The method according to claim 1, in, Determining the color fill rates of the first text bitmap and the second text bitmap respectively includes: Counting a first pixel number of non-transparent pixels in the first text bitmap, and counting a second pixel number of non-transparent pixels in the second text bitmap; determining a first fill rate of the first text bitmap based on a ratio of the first number of pixels to a total number of pixels in the first text bitmap; A second fill rate of the second character bitmap is determined based on a ratio of the second number of pixels to a total number of pixels in the second character bitmap.

3. The method according to claim 2, in, Determining whether an abnormality occurs when displaying text on the application end based on the color filling rates of the first text bitmap and the second text bitmap and a preset corresponding relationship includes: When the first filling rate and the second filling rate are equal, or one of the first filling rate and the second filling rate is greater than or equal to a preset threshold, it is determined that an abnormality will occur in displaying text on the application end.

4. The method according to any one of claims 1 to 3, in, The method further comprises: After determining that an abnormality occurs when displaying text on the application end, the application end is configured so that a text bitmap is subsequently obtained by specifying a default font.

5. The method according to any one of claims 1 to 3, in, The method further comprises: After the application is started, the text display abnormality detection process is triggered periodically to detect whether there is any abnormality in the text display on the application.

6. The method according to any one of claims 1 to 3, in, Before respectively determining the color filling rates of the first character bitmap and the second character bitmap, the method further includes: When the first character bitmap and the second character bitmap are in a multi-channel mode, converting the first character bitmap and the second character bitmap into a single-channel grayscale image; Determining the color fill rates of the first text bitmap and the second text bitmap respectively includes: The color fill rate is determined based on the number of pixels with pixel values ​​greater than 0 in the single-channel grayscale images corresponding to the first text bitmap and the second text bitmap.

7. A method for providing location-based services, include: The method described in any one of claims 1 to 6 is used to detect abnormal text display on an electronic map, and based on the detection results, location-based services are provided to the service object, wherein the location-based services include one or more of navigation, map rendering, and route planning.

8. A device for detecting abnormal text display, in, include: An acquisition module is configured to acquire the first text bitmap and the second text bitmap using an operating system interface; The first character bitmap and the second character bitmap correspond to different characters respectively; The first determination module is configured to determine the color filling rate of the first character bitmap and the second character bitmap respectively; the color filling rate is the proportion of colored pixels in the total number of pixels; A second determination module is configured to determine whether an abnormality occurs when displaying text on the application end based on the color filling rates of the first text bitmap and the second text bitmap and a preset corresponding relationship; The preset corresponding relationship is the relationship between the text display abnormality and the color filling rate of the first text bitmap and the second text bitmap.

9. An electronic device, in, The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the method according to any one of claims 1 to 7.

10. A computer program product comprising computer instructions, in, When the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.