Method and device for generating device capability map, intelligent terminal and storage medium
By generating device capability maps through autonomous traversal and semantic recognition models, the problem of unadaptable mapping relationships in cross-brand device control is solved, realizing automated generation of device capability maps and scalability across brands.
Patent Information
- Application Number
- CN202611430765.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-11-27
AI Technical Summary
In cross-brand device control, the control mapping relationship cannot automatically adapt to the increase in device categories or changes in application interfaces, requiring repeated manual maintenance, which limits scalability.
By autonomously traversing the target application's pages and combining a pre-trained semantic recognition model, the system automatically identifies device entities, status display elements, and operable controls, extracts device identifiers, status values, and operation method information, and converts them into standardized labels through semantic mapping rules to generate a device capability map.
It enables the automatic generation of device capability maps across brands without relying on manually pre-built mapping tables. When device categories increase or application interfaces change, no manual reconfiguration is required, thus improving scalability.
Smart Images

Figure CN123178642A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of data processing technology and intelligent control technology, and in particular to a method, apparatus, intelligent terminal and storage medium for generating a device capability map. Background Technology
[0002] With the increasing prevalence of smart home systems, centralized procurement of multi-brand devices has become commonplace in the delivery of fully furnished real estate projects. Different brands of devices each have their own independent official applications, creating information silos as devices and control logic cannot be directly integrated. To achieve device control across different brands' applications, current technology typically requires manual pre-configuration of the mapping relationship between control commands and page operation paths for each brand, device type, and control command, forming a fixed command mapping table. However, whenever a new brand or device type is added, or when the application version is updated resulting in changes to the page structure, this mapping table must be manually maintained again. This reliance on manually pre-built mapping tables means that the control mapping relationship cannot automatically adapt to changes in device categories or application interface structure, requiring repeated manual intervention for updates, thus limiting scalability. Summary of the Invention
[0003] This application provides a method, apparatus, smart terminal, and storage medium for generating a device capability map, in order to solve the problem that the control mapping relationship in cross-brand device control cannot automatically adapt to the increase in device categories or changes in application interface, requiring repeated manual maintenance and having limited scalability.
[0004] In a first aspect, embodiments of this application provide a method for generating a device capability map, comprising: Obtain the target application deployed on the smart terminal; The application is traversed based on its root page, and the operation path from the root page to each target page is recorded. The page information of each target page is also collected. The page information of each target page is input into a pre-trained semantic recognition model to obtain the device entity, status display element and operable control in each target page, and extract the device identifier of the device entity, the current status value corresponding to the status display element, the operation mode information corresponding to the operable control and the status verification point for the status display element. Based on preset semantic mapping rules, the device identifier of each target page is converted into a first standardized device tag, and the operation method information of each target page is converted into a first standardized operation tag; Based on the first standardized device tag, the first standardized operation tag, the current status value, the operation path, and the status verification point of each target page, a device capability map is generated.
[0005] Secondly, embodiments of this application provide an apparatus for generating a device capability map, comprising: The acquisition module is used to acquire target applications deployed on smart terminals; The traversal module is used to traverse based on the root page of the target application, record the operation path from the root page to each target page, and collect the page information of each target page. The model processing module is used to input the page information of each target page into a pre-trained semantic recognition model, obtain the device entity, status display element and operable control in each target page, and extract the device identifier of the device entity, the current status value corresponding to the status display element, the operation mode information corresponding to the operable control and the status verification point for the status display element. The conversion module is used to convert the device identifier of each target page into a first standardized device tag based on a preset semantic mapping rule, and to convert the operation mode information of each target page into a first standardized operation tag. The generation module is used to generate a device capability map based on the first standardized device tag, the first standardized operation tag, the current status value, the operation path, and the status verification point of each target page.
[0006] Thirdly, embodiments of this application provide a smart terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the above-described method for generating a device capability map.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method for generating a device capability map.
[0008] The above-mentioned method, apparatus, smart terminal, and storage medium for generating a device capability map include: acquiring a target application deployed on a smart terminal; traversing the root page of the target application, recording the operation path from the root page to each target page, and collecting page information of each target page; inputting the page information of each target page into a pre-trained semantic recognition model to acquire device entities, status display elements, and operable controls in each target page, and extracting the device identifier of the device entity, the current status value corresponding to the status display element, the operation mode information corresponding to the operable control, and the status verification point for the status display element; converting the device identifier of each target page into a first standardized device label based on a preset semantic mapping rule, and converting the operation mode information of each target page into a first standardized operation label; and generating a device capability map based on the first standardized device label, the first standardized operation label, the current status value, the operation path, and the status verification point of each target page. This solution automatically identifies device entities, status display elements, and operable controls by autonomously traversing the target application's pages and combining a semantic recognition model. It then extracts device identifiers, status values, operation method information, and status verification points. These are then uniformly converted into standardized device tags and standardized operation tags through semantic mapping rules. Finally, a structured device capability map is generated using device entities as indexes. This solution enables the automatic generation of cross-brand device capability maps without relying on manually pre-built mapping tables. It also eliminates the need for manual reconfiguration when device categories increase or application interfaces change, demonstrating strong scalability. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a flowchart illustrating a method for generating a device capability map in one embodiment of this application; Figure 2 This is a schematic diagram of the device for generating a device capability map according to one embodiment of this application; Figure 3 This is a schematic diagram of the structure of a smart terminal in one embodiment of this application. Detailed Implementation
[0011] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0012] Firstly, such as Figure 1 As shown in the figure, this application embodiment provides a method for generating a device capability map, including the following steps: S101: Obtain the target application deployed on the smart terminal.
[0013] Here, "smart terminal" refers to embedded hardware devices deployed in users' homes, which may include, but are not limited to, smart central control boxes, smart entry screens, or whole-house smart hubs. "Target application" refers to the official application corresponding to the smart home device.
[0014] As an example, smart terminals come pre-installed with official applications from major smart home brands. The smart terminal obtains a list of installed applications and filters out those belonging to the smart home control category as target applications. For instance, the smart terminal scans for installed applications, obtains the application list, and then filters out Brand A Smart Home App, Brand B Smart Home App, and Brand C Smart Home App as target applications based on their package names, application category tags, or function descriptions.
[0015] For example, there are multiple target applications. Before traversing based on the root page of each target application, the smart terminal also performs account login preprocessing. Specifically, the smart terminal obtains the account credentials corresponding to each target application; stores each account credential in a unified encrypted manner; and automatically logs into each target application based on the stored account credentials. Account credentials refer to the username and password registered by the user in the target application, or an authorization token issued by the target application's authentication server. The smart terminal has a built-in encrypted secure storage partition, which is isolated from the smart terminal's ordinary storage partition, and is used for unified encrypted storage and automatic login maintenance of account credentials for multiple brands of smart home applications. For example, the user enters the username and password corresponding to Brand A Smart Home APP, Brand B Smart Home APP, and Brand C Smart Home APP through the smart terminal's human-computer interaction interface, or completes account authorization by scanning a QR code. The smart terminal stores each account credential in the encrypted secure storage partition. When login is required, the smart terminal responds to the startup event or the map reconstruction command triggered by the user, reads the account credentials corresponding to each target application from the encrypted storage partition, encapsulates the account credentials into a login request message according to the login protocol corresponding to each target application, and sends it to the authentication server of each target application. It receives the session token returned by each authentication server and injects the session token into the runtime context of each target application, thereby completing automatic login and maintaining the login state in each target application.
[0016] As can be seen, through the unified account management mechanism, users only need to enter or reset their username and password for each brand's app on the smart terminal interface, or complete account authorization by scanning a QR code, to complete account initialization. The entire process requires no contact with technical configuration items. Furthermore, each account credential is stored in an encrypted and secure storage partition, isolated from ordinary storage partitions, ensuring the security of user account data.
[0017] S102: Traverse the target application based on its root page, record the operation path from the root page to each target page, and collect the page information of each target page.
[0018] Here, the root page refers to the homepage or starting page of the target application, which is the starting point for traversal. The operation path refers to the sequence of simulated triggering events traversed from the root page to a specific target page. Page information refers to the content data of the target page, which may include page screenshot data and node tree structure data, etc.
[0019] As an example, taking Brand A's smart home app as an example, the smart terminal launches a page traversal engine, starting the traversal from the app's homepage as the root page. The page traversal engine, using the root page as the starting point, simulates clicking on interactive elements within the root page to sequentially navigate to each target page, recording the sequence of interactive actions from the root page to each target page. During the traversal process, the page traversal engine also performs a page information collection operation on each target page reached, obtaining the target page's information.
[0020] For example, interactive elements in the root page include clickable buttons, icons, menu items, and other page controls. The page traversal engine triggers these interactive elements to navigate between pages. After navigating to a target page, the page traversal engine uses the interface screenshot and view structure acquisition interfaces provided by the operating system to collect the page screenshot data and node tree structure data of the target page as its page information. The page traversal engine traverses all target pages of Brand A Smart Home APP in the above manner. For each target page, it records the sequence of interactive actions from the root page to the target page as the operation path and collects the page information of the target page.
[0021] As can be seen, through the above traversal mechanism, the smart terminal can automatically traverse all accessible target pages of the target application without human intervention, and simultaneously collect the page information of each target page, reducing the workload of manual configuration.
[0022] S103: Input the page information of each target page into the pre-trained semantic recognition model to obtain the device entities, status display elements and operable controls in each target page, and extract the device identifier of the device entity, the current status value corresponding to the status display element, the operation mode information corresponding to the operable control, and the status verification point for the status display element.
[0023] The semantic recognition model is trained on a corpus of home interface data, using page information from each target page as input. It is used to classify interface elements by function, identify control types, determine device and location attribution, and extract state semantics. A device entity refers to an element on the target page representing a physical device. A status display element refers to an element on the target page used to display the current status of a device. An operable control refers to an interactive element on the target page that can be operated by the user to control the device. A device identifier is information used to uniquely identify a device entity. The current status value refers to the numerical value of the current device status displayed by the status display element. Operation method information refers to the operation type corresponding to the operable control. A status verification point refers to the location information of the status display element on the target page.
[0024] As an example, the smart terminal inputs page information collected from each target page of the target application into a pre-trained semantic recognition model. The semantic recognition model identifies each target page and outputs the corresponding device entity, status display element, and operable control on the target page. Taking the living room light control page of Brand A's smart home APP as an example, the semantic recognition model identifies the text element "living room light" as a device entity, the brightness display "80%" as a status display element, and the "on / off" button as an operable control.
[0025] After identifying device entities, status display elements, and operable controls, the semantic recognition model further extracts corresponding detailed data. For device entities, it extracts the device identifier, such as the device name text "living room light" or the device model text "LED-001". For status display elements, it extracts the current status value corresponding to the status display element; for example, it extracts the value "80%" from the brightness display "80%" as the current status value. For operable controls, it extracts the corresponding operation method information; for example, the operation method information for a "switch" button is a switch toggling operation. For status display elements, it also extracts status verification points for the status display element, such as the node path of the status display element in the node tree structure data or its position coordinates in the target page screenshot data.
[0026] As can be seen, through the semantic recognition model, the smart terminal can automatically identify device entities, status display elements and operable controls from the target page, and automatically extract device identifiers, current status values, operation mode information and status verification points, thus realizing the automatic discovery of device control information and the automatic extraction of semantic information.
[0027] S104: Based on the preset semantic mapping rules, convert the device identifier of each target page into a first standardized device label, and convert the operation method information of each target page into a first standardized operation label.
[0028] The preset semantic mapping rules refer to the conversion rules that unify the differentiated device names and operation descriptions in different brand applications into standardized tags. These rules can include a standardized device name mapping table and a standardized operation mapping table. The standardized device name mapping table is a pre-configured dictionary of standardized device names, used to map different names for the same device in different brand applications to a unified standardized device name. The standardized operation mapping table is a pre-configured dictionary of standardized operations, used to map different descriptions of the same operation in different brand applications to a unified standardized operation name. The first standardized device tag refers to the standardized device name obtained after semantic mapping of the device identifier. The first standardized operation tag refers to the standardized operation name obtained after semantic mapping of the operation method information.
[0029] As an example, the smart terminal retrieves the device identifier "Living Room Main Light" from the living room light control page of Brand A's smart home app. The smart terminal matches the device name text "Living Room Main Light" in the device identifier with each standardized device name entry in the standardized device name mapping table. If a match is found with the standardized device name entry "Living Room Light," then "Living Room Light" is used as the first standardized device tag corresponding to the device identifier. In Brand B's smart home app, the device identifier for the same device is "Living Room Light." The smart terminal similarly matches this with the standardized device name mapping table, again finding the standardized device name entry "Living Room Light," and similarly uses "Living Room Light" as the first standardized device tag corresponding to the device identifier. Thus, different names for the same device in different brand applications are uniformly mapped to the same first standardized device tag.
[0030] The smart terminal performs the same semantic mapping processing on the operation method information. Specifically, the smart terminal obtains the operation method information "click the switch button" corresponding to the operable control "switch" on the living room light control page of Brand A's smart home APP. The smart terminal obtains the control description text "switch" corresponding to the operation method information, matches the control description text with each standardized operation type entry in the standardized operation mapping table, and if a standardized operation type entry "switch toggle" is matched, then "switch toggle" is used as the first standardized operation label corresponding to the operation method information. In Brand C's smart home APP, the control with the same function is described as "ON / OFF," and the smart terminal similarly matches it with the standardized operation mapping table, similarly matching the standardized operation type entry "switch toggle," and similarly using "switch toggle" as the first standardized operation label corresponding to the operation method information. Thus, different descriptions of the same operation in different brand applications are uniformly mapped to the same first standardized operation label.
[0031] For example, the smart terminal extracts the device name text from the device identifier, matches the device name text with each standardized device name entry in the standardized device name mapping table, and selects the standardized device name entry with the highest matching degree as the first standardized device label. The smart terminal extracts the control description from the control description text corresponding to the operation method information, matches the control description with each standardized operation type entry in the standardized operation mapping table, and selects the standardized operation type entry with the highest matching degree as the first standardized operation label.
[0032] As can be seen, through the semantic mapping mechanism, the differentiated device names and operation descriptions in different brand applications are uniformly converted into standardized device tags and operation tags, eliminating semantic differences between brands.
[0033] S105: Generate a device capability map based on the first standardized device label, the first standardized operation label, the current status value, the operation path, and the status verification point of each target page.
[0034] The device capability map refers to a unified set of capabilities that can be directly retrieved and invoked by linkage rules. This is formed by standardizing the semantic mapping of device entities, functions, operable controls or control channels, status variables, operation paths, and verification methods of native smart devices and existing retrofitted devices across brands and technology routes. Control information records refer to structured data records formed by associating the first standardized device tag, first standardized operation tag, operation path, current status value, and status verification point of the same device entity. The searchable data set refers to a data structure that supports rapid querying, formed by organizing each control information record using the first standardized device tag as an index.
[0035] As an example, the smart terminal associates various data extracted from the living room light control page of Brand A's smart home APP. On this target page, the first standardized device label is "Living Room Light," the first standardized operation labels include "On / Off Switch" and "Brightness Adjustment," the operation path is "Trigger 'My Devices' control → Trigger 'Living Room Light' control," the current state value is 80%, and the state verification point is "the node path of the brightness display area in the node tree structure data on the living room light control page." The smart terminal associates the above five data items into a control information record corresponding to the living room light device entity.
[0036] The smart terminal also correlates various data extracted from the bedroom air conditioner control page of Brand B's smart home APP. On this target page, the first standardized device label is "Bedroom Air Conditioner," and the first standardized operation labels include "On / Off Switch," "Temperature Adjustment," and "Mode Switch." The operation path is "Trigger 'Device' Control → Trigger 'Bedroom Air Conditioner' Control." The current state value is 26℃, and the state verification point is "the node path of the temperature display area in the node tree structure data of the bedroom air conditioner control page." The smart terminal correlates these five data items into a control information record corresponding to the bedroom air conditioner device entity.
[0037] The smart terminal generates a corresponding control information record for each device entity identified on all target pages using the same method. After all control information records are generated, the smart terminal uses the first standardized device tag in each control information record as an index to construct a searchable data set, forming a device capability map. In this searchable data set, the control information record corresponding to the living room light can be retrieved using "living room light" as the key, and the control information record corresponding to the bedroom air conditioner can be retrieved using "bedroom air conditioner" as the key.
[0038] As can be seen, by associating the first standardized device tag, the first standardized operation tag, the operation path, the current status value, and the status verification point belonging to the same device entity in each target page as control information records, and constructing a searchable data set with the first standardized device tag as an index, the smart terminal generates a device capability map, realizing unified storage and rapid retrieval of cross-brand device control information.
[0039] In summary, the above steps automatically identify device entities, status display elements, and operable controls by autonomously traversing the target application's pages and combining them with a semantic recognition model. They also extract device identifiers, status values, operation method information, and status verification points. These are then uniformly converted into standardized device tags and standardized operation tags through semantic mapping rules. Finally, a structured device capability map is generated using device entities as indexes. This achieves the automatic generation of cross-brand device capability maps without relying on manually pre-built mapping tables. When device categories increase or the application interface changes, no manual reconfiguration is required, demonstrating strong scalability.
[0040] In one embodiment, the process involves traversing the target application based on its root page and recording the operation path from the root page to each target page, including the following steps: S121: Taking the root page as the current page, expand the control nodes in the current page level by level, identify the attributes of each control node, and generate corresponding simulated trigger events for the remaining control nodes after filtering out control nodes containing dangerous operations. Dangerous operations include account logout, device unbinding and device deletion. S122: Trigger each simulated trigger event in sequence to make the target application jump from the current page to the next level target page, and perform skip processing on pop-up window controls and / or guide overlay controls during the jump, and perform a preset retry strategy on the target page loading timeout event; S123: After redirecting to the next level target page, determine whether the next level target page is a page that has already been visited; S124: If the next level target page is a visited page, stop traversing downwards from the next level target page; if the next level target page is not a visited page, use the next level target page as the new current page and continue traversing until all target pages have been traversed. S125: Record the jump chain formed by each simulated triggering event during the traversal from the root page to each target page as the operation path from the root page to the corresponding target page.
[0041] Among them, control nodes refer to interactive elements on the target page that can be triggered to generate page navigation, and can include buttons, icons, links, and menu items. The attributes of control nodes include control type, control identifier, text content, and whether it is clickable. Simulated trigger events refer to interactive events generated by simulating user clicks or touches on control nodes, used to drive the target application to jump from the current page to the next level target page. Dangerous operations refer to irreversible operations that, once triggered, will result in account logout, device unbinding, or device deletion. By filtering out control nodes containing dangerous operations, it can be ensured that only view and control-related target pages are traversed, effectively avoiding the execution of irreversible dangerous operations. Pop-up controls refer to prompt windows or advertisement windows that pop up on the target page, including a close button. Guided layer controls refer to guided prompt layers displayed when the application is first launched or when a feature is updated, including a skip button. Preset retry strategy refers to the processing mechanism triggered when the target page loads beyond a preset time threshold, including reloading the target page or skipping the jump. Visited pages refer to target pages that have already been visited during the traversal process, determined by comparing page features.
[0042] As an example, taking Brand A's smart home app as an example, the page traversal engine starts traversing from the homepage of Brand A's smart home app as the root page. The page traversal engine takes the root page as the current page and expands the control nodes on the current page level by level. The current page contains three control nodes: "My Devices," "Scenes," and "My." The page traversal engine identifies the attributes of each control node. The "My" control node contains a "Account Logout" dangerous operation flag and is filtered out. The page traversal engine generates corresponding simulated trigger events for "My Devices" and "Scenes" respectively. The page traversal engine triggers each simulated trigger event sequentially, first triggering the "My Devices" simulated trigger event, causing Brand A's smart home app to jump from the homepage to the device list page. During the jump, the device list page pops up a guide overlay. After the page traversal engine identifies this guide overlay control, it generates and triggers a skip simulated trigger event for this guide overlay control. After the guide overlay disappears, the jump continues. After reaching the device list page, the page traversal engine determines whether the device list page is a previously visited page. Since this is the first visit to the device list page, the page traversal engine treats it as the new current page and continues traversing. The engine expands the control nodes in the device list page, identifies the attributes of each node, filters out nodes containing dangerous operations, generates simulated trigger events, and triggers a redirect. The engine repeats the steps of expanding control nodes, identifying attributes, filtering out dangerous operations, generating simulated trigger events, triggering redirects, and determining visited pages until all target pages of Brand A's smart home app have been traversed.
[0043] During the traversal process, if a target page has already been visited after reaching it, the page traversal engine stops traversing downwards from that target page to avoid looping. The page traversal engine records the jump chains formed by each simulated trigger event from the root page to each target page as the operation path from the root page to the corresponding target page. For example, if the "My Devices" control is triggered sequentially from the homepage of Brand A's smart home APP to the device list page, and then the "Living Room Light" control is triggered to the living room light control page, then "triggering the 'My Devices' control → triggering the 'Living Room Light' control" is the operation path from the root page to the living room light control page.
[0044] As can be seen, this embodiment avoids irreversible dangerous operations during traversal by filtering out control nodes containing dangerous operations, thus ensuring data security; it ensures uninterrupted traversal by automatically identifying pop-up controls and guide overlay controls and skipping them; it improves the robustness of traversal through a target page loading timeout retry strategy; and it avoids loop collection and repeated traversal through an already visited page determination mechanism. Therefore, it achieves automatic traversal of all target pages of the target application without manual intervention, and completely records the operation path from the root page to each target page.
[0045] In one embodiment, determining whether the next-level target page is a visited page includes the following steps: S1231: Extract the target page features of the next level target page. The target page features include at least one of the following: the Uniform Resource Locator (URL) of the next level target page, the page title, the page layout hash value, and the combination of key controls. S1232: Compare the target page features with the features of each target page in the set of visited pages; S1233: If the target page feature matches any target page feature in the set of visited pages, then the next level target page is determined to be a visited page; S1234: If the target page features do not match any of the target page features in the set of visited pages, then the next level target page is determined to be an unvisited page.
[0046] Here, page features refer to the set of characteristic information used to uniquely identify or distinguish a target page. A Uniform Resource Locator (URL) is a unique resource identifier for the target page, such as "app: / / b***dA / d***ces / list". A page title is the title text displayed at the top of the target page, such as "Device List". A page layout hash value is a hash value calculated based on the position and type of controls on the target page, such as "0x3F2A". A key control combination refers to the set of key controls contained in the target page, such as the page containing three key controls: "Add Device", "Device List", and "Back". The visited page set is a collection storing the page features of all target pages that have been visited, used for deduplication.
[0047] As an example, after the page traversal engine navigates to the next target page, it extracts the Uniform Resource Locator (URL) "app: / / b***dA / d***ces / list", the page title "Device List", the page layout hash value "0x3F2A", and the key control combination "Add Device", "Device List", and "Back". The page traversal engine then compares the extracted page features with the page features of each visited page in the visited page set.
[0048] If a page record with the Uniform Resource Locator (URL) "app: / / b***dA / d***ces / list" already exists in the visited page set, the page traversal engine determines that the target page is a visited page and stops traversing downwards from that target page to avoid loop collection and repeated traversal. If a page record with the URL "app: / / b***dA / d***ces / list" does not exist in the visited page set, and there is no page record with the title "Device List" or the page layout hash value "0x3F2A", meaning that the page characteristics do not match any of the page characteristics in the visited page set, the page traversal engine determines that the target page is not a visited page, adds the target page to the visited page set, and continues traversal.
[0049] As can be seen, this embodiment extracts various page features of the target page, such as the Uniform Resource Locator, page title, page layout hash value, and key control combination, and compares them with the set of visited pages. This can accurately identify whether the target page has been visited, effectively avoiding loop collection and repeated traversal during the traversal process, and improving traversal efficiency.
[0050] In one embodiment, the page information includes page screenshot data and node tree structure data; The page information of each target page is input into a pre-trained semantic recognition model to obtain device entities, status display elements, and operable controls in each target page, including the following steps: S131: Sequentially determine each target page as the current page, and input the page screenshot data and node tree structure data of the current page into the pre-trained semantic recognition model to obtain the device entities, status display elements and operable controls in the current page, until the device entities, status display elements and operable controls in each target page are obtained. S132: Input the current page screenshot data and node tree structure data into the pre-trained semantic recognition model to obtain the device entities, status display elements, and operable controls in the current page, including: S133: Input the screenshot data of the current page into the visual encoding layer of the semantic recognition model to extract the visual feature map of the current page; S134: Input the node tree structure data of the current page into the structure encoding layer of the semantic recognition model to extract the structure feature vector of the current page; S135: Input the visual feature map and structural feature vector of the current page into the multimodal fusion layer of the semantic recognition model to perform feature fusion and generate the fused features of the current page; S136: Input the fusion features of the current page into the classification and regression layer of the semantic recognition model to obtain the functional category labels and location bounding boxes of each element in the current page; S137: Based on the functional category labels and position bounding boxes of each element on the current page, determine the device entities, status display elements, and operable controls on the current page.
[0051] The semantic recognition model includes several layers of data. Screenshot data refers to the image data obtained by taking a screenshot of the target page, containing visual information such as the shape, color, position, and layout of controls. Node tree structure data refers to the view hierarchy structure data of the target page, containing node information for each control, including control type, control identifier, text content, position coordinates, and hierarchical relationship. The visual encoding layer, using a convolutional neural network structure, is a network layer in the semantic recognition model used to extract visual features from the screenshot data. The visual feature map is a multi-dimensional feature matrix representing the visual semantic information in the screenshot. The structural encoding layer, using a graph neural network structure or a Transformer structure, is a network layer in the semantic recognition model used to extract structural features from the node tree structure data. The structural feature vector is a multi-dimensional vector representing the structural semantic information in the page's node tree structure. The multimodal fusion layer, using an attention mechanism or a gating fusion mechanism, is a network layer in the semantic recognition model used to fuse visual and structural features, aligning and fusing the visual feature map and structural feature vector to generate fused features. A fusion feature is a comprehensive feature representation that integrates visual and structural semantics. The classification and regression layer is a network layer in the semantic recognition model used to output element categories and locations, providing functional category labels and location bounding boxes for each element. Functional category labels identify whether an element belongs to a device entity, a status display element, an operable control, or a decorative element. Location bounding boxes identify the element's coordinates on the page.
[0052] As an example, the living room light control page of Brand A's smart home app is used as the current page. The screenshot data for this current page is a screenshot of the living room light control page, and the node tree structure data is the view hierarchy structure of this current page. The smart terminal inputs the screenshot data of the living room light control page into the visual encoding layer of the semantic recognition model. The visual encoding layer outputs a visual feature map of the living room light control page, which includes visual features such as the shape, color, and position of elements like the "living room light" text, the "80% brightness" display, and the "switch" button. The smart terminal inputs the node tree structure data of the living room light control page into the structure encoding layer of the semantic recognition model. The structure encoding layer outputs a structural feature vector for this page, which includes structural features such as the hierarchical position of the "living room light" text node, the text content of the "80% brightness" display node, and the control type of the "switch" button node. The smart terminal inputs the visual feature map output from the visual encoding layer into the first input of the multimodal fusion layer, and the structural feature vector output from the structural encoding layer into the second input of the multimodal fusion layer. The multimodal fusion layer aligns and fuses the visual and structural features, outputting the fused features of the living room light control page. The smart terminal then inputs the fused features output from the multimodal fusion layer into the classification and regression layer. The classification and regression layer outputs the following: for the "living room light" text element, the functional category label is "device entity"; for the "80% brightness" display element, the functional category label is "status display element"; for the "switch" button element, the functional category label is "operable control"; and for the "switch" button element, the functional category label is "operable control"; and for the "switch" button, the functional category label is "operable control"; and the "switch" button. Based on the functional category labels and position bounding boxes of each element output from the classification and regression layer, the smart terminal determines that the device entity in the living room light control page is "living room light," the status display element is the brightness display "80%," and the operable control is the "switch" button.
[0053] As can be seen, this embodiment extracts visual feature maps from page screenshot data through a visual encoding layer, extracts structural feature vectors from node tree structure data through a structural encoding layer, fuses the visual feature maps and structural feature vectors through a multimodal fusion layer to generate fused features, and then outputs functional category labels and position bounding boxes for each element through a classification and regression layer, thereby identifying device entities, status display elements, and operable controls on the page. This multimodal fusion recognition mechanism comprehensively utilizes the visual and structural information of the page, improving the accuracy of device entity and control recognition.
[0054] In one embodiment, a device capability map is generated based on the first standardized device tag, the first standardized operation tag, the current status value, the operation path, and the status verification point of each target page, including the following steps: S151: Associate the first standardized device label, first standardized operation label, operation path, current status value and status verification point belonging to the same device entity in each target page as the control information record of the corresponding device entity; S152: Using the first standardized equipment label as an index, each control information record is constructed into a searchable data set to form an equipment capability map.
[0055] Among them, control information records refer to structured data records formed by associating the first standardized equipment tag, first standardized operation tag, operation path, current status value, and status verification point of the same equipment entity. Searchable data sets refer to data structures that support fast querying, formed by organizing each control information record using the first standardized equipment tag as an index.
[0056] As an example, the smart terminal extracts the following data from the living room light control page of Brand A's smart home APP: the first standardized device label is "living room light," the first standardized operation labels include "on / off switching" and "brightness adjustment," the operation path is "trigger 'My Devices' control → trigger 'living room light' control," the current state value is 80%, and the state verification point is "the node path of the brightness display area in the node tree structure data of the living room light control page." The smart terminal associates the above five data items into a control information record corresponding to the living room light device entity.
[0057] The smart terminal extracted the following data from the bedroom air conditioner control page of Brand B's smart home APP: the first standardized device label is "Bedroom Air Conditioner," the first standardized operation labels include "On / Off Switch," "Temperature Adjustment," and "Mode Switch," the operation path is "Trigger 'Device' Control → Trigger 'Bedroom Air Conditioner' Control," the current status value is 26℃, and the status verification point is "the node path of the temperature display area in the node tree structure data of the bedroom air conditioner control page." The smart terminal associated the above five data items into a control information record corresponding to the bedroom air conditioner device entity.
[0058] The smart terminal generates a corresponding control information record for each device entity identified on all target pages in the same manner. After all control information records are generated, the smart terminal uses the first standardized device tag in each control information record as an index to construct a searchable data set from all control information records, forming a device capability map.
[0059] Within the completed searchable dataset, the control information record for the living room light can be retrieved using "living room light" as the key. This control information record includes the first standardized operation tags "on / off switching" and "brightness adjustment," the operation path "trigger 'My Devices' control → trigger 'living room light' control," the current status value "80%," and the status verification point "the node path of the brightness display area in the living room light control page within the node tree structure data." Similarly, the control information record for the bedroom air conditioner can be retrieved using "bedroom air conditioner" as the key. This record includes the first standardized operation tags "on / off switching," "temperature adjustment," and "mode switching," the operation path "trigger 'Device' control → trigger 'bedroom air conditioner' control," the current status value "26℃," and the status verification point "the node path of the temperature display area in the bedroom air conditioner control page within the node tree structure data."
[0060] As can be seen, this embodiment achieves unified storage and rapid retrieval of cross-brand device control information by associating the first standardized device tag, the first standardized operation tag, the operation path, the current status value, and the status verification point belonging to the same device entity in each target page as control information records, and constructing a searchable data set with the first standardized device tag as an index.
[0061] In one embodiment, after generating the device capability map, the following steps are further included: S201: Obtain pairing completion information for existing retrofitted equipment, which includes at least one of mechanical pressing actuators, infrared forwarding control units, and smart switch sockets; S202: Based on the pairing completion information, determine the equipment type, equipment function, control channel type, status quantity, and verification method of the existing equipment to be upgraded; S203: Based on the equipment type, determine the second standardized equipment label corresponding to the existing equipment to be upgraded. The second standardized equipment label has the same semantic level as the first standardized equipment label. S204: Based on the equipment function, determine the second standardized operation label corresponding to the existing equipment to be upgraded. The second standardized operation label has the same semantic level as the first standardized operation label. S205: Generate existing equipment control information records for the corresponding existing retrofitted equipment based on the second standardized equipment label, the second standardized operation label, the control channel type, and the verification method; S206: Using the second standardized equipment label as an index, incorporate the existing equipment control information records into the searchable data set of the equipment capability map.
[0062] Among them, "existing home renovation equipment" refers to hardware devices used to upgrade traditional non-smart homes to be intelligent. Mechanical press actuators are adhesive miniature actuators that achieve remote or automatic control by physically pressing traditional wall switches or appliance buttons with a robotic arm, without requiring modifications to the original wiring. Infrared forwarding control units are devices that learn and simulate infrared signals from appliance remote controls to achieve intelligent control of traditional infrared appliances. Smart switches and sockets are socket devices that can be controlled via a wireless network. Pairing completion information refers to the device information data generated after the existing renovation equipment and the smart terminal have completed pairing, including device identification, device type, device function, and control channel type. Control channel type refers to the communication link type used to issue control commands to the device, such as infrared channel, wireless radio frequency channel, and local area network protocol channel (such as Wi-Fi, Zigbee, Z-Wave). Status quantities refer to the status information that the existing renovation equipment can feedback, such as the "pressed" or "not pressed" status of the mechanical press actuator, and the "powered on" or "powered off" status of the smart switch and socket. Verification methods refer to the ways to verify the results of existing equipment upgrades, such as through status feedback, power consumption detection, and circuit status detection.
[0063] As an example, a mechanical push-button actuator is adhesively mounted on a traditional wall switch in a home to control the main living room light. After the actuator is paired with a smart device via Bluetooth, the smart device receives pairing completion information from the actuator.
[0064] Based on the pairing completion information, the intelligent terminal determines the device type of the mechanical press actuator to be "mechanical press actuator," the device function to be "press switch," the control channel type to be "wireless radio frequency channel," the status quantity to be "pressed / not pressed," and the verification method to be "status feedback." Based on the device type "mechanical press actuator," the intelligent terminal determines the second standardized device tag corresponding to the existing retrofit device to be "living room main light." The second standardized device tag "living room main light" has the same semantic level as the first standardized device tag "living room light" in the aforementioned embodiment, both representing the lighting equipment in the living room. Based on the device function "press switch," the intelligent terminal determines the second standardized operation tag corresponding to the existing retrofit device to be "switch switching," which has the same semantic level as the first standardized operation tag "switch switching." Based on the second standardized device tag "living room main light," the second standardized operation tag "switch switching," the control channel type "wireless radio frequency channel," and the verification method "status feedback," the intelligent terminal generates the corresponding existing device control information record for the mechanical press actuator. The smart terminal uses the second standardized device label "living room main light" as an index to incorporate the existing device control information records into the searchable data set of the device capability map, and stores them side by side with the control information records of native smart devices.
[0065] As another example, an infrared forwarding control unit learns and simulates the infrared signals of an air conditioner remote control to control the living room air conditioner. After the infrared forwarding control unit pairs with the smart terminal, the smart terminal obtains the pairing completion information, determines the device type as "infrared forwarding control unit," the device function as "infrared remote control," the control channel type as "infrared channel," the status quantity as "sent / not sent," and the verification method as "status feedback." Based on the device type, the smart terminal determines the second standardized device tag as "living room air conditioner," and based on the device function, determines the second standardized operation tag as "air conditioner control," generates existing device control information records, and incorporates them into the searchable data set of the device capability map using "living room air conditioner" as the index.
[0066] The smart terminal stores the control information records of native smart devices and the control information records of existing upgraded devices in the same searchable data set of the device capability map. When a linkage rule is triggered, the smart terminal uses standardized device tags as indexes to uniformly retrieve matching control information records from the searchable data set. Both native smart devices and existing upgraded devices can be invoked uniformly by the same linkage rule.
[0067] As can be seen, this embodiment abstracts the control capabilities of existing retrofitted devices with completely heterogeneous control channels into second standardized device labels and second standardized operation labels according to the same semantic level as the original devices, and generates existing device control information records and incorporates them into the device capability map. This allows existing retrofitted devices and original smart devices to be included in the same map and the same linkage system, realizing unified modeling and unified linkage between original devices and existing retrofitted devices without the need for separate pre-labeling.
[0068] In one embodiment, after generating the device capability map, the following steps are further included: S301: Obtain linkage rules. Linkage rules include trigger conditions and execution actions. Execution actions include target device tags and target operation tags. S302: In response to detecting an event that meets the triggering conditions, retrieve at least one matching target control information record from the searchable data set of the device capability map based on the target device tag and the target operation tag; S303: Generate at least one atomic operation based on at least one target control information record; S304: Determine the timing constraints of each atomic operation based on the prerequisite dependencies, mutual exclusions, and priority relationships between them; S305: Obtain the application identifier of the target application corresponding to each atomic operation, and merge atomic operations belonging to the same application identifier into the same session batch; S306: Based on the session batches and timing constraints of each atomic operation, sort each session batch with the constraint of minimizing the number of foreground switching of the target application, and generate the target operation sequence. S307: Execute the corresponding simulated interactive operations within each session batch in sequence according to the target operation sequence.
[0069] The linkage rule is a control logic composed of triggering conditions and corresponding execution actions, used to achieve automated scene linkage control. The triggering condition refers to the condition that triggers the execution of the linkage rule, including one or more of the following: device state change events, sensor triggering events, time threshold events, geofencing events, and user-manually triggered events. The execution action refers to the control operation to be performed when the triggering condition is met, expressed in a semantic target state, including a target device label and a target operation label. The target device label is a standardized label for the target device specified in the execution action, used to retrieve matching control information records in the device capability map. The target operation label is a standardized label for the target operation specified in the execution action, used in conjunction with the target device label to accurately locate the specific operation in the control information record.
[0070] An atomic operation is the smallest unit of execution after the action has been parsed. It includes the target device, control channel type, operation path, target state value, and state checkpoint. The target device, control channel type, operation path, and state checkpoint can be obtained from the target control information record, while the target state value can be determined from the semantics of the action. Pre-dependency refers to the relationship that one atomic operation must be executed before another, such as "turn on the air conditioner" before "set the temperature." Mutual exclusion refers to the relationship that two atomic operations cannot be executed simultaneously. Priority refers to the relationship that determines the execution order based on priority when multiple atomic operations simultaneously meet their execution conditions. Timing constraints are the execution order restrictions of atomic operations determined by pre-dependency, mutual exclusion, and priority relationships. A session batch refers to an execution batch formed by merging multiple atomic operations belonging to the same target application identifier. Atomic operations within the same session batch are executed in batches within the foreground session of the same target application to reduce the number of foreground switching operations. A target operation sequence refers to the execution order sequence generated after sorting the session batches.
[0071] It should be understood that the linkage rules support dual-mode configuration: the first is visual drag-and-drop configuration, where users directly select trigger conditions and execution actions based on the device capability map to generate linkage rules; the second is natural language interaction configuration, where users input scenario requirements via voice or text, and the smart terminal automatically decomposes the requirements and matches them with the device capability map through the on-device semantic parsing model to generate linkage rules, without any limitations here. The linkage rules can include both native devices and existing modified devices.
[0072] As an example, a user configured a linkage rule named "Homecoming Mode." The trigger condition for this rule is a "door lock unlocking event," and the actions to be performed are: "Turn the living room main light to 80% brightness, turn on the air conditioner and set it to cooling temperature 26℃, open the curtains, and turn on the entryway light." This execution includes four target operations: adjusting the brightness of the living room main light (using Brand A's smart home app), turning on the air conditioner and setting the temperature (using Brand B's smart home app), opening the curtains (using an infrared control device, without an official app, controlled via infrared channels), and turning on the entryway light (using Brand C's smart home app).
[0073] The smart terminal monitors device status in real time. When the door lock detects an unlocking event, the smart terminal determines that the triggering conditions of the "Homecoming Mode" linkage rule are met and enters the target operation matching stage. Based on the target device tag and target operation tag in the executed action, the smart terminal retrieves matching target control information records from the searchable data set of the device capability map. Specifically, based on the target device tag "living room main light" and the target operation tag "brightness adjustment," the smart terminal retrieves the target control information record corresponding to the living room main light. This record includes the control channel type, operation path, and status verification point of the living room main light. Based on the target device tag "bedroom air conditioner" and the target operation tag "temperature adjustment," the smart terminal retrieves the target control information record corresponding to the bedroom air conditioner. The smart terminal performs the same search operation on the curtains and entryway light, obtaining their respective corresponding target control information records.
[0074] The smart terminal generates four atomic operations based on the four retrieved target control information records. The first atomic operation controls the brightness adjustment of the main living room light, including the control channel type, operation path, target state value, and state verification point. The second atomic operation controls the air conditioner to turn on, the third atomic operation controls the air conditioner temperature setting, the fourth atomic operation controls the curtains to open, and the fifth atomic operation controls the entryway light to turn on. The air conditioner turning on and the air conditioner temperature setting belong to the same target application (Brand B Smart Home APP) of the same device (air conditioner). There is a prerequisite dependency between the two atomic operations; that is, the air conditioner must be turned on first, and then the air conditioner temperature setting must be executed.
[0075] The smart terminal identifies the prerequisite dependencies, mutual exclusions, and priority relationships between atomic operations. There is a prerequisite dependency between turning on the air conditioner and setting the air conditioner temperature; both must be executed in the order of "turning on the air conditioner → setting the air conditioner temperature." There is no mutual exclusion between adjusting the brightness of the main living room light, opening the curtains, and turning on the entryway light; they can be executed in parallel. Based on these prerequisite dependencies, mutual exclusions, and priority relationships, the smart terminal determines the timing constraints of each atomic operation.
[0076] The smart terminal obtains the application identifier of the target application corresponding to each atomic operation. The target application for adjusting the brightness of the main living room light is Brand A Smart Home APP; the target application for turning on the air conditioner and setting the air conditioner temperature is Brand B Smart Home APP; the target application for turning on the entryway light is Brand C Smart Home APP; and the target application for opening the curtains is empty (no application, controlled via infrared channel). The smart terminal merges atomic operations belonging to the same application identifier into the same session batch. The main living room light brightness adjustment from Brand A Smart Home APP is merged into one session batch A; the air conditioner turning on and temperature setting from Brand B Smart Home APP is merged into one session batch B (internally ordered by prerequisite dependencies: air conditioner turning on is executed first, then temperature setting); and the entryway light turning on from Brand C Smart Home APP is merged into one session batch C. Opening the curtains is not included in any session batch and is treated as an independent parallel operation.
[0077] The smart terminal sorts the session batches according to the session batches and timing constraints, with the constraint of minimizing the number of foreground switching of the target application. Session batch A corresponds to the smart home app of brand A, session batch B corresponds to the smart home app of brand B, and session batch C corresponds to the smart home app of brand C. The three session batches correspond to three different target applications, which cannot be in the foreground at the same time and must be executed sequentially. The smart terminal sorts the three session batches to generate the target operation sequence as: session batch A → session batch B → session batch C. The curtain opening operation does not involve any foreground operation of the target application and is executed in parallel through the infrared channel.
[0078] The smart terminal executes control operations according to the target operation sequence. First, the smart terminal switches the Brand A smart home app to the foreground and executes the simulated interactive operations within session batch A in sequence: following the operation path of the main living room light, it jumps step by step to the living room light control page, locates the brightness slider control, and performs a simulated sliding operation, moving the brightness slider to the 80% position. After completion, the Brand A smart home app is switched to the background. Next, the smart terminal switches the Brand B smart home app to the foreground and executes the simulated interactive operations within session batch B in sequence: first, it performs a simulated click operation based on the operation path of turning on the air conditioner, and then performs a simulated sliding operation based on the operation path of setting the air conditioner temperature, moving the temperature slider to the 26℃ position. After completion, the Brand B smart home app is switched to the background. Finally, the smart terminal switches the Brand C smart home app to the foreground and executes the simulated interactive operations within session batch C: following the operation path of turning on the entryway light, it performs a simulated click operation. While executing the above session batches, the smart terminal simultaneously sends a curtain opening command via the infrared channel.
[0079] As can be seen, this embodiment, after generating the device capability map, obtains the linkage rules and, when the triggering conditions are met, retrieves matching target control information records in the device capability map based on the target device tag and the target operation tag, generates atomic operations, identifies the pre-dependencies, mutual exclusions, and priority relationships between each atomic operation to determine timing constraints, merges atomic operations belonging to the same application identifier into the same session batch, sorts each session batch to generate a target operation sequence with the constraint of minimizing the number of foreground switching of the target application, and finally executes the corresponding simulated interactive operations in each session batch according to the target operation sequence. This achieves the automatic generation of the optimal execution sequence based on the device capability map when the triggering conditions are met, and the merging of operations of the same application into the same session batch for batch execution, reducing the number of foreground switching of the application.
[0080] It should be noted that after executing the simulated interactive operations corresponding to each session batch, the smart terminal obtains the execution results of each atomic operation and verifies the results according to the device type corresponding to each atomic operation: for native smart devices, the current page is captured and the current state value of the target control is read through a semantic recognition model and compared with the target state value; for existing upgraded devices, the execution results are obtained through status feedback, power consumption detection, or circuit status detection. If the comparison is inconsistent, differentiated retries are performed according to the control type corresponding to the atomic operation: switch-type controls are retried for the first number of times, and continuously adjustable or mode selection controls are retried for the second number of times, with the second number being greater than the first number. If the comparison is consistent, the linkage rule is associated with the target operation sequence and stored as a fixed skill, so that when the same triggering conditions are met again, the fixed skill can be directly invoked for execution, thereby improving response speed and reducing computing power consumption.
[0081] In one embodiment, the following steps are also included: S308: During the simulated interactive operation, obtain the matching degree of the control positioning in the target application's page.
[0082] The matching degree of control positioning refers to the degree of matching between the actual matched control and the expected control when the smart terminal locates the target control on the target application page according to the operation path corresponding to the atomic operation during simulated interactive operations. The matching degree of control positioning can be calculated through similarity in multiple dimensions such as control type, control identifier, text content, and position coordinates. The smart terminal obtains the matching degree of control positioning in the current page in real time when executing each atomic operation to monitor whether the interface structure of the target application has changed.
[0083] S309: When the matching degree is lower than the preset threshold, perform incremental re-traversal on the pages of the target application that have changed, and update at least one of the operation path, status verification point, current status value and first standardized operation label in the device capability map.
[0084] The preset threshold is a critical value used to determine whether control positioning has failed. It can be set according to actual accuracy requirements, for example, to 80%. Incremental re-traversal means that only the local page areas that have changed in the target application are re-performed through page traversal, rather than a full reconstruction and traversal of all pages in the target application. The changed page areas refer to local page areas where the original control positioning anchor points cannot be matched or the matching degree is lower than the preset threshold due to target application version updates or interface structure adjustments.
[0085] Specifically, when the matching degree is lower than a preset threshold, the smart terminal identifies the page in the target application that has changed, and performs incremental re-traversal only on the changed page, re-collecting the page information of the page, and re-identifying the device entities, status display elements, and operable controls within it through a semantic recognition model. Based on the incremental re-traversal results, the smart terminal updates at least one of the following in the device capability map: the corresponding operation path, status verification point, current status value, and first standardized operation label. Specifically, if the control positioning anchor point in the operation path changes, the operation path is updated; if the position of the status display element changes, the status verification point is updated; if the current status value of the status display element changes, the current status value is updated; if the description of the operable control changes, semantic mapping is re-executed and the first standardized operation label is updated. Since incremental re-traversal is only performed on the changed page, the control information records corresponding to other unchanged target pages in the device capability map remain unchanged.
[0086] As an example, suppose Brand A's smart home app has been updated, changing the layout of the living room light control page. The brightness slider has moved, and the display format of the brightness display area has changed from "80%" to "Brightness: 80%". During subsequent execution of "Home Mode", the smart terminal's matching accuracy for locating the brightness slider control is below a preset threshold. The smart terminal determines that the living room light control page has changed and performs an incremental re-traversal only on this page, re-collecting the page screenshot data and node tree structure data. It then re-identifies the brightness slider control, brightness display elements, and their status verification points using a semantic recognition model. Based on the incremental re-traversal results, the smart terminal updates the operation path (updating the positioning anchor point of the brightness slider control in the original operation path to a new positioning anchor point), status verification points (updating the original status verification points to the node path of the brightness display element in the new page), current status value (re-extracting the value 80% from "Brightness: 80%)), and the first standardized operation label (re-mapping if the description of the brightness adjustment control changes) in the device capability map.
[0087] As can be seen, this step achieves partial updates of at least one of the operation path, status verification point, current status value and first standardized operation label in the device capability map by incrementally retracing the pages where the target application changes when the matching degree is lower than the preset threshold, without the need for full map reconstruction.
[0088] It should be noted that when the matching degree is lower than a preset threshold, partial relocation can be performed on controls with matching degrees below the preset threshold. If the partial relocation is successful, the simulated interaction operations corresponding to each session batch will continue to be executed sequentially according to the target operation sequence. If the partial relocation is unsuccessful, incremental retracing will be performed on the pages of the target application that have changed. In addition, if the smart terminal detects a lost login state or expired account credentials, it will attempt to log in again using the account credentials stored in the encrypted storage partition. If the re-login is successful, the simulated interaction operations corresponding to each session batch will continue to be executed sequentially according to the target operation sequence; otherwise, incremental retracing will be performed on the pages of the target application that have changed.
[0089] In one embodiment, the target operation sequence is generated by sorting each session batch according to the session batch and timing constraints of each atomic operation, with the constraint of minimizing the number of foreground switching of the target application, including the following steps: S361: Obtain the switching latency of the target application between the foreground and background for each session batch, as well as the expected execution latency of each operation path within each session batch; S362: Determine the execution order constraints between each session batch based on timing constraints; S363: Based on the fact that the target applications corresponding to each session batch cannot be in the foreground at the same time during runtime, session batches belonging to different target applications are determined as serial execution types; S364: Based on the execution order constraints and serial execution type, with the goal of minimizing the number of foreground switching times and total execution latency of the target application, sort each session batch to generate the target operation sequence, wherein the total execution latency is determined by the switching latency and expected execution latency corresponding to each session batch.
[0090] Switching latency refers to the time overhead required to switch a target application from the background to the foreground, including system scheduling time and application recovery time. Expected execution latency refers to the estimated time required to execute an operation path, including page load time and control response time. Total execution latency equals the sum of the switching latencies of all session batches plus the sum of the expected execution latencies of all operation paths. Execution order constraints refer to the execution order restrictions that must be followed between session batches, determined by timing constraints. Serial execution type means that multiple session batches, because they correspond to different target applications, cannot be in the foreground simultaneously and therefore must be executed serially.
[0091] As an example, for "Home Mode," the smart terminal obtains the switching latency and expected execution latency corresponding to each session batch. The switching latency of session batch A (Brand A Smart Home APP) is 300 milliseconds, and the expected execution latency of the operation path within the batch is 200 milliseconds; the switching latency of session batch B (Brand B Smart Home APP) is 400 milliseconds, and the expected execution latency of the operation path within the batch is 500 milliseconds (including the two operations of turning on the air conditioner and setting the temperature); the switching latency of session batch C (Brand C Smart Home APP) is 250 milliseconds, and the expected execution latency of the operation path within the batch is 100 milliseconds.
[0092] The smart terminal determines the execution order constraints between each session batch based on timing constraints. One of the timing constraints is that turning on the air conditioner must be executed before setting the air conditioner temperature. However, both turning on the air conditioner and setting the air conditioner temperature belong to session batch B. Therefore, this constraint is already satisfied within session batch B. There are no mandatory execution order constraints between session batches A, B, and C.
[0093] Since the target applications corresponding to each session batch cannot be in the foreground at the same time, the smart terminal determines that session batch A, session batch B, and session batch C are all of serial execution type. That is, the three session batches must be executed sequentially and cannot be executed in parallel.
[0094] The smart terminal sorts each session batch based on execution order constraints and serial execution type, aiming to minimize the number of foreground switching times and total execution latency for the target application. Since the three session batches correspond to three different target applications, the number of foreground switching times is fixed at 3. The total execution latency is determined by the sum of the switching latency and the expected execution latency. The total execution latency for session batch A is 300 + 200 = 500 milliseconds, for session batch B it is 400 + 500 = 900 milliseconds, and for session batch C it is 250 + 100 = 350 milliseconds. The total execution latency under different sorting schemes are as follows: A→B→C: 500+900+350=1750 milliseconds; A→C→B: 500+350+900=1750 milliseconds; B→A→C: 900+500+350=1750 milliseconds. The total execution latency is the same for all schemes. The smart terminal can select any sorting scheme, and the target operation sequence is session batch A→session batch B→session batch C. The curtain opening operation (infrared channel) does not occupy the application foreground and is executed in parallel with all session batches; its execution latency is not included in the total foreground execution latency.
[0095] As can be seen, this embodiment obtains the switching latency and expected execution latency corresponding to each session batch, determines the execution order constraint based on timing constraints, and determines the session batches belonging to different target applications as serial execution types based on the characteristic that the target applications cannot be in the foreground at the same time. The session batches are sorted with the goal of minimizing the number of foreground switching and the total execution latency, thus minimizing the number of foreground switching and the total execution latency of the target application under the premise of satisfying the timing constraints.
[0096] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0097] Secondly, embodiments of this application provide an apparatus for generating a device capability map, which corresponds one-to-one with the device capability map generation methods described in the above embodiments. For example... Figure 2 As shown, the device capability map generation apparatus includes an acquisition module 100, a traversal module 200, a model processing module 300, a conversion module 400, and a generation module 500. Detailed descriptions of each functional module are as follows: Acquisition module 100 is used to acquire target applications deployed on smart terminals; The traversal module 200 is used to traverse based on the root page of the target application, record the operation path from the root page to each target page, and collect the page information of each target page. The model processing module 300 is used to input the page information of each target page into a pre-trained semantic recognition model, obtain the device entity, status display element and operable control in each target page, and extract the device identifier of the device entity, the current status value corresponding to the status display element, the operation mode information corresponding to the operable control and the status verification point for the status display element. The conversion module 400 is used to convert the device identifier of each target page into a first standardized device tag based on a preset semantic mapping rule, and to convert the operation mode information of each target page into a first standardized operation tag. The generation module 500 is used to generate a device capability map based on the first standardized device tag, the first standardized operation tag, the current status value, the operation path, and the status verification point of each target page.
[0098] In one embodiment, the traversal module 200 is further configured to: Taking the root page as the current page, expand the control nodes in the current page level by level, identify the attributes of each control node, and generate corresponding simulated trigger events for the remaining control nodes after filtering out control nodes containing dangerous operations. The dangerous operations include account logout, device unbinding, and device deletion. Each of the simulated trigger events is triggered sequentially, causing the target application to jump from the current page to the next level target page. During the jump, the pop-up window control and / or the guide overlay control are skipped, and a preset retry strategy is executed for the target page loading timeout event. After navigating to the next-level target page, determine whether the next-level target page is a page that has already been visited; If the next-level target page is an already visited page, then stop traversing downwards from the next-level target page as the starting point; if the next-level target page is not an already visited page, then use the next-level target page as the new current page and continue traversing until all the target pages have been traversed. The jump chains formed by each simulated triggering event traversed during the traversal from the root page to each target page are recorded as the operation path from the root page to the corresponding target page.
[0099] In one embodiment, the traversal module 200 is further configured to: Extract the target page features of the next-level target page, wherein the target page features include at least one of the following: Uniform Resource Locator (URL), page title, page layout hash value, and key control combination of the next-level target page; The target page features are compared with the features of each target page in the visited page set; If the target page feature matches any target page feature in the set of visited pages, then the next-level target page is determined to be a visited page; If the target page features do not match any of the target page features in the visited page set, then the next-level target page is determined to be an unvisited page.
[0100] In one embodiment, the page information includes page screenshot data and node tree structure data; the model processing module 300 is further configured to: Each of the target pages is sequentially determined as the current page, and the page screenshot data and node tree structure data of the current page are input into the pre-trained semantic recognition model to obtain the device entities, status display elements and operable controls in the current page, until the device entities, status display elements and operable controls in each of the target pages are obtained; The step of inputting the screenshot data and node tree structure data of the current page into a pre-trained semantic recognition model to obtain device entities, status display elements, and operable controls in the current page includes: The screenshot data of the current page is input into the visual encoding layer of the semantic recognition model to extract the visual feature map of the current page; The node tree structure data of the current page is input into the structure encoding layer of the semantic recognition model to extract the structure feature vector of the current page; The visual feature map and structural feature vector of the current page are input into the multimodal fusion layer of the semantic recognition model for feature fusion to generate the fused features of the current page; The fusion features of the current page are input into the classification and regression layer of the semantic recognition model to obtain the functional category labels and location bounding boxes of each element in the current page; Based on the function category labels and location bounding boxes of each element on the current page, determine the device entities, status display elements, and operable controls on the current page.
[0101] In one embodiment, the generation module 500 is further configured to: The first standardized device tag, the first standardized operation tag, the operation path, the current status value, and the status verification point belonging to the same device entity in each of the target pages are associated as control information records for the corresponding device entity. Using the first standardized equipment tag as an index, each of the control information records is constructed into a searchable data set to form the equipment capability map.
[0102] In one embodiment, the apparatus further includes a stock device processing module (not shown in the figure); the stock device processing module is used for: Obtain pairing completion information for existing retrofitted equipment, wherein the existing retrofitted equipment includes at least one of a mechanical pressing actuator, an infrared forwarding control unit, and a smart switch socket; Based on the pairing completion information, determine the equipment type, equipment function, control channel type, status quantity, and verification method of the existing equipment to be upgraded; Based on the equipment type, a second standardized equipment tag is determined for the existing equipment to be upgraded. The second standardized equipment tag has the same semantic level as the first standardized equipment tag. Based on the equipment function, a second standardized operation tag is determined for the existing equipment to be upgraded. The second standardized operation tag has the same semantic level as the first standardized operation tag. Based on the second standardized equipment label, the second standardized operation label, the control channel type, and the verification method, generate a record of existing equipment control information corresponding to the existing retrofitted equipment. Using the second standardized equipment tag as an index, the existing equipment control information records are incorporated into the searchable data set of the equipment capability map.
[0103] In one embodiment, the device further includes an operation module (not shown); the operation module is further configured to: Obtain the linkage rules, which include triggering conditions and execution actions, and the execution actions include target device tags and target operation tags; In response to detecting an event that satisfies the triggering condition, at least one matching target control information record is retrieved from the searchable data set of the device capability map based on the target device tag and the target operation tag; Based on the at least one target control information record, generate at least one atomic operation; Based on the prerequisite dependencies, mutual exclusions, and priority relationships among the atomic operations, determine the timing constraints of each atomic operation; Obtain the application identifier of the target application corresponding to each atomic operation, and merge atomic operations belonging to the same application identifier into the same session batch; Based on the session batches of each atomic operation and the timing constraints, the session batches are sorted with the constraint of minimizing the number of foreground switching of the target application, thereby generating a target operation sequence. According to the target operation sequence, the corresponding simulated interaction operations within each session batch are executed sequentially.
[0104] Specific limitations regarding the device for generating the device capability map can be found in the limitations on the device capability map generation method described above, and will not be repeated here. Each module in the aforementioned device capability map generation device can be implemented wholly or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the smart terminal in hardware form or independently of it, or stored in the memory of the smart terminal in software form, so that the processor can call and execute the operations corresponding to each module.
[0105] Thirdly, embodiments of this application provide a smart terminal, the internal structure of which can be shown in the following diagram. Figure 3As shown, the intelligent terminal includes a processor, memory, and network interface connected via a bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores a computer program. The internal memory provides an environment for the execution of the computer program in the non-volatile storage medium. When executed by the processor, the computer program implements the steps of a method for generating a device capability map.
[0106] In one embodiment, this application provides a smart terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the device capability map generation method in the above embodiment. To avoid repetition, these steps will not be repeated here.
[0107] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the device capability map generation method described in the above embodiments. To avoid repetition, these steps will not be repeated here.
[0108] It should be noted that the steps described above that can be implemented by computer-readable storage media or smart terminals can be referred to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0109] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0111] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0112] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for generating a device capability map, characterized in that, include: Obtain the target application deployed on the smart terminal; The application is traversed based on its root page, and the operation path from the root page to each target page is recorded. The page information of each target page is also collected. The page information of each target page is input into a pre-trained semantic recognition model to obtain the device entity, status display element and operable control in each target page, and extract the device identifier of the device entity, the current status value corresponding to the status display element, the operation mode information corresponding to the operable control and the status verification point for the status display element. Based on preset semantic mapping rules, the device identifier of each target page is converted into a first standardized device tag, and the operation method information of each target page is converted into a first standardized operation tag; Based on the first standardized device tag, the first standardized operation tag, the current status value, the operation path, and the status verification point of each target page, a device capability map is generated.
2. The method for generating a device capability map according to claim 1, characterized in that, The step of traversing the root page of the target application and recording the operation path from the root page to each target page includes: Taking the root page as the current page, expand the control nodes in the current page level by level, identify the attributes of each control node, and generate corresponding simulated trigger events for the remaining control nodes after filtering out control nodes containing dangerous operations. The dangerous operations include account logout, device unbinding, and device deletion. Each of the simulated trigger events is triggered sequentially, causing the target application to jump from the current page to the next level target page. During the jump, the pop-up window control and / or the guide overlay control are skipped, and a preset retry strategy is executed for the target page loading timeout event. After navigating to the next-level target page, determine whether the next-level target page is a page that has already been visited; If the next-level target page is an already visited page, then stop traversing downwards from the next-level target page as the starting point; if the next-level target page is not an already visited page, then use the next-level target page as the new current page and continue traversing until all the target pages have been traversed. The jump chains formed by each simulated triggering event traversed during the traversal from the root page to each target page are recorded as the operation path from the root page to the corresponding target page.
3. The method for generating a device capability map according to claim 2, characterized in that, Determining whether the next-level target page is a visited page includes: Extract the target page features of the next-level target page, wherein the target page features include at least one of the following: Uniform Resource Locator (URL), page title, page layout hash value, and key control combination of the next-level target page; The target page features are compared with the features of each target page in the visited page set; If the target page feature matches any target page feature in the set of visited pages, then the next-level target page is determined to be a visited page; If the target page features do not match any of the target page features in the visited page set, then the next-level target page is determined to be an unvisited page.
4. The method for generating a device capability map according to claim 1, characterized in that, The page information includes page screenshot data and node tree structure data; the step of inputting the page information of each target page into a pre-trained semantic recognition model to obtain device entities, status display elements, and operable controls in each target page includes: Each of the target pages is sequentially determined as the current page, and the page screenshot data and node tree structure data of the current page are input into the pre-trained semantic recognition model to obtain the device entities, status display elements and operable controls in the current page, until the device entities, status display elements and operable controls in each of the target pages are obtained; The step of inputting the screenshot data and node tree structure data of the current page into a pre-trained semantic recognition model to obtain device entities, status display elements, and operable controls in the current page includes: The screenshot data of the current page is input into the visual encoding layer of the semantic recognition model to extract the visual feature map of the current page; The node tree structure data of the current page is input into the structure encoding layer of the semantic recognition model to extract the structure feature vector of the current page; The visual feature map and structural feature vector of the current page are input into the multimodal fusion layer of the semantic recognition model for feature fusion to generate the fused features of the current page; The fusion features of the current page are input into the classification and regression layer of the semantic recognition model to obtain the functional category labels and location bounding boxes of each element in the current page; Based on the function category labels and location bounding boxes of each element on the current page, determine the device entities, status display elements, and operable controls on the current page.
5. The method for generating a device capability map according to claim 1, characterized in that, The process of generating a device capability map based on the first standardized device tag, the first standardized operation tag, the current status value, the operation path, and the status verification point of each target page includes: The first standardized device tag, the first standardized operation tag, the operation path, the current status value, and the status verification point belonging to the same device entity in each of the target pages are associated as control information records for the corresponding device entity. Using the first standardized equipment tag as an index, each of the control information records is constructed into a searchable data set to form the equipment capability map.
6. The method for generating a device capability map according to claim 5, characterized in that, Following the generation of the device capability map, the following is also included: Obtain pairing completion information for existing retrofitted equipment, wherein the existing retrofitted equipment includes at least one of a mechanical pressing actuator, an infrared forwarding control unit, and a smart switch socket; Based on the pairing completion information, determine the equipment type, equipment function, control channel type, status quantity, and verification method of the existing equipment to be upgraded; Based on the equipment type, a second standardized equipment tag is determined for the existing equipment to be upgraded. The second standardized equipment tag has the same semantic level as the first standardized equipment tag. Based on the equipment function, a second standardized operation tag is determined for the existing equipment to be upgraded. The second standardized operation tag has the same semantic level as the first standardized operation tag. Based on the second standardized equipment label, the second standardized operation label, the control channel type, and the verification method, generate a record of existing equipment control information corresponding to the existing retrofitted equipment. Using the second standardized equipment tag as an index, the existing equipment control information records are incorporated into the searchable data set of the equipment capability map.
7. The method for generating a device capability map according to any one of claims 1 to 6, characterized in that, Following the generation of the device capability map, the following is also included: Obtain the linkage rules, which include triggering conditions and execution actions, and the execution actions include target device tags and target operation tags; In response to detecting an event that satisfies the triggering condition, at least one matching target control information record is retrieved from the searchable data set of the device capability map based on the target device tag and the target operation tag; Based on the at least one target control information record, generate at least one atomic operation; Based on the prerequisite dependencies, mutual exclusions, and priority relationships among the atomic operations, determine the timing constraints of each atomic operation; Obtain the application identifier of the target application corresponding to each atomic operation, and merge atomic operations belonging to the same application identifier into the same session batch; Based on the session batches of each atomic operation and the timing constraints, the session batches are sorted with the constraint of minimizing the number of foreground switching of the target application, thereby generating a target operation sequence. According to the target operation sequence, the corresponding simulated interaction operations within each session batch are executed sequentially.
8. A device for generating a capability map, characterized in that, include: The acquisition module is used to acquire target applications deployed on smart terminals; The traversal module is used to traverse based on the root page of the target application, record the operation path from the root page to each target page, and collect the page information of each target page. The model processing module is used to input the page information of each target page into a pre-trained semantic recognition model, obtain the device entity, status display element and operable control in each target page, and extract the device identifier of the device entity, the current status value corresponding to the status display element, the operation mode information corresponding to the operable control and the status verification point for the status display element. The conversion module is used to convert the device identifier of each target page into a first standardized device tag based on a preset semantic mapping rule, and to convert the operation mode information of each target page into a first standardized operation tag. The generation module is used to generate a device capability map based on the first standardized device tag, the first standardized operation tag, the current status value, the operation path, and the status verification point of each target page.
9. A smart terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method for generating a device capability map as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for generating a device capability map as described in any one of claims 1 to 7.
