Pattern management method and device based on graphics library, equipment and medium

By grouping and managing graphic style objects and managing their initialization identifiers, the memory leaks and fragmentation caused by frequent initialization of graphic styles are resolved, thereby improving system performance and memory utilization.

CN120910289APending Publication Date: 2025-11-07ZHENSHI INFORMATION TECH SHANGHAI CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511041814.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

In interface design based on basic graphics libraries, frequent initialization of graphic styles leads to memory leaks, memory fragmentation, and system performance degradation, while style redundancy causes memory waste.

Method used

By grouping and managing graphical style objects and carrying initialization identifiers, repetitive initialization operations are reduced. System word length-aligned memory allocation and compile-time memory allocation are used to avoid frequent memory allocation and release.

Benefits of technology

It reduces memory fragmentation, improves memory utilization and system stability, reduces memory allocation frequency, and enhances system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910289A_ABST
    Figure CN120910289A_ABST
Patent Text Reader

Abstract

The invention discloses a pattern management method and device based on a graphics library, equipment and a medium. Comprising the steps of determining multiple graphic style objects according to a graphic library; wherein each graphic style object at least comprises graphic configuration information determined according to at least one basic graphic in a graphic library; storing the graphic style objects in groups to obtain a plurality of style groups; wherein each pattern group comprises at least one graphic pattern object and an initialization identifier corresponding to each graphic pattern object; and determining initialization operation information of the first graphic style object in each style group, and configuring an initialization identifier corresponding to the first graphic style object according to the initialization operation information. According to the method, the graphic style objects are subjected to grouping management, and the initialization information of each graphic style object is carried in the grouping management, so that the memory overhead caused by frequent repeated initialization of the graphic style objects is reduced, the memory allocation frequency is reduced, and the memory fragmentation degree is further reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a style management method and device based on a graphics library, an equipment and a medium. BACKGROUND

[0002] In the interface design development process based on the basic graphics library, the graphics style developed based on the graphics library is used to beautify the interface. However, the graphics style needs to be initialized every time it is used, which is prone to memory leakage and causes memory depletion, resulting in system lag or even shutdown. In addition, repeated initialization of the graphics style during use will also cause serious memory fragmentation due to frequent allocation and release of style-related memory, affecting system performance and power consumption. At the same time, the use of styles is usually scattered, which brings about style redundancy and also causes memory waste and other problems. SUMMARY

[0003] The present application provides a style management method and device based on a graphics library, an equipment and a medium to solve the problem of low memory utilization rate of graphics style in the interface design process.

[0004] According to one aspect of the present application, a style management method based on a graphics library is provided, comprising:

[0005] determining a plurality of graphics style objects according to the graphics library; wherein each graphics style object includes at least graphics configuration information determined according to at least one basic graphics in the graphics library;

[0006] grouping and storing the graphics style objects to obtain a plurality of style groups; wherein each style group includes at least one graphics style object and the initialization identifier corresponding to each graphics style object;

[0007] determining the initialization operation information of the first graphics style object in each style group, and configuring the initialization identifier corresponding to the first graphics style object according to the initialization operation information.

[0008] According to another aspect of the present application, a style management device based on a graphics library is provided, comprising:

[0009] determining a plurality of graphics style objects according to the graphics library; wherein each graphics style object includes at least graphics configuration information determined according to at least one basic graphics in the graphics library;

[0010] grouping and storing the graphics style objects to obtain a plurality of style groups; wherein each style group includes at least one graphics style object and the initialization identifier corresponding to each graphics style object;

[0011] Determine initialization operation information of a first graphic style object in each style group, and configure an initialization identifier corresponding to the first graphic style object according to the initialization operation information.

[0012] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0013] at least one processor; and

[0014] a memory connected with the at least one processor in communication; wherein,

