A gateway binding method, apparatus, device, and storage medium

By completing database operations and submitting the task before sending a successful binding message during the gateway binding process, the problem of long gateway binding time is solved, user experience is improved, and the accuracy of data processing is guaranteed.

CN123123440APending Publication Date: 2026-11-17GUANGZHOU HEMI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611300720.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, the IoT gateway binding process is time-consuming, which affects the user experience.

Method used

Upon receiving a gateway binding request, a database task is initiated to perform the binding operation. After the operation is completed, the task is submitted, and a binding success message is sent to the client, without waiting for the data collaboration operation to complete before performing the data collaboration operation.

Benefits of technology

It effectively shortens the total time from when a user initiates a binding request to when they receive a successful binding response, improves the user experience, and avoids timing errors in data collaboration operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123440A_ABST
    Figure CN123123440A_ABST
Patent Text Reader

Abstract

This application discloses a gateway binding method, apparatus, device, and storage medium. The technical solution provided in this application initiates a database task in response to a gateway binding request. This database task executes database operations for binding a target user and a target gateway. After completing the database operations, the completed database task is submitted to the database end. Upon successful submission of the completed database task, a binding success message is sent to the client. This eliminates the need to wait for the data collaboration operation to complete before sending the binding success message to the client, effectively shortening the total time from when the user initiates a binding request to when the binding success response is received, thus improving the user experience. Furthermore, executing the data collaboration operation after successfully submitting the database task effectively solves the problem of timing errors when calling external interfaces during data collaboration operations due to the database not being fully submitted, ensuring the correct processing of gateway binding data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to a gateway binding method, apparatus, device, and storage medium. Background Technology

[0002] Internet of Things (IoT) gateways are important bridges connecting IoT devices and the Internet. They are responsible for processing, storing, and forwarding the data collected by IoT devices, enabling them to communicate with the cloud or other devices.

[0003] In related technologies, IoT platforms typically use a synchronous approach to complete the gateway binding process. After a user initiates a binding request through a client program (APP), the server sequentially performs the following operations: verifies user and device permissions, checks whether the device has already been bound by another user, writes the binding relationship to the database, sends a binding command to the gateway and waits for confirmation, triggers the synchronization of the sub-device list, distributes environment configurations, refreshes the scene, and returns a successful binding result to the client.

[0004] In the aforementioned synchronous binding process, the gateway binding operation needs to simultaneously complete database writing and data collaboration operations (device authorization credential allocation, third-party operation platform registration, etc.). Database writing and data collaboration operations are typically executed synchronously within the database task, coupled with the core gateway binding process. Therefore, from the time a user initiates a binding request to the final receipt of a successful binding response, the cloud needs to sequentially complete multiple steps, including database operations, data collaboration operations, and configuration distribution. The total time spent by the user waiting for the successful binding response is relatively long, impacting the user experience. Summary of the Invention

[0005] This application provides a gateway binding method, apparatus, device, and storage medium to solve the technical problem in the related art where the total time from when a user initiates a binding request to when the user finally receives a successful binding response is too long, affecting the user experience. It can effectively shorten the total time from when a user initiates a binding request to when the user finally receives a successful binding response, thereby improving the user experience.

[0006] In a first aspect, embodiments of this application provide a gateway binding method, including: In response to a gateway binding request, a database task is initiated, and database operations for binding the target user and the target gateway are performed through the database task. After completing the database operation, submit the completed database task to the database client. After successfully submitting and executing the database task, a binding success message is sent to the client.

[0007] In a second aspect, embodiments of this application provide a gateway binding device, including a task initiation module, a task submission module, and a binding feedback module, wherein: The task initiation module is configured to initiate a database task in response to a gateway binding request, and to perform database operations for binding the target user and the target gateway through the database task; The task submission module is configured to submit the completed database task to the database end after completing the database operation. The binding feedback module is configured to send a binding success message to the client after the database task has been successfully submitted and completed.

[0008] In a third aspect, embodiments of this application provide a gateway binding device, including: a memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the gateway binding method as described in the first aspect.

[0009] In a fourth aspect, embodiments of this application provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the gateway binding method as described in the first aspect.

