Method, system, storage medium and electronic device for determining association relationship
By setting unique identifiers for edge gateway scenarios and associating operation logs for cloud and edge gateways, the problem of edge gateway scenario process monitoring is solved, and the status monitoring and operation process of edge gateway scenarios is realized, improving user experience and problems Positioning efficiency.
Patent Information
- Application Number
- CN202211123924.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-09-15
AI Technical Summary
In the edge gateway scenario, effective process monitoring cannot be implemented, operation logs cannot be flexibly viewed and scenario changes are monitored, resulting in the inability to implement operational process monitoring.
Set a unique identifier for the edge gateway scenario on the cloud server, obtain and associate the operation logs of the cloud and edge gateways, monitor and associate the operation logs through the log collection system, and generate query results to achieve process monitoring.
It realizes process monitoring of edge gateway scenarios, can collect operation logs asynchronously in real time, monitor the changes in the scenario status, and improves the efficiency of user experience and problem positioning.
Smart Images

Figure CN115499333B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a method, system, storage medium and electronic device for determining an association relationship. Background Art
[0002] At present, in the process of users using edge gateway scenarios, the scenarios on the running edge gateways often cannot be viewed normally, or cannot trigger operations, execute operations, etc. Since it is impossible to flexibly view the different operation logs corresponding to the edge gateway scenarios, and it is impossible to monitor the changes in the edge gateway scenarios, the purpose of monitoring the operation process of the edge gateway scenarios cannot be achieved.
[0003] Therefore, in the related technology, there is a problem of how to implement process monitoring in edge gateway scenarios.
[0004] Regarding the problem of how to implement process monitoring in edge gateway scenarios in related technologies, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method, system, storage medium and electronic device for determining an association relationship, so as to at least solve the problem of how to implement process monitoring in an edge gateway scenario in the related art.
[0006] According to an embodiment of the embodiments of the present application, a method for determining an association relationship is provided, including: setting a unique identifier for an edge gateway scenario that has been successfully created on a cloud server, and sending the edge gateway scenario carrying the unique identifier to a target edge gateway; obtaining a first operation of the cloud server on the edge gateway scenario carrying the unique identifier to obtain a first operation log, and obtaining a second operation of the target edge gateway on the edge gateway scenario carrying the unique identifier to obtain a second operation log; determining the association relationship between the first operation log and the second operation log based on the unique identifier.
[0007] In an exemplary embodiment, sending an edge gateway scenario carrying the unique identifier to a target edge gateway includes: sending the edge gateway scenario carrying the unique identifier and a target operation instruction to a device access gateway, wherein the target operation instruction is used to represent the operation instructions of different business scenarios corresponding to the edge gateway scenario carrying the unique identifier; obtaining multiple edge gateways corresponding to the device access gateway; determining a target edge gateway from the multiple edge gateways, and sending the edge gateway scenario carrying the unique identifier and the target operation instruction to the target edge gateway through the device access gateway.
[0008] In an exemplary embodiment, before sending the edge gateway scenario and target operation instruction carrying the unique identifier to the device access gateway, the method also includes: sending the edge gateway scenario carrying the unique identifier to a cloud-based scene management service to instruct the cloud-based scene management service to perform the following operations: determining the operation type of the first operation of the server on the edge gateway scenario carrying the unique identifier, and the business processing instruction corresponding to the operation type of the first operation; performing scene business processing on the edge gateway scenario carrying the unique identifier according to the business processing instruction within the cloud-based scene management service to obtain the target operation instruction.
[0009] In an exemplary embodiment, before obtaining the second operation of the target edge gateway on the edge gateway scene carrying the unique identifier and obtaining the second operation log, the method also includes: determining that the second operation of the target edge gateway on the edge gateway scene carrying the unique identifier includes at least the following steps: obtaining the operation type corresponding to the target operation instruction, and obtaining the scene information of the edge gateway scene carrying the unique identifier based on the operation type corresponding to the target operation instruction; determining a device control instruction based on the scene information and the target operation instruction, and sending the device control instruction and the edge gateway scene carrying the unique identifier to a terminal device, so that the terminal device executes the device control instruction on the edge gateway scene carrying the unique identifier.
[0010] In an exemplary embodiment, the method also includes: sending an edge gateway scene carrying the unique identifier and the target operation instruction to the target edge gateway to instruct the target edge gateway to obtain scene information of the edge gateway scene carrying the unique identifier based on the operation type corresponding to the target operation instruction, including: when the operation type corresponding to the target operation instruction includes scene creation or scene editing, obtaining scene basic information and scene script information corresponding to the edge gateway scene carrying the unique identifier; updating the scene basic information and scene script information according to the target operation instruction to obtain scene information of the edge gateway scene carrying the unique identifier.
[0011] In an exemplary embodiment, before determining the association relationship between the first operation log and the second operation log according to the unique identifier, the method also includes: collecting the first operation log and the second operation log in the following manner: when it is determined that the target edge gateway is online, collecting the first operation log and the second operation log in real-time asynchronous manner; when it is determined that the target edge gateway is offline, if it is monitored that the target edge gateway changes from an offline state to an online state, obtaining a third operation on the edge gateway scenario carrying the unique identifier when the target edge gateway is offline, obtaining a third operation log, and collecting the first operation log, the second operation log, and the third operation log; determining from the first operation log and the second operation log a fourth operation log for indicating a failed operation on the edge gateway scenario carrying the unique identifier, and collecting the first operation log, the second operation log, and the fourth operation log according to a preset time period.
[0012] In an exemplary embodiment, after determining the association relationship between the first operation log and the second operation log based on the unique identifier, the method also includes: responding to a query instruction to query all operation logs for operating on an edge gateway scenario carrying the unique identifier; and generating a query result corresponding to the query instruction based on the association relationship and all the operation logs.
[0013] According to another embodiment of the embodiment of the present application, a system for determining an association relationship is also provided, including: a cloud server, used to create an edge gateway scenario, perform a first operation on the edge gateway scenario carrying a unique identifier, and generate a first operation log; a target edge gateway, used to perform a second operation on the received edge gateway scenario carrying the unique identifier, and generate a second operation log; a log collection system, used to set the unique identifier for the edge gateway scenario that has been successfully created on the cloud server, and determine the association relationship between the first operation log and the second operation log based on the unique identifier.
[0014] In an exemplary embodiment, the log collection system is also used to: determine a first tracking point of the cloud server and a second tracking point of the target edge gateway; monitor first log information corresponding to the first tracking point through the log collection system, and monitor second log information corresponding to the second tracking point through the log collection system; wherein both the first log information and the second log information carry the unique identifier; and determine all operation logs of the edge gateway scenario carrying the unique identifier based on the first log information and the second log information.
[0015] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for determining the association relationship when running.
[0016] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for determining the association relationship through the computer program.
[0017] In an embodiment of the present application, a unique identifier is set for an edge gateway scenario that has been successfully created on a cloud server, and the edge gateway scenario carrying the unique identifier is sent to a target edge gateway; a first operation of the cloud server on the edge gateway scenario carrying the unique identifier is obtained to obtain a first operation log, and a second operation of the target edge gateway on the edge gateway scenario carrying the unique identifier is obtained to obtain a second operation log; an association relationship between the first operation log and the second operation log is determined based on the unique identifier; the above technical solution is used to solve the problem of how to implement process monitoring of edge gateway scenarios, thereby being able to monitor the process status of edge gateway scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 It is a hardware environment diagram of a method for determining an association relationship in an embodiment of the present application;
[0021] Figure 2 is a flow chart of a method for determining an association relationship according to an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of the architecture of a method for determining an association relationship according to an embodiment of the present application;
[0023] Figure 4 is a flowchart of a method for determining an association relationship according to an embodiment of the present application;
[0024] Figure 5is a flow chart of log collection and integration according to an embodiment of the present application;
[0025] Figure 6 It is a structural block diagram of a system for determining an association relationship according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] According to one aspect of an embodiment of the present application, a method for determining an association relationship is provided. The method for determining an association relationship is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (IntelligenceHouse) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for determining an association relationship can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0029] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0030] In this embodiment, a method for determining an association relationship is provided, which is applied to the above-mentioned computer terminal. Figure 2 : is a flow chart of a method for determining an association relationship according to an embodiment of the present application, and the flow includes the following steps:
[0031] Step S202, setting a unique identifier for the edge gateway scenario that has been successfully created on the cloud server, and sending the edge gateway scenario carrying the unique identifier to the target edge gateway;
[0032] It should be noted that the objects for setting a unique identifier for the successfully created edge gateway scenario may also include other execution entities such as devices and device access gateways. This application is not limited to setting a unique identifier for the successfully created edge gateway scenario on the cloud server.
[0033] Step S204, obtaining a first operation of the cloud server on the edge gateway scenario carrying the unique identifier to obtain a first operation log, and obtaining a second operation of the target edge gateway on the edge gateway scenario carrying the unique identifier to obtain a second operation log;
[0034] Step S206: determining the association relationship between the first operation log and the second operation log according to the unique identifier.
[0035] Through the above steps, a unique identifier is set for the edge gateway scene that has been successfully created on the cloud server, and the edge gateway scene carrying the unique identifier is sent to the target edge gateway; the first operation of the cloud server on the edge gateway scene carrying the unique identifier is obtained to obtain a first operation log, and the second operation of the target edge gateway on the edge gateway scene carrying the unique identifier is obtained to obtain a second operation log; the association relationship between the first operation log and the second operation log is determined according to the unique identifier, which solves the problem of how to realize process monitoring of the edge gateway scene in the related technology, and then the process status of the edge gateway scene can be monitored.
[0036] In an exemplary embodiment, in order to better understand how to send the edge gateway scene carrying the unique identifier to the target edge gateway in the above step S202, a technical solution is also proposed, which specifically includes: sending the edge gateway scene carrying the unique identifier and the target operation instruction to the device access gateway, wherein the target operation instruction is used to represent the operation instructions of the edge gateway scene carrying the unique identifier corresponding to different business scenarios; obtaining multiple edge gateways corresponding to the device access gateway; determining the target edge gateway from the multiple edge gateways, and sending the edge gateway scene carrying the unique identifier and the target operation instruction to the target edge gateway through the device access gateway.
[0037] In an exemplary embodiment, further, before sending the edge gateway scene carrying the unique identifier and the target operation instruction to the device access gateway, the following implementation scheme is proposed: sending the edge gateway scene carrying the unique identifier to the cloud scene management service to instruct the cloud scene management service to perform the following operations: determining the operation type of the first operation of the server on the edge gateway scene carrying the unique identifier, and the business processing instructions corresponding to the operation type of the first operation; performing scene business processing on the edge gateway scene carrying the unique identifier according to the business processing instructions within the cloud scene management service to obtain the target operation instructions.
[0038] In an exemplary embodiment, before obtaining the second operation of the target edge gateway on the edge gateway scene carrying the unique identifier and obtaining the second operation log, the process of how to determine the second operation is described, as follows: Determining the second operation of the target edge gateway on the edge gateway scene carrying the unique identifier includes at least the following steps: obtaining the operation type corresponding to the target operation instruction, and obtaining the scene information of the edge gateway scene carrying the unique identifier based on the operation type corresponding to the target operation instruction; determining a device control instruction based on the scene information and the target operation instruction, and sending the device control instruction and the edge gateway scene carrying the unique identifier to a terminal device, so that the terminal device executes the device control instruction on the edge gateway scene carrying the unique identifier.
[0039] In one embodiment, the target edge gateway includes at least an intelligent device unit, a scenario software development kit and other software development tools: in the target edge gateway, the edge gateway scene carrying the unique identifier is sent to the scenario software development kit through the intelligent device unit; the scenario software development kit is used to obtain the operation type corresponding to the target operation instruction, and based on the operation type corresponding to the target operation instruction, the scenario information of the edge gateway scene carrying the unique identifier is obtained; the device control instruction is determined according to the scenario information and the target operation instruction, and the device control instruction and the edge gateway scene carrying the unique identifier are sent to the terminal device through the other software development kits, so that the terminal device executes the device control instruction on the edge gateway scene carrying the unique identifier.
[0040] In an exemplary embodiment, a method for obtaining scene information of an edge gateway carrying the unique identifier is provided, and the specific steps include: sending the edge gateway scene carrying the unique identifier and the target operation instruction to the target edge gateway to instruct the target edge gateway to obtain the scene information of the edge gateway scene carrying the unique identifier based on the operation type corresponding to the target operation instruction, including: when the operation type corresponding to the target operation instruction includes scene creation or scene editing, obtaining the scene basic information and scene script information corresponding to the edge gateway scene carrying the unique identifier; updating the scene basic information and scene script information according to the target operation instruction to obtain the scene information of the edge gateway scene carrying the unique identifier.
[0041] In an exemplary embodiment, before determining the association relationship between the first operation log and the second operation log according to the unique identifier, further, the first operation log and the second operation log can also be collected in the following manner: when it is determined that the target edge gateway is in an online state, the first operation log and the second operation log are collected in a real-time asynchronous manner; when it is determined that the target edge gateway is in an offline state, if it is monitored that the target edge gateway changes from an offline state to an online state, a third operation on the edge gateway scenario carrying the unique identifier when the target edge gateway is in an offline state is obtained to obtain a third operation log, and the first operation log, the second operation log and the third operation log are collected; a fourth operation log for indicating a failed operation on the edge gateway scenario carrying the unique identifier is determined from the first operation log and the second operation log, and the first operation log, the second operation log and the fourth operation log are collected according to a preset time period.
[0042] In an exemplary embodiment, after determining the association relationship between the first operation log and the second operation log based on the unique identifier, a technical solution for obtaining a query result is provided, which is as follows: responding to a query instruction, querying all operation logs for operations on an edge gateway scenario carrying the unique identifier; generating a query result corresponding to the query instruction based on the association relationship and all the operation logs.
[0043] Further, in one embodiment, after configuring the edge scene in the cloud, all operations such as the creation, opening, execution and triggering of the edge gateway scene are associated, and the operation log obtained by the operation on the edge gateway scene can be synchronized to the edge gateway, and the edge gateway also stores the scene information of the edge gateway scene, such as the scene script, scene configuration, etc. Once the operation of the edge gateway scene is triggered automatically or manually, the corresponding operation log can be uploaded to the cloud, for example, the operation log of the edge scene on the edge gateway is uploaded to the cloud to monitor the process change process of the edge scene, and the operation log is displayed to the user at the same time, so that the user can view the execution record. In addition, developers can troubleshoot, analyze and monitor the operations on different gateways on the cloud, provide efficient and fast problem location and analysis methods, and improve the user experience.
[0044] In order to better understand the process of the method for determining the above-mentioned association relationship, the implementation method flow of determining the above-mentioned association relationship is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0045] Figure 3 is a schematic diagram of the architecture of a method for determining an association relationship according to an embodiment of the present application, such as Figure 3 As shown, the architecture structure of the method for determining the association relationship includes:
[0046] Smart Home APP: Used to display edge gateway scenarios and edge gateway scenario operation logs to users, receive users' operations such as creation, editing, opening, closing, and execution of edge gateway scenarios, and feedback to the cloud scenario management service.
[0047] Cloud scene management service: used to perform edge gateway scene business inspection, scene configuration change processing and other related business processing, and send user operation instructions for edge gateway scenes to the device access gateway. Among them, APPServer and cloud scene management service jointly realize the functions of the above cloud server.
[0048] Device access gateway: used to convert the instructions issued by the cloud scene management service into instructions recognizable by the edge gateway, send them to the edge gateway, and determine the target edge gateway from multiple edge gateways.
[0049] Edge gateway: refers to a gateway with the ability to execute scenarios. It can be used to run edge gateway scenarios and perform device control and log reporting, etc. It consists of SmartDevice (equivalent to the above-mentioned smart device unit), uSDK (equivalent to the above-mentioned other software development kits), and scenario SDK (equivalent to the above-mentioned scenario software development kit).
[0050] Log collection system: specially used to store and display the log information of the above-mentioned cloud scene management services, edge gateways, etc., and can determine the association between the first operation log and the second operation log based on the unique utraceId (equivalent to the above-mentioned unique identifier), that is, the operation logs of each link are globally associated according to the unique utraceId of each link.
[0051] The device, namely the above-mentioned terminal device, is used to execute device control instructions on the edge gateway scene carrying the unique identifier.
[0052] Device APP is used to provide users with an input interface for device control commands.
[0053] Based on the architectural structure of the method for determining the above-mentioned association relationship, full-process log collection of edge scenarios and monitoring of the operation process of edge scenarios through the cloud can be realized. Specifically, by configuring the creation, opening, execution and other operations of the edge gateway scenario on the cloud server (or device), a unique identifier is configured for the edge gateway scenario, and the operations of the cloud server on the edge scenario and the operations of the edge gateway on the edge scenario are connected through the unique identifier. The log information on the cloud server and the edge gateway is continuously monitored through the log collection system. The entire process of edge gateway operation can be monitored based on the log information with a unique identifier, so as to troubleshoot and analyze operational problems that occur in the entire process, quickly locate the problem location, increase the monitoring of the entire process of edge gateway operation, and improve user experience.
[0054] The method for determining the association relationship based on the above architecture may include the following steps:
[0055] When setting a unique identifier for the edge scenario that has been successfully created on the cloud server, perform steps A1 to A9:
[0056] Step A1: The Smart Home APP completes the edge scenario (equivalent to the above-mentioned edge gateway scenario), opens / closes, executes and other operations, and carries the unique utraceId through the header part of the http request;
[0057] Step A2: APPserver forwards the edge scenario request carrying the unique utraceId;
[0058] Step A3: The cloud scenario management service sends an edge scenario request with a unique utraceId;
[0059] Step A4: The device access gateway sends an edge scenario request carrying a unique utraceId;
[0060] Step A5: In the edge gateway (i.e., the target edge gateway), the SmartDevice sends an edge scenario request carrying a unique utraceId;
[0061] Step A6: The scene SDK obtains edge scene information and script information from the cloud, and carries a unique utraceId;
[0062] Step A7: The scene SDK sends a device control request carrying a unique utraceId to the uSDK;
[0063] Step A8: uSDK controls the device and records the unique utraceId;
[0064] Step A9: The scenario SDK reports the log and execution result information carrying the unique utraceId.
[0065] When setting a unique identifier for the edge scenario that has been successfully created on the device APP, perform steps B1 to B3:
[0066] B1: Operate the edge scenario on the edge gateway panel of the device and generate an execution instruction with a unique utraceId;
[0067] Step B2: The scene SDK sends a device control request carrying a unique utraceId to the uSDK;
[0068] Step B3: uSDK implements device control and records the unique utraceId;
[0069] Step B4: The scenario SDK reports the log and execution result information carrying the unique utraceId.
[0070] In this embodiment, a method for determining an association relationship is provided. Figure 4 is a flow chart of a method for determining an association relationship according to an embodiment of the present application, such as Figure 4 As shown, the specific steps are as follows:
[0071] Step 1: Create an edge scenario (i.e. the edge gateway scenario mentioned above), configure on / off, and execute operations;
[0072] Step 2: Send the created edge scenario to the APP Server via http request;
[0073] Step 2.1: Edge scene business logic processing, the APP Server sends the edge scene carrying the unique identifier to the cloud scene management service;
[0074] Step 2.2: The cloud scene management service sends the edge scene to the device access gateway;
[0075] Step 2.2.1: The device access gateway sends the edge scene to the edge gateway, where the edge gateway includes SmartDevice (equivalent to the above-mentioned smart device unit), uSDK (equivalent to the above-mentioned other software development kits), and scene SDK (equivalent to the above-mentioned scene software development kit).
[0076] Step 2.2.2: Return the response;
[0077] Step 2.2.2.1: Return the response;
[0078] Step 2.2.1.1: Local business scenario operation:
[0079] Step 2.2.1.1.1: Determine the command type, for example, a create command or an edit command for a scene;
[0080] Step 2.2.1.1.2: Get scene information and script information;
[0081] Step 2.2.1.1.3: Return scene information and script information;
[0082] Step 2.2.1.1.4: Update scene information and script information;
[0083] Step 2.2.1.1.5: If the instruction execution type, send device control;
[0084] Step 2.2.1.1.5.1: Equipment control;
[0085] Step 2.2.1.1.5.2: The device responds;
[0086] Step 2.2.1.1.6: Device control response;
[0087] Step 2.2.1.1.7: Report edge scenario operation results;
[0088] In one embodiment, in the edge gateway, SmartDevice sends the edge scene to the scene SDK. The scene SDK determines the device control instruction based on the scene information of the edge scene obtained from the cloud and the edge scene request, and sends the device control instruction to the uSDK. The uSDK sends the device control instruction and the edge scene to the device to instruct the device to execute the device control instruction.
[0089] In other embodiments, the user's operation instructions on the operation panel of the edge gateway can also be obtained from the device APP, and the operation instructions can be sent to the scene SDK, so that the operation instructions can be sent to the device through the scene SDK and uSDK to instruct the device to execute the operation instructions.
[0090] Step 2.2.1.1.8: Return the request result;
[0091] Step 2.2.1.1.7: Report and collect logs;
[0092] Step 2.2.1.1.9: Report and collect logs;
[0093] Step 2.2.1.2: Report and collect logs;
[0094] Step 2.2.3: Report and collect logs;
[0095] Step 2.2.2.1.9: Report and collect logs;
[0096] Step 2.2.2.1.9.1: Log consolidation.
[0097] In one embodiment, the scene SDK in the device access gateway sends the result of the device executing the device control instruction and the operation log corresponding to the edge scene to the cloud scene management service.
[0098] In one embodiment, CS: client initiates request, CR: client receives request, SS: server initiates request, SR: server receives request, DI: asynchronous message sending.
[0099] Among them, the management log is reported to the log system via HTTP.
[0100] The local scene log reporting strategy is as follows:
[0101] 1. Real-time asynchronous reporting. Upload the local scene-related operation instructions issued by the cloud to the log system asynchronously in real time.
[0102] 2. Report when the network is restored after being offline. For offline edge scene control, listen to the gateway online notification after the network is restored, and report the gateway edge scene operation log to the cloud.
[0103] 3. Polling reporting: Collect the logs of edge reporting operation failures every 10 minutes and send the operation logs to the log collection system.
[0104] The log reporting format is shown in Table 1:
[0105] Table 1
[0106]
[0107] Figure 5 is a flow chart of log collection and integration according to an embodiment of the present application, such as Figure 5 As shown in the figure, the processing process of the collected logs is as follows:
[0108] Step 1: The developer or manager checks the link log information in the log collection system based on utraceId.
[0109] Step 1.1: The log collection system searches for all log information of the link and returns it to the management system for display;
[0110] Step 1.2: Return the result;
[0111] Step 2: View the log details and perform subsequent analysis based on the returned results.
[0112] Through the above embodiments, developers and managers can associate all different edge scene operations from the entire cloud to the edge gateway for analysis and monitoring based on the unique identifier of the full-link log, utraceId. The edge gateway can expand and manage the edge scene business operations on the edge gateway to the cloud based on the log reporting strategy, and check and analyze the scene operation status and problem troubleshooting on the edge gateway through the cloud.
[0113] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0114] Figure 6 is a structural block diagram of a system for determining an association relationship according to an embodiment of the present application; Figure 6 As shown, including:
[0115] The cloud server 62 is used to create an edge gateway scenario, perform a first operation on the edge gateway scenario carrying a unique identifier, and generate a first operation log;
[0116] It should be noted that the objects for setting a unique identifier for the successfully created edge gateway scenario may also include other execution entities such as devices and device access gateways. This application is not limited to setting a unique identifier for the successfully created edge gateway scenario on the cloud server.
[0117] The target edge gateway 66 is used to perform a second operation on the received edge gateway scenario carrying the unique identifier and generate a second operation log;
[0118] The log collection system 64 is used to set the unique identifier for the edge gateway scenario that has been successfully created on the cloud server, and determine the association relationship between the first operation log and the second operation log according to the unique identifier.
[0119] Through the above system, a unique identifier is set for the edge gateway scene that has been successfully created on the cloud server, and the edge gateway scene carrying the unique identifier is sent to the target edge gateway; the first operation of the cloud server on the edge gateway scene carrying the unique identifier is obtained to obtain a first operation log, and the second operation of the target edge gateway on the edge gateway scene carrying the unique identifier is obtained to obtain a second operation log; the association between the first operation log and the second operation log is determined according to the unique identifier, which solves the problem of how to realize process monitoring of the edge gateway scene in the related technology, and then the process status of the edge gateway scene can be monitored.
[0120] In an exemplary embodiment, the above-mentioned association relationship determination system is also used to send the edge gateway scenario carrying the unique identifier to the target edge gateway, specifically: sending the edge gateway scenario carrying the unique identifier and the target operation instruction to the device access gateway, wherein the target operation instruction is used to represent the operation instructions of the edge gateway scenario carrying the unique identifier corresponding to different business scenarios; obtaining multiple edge gateways corresponding to the device access gateway; determining the target edge gateway from the multiple edge gateways, and sending the edge gateway scenario carrying the unique identifier and the target operation instruction to the target edge gateway through the device access gateway.
[0121] In an exemplary embodiment, before sending the edge gateway scene carrying the unique identifier and the target operation instruction to the device access gateway, the above-mentioned association relationship determination system is also used to send the edge gateway scene carrying the unique identifier to the cloud scene management service to instruct the cloud scene management service to perform the following operations: determine the operation type of the first operation of the server on the edge gateway scene carrying the unique identifier, and the business processing instruction corresponding to the operation type of the first operation; perform scene business processing on the edge gateway scene carrying the unique identifier according to the business processing instruction within the cloud scene management service to obtain the target operation instruction.
[0122] In an exemplary embodiment, before obtaining the second operation of the target edge gateway on the edge gateway scene carrying the unique identifier and obtaining the second operation log, the above-mentioned association relationship determination system is also used to determine that the second operation of the target edge gateway on the edge gateway scene carrying the unique identifier includes at least the following steps: obtaining the operation type corresponding to the target operation instruction, and obtaining the scene information of the edge gateway scene carrying the unique identifier based on the operation type corresponding to the target operation instruction; determining a device control instruction based on the scene information and the target operation instruction, and sending the device control instruction and the edge gateway scene carrying the unique identifier to a terminal device, so that the terminal device executes the device control instruction on the edge gateway scene carrying the unique identifier.
[0123] In one embodiment, the target edge gateway includes at least an intelligent device unit, a scenario software development kit and other software development tools: in the target edge gateway, the edge gateway scene carrying the unique identifier is sent to the scenario software development kit through the intelligent device unit; the scenario software development kit is used to obtain the operation type corresponding to the target operation instruction, and based on the operation type corresponding to the target operation instruction, the scenario information of the edge gateway scene carrying the unique identifier is obtained; the device control instruction is determined according to the scenario information and the target operation instruction, and the device control instruction and the edge gateway scene carrying the unique identifier are sent to the terminal device through the other software development kits, so that the terminal device executes the device control instruction on the edge gateway scene carrying the unique identifier.
[0124] In an exemplary embodiment, the above-mentioned association relationship determination system is also used to send the edge gateway scene carrying the unique identifier and the target operation instruction to the target edge gateway to instruct the target edge gateway to obtain the scene information of the edge gateway scene carrying the unique identifier based on the operation type corresponding to the target operation instruction, including: when the operation type corresponding to the target operation instruction includes scene creation or scene editing, obtaining the scene basic information and scene script information corresponding to the edge gateway scene carrying the unique identifier; updating the scene basic information and scene script information according to the target operation instruction to obtain the scene information of the edge gateway scene carrying the unique identifier.
[0125] In an exemplary embodiment, before determining the association relationship between the first operation log and the second operation log according to the unique identifier, the above-mentioned association relationship determination system is also used to collect the first operation log and the second operation log in the following manner: when it is determined that the target edge gateway is online, the first operation log and the second operation log are collected in a real-time asynchronous manner; when it is determined that the target edge gateway is offline, if it is monitored that the target edge gateway changes from an offline state to an online state, a third operation on the edge gateway scenario carrying the unique identifier when the target edge gateway is offline is obtained to obtain a third operation log, and the first operation log, the second operation log and the third operation log are collected; a fourth operation log for indicating a failed operation on the edge gateway scenario carrying the unique identifier is determined from the first operation log and the second operation log, and the first operation log, the second operation log and the fourth operation log are collected according to a preset time period.
[0126] In an exemplary embodiment, after determining the association relationship between the first operation log and the second operation log based on the unique identifier, the system for determining the association relationship is also used to respond to a query instruction to query all operation logs for operating the edge gateway scenario carrying the unique identifier; and generate a query result corresponding to the query instruction based on the association relationship and all the operation logs.
[0127] In an exemplary embodiment, the log collection system 64 is also used to: determine a first tracking point of the cloud server and a second tracking point of the target edge gateway; monitor the first log information corresponding to the first tracking point through the log collection system, and monitor the second log information corresponding to the second tracking point through the log collection system; wherein the first log information and the second log information both carry the unique identifier; and determine all operation logs of the edge gateway scenario carrying the unique identifier based on the first log information and the second log information.
[0128] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0129] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0130] S1, setting a unique identifier for the edge gateway scene that has been successfully created on the cloud server, and sending the edge gateway scene carrying the unique identifier to the target edge gateway;
[0131] S2, obtaining a first operation of the cloud server on the edge gateway scenario carrying the unique identifier to obtain a first operation log, and obtaining a second operation of the target edge gateway on the edge gateway scenario carrying the unique identifier to obtain a second operation log;
[0132] S3: Determine an association relationship between the first operation log and the second operation log according to the unique identifier.
[0133] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0134] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0135] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0136] S1, setting a unique identifier for the edge gateway scene that has been successfully created on the cloud server, and sending the edge gateway scene carrying the unique identifier to the target edge gateway;
[0137] S2, obtaining a first operation of the cloud server on the edge gateway scenario carrying the unique identifier to obtain a first operation log, and obtaining a second operation of the target edge gateway on the edge gateway scenario carrying the unique identifier to obtain a second operation log;
[0138] S3: Determine an association relationship between the first operation log and the second operation log according to the unique identifier.
[0139] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0140] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0141] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0142] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for determining an association relationship, characterized in that: include: Setting a unique identifier for the edge gateway scene that has been successfully created on the cloud server, and sending the edge gateway scene carrying the unique identifier to the target edge gateway; Obtain a first operation of the cloud server on the edge gateway scenario carrying the unique identifier to obtain a first operation log, and obtain a second operation of the target edge gateway on the edge gateway scenario carrying the unique identifier to obtain a second operation log; Determine an association relationship between the first operation log and the second operation log according to the unique identifier; Sending the edge gateway scene carrying the unique identifier to the target edge gateway includes: Sending the edge gateway scenario and the target operation instruction carrying the unique identifier to the device access gateway, wherein the target operation instruction is used to indicate the operation instructions of the edge gateway scenario carrying the unique identifier corresponding to different business scenarios; Acquire multiple edge gateways corresponding to the device access gateway; A target edge gateway is determined from the multiple edge gateways, and the edge gateway scenario carrying the unique identifier and the target operation instruction are sent to the target edge gateway through the device access gateway.
2. The method for determining an association relationship according to claim 1, characterized in that: Before sending the edge gateway scenario and target operation instruction carrying the unique identifier to the device access gateway, the method further includes: The edge gateway scene carrying the unique identifier is sent to the cloud scene management service to instruct the cloud scene management service to perform the following operations: Determine an operation type of a first operation of the server on an edge gateway scenario carrying the unique identifier, and a business processing instruction corresponding to the operation type of the first operation; In the cloud-based scene management service, scene business processing is performed on the edge gateway scene carrying the unique identifier according to the business processing instruction to obtain the target operation instruction.
3. The method for determining an association relationship according to claim 1, characterized in that: Before obtaining a second operation of the target edge gateway on the edge gateway scenario carrying the unique identifier and obtaining a second operation log, the method further includes: Determining the second operation of the target edge gateway for the edge gateway scenario carrying the unique identifier includes at least the following steps: Obtaining an operation type corresponding to the target operation instruction, and obtaining scene information of an edge gateway scene carrying the unique identifier based on the operation type corresponding to the target operation instruction; A device control instruction is determined according to the scene information and the target operation instruction, and the device control instruction and the edge gateway scene carrying the unique identifier are sent to a terminal device so that the terminal device executes the device control instruction on the edge gateway scene carrying the unique identifier.
4. The method for determining an association relationship according to claim 3, characterized in that: The method further includes: sending the edge gateway scenario carrying the unique identifier and the target operation instruction to the target edge gateway, so as to instruct the target edge gateway to obtain the scenario information of the edge gateway scenario carrying the unique identifier based on the operation type corresponding to the target operation instruction, including: When the operation type corresponding to the target operation instruction includes scene creation or scene editing, obtaining scene basic information and scene script information corresponding to the edge gateway scene carrying the unique identifier; The scene basic information and scene script information are updated according to the target operation instruction to obtain the scene information of the edge gateway scene carrying the unique identifier.
5. The method for determining an association relationship according to claim 1, characterized in that: Before determining the association relationship between the first operation log and the second operation log according to the unique identifier, the method further includes: The first operation log and the second operation log are collected in the following manner: When it is determined that the target edge gateway is online, collecting the first operation log and the second operation log in a real-time asynchronous manner; In the case where it is determined that the target edge gateway is in an offline state, if it is monitored that the target edge gateway changes from an offline state to an online state, a third operation on the edge gateway scene carrying the unique identifier when the target edge gateway is in an offline state is obtained, a third operation log is obtained, and the first operation log, the second operation log, and the third operation log are collected; A fourth operation log representing a failed operation on an edge gateway scenario carrying the unique identifier is determined from the first operation log and the second operation log, and the first operation log, the second operation log, and the fourth operation log are collected according to a preset time period.
6. The method for determining an association relationship according to claim 1, characterized in that: After determining the association relationship between the first operation log and the second operation log according to the unique identifier, the method further includes: In response to the query instruction, query all operation logs of operating the edge gateway scene carrying the unique identifier; Generate a query result corresponding to the query instruction according to the association relationship and all the operation logs.
7. A system for determining an association relationship, characterized in that: include: The cloud server is used to create an edge gateway scenario, perform a first operation on the edge gateway scenario carrying a unique identifier, and generate a first operation log; The target edge gateway is used to perform a second operation on the received edge gateway scenario carrying the unique identifier and generate a second operation log; A log collection system, used to set the unique identifier for the edge gateway scenario that has been successfully created on the cloud server, and determine the association relationship between the first operation log and the second operation log according to the unique identifier; The association relationship determination system is also used to send the edge gateway scenario and the target operation instruction carrying the unique identifier to the device access gateway, wherein the target operation instruction is used to indicate the operation instructions of the edge gateway scenario carrying the unique identifier corresponding to different business scenarios; Acquire multiple edge gateways corresponding to the device access gateway; determine a target edge gateway from the multiple edge gateways, and send the edge gateway scene carrying the unique identifier and the target operation instruction to the target edge gateway through the device access gateway.
8. The system for determining association relationships according to claim 7, characterized in that: The log collection system is also used for: Determine a first embedding point of the cloud server and a second embedding point of the target edge gateway; Monitoring first log information corresponding to the first burial point through a log collection system, and monitoring second log information corresponding to the second burial point through the log collection system; wherein both the first log information and the second log information carry the unique identifier; Based on the first log information and the second log information, all operation logs of the edge gateway scenario carrying the unique identifier are determined.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
Citation Information
Patent Citations
Intelligent terminal control method and device, electronic equipment and storage medium
CN111327497A
Smart home multi-manufacturer equipment cloud scene optimization method and device
CN115016312A