[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the graphic library-based style management method according to any one of the embodiments of the present application.

[0016] According to another aspect of the present application, a computer readable storage medium is provided, the computer readable storage medium stores computer instructions for enabling a processor to implement the graphic library-based style management method according to any one of the embodiments of the present application when executed by the processor.

[0017] The technical solution of the embodiments of the present application reduces the memory overhead caused by frequent repeated initialization of graphic style objects by grouping and managing the graphic style objects and carrying initialization information of each graphic style object in the grouping and management, reduces the number of memory allocations, and further reduces the degree of memory fragmentation.

[0018] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0020] Figure 1 is a flowchart of a graphic library-based style management method according to an embodiment of the present application;

[0021] Figure 2 is a flowchart of another graphic library-based style management method according to an embodiment of the present application;

[0022] Figure 3is an example diagram of interface design;

[0023] Figure 4 is a structural schematic diagram of a style management device based on a graphics library according to an embodiment of the present application;

[0024] Figure 5 is a structural schematic diagram of an electronic device implementing a graphics library-based style management method according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the person skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0026] It should be noted that the terms "candidate", "target" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0027] Figure 1 A flowchart of a graphics library-based style management method is provided for the embodiments of the present application. The present embodiment can be applicable to improve the memory management efficiency of generating styles based on a graphics library. The method can be performed by a graphics library-based style management device, which can be realized in the form of hardware and / or software, and can be configured in a server with computing capability. As shown in the figure, the method comprises: Figure 1

[0028] S110, determining a plurality of graphic style objects according to a graphics library.

[0029] The graphics library refers to a library providing a plurality of basic graphics, which can be generated according to the combination and configuration of the basic graphics in the graphics library. The basic graphics can be basic regular graphics such as circles and squares, or irregular graphics, etc. The basic graphics can also be directly applied in the UI design interface.​

[0030] The graphic style object refers to a style generated according to a basic graphic in a graphic library. The graphic style object can be a graphic style after modification based on the basic graphic, or a graphic style based on a combination of multiple basic graphics, wherein each basic graphic in the combination can be a default parameter without modification, or a parameter after modification of the default parameter.

[0031] Specifically, multiple graphic style objects are designed in advance according to interface design requirements according to the basic graphics provided in the graphic library. Each graphic style object includes at least graphic configuration information determined according to at least one basic graphic in the graphic library. For example, a graphic style object is generated by modifying parameters of one basic graphic in the graphic library. The graphic configuration information included in the graphic style object includes at least index information of the basic graphic, parameter modification information, and a name of the graphic style object. Alternatively, a graphic style object is generated by combining at least two basic graphics in the graphic library. The graphic configuration information included in the graphic style object includes at least index information of the at least two basic graphics, parameter modification information, a positional relationship, and a name of the graphic style object. The positional relationship is used to represent the mutual positional relationship between the at least two basic graphics.

[0032] S120, grouping and storing the graphic style objects to obtain multiple style groups.

[0033] The multiple graphic style objects are grouped and stored in memory to obtain multiple style groups. Each style group includes at least one graphic style object and an initialization identifier corresponding to each graphic style object. Each style group includes definition information of at least one graphic style object and an initialization identifier corresponding to each graphic style object. The initialization identifier is used to identify whether the graphic style object is initialized.

[0034] Specifically, the multiple graphic style objects are grouped. The grouping can be based on the basic graphic corresponding to the graphic style object, that is, the graphic style objects including the same basic graphic are grouped in the same group, or the graphic style objects with the same object attribute are grouped in the same group. The object attribute can be predefined according to the specific content of the graphic style object, for example, the object attribute includes whether to include background information, etc. For example, the object attribute information can be embodied in the name of the graphic style object, that is, the graphic style objects with different object attributes can be located according to the name.

[0035] The allocated memory space corresponding to each style group comprises a graphic style object memory block and an initialization identifier memory block, the graphic style object memory block comprises allocated memory corresponding to all graphic style objects included in the style group, the initialization identifier memory block comprises initialization identifier information corresponding to all graphic style objects included in the style group, and the initialization identifier information is saved in the same order as the graphic style objects, so as to determine the corresponding initialization identifier according to the positioning result of the graphic style object in the style group.