[0010] This application embodiment initiates a database task in response to a gateway binding request. The database task executes database operations for binding the target user and the target gateway. After completing the database operations, the completed database task is submitted to the database end. Upon successful submission of the completed database task, a binding success message is sent to the client. This eliminates the need to wait for the data collaboration operation to complete before sending the binding success message to the client, effectively shortening the total time from when the user initiates the binding request to when the binding success response is finally received, thus improving the user experience. Furthermore, executing the data collaboration operation after successfully submitting the database task effectively solves the problem of timing errors when calling external interfaces during data collaboration operations due to the database not being fully submitted, ensuring the correct processing of gateway binding data. Attached Figure Description

[0011] Figure 1 This is a flowchart of a gateway binding method provided in an embodiment of this application; Figure 2 This is a flowchart of another gateway binding method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of a gateway binding device provided in an embodiment of this application; Figure 4This is a schematic diagram of the structure of a gateway binding device provided in an embodiment of this application. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but additional steps not included in the drawings may also be present. The above processes can correspond to methods, functions, procedures, subroutines, subroutines, etc.

[0013] In the gateway binding process of related technologies, after a user initiates a binding request through the user-side application, the cloud sequentially performs the following operations: verifying user and device permissions, checking that the device is not bound by other users, writing the binding relationship to the database, issuing a binding command to the gateway and waiting for confirmation, triggering the synchronization of the sub-device list, issuing environment configuration, refreshing the scene, and returning a successful binding result to the user. For external platform authorization credential allocation and third-party operation platform registration, these data collaborative operations are usually executed synchronously within database tasks (database transactions), coupled with the core gateway binding process. The gateway binding operation needs to complete multiple steps simultaneously, including database writing, external platform authorization credential allocation, third-party system registration, IoT cloud attribute reading, environment configuration issuance, and scene refresh. Users not only need to wait for the database task to complete, but also for the data collaborative operations to complete (e.g., waiting for the external interface to return an operation completion notification), resulting in a long total time spent waiting for a successful binding response. Based on this, this application provides a gateway binding method according to an embodiment to solve the above-mentioned technical problems.

[0014] Figure 1 A flowchart of a gateway binding method provided in an embodiment of this application is given. The gateway binding method provided in this embodiment of the application can be executed by a gateway binding device. The gateway binding method can be configured in the service layer. The gateway binding device can be implemented by hardware and / or software and integrated in a gateway binding device (e.g., a cloud server).

[0015] The following description uses a gateway binding device to perform a gateway binding method as an example. (Reference) Figure 1 The gateway binding method includes: S110: In response to a gateway binding request, start a database task and perform database operations to bind the target user and the target gateway.

[0016] For example, upon receiving a gateway binding request to bind a target user and a target gateway, a database task can be started at the business layer in response to the gateway binding request. After the database task is started, database operations for binding the target user and the target gateway can be performed through the database task according to the gateway binding request, such as verifying the status of the target gateway in the database, binding the permissions of the target user, and writing the gateway binding status, etc.

[0017] The database operations provided in this application may include data operations performed on the gateway binding device, or data operations performed on the database side through interaction with the database. The database side is configured with a preset database, which can be used to record the binding relationships between different users and the gateway. The database side may be configured in the gateway binding device or on other servers. Optionally, the database provided in this application may be a MySQL, PostgreSQL, Oracle, Redis, or other similar database.

[0018] In one embodiment, the gateway binding request can be uploaded by a user through a client. The client can be a terminal device with a pre-installed application, a web page, or a mini-program. The target user can be a user account logged in on the client or a specified user account, and the target gateway is the gateway device that needs to be bound to the target user.

[0019] S120: After completing the database operation, submit the completed database task to the database end.

[0020] For example, after completing the database operation, the completed database task is submitted to the database terminal to persist the binding relationship between the target user and the target gateway. In one embodiment, after receiving the submitted database task, the database terminal writes the data modifications cached in the database task to the database disk, forming persistent data. After completing the persistence processing of the binding relationship, the database terminal returns a submission success message to the gateway binding device to notify the gateway binding device that the database task submission has been completed.

[0021] It needs to be explained that the database operations performed by the database task in this application do not actually modify the data in the database. Instead, the modified data is temporarily stored in the database. When other terminals query the data in the database, they obtain the data before the modification. If an exception occurs during the execution of the database operation, the database can perform a rollback operation to restore the original data. The database only persists the result of the database task execution (the temporarily stored modified data) when it receives the database task submission operation. Subsequent queries by other terminals will use the modified data.

