Expression method and device of user interface component, terminal and medium
By analyzing the component definition and usage of different user interface frameworks, determining universal components and formulating unified expression standards, the development efficiency problems caused by differences between frameworks are solved, and efficient development and maintenance of cross-platform components are achieved.
Patent Information
- Application Number
- CN202411849241.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-16
AI Technical Summary
There are differences in naming conventions and attribute definitions between different user interface frameworks and libraries, which leads to developers re-learning and adapting when switching frameworks. There is a lack of unified component expression standards, resulting in large differences in component definitions and use, affecting development efficiency.
By analyzing at least two preset user interface frameworks, a universal component is determined, and based on the definition and usage of the component, the component expression content used across platforms is determined, including unified definitions of attributes, events and methods.
The ability to develop and maintain components more efficiently in different platforms and technical environments is achieved, and by providing a flexible and consistent set of expression standards, developers can adapt to different frameworks.
Smart Images

Figure CN119690420A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of user interface development, and in particular to a method, device, terminal and medium for expressing a user interface component. Background Art
[0002] Platform independence refers to a feature of software or programming language design that allows the written program to run on a variety of different hardware or operating system platforms without the need for special modifications or recompilation for each platform. In the process of user interface development, cross-platform components can be built based on platform independence.
[0003] However, different frameworks and libraries may have different naming conventions and property definitions for existing components, which requires developers to relearn and adapt when switching frameworks. At the same time, there is no unified component expression standard that is widely used in all frameworks and libraries, resulting in large differences in the definition and use of components, which in turn greatly reduces the development results of developers. Summary of the invention
[0004] The main purpose of this application is to provide a method, device, terminal and medium for expressing user interface components, aiming to present a set of flexible and consistent expression standards by expressing the content of user interface components that can adapt to different user interface frameworks and different technology stacks, so that developers can use the expression standards to more efficiently develop and maintain components in different platforms and technical environments.
[0005] To achieve the above object, the present application provides a method for expressing a user interface component, the method comprising:
[0006] Analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework;
[0007] Based on the first analysis result, selecting at least one first component from the various components, wherein the first component is used to represent a universal component in the preset user interface framework;
[0008] Analyze the first component to obtain a second analysis result, wherein the second analysis result is used to characterize a definition of the first component under the preset user interface framework and a usage mode of the first component under the preset user interface framework;
[0009] Based on the second analysis result, the expression content of a second user interface component is determined, wherein the second component is used to represent a component that can be used across platforms.
[0010] Specifically, the second analysis result includes a code corresponding to a definition of the first component in the preset user interface framework and a code corresponding to a usage of the first component in the preset user interface framework, and the expression content includes attribute content, event content and method content;
[0011] The determining, based on the second analysis result, the expression content of the second user interface component includes:
[0012] Based on the code corresponding to the definition, determining that the expression content includes the attribute content and the event content;
[0013] Based on the code corresponding to the usage mode, it is determined that the expression content includes the method content.
[0014] Specifically, the preset user interface framework includes an EXT framework;
[0015] The determining, based on the code corresponding to the definition, that the expression content includes attribute content and the event content comprises:
[0016] Based on the code corresponding to the definition, determining that the definition of the first component in each preset user interface framework includes a setting method of the attribute corresponding to the attribute content;
[0017] Determining that the expression content includes the attribute content based on that the definitions of the first components in the respective preset user interface frameworks all include the setting manner of the attribute corresponding to the attribute content;
[0018] Based on the code corresponding to the definition of the first component in the EXT frame and the code corresponding to the definition, determine that the blur event content defined by the first component in the EXT frame is an independent description structure, and determine that the event content defined by the first component in the preset user interface frame other than the EXT frame is included in the attribute content defined by the first component;
[0019] Based on the fact that the blur event content defined by the first component in the EXT frame is an independent description structure and the event content defined by the first component in the preset user interface frame other than the EXT frame is included in the attribute content defined by the first component, it is determined that the expression content includes the event content.
[0020] Specifically, the determining, based on the code corresponding to the usage mode, that the expression content includes the method content, includes:
[0021] Based on the code corresponding to the usage mode, determining that modifying the value in the first component in each usage mode includes method content;
[0022] Based on the fact that the values in the first component modified in each of the usage modes include method content, it is determined that the expression content includes the method content.
[0023] Specifically, the method content includes a method content name, method content parameters and a method content description. The method content name is used to identify the method content, and the method content name corresponds one-to-one to the method content. The method content parameters are used to characterize all parameters received by the method content, and the method content description is used to describe in detail the functions and usage scenarios corresponding to the method content.
[0024] Specifically, the event content includes an event content name, event content parameters and event content description. The event content name is used to identify the event content, and the event content name corresponds one-to-one to the event content. The event content parameters are used to characterize additional parameters of the event object in the event content, and the event content description is used to describe in detail the functions and trigger conditions corresponding to the event content.
[0025] Specifically, the attribute content includes an attribute content name, an attribute content type, an attribute content default value, and an attribute content description. The attribute content name is used to identify the function corresponding to the attribute content, the content type is used to characterize the data type of the data in the attribute content, the attribute content default value is used to characterize the initial value of the attribute content, and the attribute content description is used to describe the attribute content.
[0026] To achieve the above object, the present application also provides an expression device of a user interface component, the device comprising:
[0027] A first unit is used to analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework;
[0028] A second unit is configured to select at least one first component from the components based on the first analysis result, wherein the first component is used to represent a universal component in the preset user interface framework;
[0029] A third unit is used to analyze the first component to obtain a second analysis result, wherein the second analysis result is used to characterize the definition of the first component under the preset user interface framework and the usage of the first component under the preset user interface framework;
[0030] The fourth unit is used to determine the expression content of the second user interface component based on the second analysis result, wherein the second component is used to represent a component that can be used across platforms.
[0031] To achieve the above-mentioned purpose, the present application also provides a terminal, including a memory storing multiple instructions; the processor loads instructions from the memory to execute the steps in any one of the methods provided in the present application.
[0032] To achieve the above objectives, the present application also provides a medium, wherein the medium stores a plurality of instructions, wherein the instructions are suitable for a processor to load to execute the steps in any one of the methods provided in the present application.
[0033] The present application provides a method, device, terminal and medium for expressing a user interface component. The method can first analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework; then, based on the first analysis result, at least one first component is selected from the various components, wherein the first component is used to characterize a universal component in the preset user interface framework; then, the first component is analyzed to obtain a second analysis result, wherein the second analysis result is used to characterize the definition of the first component under the preset user interface framework and the usage of the first component under the preset user interface framework; based on the second analysis result, the expression content of the second user interface component is finally determined, wherein the second component is used to characterize a component that can be used across platforms.
[0034] This application can present a set of flexible and consistent expression standards through the expression content of user interface components that can adapt to different user interface frameworks and different technology stacks, so that developers can use this expression standard to more efficiently develop and maintain components in different platforms and technical environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of a process flow provided for an embodiment of the present application;
[0036] Figure 2 A schematic diagram of the structure of an expression device for a user interface component provided in an embodiment of the present application;
[0037] Figure 3 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0039] Since different frameworks and libraries may have different naming conventions and property definitions for existing components, developers need to relearn and adapt when switching frameworks. At the same time, there is no unified component expression standard that is widely used in all frameworks and libraries, resulting in large differences in the definition and use of components, which in turn greatly reduces the development results of developers.
[0040] Therefore, the embodiments of the present application provide a method, device, terminal and medium for expressing a user interface component to solve practical technical problems.
[0041] In some embodiments, the device may be specifically integrated into an electronic device, which may be a terminal, a server or other device.
[0042] In some embodiments, the server may also be implemented in the form of a terminal.
[0043] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0044] The terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0045] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0046] An embodiment of the present application provides a method for expressing user interface components. The method can present a set of flexible and consistent expression standards through the expression content of user interface components that can adapt to different user interface frameworks and different technology stacks, so that developers can use the expression standards to more efficiently develop and maintain components in different platforms and technical environments.
[0047] like Figure 1 , the specific process of the method can be as follows:
[0048] S110. Analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework.
[0049] In some embodiments, in order to obtain a unified expression standard, analysis can be performed from the definition and usage of components. Specifically, in order to obtain a universal expression standard, analysis can be performed from early HTML, mid-term EXT, JS\JQUERY, current REACT\VUE and other user interface frameworks, and the preset user interface framework may include early HTML, mid-term EXT, JS\JQUERY, current REACT\VUE and the like.
[0050] Specifically, at least two of the above-mentioned preset user interface frameworks are analyzed to obtain a first analysis result.
[0051] S120. Based on the first analysis result, select at least one first component from the various components, wherein the first component is used to represent a universal component in the preset user interface framework.
[0052] In some embodiments, in order to obtain a universal expression standard, the most representative and universal input component may be selected for subsequent analysis.
[0053] S130. Analyze the first component to obtain a second analysis result, wherein the second analysis result is used to characterize a definition of the first component under the preset user interface framework and a usage method of the first component under the preset user interface framework.
[0054] In some embodiments, the definition and use of the input component can be implemented through different preset user interface frameworks, thereby obtaining the definition of the input component under different preset user interface frameworks and the use of the input component under different preset user interface frameworks, as shown in Table 1 below:
[0055]
[0056]
[0057] Table 1 Second analysis results
[0058] S140. Determine the expression content of a second user interface component based on the second analysis result, wherein the second component is used to represent a component that can be used across platforms.
[0059] In some embodiments, the second analysis result includes the code corresponding to the definition of the first component under the preset user interface framework and the code corresponding to the usage of the first component under the preset user interface framework, and the expression content includes attribute content, event content and method content.
[0060] Specifically, the component expression standards in different user interface frameworks in different development environments are presented through attribute content, event content, and method content.
[0061] Therefore, the step of determining the expression content of the second user interface component based on the second analysis result includes the following steps S141 to S142:
[0062] S141. Based on the code corresponding to the definition, determine that the expression content includes the attribute content and the event content.
[0063] In some embodiments, the preset user interface frame includes an EXT frame.
[0064] Specifically, the determining, based on the code corresponding to the definition, that the expression content includes attribute content and the event content includes the following steps S1411 to S1414:
[0065] S1411. Based on the code corresponding to the definition, determine that the definition of the first component in each preset user interface framework includes a setting method of the attribute corresponding to the attribute content.
[0066] S1412: Determine that the expression content includes the attribute content based on the fact that the definition of the first component in each preset user interface framework includes a setting method of the attribute corresponding to the attribute content.
[0067] Specifically, as shown in the following List 2, the attribute content includes an attribute content name, an attribute content type, an attribute content default value, and an attribute content description. The attribute content name is used to identify the function corresponding to the attribute content, the content type is used to characterize the data type of the data in the attribute content, the attribute content default value is used to characterize the initial value of the attribute content, and the attribute content description is used to describe the attribute content.
[0068]
[0069] Table 2 Attribute content
[0070] Through detailed structured descriptions such as those shown in Table 2, each property in the interface component library can be clearly and consistently defined, which helps improve developers' development results, reduce usage errors, and enhance code readability and maintainability.
[0071] S1413. Based on the code corresponding to the definition of the first component under the EXT framework and the code corresponding to the definition, determine that the blur event content defined by the first component in the EXT framework is an independent description structure, and determine that the event content defined by the first component in the preset user interface framework other than the EXT framework is included in the attribute content defined by the first component.
[0072] S1414 determines that the expression content includes the event content based on that the blur event content defined by the first component in the EXT frame is an independent description structure and that the event content defined by the first component in the preset user interface frame other than the EXT frame is included in the attribute content defined by the first component.
[0073] Specifically, as shown in the following List 3, the event content includes an event content name, event content parameters and event content description, the event content name is used to identify the event content, the event content name corresponds one-to-one to the event content, the event content parameters are used to characterize additional parameters of the event object in the event content, and the event content description is used to describe in detail the functions and triggering conditions corresponding to the event content.
[0074]
[0075] Table 3 Event content
[0076] Through the structural definition of event content as shown in Table 3 above, developers can accurately understand the triggering conditions and usage methods of the events corresponding to each event content, ensuring correct responses to various interactive events in components.
[0077] S142. Based on the code corresponding to the usage mode, determine that the expression content includes the method content.
[0078] In some embodiments, the determining, based on the code corresponding to the usage mode, that the expression content includes the method content, includes the steps S1421 to S1422 as shown below:
[0079] S1421. Based on the code corresponding to the usage mode, determine that modifying the value in the first component in each usage mode includes method content.
[0080] S1422. Based on the fact that the modification of the value in the first component in each of the usage modes includes method content, determine that the expression content includes the method content.
[0081] Specifically, as shown in List 4 below, the method content includes a method content name, method content parameters, and method content description. The method content name is used to identify the method content, and the method content name corresponds one-to-one to the method content. The method content parameters are used to characterize all parameters received by the method content, and the method content description is used to describe in detail the functions and usage scenarios corresponding to the method content.
[0082]
[0083] Table 4 Method content
[0084] Through the structural definition of the method content in Table 4 above, each method in the method content can be clearly described, including its purpose, how to call it correctly, and the expected behavior and return results, which helps developers to efficiently use the methods corresponding to the method content in the user interface component library.
[0085] The embodiment of the present application first analyzes at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework; then, based on the first analysis result, at least one first component is selected from the various components, wherein the first component is used to characterize the universal component in the preset user interface framework; then, the first component is analyzed to obtain a second analysis result, wherein the second analysis result is used to characterize the definition of the first component under the preset user interface framework and the usage of the first component under the preset user interface framework; based on the second analysis result, the expression content of the second user interface component is finally determined, wherein the second component is used to characterize the component that can be used across platforms.
[0086] In summary, the present application provides a method for expressing user interface components, which presents a set of flexible and consistent expression standards by adapting to the expression content of user interface components of different user interface frameworks and different technology stacks, so that developers can use the expression standards to more efficiently develop and maintain components in different platforms and technical environments.
[0087] In order to better implement the above method, the embodiment of the present application also provides an expression device of a user interface component, which can be integrated in an electronic device, and the electronic device can be a terminal, a server, etc. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers.
[0088] For example, in this embodiment, the method of the embodiment of the present application will be described in detail by taking the expression device of the user interface component specifically integrated in the terminal as an example.
[0089] For example, Figure 2 As shown, the expression device 200 of the user interface component may include a first unit 201, a second unit 202, a third unit 203 and a fourth unit 204, and the expression device 200 of the user interface component includes:
[0090] The first unit 201 is used to analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework;
[0091] A second unit 202 is configured to select at least one first component from the components based on the first analysis result, wherein the first component is used to represent a universal component in the preset user interface framework;
[0092] The third unit 203 is used to analyze the first component to obtain a second analysis result, wherein the second analysis result is used to characterize the definition of the first component in the preset user interface framework and the usage of the first component in the preset user interface framework;
[0093] The fourth unit 204 is used to determine the expression content of the second user interface component based on the second analysis result, wherein the second component is used to represent a component that can be used across platforms.
[0094] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
[0095] From the above, it can be seen that the embodiments of the present application present a set of flexible and consistent expression standards by being able to adapt to the expression content of user interface components of different user interface frameworks and different technology stacks, so that developers can use this expression standard to more efficiently develop and maintain components in different platforms and technical environments.
[0096] The embodiment of the present application also provides an electronic device, which can be a terminal, a server, etc. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc. The server can be a single server or a server cluster composed of multiple servers, etc.
[0097] In some embodiments, the product processing device may also be integrated into multiple electronic devices. For example, the product processing device may be integrated into multiple servers, and the multiple servers may implement the expression method of the user interface component of the present application.
[0098] In this embodiment, the electronic device of this embodiment is a terminal as an example for detailed description, for example, Figure 3 As shown, it shows a schematic diagram of the structure of the terminal 300 involved in the embodiment of the present application, specifically:
[0099] The terminal 300 may include one or more processors 301 of processing cores, one or more storage media 302, a power supply 303, an input module 304, and a communication module 305. Those skilled in the art will appreciate that Figure 3 The structure of the terminal 300 shown in the figure does not constitute a limitation on the terminal 300, and the terminal 300 may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0100] The processor 301 is the control center of the terminal 300. It uses various interfaces and lines to connect various parts of the entire terminal 300. It executes various functions of the terminal 300 and processes data by running or executing software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, so as to monitor the terminal 300 as a whole. In some embodiments, the processor 301 may include one or more processing cores; in some embodiments, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 301.
[0101] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal 300, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
[0102] The terminal 300 also includes a power supply 303 for supplying power to various components. In some embodiments, the power supply 303 can be logically connected to the processor 301 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 303 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0103] The terminal 300 may further include an input module 304, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0104] The terminal 300 may also include a communication module 305. In some embodiments, the communication module 305 may include a wireless module. The terminal 300 may perform short-range wireless transmission through the wireless module of the communication module 305, thereby providing the user with wireless broadband Internet access. For example, the communication module 305 may be used to help the user send and receive emails, browse web pages, and access streaming media.
[0105] Although not shown, the terminal 300 may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 301 in the terminal 300 will load the executable files corresponding to the processes of one or more applications into the memory 302 according to the following instructions, and the processor 301 will run the applications stored in the memory 302, thereby realizing various functions, as follows:
[0106] Analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework;
[0107] Based on the first analysis result, selecting at least one first component from the various components, wherein the first component is used to represent a universal component in the preset user interface framework;
[0108] Analyze the first component to obtain a second analysis result, wherein the second analysis result is used to characterize a definition of the first component under the preset user interface framework and a usage mode of the first component under the preset user interface framework;
[0109] Based on the second analysis result, the expression content of a second user interface component is determined, wherein the second component is used to represent a component that can be used across platforms.
[0110] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0111] From the above, it can be seen that the embodiments of the present application can present a set of flexible and consistent expression standards through the expression content of user interface components that can adapt to different user interface frameworks and different technology stacks, so that developers can use this expression standard to more efficiently develop and maintain components in different platforms and technical environments.
[0112] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a medium and loaded and executed by a processor.
[0113] To this end, an embodiment of the present application provides a medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any method of expressing a user interface component provided in the embodiment of the present application. For example, the instructions can execute the following steps:
[0114] Analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework;
[0115] Based on the first analysis result, selecting at least one first component from the various components, wherein the first component is used to represent a universal component in the preset user interface framework;
[0116] Analyze the first component to obtain a second analysis result, wherein the second analysis result is used to characterize a definition of the first component under the preset user interface framework and a usage mode of the first component under the preset user interface framework;
[0117] Based on the second analysis result, the expression content of a second user interface component is determined, wherein the second component is used to represent a component that can be used across platforms.
[0118] The medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0119] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, the computer instruction is stored in a medium. A processor of a computer device reads the computer instruction from the medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations provided in the above embodiments.
[0120] Since the instructions stored in the medium can execute the steps in the expression method of any user interface component provided in the embodiments of the present application, the beneficial effects that can be achieved by the expression method of any user interface component provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0121] The above is a detailed introduction to the expression method, device, terminal and medium of a user interface component provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for expressing a user interface component, characterized in that: The method comprises: Analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework; Based on the first analysis result, selecting at least one first component from the various components, wherein the first component is used to represent a universal component in the preset user interface framework; Analyze the first component to obtain a second analysis result, wherein the second analysis result is used to characterize a definition of the first component under the preset user interface framework and a usage mode of the first component under the preset user interface framework; Based on the second analysis result, the expression content of a second user interface component is determined, wherein the second component is used to represent a component that can be used across platforms.
2. The method according to claim 1, characterized in that The second analysis result includes a code corresponding to a definition of the first component in the preset user interface framework and a code corresponding to a usage of the first component in the preset user interface framework, and the expression content includes attribute content, event content, and method content; The determining, based on the second analysis result, the expression content of the second user interface component includes: Based on the code corresponding to the definition, determining that the expression content includes the attribute content and the event content; Based on the code corresponding to the usage mode, it is determined that the expression content includes the method content.
3. The method according to claim 2, characterized in that The preset user interface framework includes an EXT framework; The determining, based on the code corresponding to the definition, that the expression content includes attribute content and the event content comprises: Based on the code corresponding to the definition, determining that the definition of the first component in each preset user interface framework includes a setting method of the attribute corresponding to the attribute content; Determining that the expression content includes the attribute content based on that the definitions of the first components in the respective preset user interface frameworks all include the setting manner of the attribute corresponding to the attribute content; Based on the code corresponding to the definition of the first component in the EXT frame and the code corresponding to the definition, determine that the blur event content defined by the first component in the EXT frame is an independent description structure, and determine that the event content defined by the first component in the preset user interface frame other than the EXT frame is included in the attribute content defined by the first component; Based on the fact that the blur event content defined by the first component in the EXT frame is an independent description structure and the event content defined by the first component in the preset user interface frame other than the EXT frame is included in the attribute content defined by the first component, it is determined that the expression content includes the event content.
4. The method according to claim 2, characterized in that The determining, based on the code corresponding to the usage mode, that the expression content includes the method content, comprises: Based on the code corresponding to the usage mode, determining that modifying the value in the first component in each usage mode includes method content; Based on the fact that the values in the first component modified in each of the usage modes include method content, it is determined that the expression content includes the method content.
5. The method according to claim 2, characterized in that The method content includes a method content name, method content parameters and method content description. The method content name is used to identify the method content, and the method content name corresponds to the method content one by one. The method content parameters are used to characterize all parameters received by the method content, and the method content description is used to describe in detail the functions and usage scenarios corresponding to the method content.
6. The method according to claim 2, characterized in that The event content includes an event content name, event content parameters and event content description. The event content name is used to identify the event content, and the event content name corresponds to the event content one by one. The event content parameters are used to characterize additional parameters of the event object in the event content, and the event content description is used to describe in detail the functions and triggering conditions corresponding to the event content.
7. The method according to claim 2, characterized in that The attribute content includes an attribute content name, an attribute content type, an attribute content default value, and an attribute content description. The attribute content name is used to identify the function corresponding to the attribute content, the content type is used to characterize the data type of the data in the attribute content, the attribute content default value is used to characterize the initial value of the attribute content, and the attribute content description is used to describe the attribute content.
8. An expression device for a user interface component, characterized in that: The device comprises: A first unit is used to analyze at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize the definition of each component in the preset user interface framework, the usage of each component in the preset user interface framework, the commonalities between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework, and the differences between the definition of each component in the preset user interface framework and the usage of each component in the preset user interface framework; A second unit is configured to select at least one first component from the components based on the first analysis result, wherein the first component is used to represent a universal component in the preset user interface framework; A third unit is used to analyze the first component to obtain a second analysis result, wherein the second analysis result is used to characterize the definition of the first component under the preset user interface framework and the usage of the first component under the preset user interface framework; The fourth unit is used to determine the expression content of the second user interface component based on the second analysis result, wherein the second component is used to represent a component that can be used across platforms.
9. A terminal, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the method according to any one of claims 1 to 7.
10. A medium, characterized in that The medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
An instruction document generation method and device of an application component
CN109725932A
Rich text generation method and device, medium and electronic equipment
CN111539200A
Cross-platform client interface development method and device, terminal equipment and medium
CN111752562A
Method and device for converting front-end assembly and rear-end assembly
CN114968204A
Component conversion system construction method, component conversion method and device and electronic equipment
CN117806652A