[0036] S130, determine initialization operation information of the first graphic style object in each style group, and configure the initialization identifier corresponding to the first graphic style object according to the initialization operation information.

[0037] Determine whether the user has performed an initialization operation on the first graphic style object, if initialization operation information is generated, modify the initialization identifier of the first graphic style object to initialized; if the first graphic style object is not initialized, the initialization identifier of the first graphic style object is in a default state, i.e. uninitialized.

[0038] In the interface design process using the graphic style objects in the style group, if the user needs to use the first graphic style object, first determine the initialization identifier corresponding to the first graphic style object, if the initialization identifier is initialized, the user can directly use the first graphic style object; if the initialization identifier is uninitialized, the user initializes the first graphic style object before using it, and modifies the initialization identifier corresponding to the first graphic style object after the initialization operation. This avoids repeated initialization operations on the same graphic style object, reduces the degree of memory fragmentation caused by repeated initialization operations, and reduces the number of memory allocations.

[0039] The technical scheme of the embodiment reduces the memory overhead caused by frequent repeated initialization of graphic style objects, improves memory utilization, reduces the number of memory allocations, thereby reducing the degree of memory fragmentation, and improves system stability and performance.

[0040] Figure 2 Another flowchart of a style management method based on a graphic library is provided in the embodiment, and the embodiment further refines the step of grouping and storing the graphic style objects in the above-mentioned embodiment to obtain a plurality of style groups. As shown in Figure 2 The method comprises:

[0041] S210, determine a plurality of graphic style objects according to a graphic library.

[0042] Each of the graphic style objects comprises graphic configuration information determined according to at least one base graphic in a graphic library.

[0043] S220, determining at least one first graphic style object from the plurality of graphic style objects according to a style attribute corresponding to the first style group.

[0044] The style attribute is determined according to an object attribute of the graphic style object, and the object attribute is predefined according to specific content of the graphic style object. The corresponding style attribute of each style group is determined according to the object attribute of the plurality of graphic style objects in advance, and at least one first graphic style object matched with the first style group is determined from the plurality of graphic style objects according to a matching relationship between the defined style attribute of the first style group and the object attribute, and the at least one first graphic style object is stored in the first style group. For example, the object attribute of the graphic style object includes a single background attribute, a complex background attribute, a button background attribute, etc., and the style attribute of the first style group is defined as a background attribute. Therefore, the plurality of graphic style objects included in the first style group are graphic style objects with a single background attribute, graphic style objects with a complex background attribute, and graphic style objects with a button background attribute. Optionally, the style attribute and the object attribute can also be determined according to other content of the graphic style object.

[0045] S230, determining a memory block corresponding to each first graphic style object in the allocated memory space corresponding to the first style group.

[0046] In the memory allocation, a corresponding memory space is allocated for each style group, and a corresponding memory block for each first graphic style object in the style group is determined in the allocated memory space. That is, in the allocated memory space corresponding to the first style group, each graphic style object corresponds to a memory block.

[0047] In a feasible embodiment, the memory blocks corresponding to the first graphic style objects in the first style group are stored in a system word length alignment manner.

[0048] The memory blocks of all graphic style objects in each style group are stored in a system word length alignment manner. The system word length is a number of bytes predefined by an interface design system, for example, the system word length is 4 bytes. For example, three first graphic style objects are defined in the first style group, and the memory blocks corresponding to each first graphic style object are an integer multiple of the system word length.

[0049] In this embodiment, the related memory of the graphic style object is allocated in a system word length alignment manner, and the memory allocation time is the compilation period. Since the CPU needs to execute instructions to allocate content at the running period, the compilation period does not need CPU to execute instructions. Therefore, placing the memory allocation at the compilation period reduces the overhead of memory allocation, and more CPU resources are given to business processing.