[0022] S130: After successfully submitting and completing the database task, send a binding success message to the client.

[0023] For example, once the database task has been successfully submitted and completed to the database, a binding success message can be sent to the client without waiting for the data collaboration operation to be executed. The client can then display the binding success result on the user interface based on the message, allowing the user to use the target gateway's related functions on the client.

[0024] S140: Perform data collaboration operations.

[0025] For example, after successfully submitting a completed database task to the database, a data collaboration operation can be performed. This data collaboration operation can be a pre-defined operation related to gateway binding with one or more external systems, third-party systems, and local systems. The data collaboration operation can be performed after submitting the completed database task to the database, for example, after sending a binding success message to the client, or simultaneously with sending the binding success message to the client. The data collaboration operation does not affect the execution of sending the binding success message to the client.

[0026] This application effectively solves the problem of timing errors when calling external interfaces during data collaboration operations caused by executing data collaboration operations before the database task is successfully submitted, by performing data collaboration operations after successful database task submission, thus ensuring the correct processing of gateway-bound data.

[0027] As described above, by initiating a database task in response to a gateway binding request, the database task executes database operations to bind the target user and the target gateway. After completing the database operations, the completed database task is submitted to the database end, and a binding success message is sent to the client after successful submission. This eliminates the need to wait for the data collaboration operation to complete before sending the binding success message to the client, effectively shortening the total time from when the user initiates the binding request to when the binding success response is finally received, thus improving the user experience. Furthermore, executing the data collaboration operation after successfully submitting the database task effectively solves the problem of timing errors when calling external interfaces during data collaboration operations caused by executing the data collaboration operation before the database submission is complete, ensuring the correct processing of gateway binding data.

[0028] Based on the above embodiments, Figure 2 A flowchart of another gateway binding method provided in an embodiment of this application is given, which is a concretization of the gateway binding method described above. (Reference) Figure 2 The gateway binding method includes: S210: In response to the gateway binding request, start a database task to verify the binding permissions of the target user and the device permissions of the target gateway, and to verify the binding conflict of the target gateway.

[0029] S220: After passing permission verification and conflict verification, establish the binding relationship between the target gateway and the target user, and perform a binding snatching operation on the sub-devices bound to the target gateway.

[0030] For example, after starting the database task, the database task is executed to verify the binding permissions of the target user and the device permissions of the target gateway. The permission verification for the target user's binding permissions can involve verifying whether the user initiating the gateway binding request (which could be the target user or another user) is a legitimate user. For instance, it can be done by determining whether the user account is legitimate and whether it has the permission to bind to the gateway based on the user identifier carried in the gateway binding request. The permission verification for the target gateway's device permissions can involve verifying whether the target gateway is a gateway device within a preset brand and model range.

[0031] In one embodiment, a binding conflict check is also performed on the target gateway. For example, the database is queried to see if the target gateway has been bound. If the target gateway has been bound, a binding failure can be returned, indicating that the target gateway has been bound by another user and needs to be unbound before trying again.

[0032] In one embodiment, upon passing permission and conflict verification, a binding relationship between the target gateway and the target user can be established (e.g., writing the binding relationship between the target gateway and the target user to the database), and a preemptive binding operation can be performed on the sub-devices bound to the target gateway. The preemptive binding operation can be understood as updating the user bound to the sub-devices already bound to the target gateway to the target user. Optionally, other preset database write operations can also be performed, such as writing binding logs to the database (e.g., recording key nodes in the binding process from the start of the request to success), updating the user's bound gateways, and writing device change logs.

[0033] This application verifies the binding permissions of the target user and the device permissions of the target gateway through a database task, and performs binding conflict verification on the target gateway. When the verification is passed, the binding relationship between the target gateway and the target user is established, and the binding operation is performed on the sub-devices bound to the target gateway to complete the database-related binding operations. Moreover, it does not need to wait for the coordination operation of external systems before submitting the database task, and can quickly complete the database-related operations and provide users with binding success information more quickly.

[0034] S230: After completing the database operation, submit the completed database task to the database end.

