A method for processing edge scenes, edge terminal and system
By sending control commands from the cloud to the edge, the edge scenario can be dynamically adjusted, solving the problem that fixed-scenario applications at the edge cannot meet business needs and improving the user experience.
Patent Information
- Application Number
- CN202110986531.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-26
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2041-08-26
AI Technical Summary
Current technologies can only support a limited number of edge scenarios, which cannot meet the growing business needs.
By sending control commands from the cloud to the edge device, the edge device can perform operations such as starting, deleting, and restoring the edge scene to factory settings according to the received commands, thereby realizing dynamic adjustment of the edge scene.
It enables dynamic adjustment of edge scenarios in edge devices, meeting the growing business needs and improving the user experience.
Smart Images

Figure CN113849301B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge computing technology, specifically to a method for processing edge scenarios, an edge terminal, and a system. Background Technology
[0002] With the development of the Internet of Things (IoT), edge computing is increasingly valued by various industries. Currently, in practical applications of edge computing, the edge can only support a fixed number of edge scenarios, which is insufficient to meet the growing business demands. Therefore, how to dynamically adjust the edge scenarios is a pressing issue that needs to be addressed. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method for processing edge scenes, an edge terminal, and a system to solve problems such as the inability to dynamically adjust edge scenes in edge terminals.
[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0005] The first aspect of this invention discloses a method for processing edge scenes, the method being applicable to edge environments, the method comprising:
[0006] Receive control commands sent from the cloud, the control commands being: a start command for starting the first edge scene, or a delete command for deleting the scene node corresponding to the second edge scene, or a reset command for restoring factory settings;
[0007] If the control command is the start command, when there is no scene node corresponding to the first edge scene in the edge terminal, the script data corresponding to the first edge scene is downloaded from the cloud.
[0008] Based on the script data, the scene node corresponding to the first edge scene is added to the scene manager at the edge end;
[0009] If the control command is the deletion command, when there is a scene node corresponding to the second edge scene in the edge end, stop executing the second edge scene and delete its corresponding scene node from the scene manager;
[0010] If the control command is the reset command, stop executing all edge scenes at the edge end and delete the corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, and restart the scene function of the edge end. The third edge scene is the edge scene configured at the factory.
[0011] Preferably, downloading the script data corresponding to the first edge scene from the cloud includes:
[0012] Send a download command to the cloud, the download command being used to download the script data corresponding to the first edge scene;
[0013] Receive the script data transmitted from the cloud and determine whether the script data has been successfully downloaded;
[0014] If the script data is successfully downloaded, obtain the script data;
[0015] If the script data is not successfully downloaded, determine whether the number of times the download command is sent to the cloud exceeds the retry threshold in the retry mechanism. The retry mechanism includes: the retry threshold and the retry interval.
[0016] If the number of times a download command is sent to the cloud exceeds the retry threshold, a startup failure message indicating that the first edge scenario failed to start is sent to the cloud.
[0017] If the number of times a download command is sent to the cloud is less than or equal to the retry threshold, the process returns to the step of sending the download command to the cloud according to the retry interval.
[0018] Preferably, adding the scene node corresponding to the first edge scene to the scene manager at the edge end according to the script data includes:
[0019] Perform a validity check on the script data;
[0020] The script data that passes the legality check is stored as a script file;
[0021] Based on the script file corresponding to the script data, add the scene node corresponding to the first edge scene to the scene manager at the edge end;
[0022] A startup success message is sent to the cloud to indicate that the first edge scenario has been successfully launched.
[0023] Preferred options also include:
[0024] If the control command is the start command, when there is a scene node corresponding to the first edge scene in the edge terminal, a start success message indicating that the first edge scene has been successfully started is sent to the cloud.
[0025] Preferably, stopping the execution of the second edge scene and removing its corresponding scene node from the scene manager includes:
[0026] Determine whether the second edge scene is currently being executed;
[0027] If the second edge scene is being executed, stop the execution of the second edge scene, remove the scene node corresponding to the second edge scene from the scene manager, and send a deletion success message to the cloud to indicate that the scene node corresponding to the second edge scene has been successfully deleted.
[0028] If the second edge scene is not currently being executed, remove the scene node corresponding to the second edge scene from the scene manager and send the deletion success message to the cloud.
[0029] Preferred options also include:
[0030] If the control command is the deletion command, when there is no scene node corresponding to the second edge scene in the edge terminal, a deletion success message is sent to the cloud to indicate that the scene node corresponding to the second edge scene has been successfully deleted.
[0031] Preferably, stopping the execution of all edge scenes at the edge end and deleting their corresponding scene nodes from the scene manager, adding the scene node corresponding to the third edge scene to the scene manager, and restarting the scene function at the edge end includes:
[0032] Stop executing all edge scenes at the edge end, and delete the scene nodes corresponding to all edge scenes at the edge end from the scene manager;
[0033] Based on the script file corresponding to the third edge scene, add the scene node corresponding to the third edge scene in the scene manager, and restart the scene function at the edge.
[0034] A reset success message indicating a successful factory reset is sent to the cloud.
[0035] A second aspect of the present invention discloses an edge end, the edge end comprising:
[0036] The receiving unit is used to receive control commands sent from the cloud. The control commands are: a start command for starting the first edge scene, or a delete command for deleting the scene node corresponding to the second edge scene, or a reset command for restoring factory settings.
[0037] A startup unit is configured to download script data corresponding to the first edge scene from the cloud when the control command is the startup command and there is no scene node corresponding to the first edge scene in the edge terminal;
[0038] An adding unit is used to add the scene node corresponding to the first edge scene to the scene manager at the edge end according to the script data;
[0039] The stop unit is configured to, if the control instruction is the delete instruction, when there is a scene node corresponding to the second edge scene in the edge end, stop executing the second edge scene and delete the scene node corresponding to it from the scene manager;
[0040] A reset unit is configured to, if the control instruction is the reset instruction, stop executing all edge scenes of the edge end and delete the corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, and restart the scene function of the edge end, wherein the third edge scene is the factory-configured edge scene.
[0041] Preferably, the starting unit is specifically used for:
[0042] Send a download command to the cloud, the download command being used to download the script data corresponding to the first edge scene;
[0043] Receive the script data transmitted from the cloud and determine whether the script data has been successfully downloaded;
[0044] If the script data is successfully downloaded, obtain the script data;
[0045] If the script data is not successfully downloaded, determine whether the number of times the download command is sent to the cloud exceeds the retry threshold in the retry mechanism. The retry mechanism includes: the retry threshold and the retry interval.
[0046] If the number of times a download command is sent to the cloud exceeds the retry threshold, a startup failure message indicating that the first edge scenario failed to start is sent to the cloud.
[0047] If the number of times a download command is sent to the cloud is less than or equal to the retry threshold, the process returns to the step of sending the download command to the cloud according to the retry interval.
[0048] A third aspect of this invention discloses a processing system for edge scenarios, the system comprising: a cloud and an edge terminal;
[0049] The cloud is used to: send control commands to the edge terminal, the control commands being: a start command to start the first edge scene, or a delete command to delete the scene node corresponding to the second edge scene, or a reset command to restore factory settings;
[0050] The edge terminal is used to: receive the control command; if the control command is the start command, when there is no scene node corresponding to the first edge scene in the edge terminal, download the script data corresponding to the first edge scene from the cloud; add the scene node corresponding to the first edge scene to the scene manager of the edge terminal according to the script data; if the control command is the delete command, when there is a scene node corresponding to the second edge scene in the edge terminal, stop executing the second edge scene and delete its corresponding scene node from the scene manager; if the control command is the reset command, stop executing all edge scenes of the edge terminal and delete its corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, and restart the scene function of the edge terminal, wherein the third edge scene is the factory-configured edge scene.
[0051] Based on the above embodiments of the present invention, an edge scene processing method, edge terminal, and system are provided. The method includes: receiving a control command sent from the cloud; if the control command is a start command, when there is no scene node corresponding to the first edge scene in the edge terminal, downloading the script data corresponding to the first edge scene from the cloud; adding the scene node corresponding to the first edge scene to the scene manager of the edge terminal according to the script data; if the control command is a delete command, when there is a scene node corresponding to the second edge scene in the edge terminal, stopping the execution of the second edge scene and deleting its corresponding scene node from the scene manager; if the control command is a reset command, stopping the execution of all edge scenes in the edge terminal and deleting their corresponding scene nodes from the scene manager, adding the scene node corresponding to the third edge scene to the scene manager, and restarting the scene function of the edge terminal. In this solution, by sending control commands from the cloud to the edge terminal, the edge terminal can perform operations such as starting, deleting, and restoring factory settings of edge scenes according to the received control commands, thereby dynamically adjusting the edge scenes in the edge terminal to meet the growing business needs and improve the user experience. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0053] Figure 1 A flowchart illustrating a method for processing edge scenes according to an embodiment of the present invention;
[0054] Figure 2A flowchart illustrating the interaction between the edge and the cloud, provided in an embodiment of the present invention;
[0055] Figure 3 Another flowchart illustrating the interaction between the edge and the cloud, as provided in this embodiment of the invention;
[0056] Figure 4 This is another flowchart illustrating the interaction between the edge and the cloud, as provided in an embodiment of the present invention.
[0057] Figure 5 A structural block diagram of an edge end provided in an embodiment of the present invention;
[0058] Figure 6 This is a structural block diagram of an edge scene processing system provided in an embodiment of the present invention. Detailed Implementation
[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0060] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0061] As the background technology shows, when applying edge computing, the edge terminal can only support a fixed number of edge scenarios, which cannot meet the ever-increasing business demands. Therefore, how to dynamically adjust the edge scenarios in the edge terminal is a problem that urgently needs to be solved.
[0062] Therefore, embodiments of the present invention provide a method, edge terminal, and system for processing edge scenes. By sending control commands from the cloud to the edge terminal, the edge terminal can perform operations such as starting, deleting, and restoring the edge scene to factory settings according to the received control commands, thereby dynamically adjusting the edge scene in the edge terminal to meet the growing business needs and improve the user experience.
[0063] It should be noted that edge computing is the extension of cloud capabilities in the Internet of Things (IoT) to the edge. The edge is closer to the user terminal, enabling faster data processing and transmission. Edge scenarios deployed at the edge can quickly respond to local messages and operate normally even in network anomalies. Therefore, dynamically adjusting edge scenarios is crucial for adapting the edge to ever-changing business needs. How to achieve this dynamic adjustment is detailed in the following embodiments of the present invention.
[0064] See Figure 1 The diagram illustrates a flowchart of an edge scene processing method provided by an embodiment of the present invention. This processing method is applicable to edge areas and includes:
[0065] Step S101: Receive control commands sent from the cloud.
[0066] It should be noted that the control commands sent from the cloud are: a start command to activate the first edge scene, a delete command to delete the scene node corresponding to the second edge scene, or a reset command to restore factory settings.
[0067] Understandably, when the first edge scene created by the user in the cloud is launched, the cloud will notify the edge device to launch the first edge scene by sending a launch command. When the cloud determines that the second edge scene no longer needs maintenance, it will notify the edge device to delete the scene node corresponding to the second edge scene by sending a delete command. When the cloud determines that the edge device needs to be restored to factory settings, it will notify the edge device to reset the edge scene by sending a reset command.
[0068] In the specific implementation step S101, the edge device receives a control command sent by the cloud, and the edge device determines that the control command is a start command, a delete command, or a reset command.
[0069] If the control instruction is a start instruction, execute steps S102 and S103; if the control instruction is a delete instruction, execute step S104; if the control instruction is a reset instruction, execute step S105.
[0070] Step S102: If the control command is a start command, when there is no scene node corresponding to the first edge scene in the edge terminal, download the script data corresponding to the first edge scene from the cloud.
[0071] In the specific implementation of step S102, if the edge terminal determines that the control command is a start command for starting the first edge scene, there are two situations: one is that the edge terminal already has a scene node corresponding to the first edge scene, and the other is that the edge terminal does not have a scene node corresponding to the first edge scene.
[0072] In other words, when the edge device receives a start command sent by the cloud (i.e., the control command is a start command), the edge device determines whether it has a scene node corresponding to the first edge scene. When the edge device determines that it has a scene node corresponding to the first edge scene, the edge device sends a start success message to the cloud to indicate that the first edge scene has been successfully started, that is, notifies the cloud that the first edge scene has been successfully started. When the edge device determines that it does not have a scene node corresponding to the first edge scene, the edge device downloads the script data corresponding to the first edge scene from the cloud.
[0073] In some specific embodiments, the edge device downloads the script data corresponding to the first edge scene from the cloud in the following way: sending a download command to the cloud, which is used to download the script data corresponding to the first edge scene; receiving the script data transmitted from the cloud and determining whether the script data was successfully downloaded; if the script data was successfully downloaded, obtaining the script data; if the script data was not successfully downloaded, determining whether the number of times the download command was sent to the cloud is greater than the retry threshold in the retry mechanism, which includes: the retry threshold and the retry interval; if the number of times the download command was sent to the cloud is greater than the retry threshold, sending a startup failure message to the cloud to indicate that the startup of the first edge scene failed; if the number of times the download command was sent to the cloud is less than or equal to the retry threshold, returning to the step of sending the download command to the cloud according to the retry interval.
[0074] In other words, when the edge device downloads the script data corresponding to the first edge scene from the cloud, if the edge device successfully downloads the script data, it acquires the script data; if the edge device fails to download the script data (for example, due to network abnormalities), it repeatedly attempts to download the script data corresponding to the first edge scene from the cloud according to the preset retry mechanism (retrying to download a maximum of "retry threshold - 1" times, and each time it needs to retry to download according to the retry interval). If the script data is successfully downloaded at this time, it acquires the script data; if the script data is still not downloaded (after the first download fails, it still fails after repeating "retry threshold - 1" times), it sends a failure message to the cloud, notifying the cloud that the first edge scene has failed to start.
[0075] For example, when the edge device downloads the script data corresponding to the first edge scene from the cloud for the first time, if the edge device fails to download the script data, the step of "downloading the script data corresponding to the first edge scene from the cloud" is repeated (if the script data is successfully downloaded during this process, the repetition process stops), and it is repeated a maximum of 4 times (that is, the retry threshold is 5). The retry interval is 2 seconds, 4 seconds, 8 seconds, and 16 seconds. That is, when the edge device fails to download the script data from the cloud for the first time, the step of "downloading the script data corresponding to the first edge scene from the cloud" is repeated for the first time after an interval of 2 seconds. If the script data is still not downloaded after the first repetition of this step, the step is repeated for the second time after an interval of 4 seconds, and so on, until the script data is successfully downloaded or the number of times the step is executed reaches 5, at which point the repetition of this step stops.
[0076] Step S103: Based on the script data, add the scene node corresponding to the first edge scene to the scene manager at the edge.
[0077] In the specific implementation step S103, after the edge terminal successfully downloads the script data corresponding to the first edge scene, the edge terminal performs a validity check on the script data (one of the purposes of which is to ensure that the newly added first edge scene can run correctly); the edge terminal stores the script data that has passed the validity check as a script file, and adds the scene node corresponding to the first edge scene in the scene manager of the edge terminal based on the script file corresponding to the script data; the edge terminal sends a startup success message to the cloud to indicate that the first edge scene has been successfully started, notifying the cloud that the first edge scene has been successfully started.
[0078] In the specific implementation of adding the scene node corresponding to the first edge scene in the scene manager, the edge end loads the script file corresponding to the script data of the first edge scene into the scene manager in order to add the scene node corresponding to the first edge scene in the scene manager.
[0079] Step S104: If the control command is a delete command, when there is a scene node corresponding to the second edge scene in the edge end, stop executing the second edge scene and delete its corresponding scene node from the scene manager.
[0080] In the specific implementation of step S104, if the edge end determines that the control instruction is a deletion instruction for deleting the scene node corresponding to the second edge scene, there are two situations: one is that the edge end has the scene node corresponding to the second edge scene, and the other is that the edge end does not have the scene node corresponding to the second edge scene.
[0081] In other words, when the edge device receives a deletion command sent by the cloud (i.e., the control command is a deletion command), the edge device determines whether it has a scene node corresponding to the second edge scene. If the edge device does not have a scene node corresponding to the second edge scene, then the edge device does not need to delete the scene node corresponding to the second edge scene. The edge device sends a deletion success message to the cloud to indicate that the scene node corresponding to the second edge scene has been successfully deleted, and notifies the cloud that the scene node corresponding to the second edge scene has been successfully deleted.
[0082] When a scene node corresponding to the second edge scene exists in the edge endpoint, the edge endpoint determines whether the second edge scene is currently being executed. If the second edge scene is being executed, it stops executing the second edge scene (ensuring that the second edge scene is idle when it is deleted to avoid causing abnormal states), removes the scene node corresponding to the second edge scene from the scene manager, and sends a deletion success message to the cloud to notify the cloud that the scene node corresponding to the second edge scene has been successfully deleted. If the second edge scene is not being executed, it directly removes the scene node corresponding to the second edge scene from the scene manager, sends a deletion success message to the cloud to notify the cloud that the scene node corresponding to the second edge scene has been successfully deleted.
[0083] Step S105: If the control command is a reset command, stop the execution of all edge scenes at the edge end and delete the corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, and restart the scene function at the edge end.
[0084] It should be noted that the third edge scene is the factory-configured edge scene. There are N (positive integer) third edge scenes, and the script files corresponding to the third edge scenes are stored in the backup area at the edge.
[0085] In the specific implementation step S105, if the edge terminal determines that the control command is a reset command for restoring factory settings, it stops executing all edge scenes on the edge terminal (equivalent to turning off the scene capability of the edge terminal), and deletes the scene nodes corresponding to all edge scenes from the scene manager; the edge terminal adds the scene node corresponding to the third edge scene in the scene manager according to the script file corresponding to the third edge scene (that is, loads the script file corresponding to the third edge scene into the scene manager), and restarts the scene function of the edge terminal; the edge terminal sends a reset success message to the cloud to indicate that the factory settings have been successfully restored, and notifies the cloud that the factory settings have been successfully restored.
[0086] In this embodiment of the invention, control commands are sent from the cloud to the edge device, enabling the edge device to perform operations such as starting, deleting, and restoring the edge scene to factory settings according to the received control commands. This achieves dynamic adjustment of the edge scene in the edge device to meet the growing business needs and improve the user experience.
[0087] To better understand the above embodiments of the present invention Figure 1 The diagram shows the specific operations performed by the edge device according to control commands sent from the cloud. Figure 2 This section provides an example of how the edge device initiates the first edge scene based on the startup command. Figure 3 This example illustrates how to delete content from the second edge scene based on a deletion command at the edge. Figure 4 This section provides an example of how the edge device restores factory settings based on a reset command. Figures 2 to 4 This is for illustrative purposes only.
[0088] See Figure 2 The diagram illustrates a flowchart of the interaction between the edge device and the cloud according to an embodiment of the present invention, wherein the control command sent by the cloud is a start command, including the following steps:
[0089] Step S201: The cloud sends a start command to the edge device to start the first edge scene.
[0090] Step S202: The edge device determines whether it has a scene node corresponding to the first edge scene; if a scene node corresponding to the first edge scene exists, it sends a startup success message to the cloud to indicate that the first edge scene has been successfully started; if no scene node corresponding to the first edge scene exists, it executes step S203.
[0091] Step S203: The edge device sends a download command to the cloud.
[0092] Step S204: The cloud transmits the script data corresponding to the first edge scene to the edge.
[0093] Step S205: The edge device determines whether the script data was successfully downloaded. If the script data was successfully downloaded, proceed to step S207; if the script data was not successfully downloaded, proceed to step S206.
[0094] Step S206: The edge device determines whether the number of times it has sent download commands to the cloud exceeds the retry threshold. If it exceeds the retry threshold, it sends a startup failure message to the cloud indicating that the first edge scenario failed to start; if it is less than or equal to the retry threshold, it returns to step S203 according to the retry interval.
[0095] Step S207: The edge device performs a validity check on the script data and stores the script data that passes the validity check as a script file.
[0096] Step S208: Based on the script file corresponding to the script data, the edge end adds the scene node corresponding to the first edge scene in the scene manager of the edge end.
[0097] Step S209: The edge device sends a startup success message to the cloud to indicate that the first edge scenario has been successfully started.
[0098] See Figure 3 This illustrates another flowchart of edge-to-cloud interaction provided by an embodiment of the present invention, wherein the control command sent by the cloud is a deletion command, including the following steps:
[0099] Step S301: The cloud sends a deletion command to the edge terminal to delete the scene node corresponding to the second edge scene.
[0100] Step S302: The edge device determines whether it has a scene node corresponding to the second edge scene. If it does, proceed to step S303; otherwise, send a deletion success message to the cloud indicating that the scene node corresponding to the second edge scene has been successfully deleted.
[0101] Step S303: The edge end determines whether the second edge scene is being executed. If the second edge scene is being executed, proceed to step S304; if the second edge scene is not being executed, proceed to step S305.
[0102] Step S304: Stop executing the second edge scene at the edge. Proceed to step S305.
[0103] Step S305: Remove the scene node corresponding to the second edge scene from the scene manager at the edge.
[0104] Step S306: The edge device sends a deletion success message to the cloud.
[0105] See Figure 4 This illustrates another flowchart of edge-to-cloud interaction provided by an embodiment of the present invention, wherein the control command sent by the cloud is a reset command, including the following steps:
[0106] Step S401: The cloud sends a reset command to the edge device to restore factory settings.
[0107] Step S402: The edge end stops executing all edge scenes on the edge end.
[0108] Step S403: Remove all scene nodes corresponding to the edge scene from the scene manager at the edge end.
[0109] Step S404: The edge end adds the scene node corresponding to the third edge scene in the scene manager according to the script file corresponding to the third edge scene in the backup area.
[0110] Step S405: Restart the scene function on the edge device.
[0111] Step S406: The edge device sends a reset success message to the cloud to indicate that the factory settings have been successfully restored.
[0112] Corresponding to the edge scene processing method provided in the above embodiments of the present invention, see also... Figure 5 The present invention also provides a structural block diagram of an edge end, which includes: a receiving unit 501, a starting unit 502, an adding unit 503, a stopping unit 504, and a resetting unit 505;
[0113] The receiving unit 501 is used to receive control commands sent from the cloud. The control commands are: a start command to start the first edge scene, or a delete command to delete the scene node corresponding to the second edge scene, or a reset command to restore factory settings.
[0114] The startup unit 502 is used to download the script data corresponding to the first edge scene from the cloud when the scene node corresponding to the first edge scene does not exist in the edge end if the control command is a startup command.
[0115] In its specific implementation, the startup unit 502 is specifically used to: send a download command to the cloud, the download command being used to download script data corresponding to the first edge scene; receive the script data transmitted from the cloud and determine whether the script data was successfully downloaded; if the script data was successfully downloaded, obtain the script data; if the script data was not successfully downloaded, determine whether the number of times the download command was sent to the cloud is greater than the retry threshold in the retry mechanism, the retry mechanism including: the retry threshold and the retry interval; if the number of times the download command was sent to the cloud is greater than the retry threshold, send startup failure information to the cloud to indicate that the startup of the first edge scene failed; if the number of times the download command was sent to the cloud is less than or equal to the retry threshold, return to the step of sending the download command to the cloud according to the retry interval.
[0116] Preferably, the startup unit 502 is further configured to: if the control instruction is the startup instruction, when there is a scene node corresponding to the first edge scene in the edge terminal, send startup success information to the cloud to indicate that the first edge scene has been successfully started.
[0117] Add unit 503 to add the scene node corresponding to the first edge scene to the scene manager at the edge end based on the script data.
[0118] In the specific implementation, the added unit 503 is used for: performing a validity check on the script data; storing the script data that passes the validity check as a script file; adding a scene node corresponding to the first edge scene in the scene manager at the edge end based on the script file corresponding to the script data; and sending a startup success message to the cloud to indicate that the first edge scene has been successfully started.
[0119] The stop unit 504 is used to stop the execution of the second edge scene and delete its corresponding scene node from the scene manager if the control instruction is a delete instruction and there is a scene node corresponding to the second edge scene in the edge end.
[0120] In the specific implementation, the stopping unit 504 is used to: determine whether the second edge scene is being executed; if the second edge scene is being executed, stop the execution of the second edge scene, remove the scene node corresponding to the second edge scene from the scene manager, and send a deletion success message to the cloud to indicate that the scene node corresponding to the second edge scene has been successfully deleted; if the second edge scene is not being executed, remove the scene node corresponding to the second edge scene from the scene manager and send a deletion success message to the cloud.
[0121] Preferably, the stop unit 504 is further configured to: if the control command is a deletion command, when there is no scene node corresponding to the second edge scene in the edge end, send deletion success information to the cloud to indicate that the scene node corresponding to the second edge scene has been successfully deleted.
[0122] The reset unit 505 is used to, if the control command is a reset command, stop the execution of all edge scenes at the edge end and delete the corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, and restart the scene function at the edge end. The third edge scene is the edge scene configured at the factory.
[0123] In a specific implementation, the reset unit 505 is used to: stop the execution of all edge scenes on the edge end and delete the scene nodes corresponding to all edge scenes on the edge end from the scene manager; add the scene node corresponding to the third edge scene in the scene manager according to the script file corresponding to the third edge scene and restart the scene function on the edge end; and send a reset success message to the cloud to indicate that the factory settings have been successfully restored.
[0124] In this embodiment of the invention, control commands are sent from the cloud to the edge device, enabling the edge device to perform operations such as starting, deleting, and restoring the edge scene to factory settings according to the received control commands. This achieves dynamic adjustment of the edge scene in the edge device to meet the growing business needs and improve the user experience.
[0125] Corresponding to the edge scene processing method provided in the above embodiments of the present invention, see also... Figure 6 The present invention also provides a structural block diagram of an edge scene processing system, which includes: a cloud 601 and an edge terminal 602;
[0126] The cloud-based 601 is used to send control commands to the edge, which are: a start command to start the first edge scene, or a delete command to delete the scene node corresponding to the second edge scene, or a reset command to restore factory settings.
[0127] Edge terminal 602 is used to: receive control commands; if the control command is a start command, when there is no scene node corresponding to the first edge scene in edge terminal 602, download the script data corresponding to the first edge scene from cloud 601; according to the script data, add the scene node corresponding to the first edge scene to the scene manager of edge terminal 602; if the control command is a delete command, when there is a scene node corresponding to the second edge scene in edge terminal 602, stop executing the second edge scene and delete its corresponding scene node from the scene manager; if the control command is a reset command, stop executing all edge scenes of edge terminal 602 and delete its corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, and restart the scene function of edge terminal 602, where the third edge scene is the factory-configured edge scene.
[0128] In summary, the embodiments of the present invention provide a method, edge terminal, and system for processing edge scenes. By sending control commands from the cloud to the edge terminal, the edge terminal can perform operations such as starting, deleting, and restoring the edge scene to factory settings according to the received control commands, thereby dynamically adjusting the edge scene in the edge terminal to meet the growing business needs and improve the user experience.
[0129] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0130] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0131] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing edge scenes, characterized in that, The method is applicable to edge ends, and the method includes: Receive control commands sent from the cloud, the control commands being: a start command for starting the first edge scene, or a delete command for deleting the scene node corresponding to the second edge scene, or a reset command for restoring factory settings; If the control command is the start command, when there is no scene node corresponding to the first edge scene in the edge terminal, the script data corresponding to the first edge scene is downloaded from the cloud. Based on the script data, the scene node corresponding to the first edge scene is added to the scene manager at the edge end to dynamically adjust the edge scene at the edge end; If the control command is the deletion command, when there is a scene node corresponding to the second edge scene in the edge end, the execution of the second edge scene is stopped and its corresponding scene node is deleted from the scene manager, so as to dynamically adjust the edge scene in the edge end; If the control command is the reset command, stop executing all edge scenes on the edge end and delete the corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, and restart the scene function of the edge end to dynamically adjust the edge scenes in the edge end. The third edge scene is the factory-configured edge scene. There are N third edge scenes, and the script file corresponding to the third edge scene is stored in the backup area of the edge end.
2. The method according to claim 1, characterized in that, The step of downloading the script data corresponding to the first edge scene from the cloud includes: Send a download command to the cloud, the download command being used to download the script data corresponding to the first edge scene; Receive the script data transmitted from the cloud and determine whether the script data has been successfully downloaded; If the script data is successfully downloaded, obtain the script data; If the script data is not successfully downloaded, determine whether the number of times the download command is sent to the cloud exceeds the retry threshold in the retry mechanism. The retry mechanism includes: the retry threshold and the retry interval. If the number of times a download command is sent to the cloud exceeds the retry threshold, a startup failure message indicating that the first edge scenario failed to start is sent to the cloud. If the number of times a download command is sent to the cloud is less than or equal to the retry threshold, the process returns to the step of sending the download command to the cloud according to the retry interval.
3. The method according to claim 1, characterized in that, The step of adding the scene node corresponding to the first edge scene to the scene manager at the edge end according to the script data includes: Perform a validity check on the script data; The script data that passes the legality check is stored as a script file; Based on the script file corresponding to the script data, add the scene node corresponding to the first edge scene to the scene manager at the edge end; A startup success message is sent to the cloud to indicate that the first edge scenario has been successfully launched.
4. The method according to claim 1, characterized in that, Also includes: If the control command is the start command, when there is a scene node corresponding to the first edge scene in the edge terminal, a start success message indicating that the first edge scene has been successfully started is sent to the cloud.
5. The method according to claim 1, characterized in that, The step of stopping the execution of the second edge scene and removing its corresponding scene node from the scene manager includes: Determine whether the second edge scene is currently being executed; If the second edge scene is being executed, stop the execution of the second edge scene, remove the scene node corresponding to the second edge scene from the scene manager, and send a deletion success message to the cloud to indicate that the scene node corresponding to the second edge scene has been successfully deleted. If the second edge scene is not currently being executed, remove the scene node corresponding to the second edge scene from the scene manager and send the deletion success message to the cloud.
6. The method according to claim 1, characterized in that, Also includes: If the control command is the deletion command, when there is no scene node corresponding to the second edge scene in the edge terminal, a deletion success message is sent to the cloud to indicate that the scene node corresponding to the second edge scene has been successfully deleted.
7. The method according to claim 1, characterized in that, The steps of stopping the execution of all edge scenes at the edge end and deleting their corresponding scene nodes from the scene manager, adding the scene node corresponding to the third edge scene to the scene manager, and restarting the scene function at the edge end include: Stop executing all edge scenes at the edge end, and delete the scene nodes corresponding to all edge scenes at the edge end from the scene manager; Based on the script file corresponding to the third edge scene, add the scene node corresponding to the third edge scene in the scene manager, and restart the scene function at the edge. A reset success message indicating a successful factory reset is sent to the cloud.
8. An edge end, characterized in that, The edge end includes: The receiving unit is used to receive control commands sent from the cloud. The control commands are: a start command for starting the first edge scene, or a delete command for deleting the scene node corresponding to the second edge scene, or a reset command for restoring factory settings. A startup unit is configured to download script data corresponding to the first edge scene from the cloud when the control command is the startup command and there is no scene node corresponding to the first edge scene in the edge terminal; The addition unit is used to add the scene node corresponding to the first edge scene to the scene manager of the edge end according to the script data, so as to dynamically adjust the edge scene in the edge end; The stop unit is used to stop executing the second edge scene and delete its corresponding scene node from the scene manager when the control instruction is the delete instruction and there is a scene node corresponding to the second edge scene in the edge end, so as to dynamically adjust the edge scene in the edge end; The reset unit is used to, if the control instruction is the reset instruction, stop the execution of all edge scenes on the edge end and delete the corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, and restart the scene function of the edge end to dynamically adjust the edge scenes in the edge end. The third edge scene is a factory-configured edge scene. There are N third edge scenes, and the script file corresponding to the third edge scene is stored in the backup area of the edge end.
9. The edge end according to claim 8, characterized in that, The startup unit is specifically used for: Send a download command to the cloud, the download command being used to download the script data corresponding to the first edge scene; Receive the script data transmitted from the cloud and determine whether the script data has been successfully downloaded; If the script data is successfully downloaded, obtain the script data; If the script data is not successfully downloaded, determine whether the number of times the download command is sent to the cloud exceeds the retry threshold in the retry mechanism. The retry mechanism includes: the retry threshold and the retry interval. If the number of times a download command is sent to the cloud exceeds the retry threshold, a startup failure message indicating that the first edge scenario failed to start is sent to the cloud. If the number of times a download command is sent to the cloud is less than or equal to the retry threshold, the process returns to the step of sending the download command to the cloud according to the retry interval.
10. A processing system for edge scenes, characterized in that, The system includes: cloud and edge; The cloud is used to: send control commands to the edge terminal, the control commands being: a start command to start the first edge scene, or a delete command to delete the scene node corresponding to the second edge scene, or a reset command to restore factory settings; The edge terminal is used to: receive the control command; if the control command is the start command, when there is no scene node corresponding to the first edge scene in the edge terminal, download the script data corresponding to the first edge scene from the cloud; according to the script data, add the scene node corresponding to the first edge scene to the scene manager of the edge terminal to dynamically adjust the edge scenes in the edge terminal; if the control command is the delete command, when there is a scene node corresponding to the second edge scene in the edge terminal, stop executing the second edge scene and delete its corresponding scene node from the scene manager to dynamically adjust the edge scenes in the edge terminal; if the control command is the reset command, stop executing all edge scenes of the edge terminal and delete its corresponding scene nodes from the scene manager, add the scene node corresponding to the third edge scene to the scene manager, restart the scene function of the edge terminal to dynamically adjust the edge scenes in the edge terminal, wherein the third edge scene is a factory-configured edge scene, there are N third edge scenes, and the script file corresponding to the third edge scene is stored in the backup area of the edge terminal.
Citation Information
Patent Citations
Smart home scene control system and method
CN109302471A
Unmanned equipment cooperative work control system and method based on cloud, and storage medium
CN111107157A