[0050] S240, store the initialization identifier corresponding to each first graphic style object in the remaining memory block in the allocated memory space corresponding to the first style group.

[0051] The initialization identifier corresponding to each first graphic style is stored in the remaining memory block in the allocated memory space of the first style group, except for the memory block corresponding to all first graphic style objects. For example, the initialization identifier corresponding to each first graphic style object is stored in the starting address of the remaining memory block in sequence, and the order of the initialization identifier is determined according to the storage order of each first graphic style object in the allocated memory space corresponding to the first style group. The memory space in the remaining memory block except for the initialization identifier is filled with default values.

[0052] In a feasible embodiment, the memory block corresponding to each first graphic style object in the first style group is stored using continuous memory, and the remaining memory block is located in the subsequent memory of the memory block corresponding to the last first graphic style object in the first style group.

[0053] Specifically, the addresses of the memory blocks corresponding to all graphic styles in each style group are continuous, which facilitates determining the position of the corresponding initialization identifier according to the position of the memory block. After determining the memory block corresponding to the last first graphic style object in the allocated memory space of the first style group, the subsequent remaining memory is the position of the remaining memory block corresponding to the initialization identifier.

[0054] For example, the definition of the first style group is as follows:

[0055] typedef struct slide_win_styles{

[0056] lv_style_t single_bg_widget_style;

[0057] lv_style_t multi_bg_widget_style;

[0058] lv_style_t tool_btn_style;

[0059] XUN_U8 inited flag[4];

[0060] }slide_win_styles_t;

[0061] Wherein, slide_win_styles_t represents the first style group, the first style group includes three first graphic style objects lv_style_t, and n XUN_U8 is added in the remaining memory after the last first graphic style object, n is to make the first style group corresponding to the allocated memory space is still an integer multiple of the system word length. In n XUN_U8, the initialization identification bit corresponding to each first graphic style object is sequentially allocated from the first XUN_U8, and the remaining XUN_U8 is filled with default values.

[0062] Since the real-time system has strict limitations on the response time of memory allocation, it is necessary to ensure that the memory allocation operation is completed within a certain time range, therefore, in order to avoid the delay of task scheduling caused by time-consuming allocation, the graphic style objects are stored in continuous memory in this embodiment, and the algorithm time complexity of finding a certain graphic style object is O(1), which is very important to ensure the real-time performance of the interface design system. And since the number of graphic style objects in each style group will not be changed during program running, there is no O(n) complexity of insertion, deletion and other operations, which improves the efficiency of interface design.

[0063] As each graphic style object in the above definition example (structure) of the first style group is declared continuously, the system will allocate a continuous memory block to store each graphic style object (style) when allocating memory. And when retrieving the graphic style object, the name of the graphic style object can be directly indexed, and the position of the initialization identification can be quickly calculated according to the index position in the style group, so as to ensure that the retrieval time complexity is O(1). Because each style group uses an aligned memory block, it is convenient for the system to splice the memory blocks of each style group into a large aligned memory block, and memory alignment ensures the efficiency of system data access.

[0064] In a feasible embodiment, after the graphic style objects are grouped and stored to obtain a plurality of style groups, the method comprises:

[0065] Determine the new graphic style object in the first style group;

[0066] Add the configuration information of the new graphic style object after the last first graphic style object in the first style group;

[0067] Determine the initialization identification bit corresponding to the new graphic style object in the remaining memory block.

[0068] If new requirements arise during interface design, new graphic style objects will be created accordingly. Since memory is allocated at compile time, after adding the configuration information for the new graphic style object to the first style group, recompilation is required for memory allocation. The memory allocation principle refers to the principle of allocation based on system word length alignment and contiguous memory allocation in the above embodiment. The initialization flag of the new graphic style object is determined after the initialization flag of the existing graphic style object in the remaining memory block.

[0069] For example, referring to the above embodiment, the definition of the newly added first style group is as follows:

[0070] typedef struct slide_win_styles{

[0071] lv_style_t single_bg_widget_style;

[0072] lv_style_t multi_bg_widget_style;

[0073] lv_style_t tool_btn_style;

[0074] lv_style_t new_style; / / Add a new graphic style object; simply append the definition information to the first style group.

[0075] XUN_U8 inited flag[4];

[0076] }slide_win_styles_t;

[0077] Furthermore, in this embodiment, the access interfaces of all graphic style objects are implemented using macro definitions for basic capabilities. For example, after defining the first style group, the interfaces of graphic style objects can be defined using macro definitions: `STYLE_CREATE(single_bg_widget_style); STYLE_CREATE(multi_bg_widget_style); STYLE_CREATE(tool_btn_style); STYLE_CREATE(new_style);`. The `STYLE_CREATE` macro is called directly using the original graphic style object definition name from the first style group; this macro is a function definition. By combining macro definitions with style groups, when adding a new graphic style object, the declaration and configuration information of the new graphic style object can be directly appended without the burden of adjusting the code structure, thus improving the efficiency of adding graphic style objects.

[0078] In a feasible embodiment, after the graphic style objects are stored in groups to obtain a plurality of style groups, the method comprises:

[0079] determining a deleted graphic style object in the first style group;

[0080] hiding a calling interface of the deleted graphic style object, or deleting a life of the deleted graphic style object.

[0081] If a new requirement is generated during interface design, and the defined graphic style object needs to be deleted, the graphic style object is determined as a deleted graphic style object, a calling interface in a corresponding style group of the deleted graphic style object is directly hidden, or a memory life of the deleted graphic style object is deleted, and the operation can be realized by simple code.

[0082] The embodiment has strong flexibility in management of styles. When it is necessary to reduce graphic style objects, only the interface needs to be hidden and the style object life needs to be deleted, and the management efficiency of the graphic style objects is improved.

[0083] S250, determining initialization operation information of a first graphic style object in each style group, and configuring an initialization identifier corresponding to the first graphic style object according to the initialization operation information.

[0084] In a feasible embodiment, the method further comprises:

[0085] determining a style name to be designed, and determining a position of a target graphic style object from the style groups according to the style name;

[0086] determining a target initialization identifier of the target graphic style object according to the position;

[0087] generating at least two controls corresponding to the target graphic style object according to the target initialization identifier, and designing an interface according to the at least two controls; wherein different configuration information of the target graphic style object is included in different controls.

[0088] During interface design, first, a style name of a graphic style object to be used is determined, a target graphic style object is determined according to the style name, and a position of the target graphic style object is determined by searching from a plurality of saved style groups. Since the graphic style objects are stored continuously in the style groups, and the initialization identifiers are sequentially stored according to the order of the graphic style objects, the initialization identifier of the target graphic style object can be found according to the position of the target graphic style object in the style groups.

[0089] If the target initialization identifier corresponds to an initialized target initialization identifier, at least two controls are generated according to the initialization result of the target graphical style object, and interface design is performed according to the at least two controls. The specific configuration information of different controls is different, for example, the background color is different, or the background is different, and the like. As shown in Figure 3 FIG. 2 is an example diagram of interface design, in which the volume setting control and the screen brightness setting control are both generated according to the graphical style object of the rectangle with a rounded corner and a background color, that is, the same graphical style object is used to manage the at least two controls.

[0090] The embodiment of the present application has centralized management of the graphical style object and high reuse rate, which is mainly reflected in that all controls with the same style in the system use the same style object, that is, the memory of (n-1) * graphical style objects is saved. In addition, since the graphical style objects are centrally stored and reused, the allocation and release of the graphical style object memory are avoided frequently, and the overhead of the initialization of the graphical style object is reduced.

[0091] The technical scheme of the embodiment of the present application improves the memory management efficiency of the graphical style object, improves the system resource utilization rate and the maintainability by centrally storing and managing the graphical style object and centrally storing and managing the initialization identifier.