[0035] S240: After successfully submitting and completing the database task, send a binding success message to the client.

[0036] S250: Perform data collaboration operations.

[0037] In one embodiment, the data collaborative operation provided in this application can be configured as multiple, and these multiple data collaborative operations can be executed independently. Furthermore, these multiple data collaborative operations can perform exception handling based on independent exception handling mechanisms (try-catch mechanisms). The execution order of the multiple data collaborative operations is sequential. For example, each data collaborative operation can be configured with a try-catch layer. Under the try-catch mechanism, the code related to the third-party collaborative sub-operation specified in the try block is executed first. If the code in the try block completes normally, the code in the catch block is skipped, and the program continues execution. If the code in the try block throws an exception, the program immediately stops executing the remaining content of the try block and jumps directly to the corresponding catch block to perform exception handling. After the catch block handles the exception (e.g., logging, sending alarms), the program continues to execute the code corresponding to subsequent data collaborative operations without affecting the execution of other data collaborative operations.

[0038] This application handles exceptions in data collaboration operations through an independent exception handling mechanism. An exception in a single data collaboration operation will not affect the execution of other data collaboration operations, which can effectively reduce the situation where the entire binding operation fails due to an exception in one data collaboration operation, and effectively improve the overall success rate of gateway binding and user experience.

[0039] In one possible embodiment, the gateway binding method provided in this application may perform data collaboration operations by creating asynchronous operation threads and executing the data collaboration operations through these threads. For example, an asynchronous operation thread may be created for each data collaboration operation, and each thread may execute the corresponding data collaboration operation separately. This reduces the time consumption of database resources caused by coupling data collaboration operations within data tasks, ensuring that multiple data collaboration operations are triggered only after the database task is submitted. Furthermore, the asynchronous execution of these data collaboration operations will not block the interface from returning binding success information. Users can perceive the gateway binding result without waiting for the result from a third-party interface. In addition, the asynchronous operation threads can be combined with an independent exception handling mechanism, effectively improving the overall success rate of gateway binding and the user experience.

[0040] In one embodiment, performing data collaboration operations includes at least one of the following: issuing a status control command to the target gateway to reset the binding status; requesting and allocating device authorization credentials from an external authorization platform; obtaining the object model attributes from the cloud platform and synchronizing them to local device data; initiating a registration and binding request to a third-party operation platform; issuing environment configuration information to the target gateway; and recalculating the associated scenarios of the target gateway and issuing scenario configurations.

[0041] Specifically, issuing a status control command to the target gateway to reset the binding status can clear the old binding configuration stored locally on the target gateway, resetting the target gateway's binding status to a new binding status. This avoids binding conflicts caused by residual configurations from old users, allowing the target gateway to quickly switch to an operating state adapted to the target user. Requesting and allocating device authorization credentials from an external authorization platform can involve the target gateway applying for an authorization credential (License) from an external authorization platform (such as a platform providing IoT services like device authentication and voice recognition). Once completed, the target gateway can use the cloud services provided by the external authorization platform normally with the authorization credential.

[0042] Obtaining the object model attributes from the cloud platform and synchronizing them to local device data can be achieved by pulling the object model attributes of the target gateway from the cloud platform providing IoT services and synchronously writing the object model attributes into the local device data (e.g., homie_device) of the device bound to the gateway, thus uniformly managing the target gateway. The object model provided in this application can be used to abstractly describe standardized information such as the gateway's type, functional attributes, and callable commands. The local device data can be a core data table or entity used to store the standardized attributes of the gateway.

[0043] In one embodiment, obtaining the object model attributes from the cloud platform and synchronizing them to local device data can be achieved by: obtaining the object model attributes from the cloud platform and synchronizing them to local device data based on a preset number of retries and a preset retry interval.

[0044] The process of acquiring object model attributes from the cloud platform and synchronizing them to local device data can be based on a preset number of retries and a preset retry interval. For example, if the preset number of retries is set to 3 and the preset retry interval is set to 2 seconds, when the first acquisition or synchronization of object model attributes fails, the process will not be marked as failed immediately. Instead, it will pause for 2 seconds and then re-initiate the request. If the second attempt also fails, a third request will be initiated after a 2-second interval. Only after all three attempts fail will an exception be recorded. It should be explained that, since the object model attributes of the target gateway need to be acquired from the cloud platform, there may be a short delay when the target gateway has just completed activation and binding, during which the object model attributes may be unavailable. This application improves the success rate of object model attribute acquisition and synchronization through a retry mechanism, eliminating the need for users to manually retry binding the gateway, thereby improving the stability of gateway binding and the user experience.

