User interface component expression method, device, terminal and medium
By analyzing the components of different user interface frameworks and determining cross-platform expression standards, we solved the learning and adaptation problems when switching frameworks, and improved development efficiency and code quality.
Patent Information
- Application Number
- CN202411849241.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2044-12-16
AI Technical Summary
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. The lack of a unified component expression standard affects development efficiency.
Analyze at least two preset user interface frameworks to identify universal components. By analyzing their definitions and usage, determine cross-platform expression content, including properties, events, and methods, to provide consistent expression standards.
It enables more efficient development and maintenance of components across different platforms and technical environments, improves development results, reduces usage errors, and enhances code readability and maintainability.
Smart Images

Figure CN119690420B_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 a program to run on a variety of different hardware or operating system platforms without requiring specific modifications or recompilation for each platform. In user interface development, platform independence can be used to build cross-platform components.
[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 component definition and usage, which in turn greatly reduces developers' development effectiveness. 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 adapting the expression content of user interface components 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.
[0005] To achieve the above objectives, the present application provides a method for expressing a user interface component, the method comprising:
[0006] Analyzing at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize definitions of components in the preset user interface frameworks, usages of components in the preset user interface frameworks, similarities between definitions of components in the preset user interface frameworks and usages of components in the preset user interface frameworks, and differences between definitions of components in the preset user interface frameworks and usages of components in the preset user interface frameworks;
[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 in the preset user interface framework and a usage of the first component in the preset user interface framework;
[0009] Based on the second analysis result, the expression content of the second 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 code corresponding to the definition of the first component in the preset user interface framework and code corresponding to the 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 component includes:
[0012] Determining the attribute content and the event content based on a code corresponding to a definition of the first component in the preset user interface framework;
[0013] The method content is determined based on the code corresponding to the usage mode.
[0014] Specifically, the preset user interface framework includes an EXT framework;
[0015] The determining of the attribute content and the event content based on the code corresponding to the definition of the first component in the preset user interface framework includes:
[0016] Based on the code corresponding to the definition of the first component in the preset user interface framework, determining that the definition of the first component in each preset user interface framework includes a setting method for the attribute corresponding to the attribute content;
[0017] Determining the attribute content based on that the definitions of the first components in the respective preset user interface frameworks all include a setting method of an attribute corresponding to the attribute content;
[0018] Based on the code corresponding to the definition of the first component in the EXT framework, determining that the blur event content defined by the first component in the EXT framework is an independent description structure, and determining that the event content defined by the first component in a preset user interface framework other than the EXT framework is included in the attribute content defined by the first component;
[0019] The event content is determined based on 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.
[0020] Specifically, determining the method content based on the code corresponding to the usage method 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 modification of the value in the first component in each of the usage modes includes method content, the method content is determined.
[0023] Specifically, 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.
[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 triggering 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-mentioned purpose, the present application further provides a device for expressing a user interface component, the device comprising:
[0027] A first unit is configured 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 similarities 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 configured to 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 in the preset user interface framework and a usage of the first component in the preset user interface framework;
[0030] The fourth unit is used to determine the expression content of the second 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 objectives, the present application also provides a terminal, comprising a memory storing a plurality of 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, which stores multiple instructions, and the instructions are suitable for a processor to load to execute the steps of any method provided in the present application.
[0033] The present application provides a method, device, terminal, and medium for expressing user interface components. 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 similarities 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 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 this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0039] Because 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 component definition and usage, which in turn greatly reduces developers' development effectiveness.
[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 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 smartphone, tablet computer, laptop computer, desktop computer, smart speaker, 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 impose any restrictions thereon.
[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, which 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 similarities 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, to obtain a unified expression standard, analysis can be performed based on the definition and usage of components. Specifically, to obtain a universal expression standard, analysis can be performed based on user interface frameworks such as early HTML, mid-term EXT, JS\jQuery, and current REACT\VUE. The preset user interface frameworks may include early HTML, mid-term EXT, JS\jQuery, and current REACT\VUE.
[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 can 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 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.
[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 in different preset user interface frameworks and the use of the input component in different preset user interface frameworks, as shown in Table 1 below:
[0055]
[0056] Table 1 Second analysis results
[0057] S140. Determine the expression content of a second component based on the second analysis result, wherein the second component is used to represent a component that can be used across platforms.
[0058] 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.
[0059] Specifically, the component expression standards that can be used in different user interface frameworks in different development environments are presented through attribute content, event content, and method content.
[0060] Therefore, the step of determining the expression content of the second component based on the second analysis result includes the following steps S141 to S142:
[0061] S141. Determine the attribute content and the event content based on the code corresponding to the definition of the first component in the preset user interface framework.
[0062] In some embodiments, the preset user interface frame includes an EXT frame.
[0063] Specifically, determining the attribute content and the event content based on the code corresponding to the definition of the first component under the preset user interface framework includes steps S1411 to S1414 as shown below:
[0064] S1411. Based on the code corresponding to the definition of the first component in the preset user interface framework, determine that the definition of the first component in each preset user interface framework includes a setting method for attributes corresponding to the attribute content.
[0065] S1412: Determine the attribute content based on the fact that the definitions of the first components in the respective preset user interface frameworks all include a setting method for the attribute corresponding to the attribute content.
[0066] Specifically, as shown in List 2 below, 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.
[0067]
[0068] Table 2 Attribute content
[0069] Through detailed structured descriptions such as those in Table 2, each property in the interface component library can be clearly and consistently defined, which helps improve developer effectiveness, reduce usage errors, and enhance code readability and maintainability.
[0070] S1413. Based on the code corresponding to the definition of the first component under the EXT framework, 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.
[0071] S1414 determines the event content based on the blur event content defined by the first component in the EXT frame being an independent description structure and the event content defined by the first component in the preset user interface frame other than the EXT frame being included in the attribute content defined by the first component.
[0072] Specifically, as shown in List 3 below, 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 triggering conditions corresponding to the event content.
[0073]
[0074] Table 3 Event content
[0075] 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 the component.
[0076] S142. Determine the method content based on the code corresponding to the usage mode.
[0077] In some embodiments, the method content is determined based on the code corresponding to the usage mode, including the following steps S1421 to S1422:
[0078] 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.
[0079] S1422. Based on the fact that modifying the value in the first component in each usage method includes method content, determine the method content.
[0080] 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 with the method content. The method content parameters are used to characterize all parameters received by the method content. The method content description is used to describe in detail the functions and usage scenarios corresponding to the method content.
[0081]
[0082] Table 4 Method content
[0083] Through the structural definition of 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. This helps developers efficiently use the methods corresponding to the method content in the user interface component library.
[0084] An 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 similarities 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 component is finally determined, wherein the second component is used to characterize the component that can be used across platforms.
[0085] In summary, this application provides a method for expressing user interface components, which presents a set of flexible and consistent expression standards by adapting the expression content of user interface components 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.
[0086] To better implement the above method, embodiments of the present application further provide a user interface component presentation device, which can be integrated into an electronic device, such as a terminal or a server. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, personal computer, or other device; the server can be a single server or a server cluster consisting of multiple servers.
[0087] For example, in this embodiment, the method of the embodiment of the present application will be described in detail by taking the specific integration of the expression device of the user interface component in the terminal as an example.
[0088] For example, Figure 2 As shown, the user interface component expression device 200 may include a first unit 201, a second unit 202, a third unit 203 and a fourth unit 204, and the user interface component expression device 200 includes:
[0089] The first unit 201 is configured 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 similarities 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;
[0090] 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;
[0091] The third unit 203 is configured 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;
[0092] The fourth unit 204 is configured to determine the expression content of the second component based on the second analysis result, wherein the second component is used to represent a component that can be used across platforms.
[0093] 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 be found in the previous method embodiments and will not be repeated here.
[0094] From the above, it can be seen that the embodiments of the present application present a set of flexible and consistent expression standards by adapting 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.
[0095] The present application also provides an electronic device, which may be a terminal, a server, or the like. The terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a personal computer, or the like; the server may be a single server or a server cluster consisting of multiple servers, or the like.
[0096] 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.
[0097] 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:
[0098] The terminal 300 may include one or more processors 301, 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.
[0099] Processor 301 is the control center of terminal 300. It connects all components of terminal 300 using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 302 and accessing data stored in memory 302, it executes various functions of terminal 300 and processes data, thereby providing overall monitoring of terminal 300. In some embodiments, processor 301 may include one or more processing cores. In some embodiments, processor 301 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 301.
[0100] Memory 302 can be used to store software programs and modules. Processor 301 executes various functional applications and data processing by running the software programs and modules stored in memory 302. Memory 302 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as sound playback or image playback). The data storage area may store data generated based on the use of terminal 300. Memory 302 may also include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory 302 may also include a memory controller to provide processor 301 with access to memory 302.
[0101] Terminal 300 also includes a power supply 303 for supplying power to various components. In some embodiments, power supply 303 can be logically connected to processor 301 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. Power supply 303 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0102] The terminal 300 may further include an input module 304 , which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0103] 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 use the wireless module of the communication module 305 to perform short-range wireless transmission, 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.
[0104] Although not shown, the terminal 300 may further 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 application programs into the memory 302 according to the following instructions, and the processor 301 will run the application programs stored in the memory 302 to implement various functions as follows:
[0105] Analyzing at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize definitions of components in the preset user interface frameworks, usages of components in the preset user interface frameworks, similarities between definitions of components in the preset user interface frameworks and usages of components in the preset user interface frameworks, and differences between definitions of components in the preset user interface frameworks and usages of components in the preset user interface frameworks;
[0106] 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;
[0107] 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 in the preset user interface framework and a usage of the first component in the preset user interface framework;
[0108] Based on the second analysis result, the expression content of the second component is determined, wherein the second component is used to represent a component that can be used across platforms.
[0109] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0110] 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.
[0111] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a medium and loaded and executed by a processor.
[0112] To this end, an embodiment of the present application provides a medium storing a plurality of instructions that can be loaded by a processor to execute the steps of any method for expressing a user interface component provided in an embodiment of the present application. For example, the instructions can execute the following steps:
[0113] Analyzing at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize definitions of components in the preset user interface frameworks, usages of components in the preset user interface frameworks, similarities between definitions of components in the preset user interface frameworks and usages of components in the preset user interface frameworks, and differences between definitions of components in the preset user interface frameworks and usages of components in the preset user interface frameworks;
[0114] 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;
[0115] 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 in the preset user interface framework and a usage of the first component in the preset user interface framework;
[0116] Based on the second analysis result, the expression content of the second component is determined, wherein the second component is used to represent a component that can be used across platforms.
[0117] The medium may include: Read Only Memory (ROM), Random Access Memory (RAM), a magnetic disk or an optical disk, etc.
[0118] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a medium. A processor of a computer device reads the computer instructions from the medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations provided in the above embodiments.
[0119] 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.
[0120] The above is a detailed introduction to the expression method, device, terminal and medium of a user interface component provided in the 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, based on the ideas of the present application, there will be changes in the specific implementation methods 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: Analyzing at least two preset user interface frameworks to obtain a first analysis result, wherein the first analysis result is used to characterize definitions of components in the preset user interface frameworks, usages of components in the preset user interface frameworks, similarities between definitions of components in the preset user interface frameworks and usages of components in the preset user interface frameworks, and differences between definitions of components in the preset user interface frameworks and usages of components in the preset user interface frameworks; 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 in the preset user interface framework and a usage of the first component in the preset user interface framework; Determining, based on the second analysis result, expression content of a second component, wherein the second component is used to represent a component that can be used across platforms; The second analysis result includes code corresponding to a definition of the first component in the preset user interface framework and code corresponding to a usage of the first component in the preset user interface framework, wherein 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 component includes: Determining the attribute content and the event content based on a code corresponding to a definition of the first component in the preset user interface framework; Determining the method content based on the code corresponding to the usage mode; The preset user interface framework includes an EXT framework; The determining the attribute content and the event content based on the code corresponding to the definition of the first component in the preset user interface framework includes: Based on the code corresponding to the definition of the first component in the preset user interface framework, determining that the definition of the first component in each preset user interface framework includes a setting method for the attribute corresponding to the attribute content; Determining the attribute content based on that the definitions of the first components in the respective preset user interface frameworks all include a setting method of an attribute corresponding to the attribute content; Based on the code corresponding to the definition of the first component in the EXT framework, determining that the blur event content defined by the first component in the EXT framework is an independent description structure, and determining that the event content defined by the first component in a preset user interface framework other than the EXT framework is included in the attribute content defined by the first component; The event content is determined based on 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.
2. The method according to claim 1, wherein The determining of the method content based on the code corresponding to the usage mode includes: 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 modification of the value in the first component in each of the usage modes includes method content, the method content is determined.
3. The method according to claim 1, wherein 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.
4. The method according to claim 1, wherein 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 triggering conditions corresponding to the event content.
5. The method according to claim 1, wherein 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.
6. A device for expressing a user interface component, characterized in that: The device comprises: A first unit is configured 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 similarities 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 configured to 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 in the preset user interface framework and a usage of the first component in the preset user interface framework; A fourth unit is configured to determine, based on the second analysis result, an expression content of a second component, wherein the second component is used to represent a component that can be used across platforms; The second analysis result includes code corresponding to a definition of the first component in the preset user interface framework and code corresponding to a usage of the first component in the preset user interface framework, wherein 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 component includes: Determining the attribute content and the event content based on a code corresponding to a definition of the first component in the preset user interface framework; Determining the method content based on the code corresponding to the usage mode; The preset user interface framework includes an EXT framework; The determining the attribute content and the event content based on the code corresponding to the definition of the first component in the preset user interface framework includes: Based on the code corresponding to the definition of the first component in the preset user interface framework, determining that the definition of the first component in each preset user interface framework includes a setting method for the attribute corresponding to the attribute content; Determining the attribute content based on that the definitions of the first components in the respective preset user interface frameworks all include a setting method of an attribute corresponding to the attribute content; Based on the code corresponding to the definition of the first component in the EXT framework, determining that the blur event content defined by the first component in the EXT framework is an independent description structure, and determining that the event content defined by the first component in a preset user interface framework other than the EXT framework is included in the attribute content defined by the first component; The event content is determined based on 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.
7. 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 5.
8. A medium, characterized in that The medium stores a plurality of instructions, which are suitable for loading by a processor to execute the steps in the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Component conversion system construction method, component conversion method and device and electronic equipment
CN117806652A
Cross-platform code generation method and device, equipment and storage medium
CN118642702A