[0092] Figure 4 A structure schematic diagram of a style management device based on a graphical library provided for the embodiment of the present application is shown in Figure 4 FIG. 3.

[0093] The style object determination module 410 is configured to determine a plurality of graphical style objects according to the graphical library, wherein each graphical style object at least includes graphical configuration information determined according to at least one basic figure in the graphical library.

[0094] The style object grouping module 420 is configured to group and store the graphical style objects to obtain a plurality of style groups, wherein each style group includes at least one graphical style object and an initialization identifier corresponding to each graphical style object.

[0095] The initialization identifier configuration module 430 is configured to determine initialization operation information of a first graphical style object in each style group, and configure an initialization identifier corresponding to the first graphical style object according to the initialization operation information.

[0096] The technical scheme of the embodiment of the present application reduces the memory overhead caused by frequent repeated initialization of the graphical style object by grouping and managing the graphical style objects and carrying the initialization information of each graphical style object in the grouping management, and reduces the degree of memory fragmentation.

[0097] Optionally, the style object grouping module is specifically configured to:

[0098] determine at least one first graphic style object from the plurality of graphic style objects according to the style attribute corresponding to the first style group;

[0099] determine a memory block corresponding to each first graphic style object in the allocated memory space corresponding to the first style group;

[0100] store an initialization identifier corresponding to each first graphic style object in the remaining memory block of the allocated memory space corresponding to the first style group.

[0101] Optionally, the memory block corresponding to each first graphic style object in the first style group is stored in a system word length alignment manner.

[0102] Optionally, the memory block corresponding to each first graphic style object in the first style group is stored in a continuous memory, and the remaining memory block is located in the subsequent remaining memory of the memory block corresponding to the last first graphic style object in the first style group.

[0103] Optionally, the device further comprises a style object adding module configured to, after the graphic style objects are stored in groups to obtain a plurality of style groups, specifically configured to:

[0104] determine an added graphic style object in the first style group;

[0105] add configuration information of the added graphic style object after the last first graphic style object in the first style group;

[0106] determine an initialization identifier corresponding to the added graphic style object in the remaining memory block.

[0107] Optionally, the device further comprises a style object deleting module configured to, after the graphic style objects are stored in groups to obtain a plurality of style groups, specifically configured to:

[0108] determine a deleted graphic style object in the first style group;

[0109] hide a calling interface of the deleted graphic style object, or delete the life of the deleted graphic style object.

[0110] Optionally, the device further comprises a style object reuse module configured to:

[0111] determine a style name to be designed, and determine a position of a target graphic style object from the style group according to the style name;

[0112] According to the position, a target initialization identifier of the target graphical style object is determined;

[0113] According to the target initialization identifier, at least two controls corresponding to the target graphical style object are generated, and interface design is performed according to the at least two controls; wherein different configuration information of the target graphical style object is included in different controls.

[0114] The style management device based on the graphical library provided in the embodiments of the present application can perform the style management method based on the graphical library provided in any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of performing the method.

[0115] In the technical solution of the present application, the acquisition, storage, use, processing and the like of data comply with relevant provisions of national laws and regulations, and do not violate public order and good customs.

[0116] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0117] Figure 5 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the present application described and / or claimed in this document.

[0118] As shown in Figure 5 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0119] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0120] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the method based on style management of a graphics library.

[0121] In some embodiments, the method based on style management of a graphics library can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the method based on style management of a graphics library described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the method based on style management of a graphics library by any other appropriate means, such as by means of firmware.

[0122] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0123] Computer programs for implementing the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, enables the functions / acts specified in the flowcharts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a standalone software package and partially on a remote machine or entirely on a remote machine or server.

[0124] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0125] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0126] The systems and techniques described herein can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described herein, or any combination of these, e.g., a backend component, a middleware component, or a front end component. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0127] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0128] In particular, the processes described above with reference to the flow charts can be implemented in a computer software program in accordance with embodiments of the application. For example, embodiments of the application include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program comprising program code for executing the methods illustrated by the flow charts. In such embodiments, the computer program can be downloaded and installed from a network via the communication unit 19, or installed from the storage unit 18, or installed from the ROM 12. When the computer program is executed by the processor 11, the above-described functions defined in the methods of the embodiments of the application are performed.