[0045] Initiating a registration and binding request to a third-party operating platform can involve registering the target gateway and target user on the platform (e.g., a third-party IoT operating service platform providing value-added services such as push notifications, value-added service billing, and device management). This allows the third-party operating platform to provide third-party value-added services to the target user and target gateway. Sending environment configuration information to the target gateway can involve sending the necessary environment configuration information for the target gateway to connect to the IoT cloud platform. This information may include the MQTT connection address, data reporting interface, service domain name, heartbeat interval, function switches, and cloud environment identifier. This allows the target gateway to configure its network and operating parameters based on the environment configuration information, ensuring its normal operation. Recalculating and sending scenario configurations to the target gateway can involve recalculating and generating automated scenario rules adapted to the target user based on the target user's device list and custom scenario configurations. These automated scenario rules are then sent to the target gateway for local storage, enabling the target gateway to execute automated linkages according to the target user's needs, thus improving the user experience.

[0046] In one embodiment, database tasks can be detected. Upon detection that a database task has been submitted, it can be determined that the binding relationship between the target user and the target gateway has been persisted on the database side. Then, data collaboration operations can be performed based on the gateway binding request. Optionally, a transaction synchronizer can be used to detect database task submissions and trigger data collaboration operations.

[0047] In one possible embodiment, the gateway binding method provided in this application further includes, before submitting the completed database task to the database end: registering a transaction synchronizer and configuring a preset callback method in the transaction synchronizer, triggering the callback method after the transaction synchronizer successfully submits the completed database task. Correspondingly, in the gateway binding method provided in this application, performing data collaboration operations can be: performing data collaboration operations in response to the triggering of the callback method.

[0048] For example, before submitting a completed database task to the database, a transaction synchronizer (e.g., a TransactionSynchronizationManager synchronizer) is registered, and a pre-defined callback method (e.g., the afterCommit() method) is configured in the transaction synchronizer. The callback method can be used to specify the business logic (code) corresponding to the data collaboration operation. The transaction synchronizer can detect the execution and commit status of the database task, and trigger the callback method after detecting a successfully committed and completed database task. Once the callback method is triggered, an asynchronous thread can be created based on the callback method to execute the data collaboration operation. Different data collaboration operations can be executed on different asynchronous threads, and each asynchronous thread performs independent exception handling to ensure that a single-step failure does not affect subsequent steps.

[0049] For example, before a database task is officially committed after execution, a custom transaction synchronization instance can be registered in the current thread's transaction context by registering a transaction synchronizer (e.g., the `TransactionSynchronizationManager.registerSynchronization()` method). The entry logic for subsequent data collaboration operations can be written into the instance's `afterCommit()` method. The transaction synchronizer can track the execution status of the database task throughout its execution. After the database task is completed, the synchronizer waits for the task to be fully committed and all binding relationships to be persisted before triggering the next callback. After the database task is committed, the synchronizer iterates through all registered synchronization instances under the current transaction, calling the callback method (`afterCommit()`) of each instance to trigger the business logic corresponding to the data collaboration operation specified in the callback method.

[0050] This application registers a transaction synchronizer before submitting the completed database task to the database end, and configures a preset callback method in the transaction synchronizer. The transaction synchronizer triggers the callback method after the database task is successfully submitted, so as to perform data collaboration operations through the callback method. This ensures that the data collaboration operation is triggered only after the database task is successfully submitted, reducing the timing errors of data operations. At the same time, it allows the main interface to return the binding success information in advance, so users do not need to wait for the time-consuming response of the third-party interface, effectively shortening the user's perceived binding time.

