Semantic driving-based user interface generation method and device
By using a semantic-driven approach to automatically match UI components and determine display constraints, the high maintenance costs and low automation caused by manual configuration of UI components are solved, enabling personalized and efficient UI generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING SOHU NEW MEDIA INFORMATION TECH
- Filing Date
- 2026-04-08
- Publication Date
- 2026-05-05
AI Technical Summary
In the existing technology, the selection of user interface (UI) components relies on manual configuration, resulting in high maintenance costs and low automation. In particular, additional configuration is required between different types of electronic devices, increasing the amount of repetitive work.
By acquiring the semantic description information of the object to be processed, matching UI components from the preset mapping rule library, and combining user behavior data and device information, the display constraints of UI components are automatically determined, eliminating the need for manual selection and code modification.
It reduces maintenance costs, increases automation, provides personalized UI layouts, and can optimize interface design based on user habits.
Smart Images

Figure CN121979527A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a semantically driven user interface generation method and apparatus. Background Technology
[0002] The user interface (UI) serves as the medium for interaction between an application and the user. A UI consists of multiple UI components, which facilitate interaction between the application and the user. However, the selection of UI components relies on manual configuration, increasing maintenance costs and resulting in low automation. Summary of the Invention
[0003] In view of the above problems, this application provides a semantically driven user interface generation method and apparatus, the specific solution of which is as follows:
[0004] The first aspect of this application provides a semantically driven user interface generation method, applied in electronic devices, comprising:
[0005] The process involves: acquiring descriptive information for generating a user interface (UI), the descriptive information including at least one object to be processed; acquiring semantic descriptive information of the object to be processed, the semantic descriptive information indicating the functional intent of the object to be processed, the object to be processed being an object in the UI to be matched with a UI component; searching for a UI component that matches the semantic descriptive information of the object to be processed from a preset mapping rule base; generating an instance of the UI component that matches the semantic descriptive information of the object to be processed; determining constraints for displaying the UI component based on collected user behavior data, device information of the electronic device, and the semantic descriptive information of the object to be processed; and rendering an instance of the UI component based on the constraints for displaying the UI component to display the UI in the display area of the electronic device.
[0006] In one possible implementation, obtaining the semantic description information of the object to be processed includes: obtaining semantic description information from the semantic fields of the object to be processed; or, extracting each matching word from the object to be processed, obtaining candidate semantic description information corresponding to each matching word, and obtaining the semantic description information of the object to be processed based on the candidate semantic description information corresponding to each matching word.
[0007] In one possible implementation, the step of extracting each matching word from the object to be processed, obtaining candidate semantic description information corresponding to each matching word, and obtaining the semantic description information of the object to be processed based on the candidate semantic description information corresponding to each matching word includes: preprocessing the object name of the object to be processed to obtain a standard name of the object name; performing word segmentation on the standard name to obtain the word segmentation result of the standard name, and extracting each keyword from the word segmentation result of the standard name; obtaining the target semantic description information matched by each keyword respectively from a preset semantic rule library and a thesaurus, and in the standard name including When dealing with prefixes and / or suffixes, the target semantic description information for prefix matching and / or suffix matching is obtained. The multiple matched target semantic description information are used as multiple candidate semantic description information for the standard name. If the multiple candidate semantic description information is the same and the functional intent indicated by the multiple candidate semantic description information is unique, then the candidate semantic description information is used as the semantic description information of the object to be processed. If the multiple candidate semantic description information is different or the functional intent indicated by the candidate semantic description information is not unique, then the semantic description information of the object to be processed is obtained according to the preset processing logic and the multiple candidate semantic description information.
[0008] In one possible implementation, obtaining the semantic description information of the object to be processed according to the preset processing logic and the plurality of candidate semantic description information includes: obtaining semantic description information with unique functional intent by using the plurality of candidate semantic description information according to at least one of priority rules, semantic logic rules and context correction rules.
[0009] In one possible implementation, obtaining semantic description information with a unique functional intent using the plurality of candidate semantic description information according to at least one of priority rules, semantic logic rules, and context correction rules includes: determining candidate semantic description information corresponding to the same priority among the plurality of candidate semantic description information using a preset priority order; if the functional intent indicated by the candidate semantic description information corresponding to the same priority is unique, then the candidate semantic description information of that priority is used as the semantic description information of the object to be processed; if the functional intent indicated by the candidate semantic description information corresponding to each priority is not unique, the plurality of candidate semantic description information is fused; if the functional intent indicated by the fused candidate semantic description information is unique, then the fused candidate semantic description information is used as the semantic description information of the object to be processed. The semantic description information is used as the semantic description information of the object to be processed; if the functional intent indicated by the fused candidate semantic description information is not unique, the context data associated with the object name is obtained, and the fused candidate semantic description information is corrected according to the context data associated with the object name to obtain the corrected candidate semantic description information; if the functional intent indicated by the corrected candidate semantic description information is unique, the corrected candidate semantic description information is used as the semantic description information of the object to be processed; if the functional intent indicated by the corrected candidate semantic description information is not unique, the semantic description information of the object to be processed is determined to be the preset semantic description information, wherein the UI component corresponding to the preset semantic description information is the default component.
[0010] In one possible implementation, determining the constraints for displaying the UI component based on the collected user behavior data, the device information of the electronic device, and the semantic description information of the object to be processed includes: determining the priority of the object to be processed based on the semantic description information of the object to be processed and the user behavior data, wherein the priority of the object to be processed is the priority of the UI component matched with the object to be processed; and determining a layout strategy based on the device information of the electronic device and the priority of each UI component, wherein the layout strategy records the constraints for displaying each UI component.
[0011] In one possible implementation, the semantic description information of the object to be processed is used to determine the priority of the object to be processed, and the user behavior data is used to adjust the priority of the object to be processed.
[0012] In one possible implementation, objects with a pairing relationship have the same priority; objects with a parent-child relationship have priorities that satisfy the parent-child relationship.
[0013] In one possible implementation, determining the layout strategy based on the device information of the electronic device and the priority of each UI component includes: determining the arrangement order of each UI component in the UI based on the priority of each UI component; and determining the position, shape, and size of each UI component in the display area based on the arrangement order of each UI component in the UI and the device information of the electronic device.
[0014] A second aspect of this application provides a semantically driven user interface generation apparatus for use in electronic devices, comprising:
[0015] The system includes: an acquisition unit for acquiring descriptive information for generating a user interface (UI), the descriptive information including at least one object to be processed and semantic descriptive information for acquiring the object to be processed, the semantic descriptive information of the object to be processed indicating the functional intent of the object to be processed, and the object to be processed being an object in the UI to be matched with a UI component; a search unit for searching a UI component that matches the semantic descriptive information of the object to be processed from a preset mapping rule base; a generation unit for generating an instance of the UI component that matches the semantic descriptive information of the object to be processed; a determination unit for determining the constraints for displaying the UI component based on collected user behavior data, device information of the electronic device, and the semantic descriptive information of the object to be processed; and a display unit for rendering an instance of the UI component based on the constraints for displaying the UI component, so as to display the UI in the display area of the electronic device.
[0016] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the semantically driven user interface generation method of the first aspect or any implementation thereof.
[0017] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0018] The memory is used to store computer programs;
[0019] The processor is used to execute the computer program to enable the electronic device to implement the semantically driven user interface generation method of the first aspect or any implementation thereof.
[0020] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the semantically driven user interface generation method described in the first aspect or any implementation thereof.
[0021] By employing the above technical solutions, the semantically driven user interface generation method and apparatus provided in this application can search for UI components that match the semantic description information of the object to be processed from a preset mapping rule library. When the data structure of the object to be processed changes, it is only necessary to re-determine the semantic description information of the object to be processed, eliminating the need for manually selecting UI components and modifying UI code. When determining the constraints for UI component display, the device information of the electronic device is introduced, allowing the constraints to be adjusted according to the device information, eliminating the need for additional configuration for different types of electronic devices, thereby reducing maintenance costs and improving automation. Furthermore, user behavior data is also introduced when determining the constraints for UI component display. User behavior data can indicate user habits, enabling the UI layout to be optimized based on user habits and providing a personalized UI. Attached Figure Description
[0022] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0023] Figure 1 A flowchart illustrating a semantically driven user interface generation method provided in this application;
[0024] Figure 2 A flowchart for determining semantic description information is provided in this application;
[0025] Figure 3 A flowchart for determining constraints when displaying a UI component is provided in this application;
[0026] Figure 4 A schematic diagram of a semantically driven user interface generation device provided in this application;
[0027] Figure 5 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation
[0028] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0029] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0030] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements but may include other elements not explicitly listed or inherent to such processes, methods, systems, products, or apparatus.
[0031] Currently, developers can write UI code, which consists of multiple objects. Each object is a UI element, and developers select UI components for it. UI components are the UI representations of these objects. For example, a price object might use a currency input box, a location object a map selector, and a date object a date selector. When the data structure of an object changes, developers need to reselect UI components for that object and modify the UI components referenced by the object in the UI code, increasing maintenance costs and reducing automation. Furthermore, different types of electronic devices require additional UI configuration, resulting in repetitive work and further increasing maintenance costs and reducing automation.
[0032] To address the aforementioned issues, this application provides a semantically driven user interface generation method and apparatus. This method can search for UI components matching the semantic description information of the object to be processed from a preset mapping rule base. When the data structure of the object changes, only the semantic description information needs to be re-determined, eliminating the need for manual selection of UI components and modification of UI code. Device information of the electronic device is incorporated when determining the constraints for UI component display, allowing the constraints to be adjusted based on this information. This eliminates the need for additional configuration for different types of electronic devices, reducing maintenance costs and increasing automation. Furthermore, user behavior data is also incorporated when determining the constraints for UI component display. This data reveals user habits, enabling the UI layout to be optimized based on user habits while providing a personalized UI.
[0033] The following description, in conjunction with the accompanying drawings, illustrates a semantically driven user interface generation method and apparatus provided in this application. Please refer to the accompanying drawings. Figure 1 It illustrates an optional flow of a semantically driven user interface generation method provided in an embodiment of this application, which may include the following steps:
[0034] S101. Obtain description information used to generate the UI. The description information includes at least one object to be processed. The description information used to generate the UI can be UI code, which can be in JSON (JavaScript Object Notation) format. Record each object to be processed in the UI within the UI code.
[0035] S102. Obtain the semantic description information of the object to be processed. The semantic description information of the object to be processed is used to indicate the functional intent of the object to be processed. The object to be processed is the UI component to be matched in the UI.
[0036] In this embodiment, the semantic description information of the object to be processed is a type description of the object to be processed, so as to determine the functional intent of the object to be processed through the type description of the object to be processed. Such semantic description information includes, but is not limited to: price, location, trend, action, and status, etc. If the semantic description information of the object to be processed is "price", it means that the functional intent of the object to be processed is to obtain the price input by the user; if the semantic description information of the object to be processed is "location", it means that the functional intent of the object to be processed is to obtain the location input by the user.
[0037] In some examples, semantic description information can be written into the fields of the object to be processed. This involves attaching type specifications to the fields (such as semantic fields) of the object to represent its meaning. The meaning of the field can characterize its functional intent. For example, the attached type specification for an object to be processed could be one of the aforementioned price, location, trend, action, and status. Therefore, one way to obtain the semantic description information of an object to be processed is to retrieve it from its semantic fields, such as by obtaining type specifications from those fields. The type specifications of the object to be processed can serve as its semantic description information.
[0038] In some examples, semantic description information can be written into non-semantic fields of the object to be processed. These non-semantic fields can include action buttons, status labels, tooltips, paginators, etc., with semantic description information appended to them. For instance, adding a non-semantic field named `semantic` to the object to be processed allows you to write the additional semantic description information. This could include the object's functional intent, which is the semantic description information. For example, `semantic:"pagination"` declares a pagination control, and `semantic:"submit"` declares a form submission button.
[0039] All objects to be processed with semantic descriptions appended to non-semantic fields can be centrally declared in the `ui.elements` array, making the page-level "control panel" clear, easy to manage, and expand. Furthermore, the semantic descriptions and the corresponding external data source (the external data source being the business data of the object to be processed) are structurally completely independent; modifying the UI layout does not affect the semantic descriptions, and changing the external data source does not require altering the semantic descriptions. The field names, array format, and centralized declaration method of the non-semantic fields mentioned here are merely optional implementations and are not limiting; other equivalent methods can be used, which are not illustrated here.
[0040] S103. Search for UI components that match the semantic description information of the object to be processed from the preset mapping rule library.
[0041] In this embodiment, a preset mapping rule base records semantic description information. After determining the semantic description information of any object to be processed, the preset mapping rule base is used to search for a UI component that corresponds to the semantic description information of the object to be processed. This UI component is the one that matches the semantic description information of the object to be processed. For example, price corresponds to a currency input box, location corresponds to a map selector, and trend corresponds to a line chart component. Therefore, if the semantic description information of the object to be processed is price, the matching UI component is the currency input box.
[0042] If multiple candidate UI components are found that match the semantic description information of the object to be processed, the UI component that matches the semantic description information is determined from these candidate components according to a preset priority rule. For example, if the semantic description information is "address", the preset mapping rule library contains matching rules for both "text input box component" and "map selector component". Therefore, when matching based on the semantic description information, two candidate UI components are obtained: a text input box component and a map selector component. At this point, a UI component can be selected from these two candidate components according to the preset priority rule. The preset priority rule may include, but is not limited to: explicit configuration takes precedence over automatic inference, exact matching takes precedence over fuzzy matching, and a preset candidate component priority table related to the scene, selecting the component with higher priority based on the scene. Explicit configuration is manually configured by the user, while automatic inference can be determined based on the semantic description information. Exact matching can be determined based on the semantic description information, and fuzzy matching can be based on data in the object to be processed other than the semantic description information, such as the name of the object to be processed, etc., which will be explained in detail later.
[0043] If no UI component matching the semantic description information of the object to be processed is found in the preset mapping rule library, the UI component matching the object can be the default component. In some instances, if no UI component matching the semantic description information of the object to be processed is found in the preset mapping rule library, it is determined whether the data of the object to be processed can be successfully parsed. If parsing is successful, the UI component matching the object can be the default component. If parsing fails, the parsing error is recorded and a controlled degradation is implemented. Specifically, if the reason for parsing failure is a separable local problem (not affecting other components), a controlled degradation is implemented, which can be using the default component. If the reason for parsing failure is a corrupted root structure / critical dependency, component allocation is prohibited and rendering is aborted. Typically, the data of the object to be processed is in JSON format. If JSON can be successfully parsed, parsing is successful; if the JSON syntax is incorrect or the structure does not conform to the specifications, parsing fails.
[0044] In some examples, the default component can be a regular input field. In others, the default component can be determined based on the data structure of the object being processed; for example, the default component for a string is TextInput (single-line), the default component for a number is NumberInput, the default component for a boolean is Switch, and the default component for an array is... <object>The default component for `table` is `Table` (columns are automatically inferred), and the default component for `object` is `Fieldset` (subfields are recursively rendered). The examples of default components are for illustrative purposes only and do not constitute a limitation on the scope of protection.
[0045] Furthermore, this embodiment can also record semantic description information of UI components that are not matched, facilitating subsequent expansion of the preset mapping rule library. The preset mapping rule library can support developers in defining new mapping relationships, and / or, during rendering, can add prompt information to instances of the UI component. For example, the prompt information can indicate that the default component is being used, and the UI component can be added to the preset mapping rule library. The prompt information can be displayed only during the UI development phase.
[0046] In some examples, the semantically driven user interface generation method described above, after determining the UI components corresponding to the components to be processed, can also determine the relationships between the UI components. These relationships can include pairing relationships and dependencies. Pairing relationships indicate that two UI components appear in pairs, such as a date component. Dependencies indicate parent-child relationships between UI components and / or indicate that the processing of one UI component depends on data from another UI component. These relationships can be recorded in a preset mapping rule base, or the relationships between the objects to be processed can be recorded in the UI code. The relationships between the objects to be processed can serve as the relationships between the UI components that match the objects to be processed.
[0047] For example, a `relations` or `dependencies` field can be added to the data structure of the object to be processed to describe the dependencies between UI components. For instance, a pagination component depends on the total count, current page, and page size fields of a list component, while a dropdown component depends on the value selected by its parent component. If the data structure of the object to be processed does not explicitly record the relationships between UI components, the electronic device can determine the relationships between UI components based on preset context combination rules or extended information from a preset mapping rule library. For example, if a pagination component and a list component at the same level both have the three fields "total", "pageSize", and "currentPage", it can be inferred that there is a dependency between the pagination component and the list component. The dependent components are defined for specific semantic descriptions in the extended information of the preset mapping rule library, such as "pagination component → must be bound to total / pageSize / currentPage". In some examples, developers are allowed to write the relationships between UI components in specific fields of the object to be processed; for example, a specific field could be a `props` field, which is used to configure the behavior or appearance of UI components.
[0048] Electronic devices can obtain a UI component tree based on the relationships between UI components. The UI component tree records each UI component and the relationships between them. During rendering, the UI component tree can be used to render, so that the relationships between the UI components in the UI satisfy the relationships recorded in the UI component tree.
[0049] S104. Generate an instance of a UI component that matches the semantic description information of the object to be processed. The UI component instance is used to obtain an interactive UI component. In this embodiment, generating a UI component instance includes: establishing a data binding relationship, injecting event handling logic, and determining the default display parameters of the UI component. The data binding relationship ensures synchronization between the UI component and the external data source, enabling the UI component to dynamically respond to data updates and user input. Injecting event handling logic is responsible for capturing user interactions and triggering semantically corresponding behaviors, supporting UI interaction and providing a data foundation for subsequent user behavior data collection and layout optimization. Default display parameters include default styles and themes to ensure visual and interactive style consistency in the generated UI. The default display parameters can be determined based on the type of electronic device to match the default display parameters with the electronic device. For example, PCs (Personal Computers) and mobile terminals use different default display parameters, but electronic devices of the same type can use the same default display parameters to provide a consistent appearance and experience for the same type of electronic device.
[0050] One point to note here is that for objects to be processed that have semantic descriptions appended to non-semantic fields, an additional field (such as the `bind` field) can be added for mapping objects. This field is used to establish data binding relationships and inject event handling logic. Specifically, the external data source is bound to the display properties of the UI component corresponding to the object to be processed, and the user's actions on the UI component corresponding to the object to be processed are converted into standard operation events, which are then handled by the UI's upper-level business logic.
[0051] Taking a pagination as an example, the `pager1` object in `ui.elements` declares the need for a pagination, with the semantic meaning "pagination," and is bound to three states: `total`, `pageSize`, and `current`. The semantic meaning "pagination" is matched against a rule in the rule library: Matching rules: The engine selects the optimal component based on the current device type (Web / Mobile). Web: Mapped to a fully functional Pagination component (including page number navigation, number of items per page, etc.). Mobile: Mapped to a simplified SimplePager component (only "previous / next page" and total information). Data binding: The engine parses the `bind` object, binding the value of `meta.total` to the component's `total` property and `query.page` to the `current` property. Simultaneously, an event listener is established; when the user interacts with the pagination, the `onChange` event is triggered, and the new `{page, pageSize}` object is passed out. Dynamic rendering and interaction: The rendering engine generates the final UI based on the mapping results. The user sees a pagination with the correct state. When the user clicks "Next Page," the pagination component emits a `{page:2}` event. Upon receiving this event, the upper-layer application retrieves the new `query.page` value and re-requests data, thus refreshing the interface. By declaring functional intent using semantic fields (i.e., non-semantic fields) and implementing data binding using bind fields, and by employing a data organization method within independent UI element areas, this invention successfully extends the semantic-driven concept from semantic fields to all UI elements. This not only achieves a unified declarative description of the entire interface but also brings high cohesion and low coupling in the architecture, greatly improving the efficiency, maintainability, and cross-platform adaptability of UI development.
[0052] S105. Based on the collected user behavior data, the device information of the electronic device, and the semantic description information of the object to be processed, determine the constraints when displaying the UI component.
[0053] In this embodiment, the constraints when displaying UI components are used to indicate the layout strategy when displaying UI components. Such constraints include, but are not limited to, the position of the UI component in the display area of the electronic device, the shape of the UI component, and the size of the UI component. These constraints are used to control the rendering of instances of UI components, thereby limiting the display of UI components in the UI.
[0054] In some examples, the position of a UI component within the display area of an electronic device can include: row, column, priority area, secondary area, etc. The size of the UI component can include its width and height; the width can be full width, half width, or proportionally scaled. The shape of the UI component can be a display shape, such as expanded, collapsed, or hidden. Furthermore, constraints on the display of UI components can include order, visual hierarchy, and display adjustments based on user behavior data.
[0055] S106. Based on the constraints of UI component display, render an instance of the UI component to display the UI in the display area of the electronic device.
[0056] As can be seen from the above technical solution, the electronic device can search for UI components matching the object to be processed from a preset mapping rule base based on the semantic description information of the object to be processed. When the data structure of the object to be processed changes, it is only necessary to re-determine the semantic description information of the object to be processed, eliminating the need for manually selecting UI components and modifying UI code. Incorporating the device information of the electronic device when determining the constraints for UI component display allows the constraints to be adjusted according to the device information, eliminating the need for additional configuration for different types of electronic devices, thereby reducing maintenance costs and improving automation. Furthermore, user behavior data is also incorporated into the determination of constraints for UI component display. User behavior data can indicate user habits, enabling the UI layout to be optimized based on user habits and to provide a personalized UI.
[0057] The above embodiments describe directly extracting semantic description information from the fields of the object to be processed. However, some fields of the object to be processed do not record semantic description information. In this case, the semantic description information of the object to be processed can be obtained by combining the content recorded in at least one field of the object to be processed. One optional approach is to extract each matching word from the object to be processed, obtain the candidate semantic description information corresponding to each matching word, and obtain the semantic description information of the object to be processed based on the candidate semantic description information corresponding to each matching word. For example, the object name can be obtained from the name field of the object to be processed, and the semantic description information of the object to be processed can be determined based on the object name, thus realizing the derivation of the semantic description information of the object to be processed from the object name. The optional derivation process is as follows: Figure 2 As shown, the following steps may be included:
[0058] S201. Preprocess the object names to obtain standard object names. Preprocessing includes, but is not limited to, case normalization, delimiter unification, and removal of invalid characters to obtain a standardized string that is easy to analyze. Case normalization converts all letters to lowercase to eliminate matching differences caused by case sensitivity, such as converting Product-Price to product-price. Delimiter unification uses preset delimiters for the string, such as unifying common delimiters (e.g., camelCase boundaries, hyphens -, spaces) to underscores _. For example, product-price becomes product_price, userID becomes user_id, and createdAt becomes created_at. Removal of invalid characters mainly removes special characters or numeric prefixes / suffixes that do not contribute to semantics.
[0059] S202. The standard name is segmented to obtain the segmentation result, and keywords are extracted from the segmentation result. Keywords are matching words. In this embodiment, the standard name is segmented using a preset delimiter. If the preset delimiter is an underscore (_), the standard name is divided into a keyword array using the underscore (_) as the boundary. The keyword array is the segmentation result of the standard name, and each word in the keyword array can be used as a keyword. This decomposes a continuous string into the smallest unit with independent semantic meaning (i.e., keywords), preparing for obtaining semantic description information.
[0060] For example, the keyword array corresponding to the standard name user_shipping_address_zip_code is ['user','shipping','address','zip','code'].
[0061] In some examples, after obtaining the keyword array, the words in the keyword array are stemmed to restore different forms of words to their root words, and the restored words are used as keywords. For example, stemming is performed on words in past tense, present continuous tense, and plural forms. For example, "running" and "ran" are restored to "run", and "Images" are restored to "image".
[0062] S203. Obtain the target semantic description information matched by each keyword from the preset semantic rule base and the thesaurus. When the standard name includes a prefix and / or a suffix, obtain the target semantic description information matched by the prefix and / or the target semantic description information matched by the suffix. The multiple target semantic description information matched are used as multiple candidate semantic description information of the standard name.
[0063] In this embodiment, a preset semantic rule base records the semantic description information corresponding to each word. Therefore, the target semantic description information corresponding to the keyword can be found in the preset semantic rule base, and this target semantic description information can be used as candidate semantic description information for the standard name. For example: the target semantic description information for 'price', 'cost', 'fee', and 'amount' is 'monetary'; the target semantic description information for 'name', 'title', 'label', and 'subject' is 'textual_identifier'; the target semantic description information for 'date' and 'time' is 'datetime'; the target semantic description information for 'image', 'photo', 'pic', and 'avatar' is 'image'; and the target semantic description information for 'url', 'link', and 'href' is 'link'.
[0064] The thesaurus is used to retrieve synonyms for keywords. In the thesaurus, synonyms can be abbreviations of the keywords. Then, matching semantic descriptions are found from a pre-defined semantic rule base using these abbreviations. For example, "desc" is a synonym for "description," and matching semantic descriptions are found from the pre-defined semantic rule base using "desc."
[0065] Some standard names also include prefixes and / or suffixes. Typically, these prefixes and / or suffixes also have specific and fixed semantics. Therefore, when a standard name includes prefixes and / or suffixes, it is also necessary to obtain the target semantic description information for the prefixes and / or suffixes. For example, the target semantic description information for suffixes like `_id` is `identifier` (unique identifier); for `_at` and `_on` (e.g., `created_at`, `published_on`), it is `datetime` (timestamp); for `_url` and `_uri`, it is `link`; for `_count` and `_num`, it is `numeric`; for `_flag`, `_is_`, `_has_`, and `_can_`, it is `boolean`; and for `_list` and `_array`, it is `array`. The target semantic description information for prefixes like `is_`, `has_`, `can_`, and `should_` is `boolean`.
[0066] In some examples, when obtaining the target semantic description information for keyword matching, multiple keywords are combined, and the target semantic description information corresponding to the combined word is identified. This target semantic description information is then used as the candidate semantic description information for the standard name. For example, the target semantic description information for 'zip' + 'code' is postal_code (postal code); the target semantic description information for 'phone' + 'number' is phone_number (phone number); and the target semantic description information for 'first' + 'name' is given_name (name).
[0067] Therefore, the predefined knowledge base in this embodiment includes a semantic rule base, a thesaurus, and known semantics of prefixes and suffixes. Using the predefined knowledge base, keywords are quickly mapped to the most likely target semantic description information, thereby obtaining multiple candidate semantic description information of standard nouns.
[0068] S204. If multiple candidate semantic description information is the same and the functional intent indicated by the multiple candidate semantic description information is unique, then the candidate semantic description information shall be used as the semantic description information of the object to be processed.
[0069] S205. If multiple candidate semantic description information are different or the functional intent indicated by the candidate semantic description information is not unique, then the semantic description information of the object to be processed is obtained according to the preset label processing logic and multiple candidate semantic description information.
[0070] In this embodiment, the preset tag processing logic is used to select the semantic description information of the object to be processed from multiple candidate semantic description information. For example, according to at least one of priority rules, semantic description rules, and context correction rules, multiple candidate semantic description information are used to obtain semantic description information with unique functional intent. One implementation method is as follows:
[0071] 1) Determining semantic description information using priority rules can be achieved by using a preset priority order to identify candidate semantic description information with the same priority among multiple candidate semantic description information. An example of this preset priority order could be: prefixes / suffixes have a higher priority than keyword combinations, and keyword combinations have a higher priority than individual keywords. For example, the priority of prefixes / suffixes could be denoted as 1, keyword combinations as 2, and keywords as 3, with each candidate semantic description information having its corresponding priority. The preset priority order can be from high to low, i.e., determining candidate semantic description information with the same priority in the order of prefixes / suffixes, then keyword matching, and then keywords.
[0072] 2) If the functional intent indicated by candidate semantic description information of the same priority is unique, then the candidate semantic description information of that priority is used as the semantic description information of the object to be processed. Here, "the functional intent indicated by candidate semantic description information of the same priority is unique" means that, in descending order of priority, the functional intent indicated by candidate semantic description information of one priority is unique. For example, if a candidate semantic description information with a unique functional intent is determined by a prefix / suffix, then it is used as the semantic description information of the object to be processed. Otherwise, continue to check whether the functional intent of candidate semantic description information of the corresponding keyword combination is unique. If it is unique, then the candidate semantic description information of the corresponding keyword combination is used as the semantic description information of the object to be processed; otherwise, continue to check the candidate semantic description information of the remaining priorities. If the functional intent indicated by candidate semantic description information of all priorities is not unique, then step 3) is executed to trigger the determination of semantic description information using semantic logic rules.
[0073] 3) If the functional intent indicated by the candidate semantic description information corresponding to each priority is not unique, the multiple candidate semantic description information are fused. If the functional intent indicated by the fused candidate semantic description information is unique, then the fused candidate semantic description information is used as the semantic description information of the object to be processed. The fusion of multiple candidate semantic description information refers to combining multiple candidate semantic description information. For example, multiple candidate semantic description information can be combined into one candidate semantic description information (i.e., obtaining a fused candidate semantic description information). Alternatively, some candidate semantic description information from multiple candidate semantic description information can be combined into one candidate semantic description information to obtain multiple fused candidate semantic description information.
[0074] 4) If the functional intent indicated by the fused candidate semantic description information is not unique, the context correction rules are triggered to determine the semantic description information. This process may involve obtaining context data associated with the object name, and then correcting the fused candidate semantic description information based on this context data to obtain the corrected candidate semantic description information. In this embodiment, the context data associated with the object name may be other fields in the object to be processed besides the object name. The context data associated with the object name is used to deduce the meaning of the fused candidate semantic description information to correct it. For example, if the functional intent of `value` is ambiguous, and the context data contains `{"product_sku":"...","product_name":"...","value": 99.9}`, it is inferred that `value` likely refers to `monetary` (price), and the corrected candidate semantic description information is `monetary` (price), with a unique and definite functional intent. If the context data contains `{"setting_key":"theme","value":"dark"}`, it is inferred that `value` may refer to a general `text` (configuration value), and the corrected candidate semantic description information is `text` (configuration value), with a unique and definite functional intent.
[0075] 5) If the functional intent indicated by the corrected candidate semantic description information is unique, then the corrected candidate semantic description information shall be used as the semantic description information of the object to be processed.
[0076] 6) If the functional intent indicated by the corrected candidate semantic description information is not unique, then the semantic description information of the object to be processed is determined to be the preset semantic description information. The UI component corresponding to the preset semantic description information is the default component. The preset semantic description information can be a semantic description information recorded in the preset mapping rule library, or a semantic description information corresponding to the default component. The specifics are not linear.
[0077] Therefore, through the above methods, a relatively accurate semantic description information with unique functional intent, after disambiguation and fusion, is obtained, resolving potential ambiguities in a single field and significantly improving accuracy and depth through contextual data. Furthermore, in some examples, semantic description information can be obtained by combining one or any two of the priority rules, semantic logic rules, and context correction rules; the process can be found in the flowchart of combining the three rules mentioned above. If a semantic description information with unique functional intent cannot be obtained when using one or any two rules, a candidate semantic description information is selected from the candidate semantic description information, and this selected candidate semantic description information is used as the semantic description information of the object to be processed. The selection can be based on the number of times the candidate semantic description information is selected; the specific method is not limited. Alternatively, if a semantic description information with unique functional intent cannot be obtained, the semantic description information of the object to be processed is determined to be the preset semantic description information.
[0078] It should be noted here that the UI components such as the paginator, submit button, map selector, and price input box involved in the embodiment are only used to illustrate the exemplary correspondence between semantic description information and UI components. This embodiment does not limit the use of the above-mentioned specific UI components or specific dependency fields. The exemplary correspondence provided in this embodiment is only used for illustrative purposes and does not constitute a limitation on the scope of protection.
[0079] Please see Figure 3 This illustrates an optional process for determining constraints when displaying a UI component, as provided in an embodiment of this application, which may include the following steps:
[0080] S301. Based on the semantic description information and user behavior data of the object to be processed, determine the priority of the object to be processed. The priority of the object to be processed is the priority of the UI component that matches the object to be processed.
[0081] In this embodiment, the semantic description information of the object to be processed is used to determine the priority of the object, and user behavior data is used to adjust the priority of the object. For example, the first priority of the object to be processed is determined based on the functional intent corresponding to the semantic description information of the object. The first priority is the basic priority of the object to be processed. All basic priorities include: highest priority, second highest priority, medium priority, and low priority, etc. The basic priority of the object to be processed is determined from these basic priorities based on the functional intent of the object.
[0082] When determining the first priority, the importance of the business rules and semantic description information of the object to be processed can be taken into account. For example, the higher the level of the business rule and / or the higher the importance of the semantic description information, the higher the first priority; otherwise, the first priority is lower.
[0083] It's important to note that two objects in a pair have the same priority. Therefore, determining the priority of one object in a pair determines the priority of the other. Similarly, two objects in a parent-child relationship have priorities that satisfy the parent-child relationship: the parent object has a higher priority than the child object, and child objects of the same priority have the same priority. Therefore, determining the priority of one object in a parent-child relationship also determines the priority of the other.
[0084] After obtaining the first priority, the first priority of at least some of the objects to be processed is adjusted according to the relationship between user behavior data and the objects to be processed, so as to obtain the second priority of the objects to be processed. If the first priority of the objects to be processed is not adjusted, the priority of the UI component corresponding to the objects to be processed is the first priority of the objects to be processed. If the first priority of the objects to be processed is adjusted to the second priority, the priority of the UI component corresponding to the objects to be processed is the second priority of the objects to be processed.
[0085] In this embodiment, user behavior data is used to indicate the user's usage of the UI component corresponding to the object to be processed. If the user behavior data does not include the usage of the UI component corresponding to a certain object to be processed, the first priority of the object to be processed remains unchanged. If the user behavior data includes the usage of the UI component corresponding to a certain object to be processed, the first priority of the object to be processed is adjusted according to the usage of the UI component corresponding to the object to be processed (or, in other words, the user behavior data of the UI component corresponding to the object to be processed) to obtain the second priority of the object to be processed. The priority of the UI component corresponding to the object to be processed is the same as the priority of the object to be processed. Therefore, after obtaining the priority of each object to be processed, the priority of the UI component corresponding to the object to be processed is obtained.
[0086] The user behavior data includes at least one behavioral indicator from usage frequency, dwell time, recent interactions, error rate, and usage trends. This embodiment can preset weights for different behavioral indicators in the user behavior data. For any object to be processed based on the user behavior data, a usage score is obtained for that object based on the value of its behavioral indicator and the preset weight. The first priority is then adjusted based on the usage score. For example, if the adjustment level is determined based on the usage score, a second priority is obtained based on the first priority and the adjustment level. For instance, each adjustment level corresponds to a threshold range or threshold. If the usage score is within the threshold range corresponding to the adjustment level, then that adjustment level is the adjustment level corresponding to the usage score; or, if the usage score is greater than the threshold of the first adjustment level but less than the threshold of the second adjustment level, and the first and second adjustment levels are adjacent, then the adjustment level of the usage score is the first adjustment level. The second priority is obtained by adding the first priority and the adjustment level. An adjustment level may be a positive or negative number. For example, four adjustment levels may be preset, with two adjustment levels being integers and two being negative numbers. This embodiment does not limit this.
[0087] This embodiment can also adjust the first priority in other ways, such as by adding or subtracting levels based on the core indicators in the behavior metrics of the object to be processed. The core indicators may include at least one of usage frequency, dwell time, error rate, and recent interaction. For example, high usage in the last 7 days: +1 level; consistently low usage and high error rate: -1 level; frequently unfolded even when collapsed: +1 level; insufficient depth due to high frequency only because it is close to the first screen: limited to a maximum of +0.5 levels. The content, level adjustment process, thresholds, and weights of user behavior data are only illustrative examples and do not constitute a limitation on the scope of protection.
[0088] Therefore, the process of adjusting the first priority based on user behavior data in this embodiment may include: determining the adjustment value of the object to be processed based on the user behavior data; adjusting the first priority of the object to be processed using the adjustment value to obtain the second priority of the object to be processed; after obtaining the second priority of any object to be processed, if there are other objects to be processed that are related to the object to be processed, adjusting the second priority of the other objects to be processed using the second priority of the object to be processed. The adjustment value may be at least one of the adjustment levels, increments / decreases mentioned above. If there are other objects to be processed that are paired with the object to be processed, the second priority of the other objects to be processed is adjusted to the second priority of the object to be processed; if the object to be processed is the parent or child object of other objects to be processed, the second priority of the other objects to be processed is adjusted using the second priority of the object to be processed, so that the second priority of the object to be processed and the second priority of other objects to be processed satisfy the parent-child relationship.
[0089] In some examples, user behavior data also includes display preference data, which instructs users to adjust the display of UI components. This display preference data directly serves as a constraint on the layout strategy. For example, display preference data might include: a user dragging a UI component to the top area, a user "pinning" a UI component to the top, a user actively hiding or turning off a UI component, or a user changing the width or display density of a UI component. The display preference data directly constrains the display of a UI component; that is, the display preference data can serve as a constraint on the UI component's display. Another example is that display preference data might include the user's selected UI display mode, such as a compact mode or a comfortable mode (also known as a minimalist mode). The UI's layout strategy differs in different modes, recording the constraints on UI component display through the layout strategy, and controlling the overall UI display through this display mode.
[0090] In this embodiment, user behavior data may differ between users, and constraints are adjusted only based on the current user's behavior data. For example, user behavior data is tagged with a user identifier to distinguish different users' behavior data. The user identifier can be a pseudonym (PID), thus marking user behavior data without storing identifiable user information. For instance, when user behavior data is generated for the first time, at least one of the following is used as input: "real user identifier (such as account ID / internal ID before hashing mobile number) + key (pepper) + timestamp / version number (optional)". A PID is generated using a hash function, and the user behavior data is stored using the PID as the primary key. The PID is carried when rendering the UI to determine the user behavior data, thereby associating the PID with the current rendering and achieving personalized layout.
[0091] In one possible implementation, anomalous behavior data may exist when collecting user behavior data. Anomalous behavior data can be data on behavioral events that do not reflect real user interactions, interfere with layout optimization decisions, or violate data quality requirements. Examples include data that does not conform to the event structure / field format, behavioral data that could not have been generated by normal users (such as hundreds of clicks repeated in a very short period of time), data from scripts / crawlers / attacks, timestamp distortion caused by network jitter or client-side clock errors, duplicate reporting, corruption, missing fields, and illegal values.
[0092] The determination of "abnormal behavior data" includes: structure verification, legality verification, time sequence verification, and duplication verification. If any one of these verifications fails, the data is considered to have abnormal behavior. Optional steps are as follows:
[0093] First, the user behavior data is validated for format integrity. Any missing or incorrectly formatted fields are immediately identified as abnormal behavior data. If the structure is correct, the frequency of use, dwell time, and intervals within the user behavior data are analyzed for reasonableness. If these exceed the range of normal user behavior or violate the logical order of components, they are considered abnormal behavior data. Next, the credibility of the user characteristics in the user behavior data is assessed. If they do not match real user characteristics, they are considered abnormal behavior data. Finally, the timestamps of the user behavior data are checked to ensure they conform to a temporal pattern with historical user behavior data. If not, they are considered abnormal behavior data. Finally, the user behavior data is checked for duplicates; if duplicates are found, they are considered abnormal behavior data.
[0094] When collecting user behavior data, if a successful response is received from the server, the data collection is considered successful; otherwise, it is considered a failure. If data collection fails, the behavior events can be cached locally and retried when the network recovers or the system is idle. Furthermore, there may be situations where user behavior data is insufficient. In such cases, user behavior data can be ignored initially, and its priority adjusted once sufficient data is available.
[0095] This embodiment can determine the problem based on the following three dimensions; if any one of them is met, it is determined that the user behavior data is insufficient:
[0096] Dimension 1: Insufficient sample size (the most important criterion): For example, the amount of user behavior data is lower than the threshold, such as less than N interaction events (e.g., N=10), less than M days of active samples (e.g., M=1~2 days), less than the coverage of basic UI components (e.g., only interacted with a small number of UI components <30%); For example, key types of data are missing, such as no click data, no input data, no dwell time data, no recent interaction (e.g., no interaction in the last 7 days).
[0097] Dimension 2: Insufficient Confidence in User Profiles (Quality Standard). A confidence score is calculated for the user behavior data of each target object. This score can be based on factors such as the number of events, time distribution, and the proportion of abnormal events. If the confidence score is below a threshold (e.g., C < 0.4), the behavioral signal is considered unreliable, and insufficient user behavior data is identified for the target object. Examples include user behavior data from a single visit, user behavior concentrated in a very short period, lack of representativeness, and an excessively high proportion of abnormal behavior data (>30%).
[0098] Dimension 3: Cold Start Users or New Devices (Time-Series Standard). Examples include first-time user access, clearing cache, first-time startup of a new device, and new account / account switching. These situations are considered "no historical data," naturally triggering "insufficient user behavior data."
[0099] S302. Based on the device information of the electronic device and the priority of each UI component, determine the layout strategy. The layout strategy records the constraints for displaying each UI component. One approach is to determine the order in which each UI component is arranged in the UI based on its priority; and based on the order in which each UI component is arranged in the UI and the device information of the electronic device, determine the position, shape, and size of each UI component in the display area.
[0100] The device information of an electronic device includes: screen size (width, height, available viewport area), resolution and pixel density (determining the amount of information that can be displayed and the font size), interaction method (touch device, desktop device, keyboard and mouse device, etc.), device type (mobile / tablet / desktop), orientation and external environment (landscape / portrait, whether it is in a safe zone, etc.). Device presentation constraints can be generated based on this information, and these constraints apply to the overall UI layout. For example, device presentation constraints include: maximum number of columns (single column for mobile devices, 2 columns for tablets, 2-4 columns for desktops), minimum / maximum display width of a single UI component; acceptable component density (how many interaction points can be placed per screen); and visible area priority (first screen is higher than the next screen). Different types of devices have different device presentation constraints. For example, device presentation constraints for multi-column devices may include: high-priority fields are allocated wider areas (e.g., entire rows or half rows); medium-priority fields are filled on both sides by column; low-priority fields are filled or collapsed downwards according to a grid sequence; if the component density is too high, low-priority fields are hidden or collapsed. Device rendering constraints for single-column devices (mobile) may include: all UI components are arranged in a vertical single column; higher priority components are placed at the front; lower priority fields are automatically collapsed in the "Expand More" area; large components (such as charts and maps) are scaled proportionally to the screen width. Device rendering constraints for landscape devices may include: multi-column layout; moving higher priority components to the center (middle / left side of the screen).
[0101] After obtaining the device rendering constraints, based on the arrangement order of each UI component in the UI and the device information of the electronic device, the position, shape, and size of each UI component in the display area are determined. Position indicates the screen to which the UI component corresponds, such as the first screen (priority area) or the second screen (sub-area), further indicating the row and column position of the UI component on the screen; shape mainly corresponds to the display mode, such as collapsed display, expanded display, or hidden display; size includes width and height (full width / half width / proportional scaling, etc.). The UI components are rendered using position, shape, and size.
[0102] In some examples, constraints may also include priority adjustment information to allow for rollback in case of layout errors. In some examples, user behavior data may also include display preference data. For UI components corresponding to the display preference data, the constraints for displaying the UI component are determined according to the display preference data; for example, if a UI component is placed on top, it will be displayed as the first UI component. If the constraints of other UI components conflict with the constraints of the UI components corresponding to the display preference data, the constraints of the other UI components are adjusted.
[0103] When user behavior data is insufficient, UI components adopt a default layout strategy. When a layout error occurs, the original layout strategy is rolled back. The default layout strategy is an adjusted strategy based on the device type, and it is a strategy that matches the device type. The original layout strategy can be a set of strategies shared by all device types.
[0104] In some examples, if no UI component matching the semantic description information of the object to be processed is found, or if no constraints are determined based on the semantic description information of the object to be processed, a preset default display strategy is used to display the UI component corresponding to the object to be processed. The form of the preset default display strategy is not limited in this embodiment.
[0105] In summary, after determining the UI components for each object to be processed, the layout can be adaptively adapted to different types of electronic devices. Furthermore, personalized layouts can be achieved by incorporating user behavior data, reducing the workload of subsequent manual fine-tuning. Therefore, only one set of semantic description information and a preset mapping rule library needs to be maintained (the preset mapping rule library can be configured with UI components and basic priorities according to the type of electronic device). At runtime, the rendering engine of the electronic device selects the matching UI components based on the type of electronic device, eliminating the need to copy / fork templates and thus avoiding the need for separate maintenance for different types of electronic devices.
[0106] The foregoing has described a semantically driven user interface generation method provided by embodiments of this application. The following will describe the apparatus for executing the above-described semantically driven user interface generation method. Please refer to... Figure 4 , Figure 4 This is a schematic diagram of a semantically driven user interface generation device provided in an embodiment of this application. Figure 4 As shown, the semantically driven user interface generation device includes: an acquisition unit 10, a search unit 20, a generation unit 30, a determination unit 40, and a display unit 50.
[0107] The acquisition unit 10 is used to acquire description information for generating the user interface (UI). The description information includes at least one object to be processed and semantic description information for acquiring the object to be processed. The semantic description information of the object to be processed is used to indicate the functional intent of the object to be processed. The object to be processed is an object in the UI that is to be matched with a UI component.
[0108] In one possible implementation, the acquisition unit 10 is used to acquire semantic description information from the semantic field of the object to be processed; or, to extract each matching word from the object to be processed, acquire the candidate semantic description information corresponding to each matching word, and obtain the semantic description information of the object to be processed based on the candidate semantic description information corresponding to each matching word.
[0109] The optional process of obtaining candidate semantic description information and obtaining semantic description information of the object to be processed based on the candidate semantic description information by the acquisition unit 10 includes: preprocessing the object name of the object to be processed to obtain the standard name of the object name; performing word segmentation on the standard name to obtain the word segmentation result of the standard name, and extracting each keyword from the word segmentation result of the standard name; obtaining the target semantic description information matched by each keyword from the preset semantic rule library and the thesaurus, and when the standard name includes a prefix and / or a suffix, obtaining the target semantic description information matched by the prefix and / or the target semantic description information matched by the suffix, and using the multiple matched target semantic description information as multiple candidate semantic description information of the standard name; if the multiple candidate semantic description information is the same and the functional intent indicated by the multiple candidate semantic description information is unique, then the candidate semantic description information is used as the semantic description information of the object to be processed; if the multiple candidate semantic description information is different or the functional intent indicated by the candidate semantic description information is not unique, then the semantic description information of the object to be processed is obtained according to the preset processing logic and the multiple candidate semantic description information.
[0110] In one possible implementation, the acquisition unit 10 is used to obtain semantic description information unique to the function intent by utilizing multiple candidate semantic description information according to at least one of priority rules, semantic logic rules and context correction rules.
[0111] For example, the acquisition unit 10 is used to determine candidate semantic description information corresponding to the same priority among multiple candidate semantic description information using a preset priority order; if the functional intent indicated by the candidate semantic description information corresponding to the same priority is unique, then the candidate semantic description information of that priority is used as the semantic description information of the object to be processed; if the functional intent indicated by the candidate semantic description information corresponding to each priority is not unique, the multiple candidate semantic description information are merged; if the functional intent indicated by the merged candidate semantic description information is unique, then the merged candidate semantic description information is used as the semantic description information of the object to be processed; if the functional intent indicated by the merged candidate semantic description information is not unique, context data associated with the object name is acquired, and the merged candidate semantic description information is corrected according to the context data associated with the object name to obtain corrected candidate semantic description information; if the functional intent indicated by the corrected candidate semantic description information is unique, then the corrected candidate semantic description information is used as the semantic description information of the object to be processed; if the functional intent indicated by the corrected candidate semantic description information is not unique, then the semantic description information of the object to be processed is determined to be preset semantic description information, wherein the UI component corresponding to the preset semantic description information is a default component.
[0112] The lookup unit 20 is used to search for UI components that match the semantic description information of the object to be processed from the preset mapping rule library.
[0113] The generation unit 30 is used to generate instances of UI components that match the semantic description information of the object to be processed.
[0114] The determining unit 40 is used to determine the constraints when displaying UI components based on the collected user behavior data, the device information of the electronic device, and the semantic description information of the object to be processed.
[0115] In one possible implementation, the determining unit 40 is used to determine the priority of the object to be processed based on the semantic description information of the object to be processed and user behavior data, wherein the priority of the object to be processed is the priority of the UI component matched with the object to be processed; and to determine a layout strategy based on the device information of the electronic device and the priority of each UI component, wherein the layout strategy records the constraints when each UI component is displayed.
[0116] The semantic description information of the objects to be processed is used to determine their priority, while user behavior data is used to adjust their priority. For objects to be processed that have a corresponding relationship, the priority among these objects satisfies the following: objects to be processed that have a pairing relationship have the same priority; objects to be processed that have a parent-child relationship have priorities that satisfy the parent-child relationship.
[0117] Display unit 50 is used to render instances of UI components according to the constraints when displaying UI components, so as to display the UI in the display area of the electronic device.
[0118] In one possible implementation, the display unit 50 is used to determine the arrangement order of each UI component in the UI according to the priority of each UI component; and to determine the position, shape, and size of each UI component in the display area according to the arrangement order of each UI component in the UI and the device information of the electronic device.
[0119] For a detailed description of each unit in the semantically driven user interface generation apparatus described above, please refer to the above method embodiments, which will not be elaborated here.
[0120] This application also provides an electronic device in its embodiments. (See reference...) Figure 5 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed electronic devices such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0121] like Figure 5 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. When the electronic device is powered on, the RAM 503 also stores various programs and data required for the operation of the electronic device. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504. The processing unit 501 can be considered as a processor in the electronic device, and the ROM 502, RAM 503, and storage device 508 can be considered as memory in the electronic device. The memory is used to store computer programs; the processor is used to execute the computer programs to implement any of the semantically driven user interface generation methods provided in the embodiments of this application.
[0122] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, memory cards, hard drives, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0123] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the semantically driven user interface generation methods provided in this application.
[0124] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the semantically driven user interface generation methods provided in this application.
[0125] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0126] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0127] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0128] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).< / object>
Claims
1. A semantically driven user interface generation method, characterized in that, Used in electronic devices, including: Obtain descriptive information for generating the user interface (UI), the descriptive information including at least one object to be processed; Obtain semantic description information of the object to be processed, the semantic description information of the object to be processed is used to indicate the functional intent of the object to be processed, the object to be processed is an object of UI component to be matched in UI; Search the preset mapping rule base for UI components that match the semantic description information of the object to be processed; Generate an instance of a UI component that matches the semantic description information of the object to be processed; Based on the collected user behavior data, the device information of the electronic device, and the semantic description information of the object to be processed, the constraints for displaying the UI component are determined. Instances of the UI component are rendered based on the constraints of the UI component's display, so as to display the UI in the display area of the electronic device.
2. The method according to claim 1, characterized in that, The step of obtaining the semantic description information of the object to be processed includes: Obtain semantic description information from the semantic fields of the object to be processed; or, Extract each matching word from the object to be processed, obtain the candidate semantic description information corresponding to each matching word, and obtain the semantic description information of the object to be processed based on the candidate semantic description information corresponding to each matching word.
3. The method according to claim 2, characterized in that, The step of extracting each matching word from the object to be processed, obtaining candidate semantic description information corresponding to each matching word, and obtaining semantic description information of the object to be processed based on the candidate semantic description information corresponding to each matching word includes: The object name of the object to be processed is preprocessed to obtain the standard name of the object name; The standard name is segmented into words to obtain the segmentation results of the standard name, and each keyword is extracted from the segmentation results of the standard name; The target semantic description information matching each keyword is obtained from the preset semantic rule base and the thesaurus. When the standard name includes a prefix and / or a suffix, the target semantic description information matching the prefix and / or the target semantic description information matching the suffix is obtained. The multiple target semantic description information matched are used as multiple candidate semantic description information of the standard name. If the multiple candidate semantic description information is the same and the functional intent indicated by the multiple candidate semantic description information is unique, then the candidate semantic description information shall be used as the semantic description information of the object to be processed. If the multiple candidate semantic description information is different or the functional intent indicated by the candidate semantic description information is not unique, then the semantic description information of the object to be processed is obtained according to the preset processing logic and the multiple candidate semantic description information.
4. The method according to claim 3, characterized in that, The step of obtaining the semantic description information of the object to be processed according to the preset processing logic and the multiple candidate semantic description information includes: By utilizing at least one of priority rules, semantic logic rules, and context correction rules, a unique semantic description of the functional intent is obtained from the plurality of candidate semantic description information.
5. The method according to claim 4, characterized in that, The step of obtaining a unique semantic description of the functional intent by utilizing the multiple candidate semantic description information according to at least one of priority rules, semantic logic rules, and context correction rules includes: Using a preset priority order, determine the candidate semantic description information corresponding to the same priority among the multiple candidate semantic description information; If the functional intent indicated by the candidate semantic description information corresponding to the same priority is unique, then the candidate semantic description information of that priority shall be used as the semantic description information of the object to be processed. If the functional intent indicated by the candidate semantic description information corresponding to each priority is not unique, the multiple candidate semantic description information are merged. If the functional intent indicated by the merged candidate semantic description information is unique, the merged candidate semantic description information is used as the semantic description information of the object to be processed. If the functional intent indicated by the fused candidate semantic description information is not unique, obtain the context data associated with the object name, and modify the fused candidate semantic description information according to the context data associated with the object name to obtain the modified candidate semantic description information. If the functional intent indicated by the modified candidate semantic description information is unique, then the modified candidate semantic description information shall be used as the semantic description information of the object to be processed. If the functional intent indicated by the corrected candidate semantic description information is not unique, then the semantic description information of the object to be processed is determined to be the preset semantic description information, wherein the UI component corresponding to the preset semantic description information is the default component.
6. The method according to claim 1, characterized in that, The step of determining the constraints for displaying the UI component based on the collected user behavior data, the device information of the electronic device, and the semantic description information of the object to be processed includes: Based on the semantic description information of the object to be processed and the user behavior data, the priority of the object to be processed is determined, and the priority of the object to be processed is the priority of the UI component matched with the object to be processed. Based on the device information of the electronic device and the priority of each UI component, a layout strategy is determined, and the layout strategy records the constraints when each UI component is displayed.
7. The method according to claim 6, characterized in that, The semantic description information of the object to be processed is used to determine the priority of the object to be processed, and the user behavior data is used to adjust the priority of the object to be processed.
8. The method according to claim 6, characterized in that, Objects with a pairing relationship have the same priority; objects with a parent-child relationship have priorities that satisfy the parent-child relationship.
9. The method according to claim 6, characterized in that, The step of determining the layout strategy based on the device information of the electronic device and the priority of each UI component includes: Determine the order in which each UI component is arranged in the UI based on its priority; Based on the arrangement order of each UI component in the UI and the device information of the electronic device, the position, shape, and size of each UI component in the display area are determined.
10. A semantically driven user interface generation device, characterized in that, Used in electronic devices, including: The acquisition unit is used to acquire description information for generating a user interface (UI). The description information includes at least one object to be processed and semantic description information for acquiring the object to be processed. The semantic description information of the object to be processed is used to indicate the functional intent of the object to be processed. The object to be processed is an object in the UI that is to be matched with a UI component. The search unit is used to search for UI components that match the semantic description information of the object to be processed from a preset mapping rule base; A generation unit is used to generate instances of UI components that match the semantic description information of the object to be processed; The determining unit is used to determine the constraints for displaying the UI component based on the collected user behavior data, the device information of the electronic device, and the semantic description information of the object to be processed; The display unit is used to render an instance of the UI component according to the constraints when the UI component is displayed, so as to display the UI in the display area of the electronic device.
Citation Information
Patent Citations
Interaction intention driven tool scheduling method, device and equipment and medium
CN120929470A
Page component configuration method and device, equipment, medium and program product
CN121050796A
Graphical user interface test case generation method based on multi-agent framework
CN121187955A
Low-code development automatic generation method based on large language model
CN121433632A
UI interface automatic generation method and system based on natural language description
CN121579007A