[0129] It should be understood that various forms of flow shown above can be used, with steps reordered, added, or removed. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, without limitation herein, so long as the desired results of the technical solutions of the present application are achieved.

[0130] The specific embodiments described above are not intended to be limiting, but rather to illustrate the principles of the present application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and principles of the present application. Any further modifications, equivalents, alternatives, and / or improvements made to the specific embodiments described above are intended to fall within the scope of the present application.

Claims

1. A style management method based on a graphics library, characterized by, The method comprises: determining a plurality of graphic style objects according to the graphic library; wherein each graphic style object comprises at least graphic configuration information determined according to at least one base graphic in the graphic library; grouping and storing the graphic style objects to obtain a plurality of style groups; wherein each style group comprises at least one graphic style object and the initialization identifier corresponding to each graphic style object; determining the initialization operation information of the first graphic style object in each style group, and configuring the initialization identifier corresponding to the first graphic style object according to the initialization operation information.

2. The method of claim 1, wherein, Grouping and storing the graphic style objects to obtain a plurality of style groups comprises: determining at least one first graphic style object from the plurality of graphic style objects according to the style attribute corresponding to the first style group; determining the memory block corresponding to each first graphic style object in the allocated memory space corresponding to the first style group; storing the initialization identifier corresponding to each first graphic style object in the remaining memory block of the allocated memory space corresponding to the first style group.

3. The method of claim 2, wherein, Among them, the memory block corresponding to each first graphic style object in the first style group is stored in a system word length alignment manner.

4. The method of claim 2, wherein, Among them, the memory block corresponding to each first graphic style object in the first style group is stored in a continuous memory, and the remaining memory block is located in the subsequent remaining memory of the memory block corresponding to the last first graphic style object in the first style group.

5. The method of claim 2, wherein, After grouping and storing the graphic style objects to obtain a plurality of style groups, the method comprises: determining a new graphic style object in the first style group; adding the configuration information of the new graphic style object after the last first graphic style object in the first style group; determining the initialization identifier corresponding to the new graphic style object in the remaining memory block.

6. The method of claim 2, wherein, After grouping and storing the graphic style objects to obtain a plurality of style groups, the method comprises: determining a deleted graphic style object in the first style group; hiding the calling interface of the deleted graphic style object, or deleting the life of the deleted graphic style object.

7. The method of claim 1, wherein, The method further comprises: determining the style name to be designed, and determining the position of the target graphic style object from the style group according to the style name; determining the target initialization identifier of the target graphic style object according to the position; generating at least two controls corresponding to the target graphic style object according to the target initialization identifier, and designing the interface according to the at least two controls; wherein different controls comprise different configuration information of the target graphic style object.

8. A style management apparatus based on a graphics library, characterized by, The device comprises: a style object determination module for determining a plurality of graphic style objects according to the graphic library; wherein each graphic style object comprises at least graphic configuration information determined according to at least one base graphic in the graphic library; a style object grouping module for grouping and storing the graphic style objects to obtain a plurality of style groups; wherein each style group comprises at least one graphic style object and the initialization identifier corresponding to each graphic style object; The initialization identification configuration module is configured to determine initialization operation information of a first graphical style object in each style group, and configure an initialization identification corresponding to the first graphical style object according to the initialization operation information.

9. An electronic device, comprising: The electronic device includes: at least one processor; and a memory connected to the at least one processor in communication; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the graphical library-based style management method in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to execute the graphical library-based style management method in any one of claims 1-7 when executed.

Citation Information

Patent Citations

  • A chart rendering method and system for a memory object

    CN109240784A

  • Styling mechanism for enriching user interface design

    CN1828597A