[0051] As described above, by initiating a database task in response to a gateway binding request, the database task executes database operations to bind the target user and the target gateway. After completing the database operations, the completed database task is submitted to the database end, and a binding success message is sent to the client after successful submission. This eliminates the need to wait for the data collaboration operation to complete before sending the binding success message to the client, effectively shortening the total time from when the user initiates the binding request to when the binding success response is finally received, thus improving the user experience. Furthermore, executing the data collaboration operation after successfully submitting the database task effectively solves the problem of timing errors when calling external interfaces during data collaboration operations caused by executing the data collaboration operation before the database submission is complete, ensuring the correct processing of gateway binding data. Meanwhile, by registering a transaction synchronizer before submitting the completed database task to the database end, and configuring a preset callback method in the transaction synchronizer, the callback method is triggered by the transaction synchronizer after the database task is successfully submitted. This allows data collaboration operations to be performed through the callback method. This ensures that data collaboration operations are triggered only after the database task is successfully submitted, reducing timing errors in data operations. At the same time, it allows the main interface to return binding success information in advance, so users do not need to wait for time-consuming third-party interface responses, effectively shortening the user's perceived binding time.

[0052] Figure 3 A schematic diagram of a gateway binding device according to an embodiment of this application is provided. (Reference) Figure 3 The gateway binding device includes a task initiation module 31, a task submission module 32, and a binding feedback module 33.

[0053] The task initiation module 31 is configured to initiate a database task in response to a gateway binding request, and to perform database operations to bind the target user and the target gateway through the database task; the task submission module 32 is configured to submit the completed database task to the database end after completing the database operation; and the binding feedback module 33 is configured to send a binding success message to the client after successfully submitting the completed database task.

[0054] As described above, by initiating a database task in response to a gateway binding request, the database task executes database operations to bind the target user and the target gateway. After completing the database operations, the completed database task is submitted to the database end, and a binding success message is sent to the client after successful submission. This eliminates the need to wait for the data collaboration operation to complete before sending the binding success message to the client, effectively shortening the total time from when the user initiates the binding request to when the binding success response is finally received, thus improving the user experience. Furthermore, executing the data collaboration operation after successfully submitting the database task effectively solves the problem of timing errors when calling external interfaces during data collaboration operations caused by executing the data collaboration operation before the database submission is complete, ensuring the correct processing of gateway binding data.

[0055] In one possible embodiment, the gateway binding device further includes an external collaboration module for performing data collaboration operations after a database task has been successfully submitted and completed.

[0056] In one possible embodiment, the gateway binding device further includes a callback processing module, which is used to register a transaction synchronizer before submitting the completed database task to the database end, configure a preset callback method in the transaction synchronizer, and trigger the callback method through the transaction synchronizer after successfully submitting the completed database task. Accordingly, the external collaboration module performs data collaboration operations, including: Execute data coordination operations in response to the triggering of callback methods.

[0057] In one possible embodiment, the external collaboration module performs data collaboration operations, including: Create an asynchronous operation thread to perform data coordination operations.

[0058] In one possible embodiment, the task initiation module 31 performs database operations for binding the target user and the target gateway, including: Perform permission verification on the binding permissions of the target user and the device permissions of the target gateway, and perform binding conflict verification on the target gateway; If the permission verification and conflict verification are passed, the binding relationship between the target gateway and the target user is established, and the binding snatching operation is performed on the sub-devices bound to the target gateway.

[0059] In one possible embodiment, the data cooperation includes multiple operations, and these multiple data cooperation operations handle exceptions based on independent exception capture mechanisms.

[0060] In one possible embodiment, the external collaboration module performs data collaboration operations including at least one of the following: Send a status control command to the target gateway to reset the binding status; Request and assign device authorization credentials from an external authorization platform; Obtain the object model attributes from the cloud platform and synchronize them to the local device data; Initiate a registration and binding request to the third-party operating platform; Send environment configuration information to the target gateway; Recalculate the associated scenarios of the target gateway and distribute the scenario configuration.

[0061] In one possible embodiment, the external collaboration module performs data collaboration operations including: Based on the preset number of retries and preset retry interval, the object model attributes of the cloud platform are obtained and synchronized to the local device data.

[0062] It is worth noting that in the above-described embodiments of the gateway binding device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this application.

[0063] This application also provides a gateway binding device that can integrate the gateway binding apparatus provided in this application. Figure 4 This is a schematic diagram of the structure of a gateway binding device provided in an embodiment of this application. (Reference) Figure 4 The gateway binding device includes: an input device 43, an output device 44, a memory 42, and one or more processors 41; the memory 42 is used to store one or more programs; when one or more programs are executed by one or more processors 41, the one or more processors 41 implement the gateway binding method provided in the above embodiments. The input device 43, output device 44, memory 42, and processors 41 can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.

[0064] The memory 42, as a computing device-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the gateway binding method provided in any embodiment of this application (e.g., task initiation module 31, task submission module 32, and binding feedback module 33 in the gateway binding device). The memory 42 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on device usage, etc. Furthermore, the memory 42 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 42 may further include memory remotely located relative to the processor 41, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0065] Input device 43 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 44 may include display devices such as a display screen.

[0066] The processor 41 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 42, thereby realizing the gateway binding method described above.

[0067] The gateway binding device, equipment, and computer provided above can be used to execute the gateway binding method provided in any of the above embodiments, and have corresponding functions and beneficial effects.

[0068] This application also provides a storage medium for storing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute the gateway binding method provided in the above embodiments. The gateway binding method includes: initiating a database task in response to a gateway binding request; performing database operations for binding a target user and a target gateway through the database task; submitting the completed database task to the database end after completing the database operations; and sending binding success information to the client after successfully submitting the completed database task.

[0069] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a first computer system in which a program is executed, or may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0070] Of course, the computer-executable instructions stored in the storage medium provided in the embodiments of this application are not limited to the gateway binding method provided above, but can also perform related operations in the gateway binding method provided in any embodiment of this application.

[0071] The gateway binding device, equipment, and storage medium provided in the above embodiments can execute the gateway binding method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the gateway binding method provided in any embodiment of this application.

[0072] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments provided herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A gateway binding method, characterized in that, include: In response to a gateway binding request, a database task is initiated, and database operations for binding the target user and the target gateway are performed through the database task. After completing the database operation, submit the completed database task to the database client. After successfully submitting and executing the database task, a binding success message is sent to the client. Perform data collaboration operations.

2. The gateway binding method according to claim 1, characterized in that, Before submitting the completed database task to the database, the process also includes: Register a transaction synchronizer and configure a preset callback method in the transaction synchronizer. The callback method is triggered by the transaction synchronizer after the database task is successfully committed and completed. Accordingly, the execution of data collaborative operations includes: The data collaboration operation is executed in response to the triggering of the callback method.

3. The gateway binding method according to claim 1, characterized in that, The execution of data collaboration operations includes: Create an asynchronous operation thread to perform data coordination operations.

4. The gateway binding method according to claim 1, characterized in that, The database operations performed to bind the target user and the target gateway include: The system performs permission verification on the binding permissions of the target user and the device permissions of the target gateway, and performs binding conflict verification on the target gateway. If the permission verification and conflict verification are passed, a binding relationship is established between the target gateway and the target user, and a binding snatching operation is performed on the sub-devices bound to the target gateway.

5. The gateway binding method according to claim 1, characterized in that, The data collaboration operation includes multiple operations, and each of these multiple data collaboration operations performs exception handling based on an independent exception capture mechanism.

6. The gateway binding method according to claim 1, characterized in that, The data collaboration operation includes at least one of the following: A status control command to reset the binding status is issued to the target gateway; Request and assign device authorization credentials from an external authorization platform; Obtain the object model attributes from the cloud platform and synchronize them to the local device data; Initiate a registration and binding request to the third-party operating platform; Send environment configuration information to the target gateway; Recalculate the associated scenarios of the target gateway and issue scenario configurations.

7. The gateway binding method according to claim 1, characterized in that, The data collaboration operation includes: Based on the preset number of retries and preset retry interval, the object model attributes of the cloud platform are obtained and synchronized to the local device data.

8. A gateway binding device, characterized in that, It includes a task initiation module, a task submission module, a binding feedback module, and an external collaboration module, among which: The task initiation module is configured to initiate a database task in response to a gateway binding request, and to perform database operations for binding the target user and the target gateway through the database task; The task submission module is configured to submit the completed database task to the database end after completing the database operation. The binding feedback module is configured to send a binding success message to the client after the database task has been successfully submitted and completed. The external collaboration module is used to perform data collaboration operations.

9. A gateway binding device, characterized in that, include: Memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the gateway binding method as described in any one of claims 1-7.

10. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the gateway binding method as described in any one of claims 1-7.