Long link creation control method and device, service equipment and storage medium
By making connection requirements judgments before the device creates a long link and only creating long links when necessary, the resource waste problem caused by the device automatically establishing long links in the existing technology is solved, and the effect of reducing costs and improving user experience is achieved.
Patent Information
- Application Number
- CN202411422795.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, after the device is started, a long connection is automatically established even if the user does not use the remote control function, resulting in waste of server resources and increased maintenance costs.
Before the device creates a long link, it is determined whether a long link needs to be automatically created by monitoring business events and preset conditions. It is only created when the conditions are met, otherwise it will not be created for the time being.
It effectively reduces the number of unnecessary long connections, reduces cost, and improves the efficiency of system resources and user experience.
Smart Images

Figure CN119276921A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a long link creation control method, device, business equipment and storage medium. Background Art
[0002] With the advancement of IoT technology, more and more devices are connected to the Internet. In order to achieve stable and instant control of devices, it is usually necessary to establish a long connection with the cloud system. However, such a long connection requires a lot of server resources, and accordingly, the maintenance cost of the server will also increase. In fact, some users do not actually use the remote control function of the device, but the device still automatically establishes a long connection, resulting in a waste of resources.
[0003] Therefore, the existing technology still needs to be improved and developed. Summary of the invention
[0004] The technical problem to be solved by the present invention is that, in view of the problems and defects of the above-mentioned prior art, a long link creation control method, device, business equipment and storage medium are provided. The present invention only creates a long connection when needed for user equipment that meets specific conditions, and does not create it for the time being if the conditions are not met; in this way, the number of unnecessary long connections can be effectively reduced, thereby reducing cost.
[0005] The technical solution adopted by the present invention to solve the problem is as follows:
[0006] A long link creation control method, comprising:
[0007] Monitor business events of business equipment;
[0008] Analyze the business event of the business device, and determine whether the business event of the business device is a business event that requires starting a long link according to the preset long link creation condition;
[0009] When it is determined that the service event of the service device is a service event that requires starting a long link, controlling to automatically create a long link for the service event of the service device;
[0010] Continue to monitor the service events of the service device, and when the service events of the service device do not meet the long link creation conditions, control to temporarily disconnect the corresponding long link.
[0011] The long link creation control method, wherein the step of monitoring the service events of the service device includes:
[0012] Pre-set the long link creation conditions of the business device; the long link creation conditions include: whether the device has been started, whether the specified business App has been opened, or whether the account login has been completed in the business corresponding App.
[0013] In the long link creation control method, the step of monitoring the service events of the service device includes:
[0014] Control and monitor whether a specified business event occurs in the business device; the business event includes the log sent during the business logic operation process;
[0015] By detecting the logs sent by the business equipment during the business logic operation process, it is possible to monitor whether the business equipment has a specified business event.
[0016] In the long link creation control method, the step of analyzing the business event of the business device and judging whether the business event of the business device is a business event that requires starting a long link according to the preset long link creation condition further includes:
[0017] The service event of the service device is analyzed, and according to the preset long link creation condition, it is determined whether the service event of the service device is a connection event that requires connection to a remote server.
[0018] In the long link creation control method, when it is determined that the service event of the service device is a service event that requires the initiation of a long link, the step of controlling the automatic creation of a long link for the service event of the service device comprises:
[0019] When it is determined that the service event of the service device is a service event that requires starting a long link, the service device is recorded as a state in which a long link can be created; and a long link is automatically created for the service event of the service device;
[0020] When it is determined that the service event of the service device is not a service event that requires starting a long link, the service device is configured to be unable to create a long link, and the conclusion is stored.
[0021] In the long link creation control method, when it is determined that the service event of the service device is a service event that requires the initiation of a long link, the step of controlling the automatic creation of a long link for the service event of the service device comprises:
[0022] When it is determined that the service event of the service device is a service event that requires starting a long link, a request to start a long link is sent, and control is performed to automatically create a long link for the service event of the service device.
[0023] The long link creation control method, wherein the step of continuing to monitor the service events of the service device and controlling to temporarily disconnect the corresponding created long link when the service events of the service device do not meet the long link creation conditions comprises:
[0024] Continue to monitor business events of business equipment;
[0025] When a business event of a corresponding APP account logging out is detected during the specified time period of the long link creation, it is determined that the business event of the business device does not meet the long link creation conditions, and the corresponding long link is temporarily disconnected;
[0026] If, during the specified time period created by the long link, it is detected that the corresponding APP account has not logged out and the corresponding APP is only temporarily logged out, there is no need to disconnect the current long link.
[0027] A long link creation control device, wherein the device comprises:
[0028] A pre-setting module is used to pre-set the long link creation conditions of the business device; the long link creation conditions include: whether the device has been started, whether the specified business app has been opened, or whether the account login has been completed in the business corresponding app;
[0029] A monitoring module, used to monitor business events of business equipment;
[0030] A judgment module, used to analyze the business event of the business device and judge whether the business event of the business device is a business event that requires starting a long link according to a preset long link creation condition;
[0031] A control module, configured to control automatic creation of a long link for the business event of the business device when determining that the business event of the business device is a business event that requires starting a long link;
[0032] The long link disconnection module is used to continue monitoring the service events of the service device, and when the service events of the service device do not meet the long link creation conditions, control to temporarily disconnect the corresponding long link.
[0033] A service device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to execute any one of the methods described above.
[0034] A computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the methods described above.
[0035] Beneficial effects of the present invention: The present invention provides a long link creation control method, device, business equipment and storage medium. The present invention adds a connection demand judgment before the device creates a long link to judge whether it is necessary to automatically create a long link. The long link is created only when necessary, which can effectively reduce the number of unnecessary long connections and thus reduce cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 It is a flowchart of a long link creation control method provided by an embodiment of the present invention.
[0038] Figure 2 It is a flow chart of the long link creation control method provided in Example 2 of the present invention.
[0039] Figure 3 It is a flowchart of a long link inquiry creation process initiated by a business device of the long link creation control method provided in Embodiment 2 of the present invention.
[0040] Figure 4 It is a principle block diagram of an embodiment of a long link creation control device provided by the present invention.
[0041] Figure 5 It is a block diagram of the internal structure principle of the service device provided by the embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0043] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0044] After the business equipment of the prior art is started, a long link will be automatically created regardless of whether the user uses the connection function, resulting in a large number of useless long links on the cloud server, increasing cost.
[0045] The present invention adds a control system before the device creates a long link, and controls whether the device needs to automatically create a long link through the system, thereby reducing the creation of unnecessary long links and reducing cost.
[0046] like Figure 1As shown, a long link creation control method of embodiment 1 of the present invention includes the following steps:
[0047] Step S100, pre-set the long link creation conditions of the business device; the long link creation conditions include: whether the device has been started, whether the specified business App has been opened, or whether the account login has been completed in the business corresponding App.
[0048] The specific application scenario in the embodiment of the present invention is that when the smart terminal opens a designated APP application, the APP application enters the login account and password, and needs to communicate with the remote service, a long link needs to be started. When the designated APP application of the smart terminal enters the login account and password, completes the corresponding operation after logging in, and exits the designated APP application, the present invention will control the temporary disconnection of the long link, which can avoid excessive resource occupation, thereby reducing cost.
[0049] The long connection in the embodiment of the present invention refers to the technology of maintaining a persistent connection between a device and a server. In the specific implementation of the present invention, it is necessary to pre-set the long connection creation conditions of the business device; pre-setting the long connection creation conditions of the device is an important step to ensure efficient operation of the system and user experience.
[0050] The long link creation conditions include: whether the device has been started, whether the specified service app has been opened, or whether the account login has been completed in the service corresponding app.
[0051] Regarding whether the device has been started, the service device of the present invention will record the status of the device. By checking whether the device has a history of being started, it can be determined whether a new long link needs to be established. For example, if the device has been started and connected to the network before, the system can directly reuse the existing connection without repeatedly establishing a new link, thereby saving time and resources.
[0052] The present invention also checks whether the specified business app has been opened: Opening a specific business application (App) on the device is another condition for determining the creation of a long link. When a user actively uses a business app, the system automatically determines whether the app has been opened by the user. If it has been opened, the system can directly connect to the server based on the status of the last session, thereby reducing connection delays and data transmission time.
[0053] Regarding whether the account login is completed in the business corresponding App, the account login status of the embodiment of the present invention is a condition closely related to the security of user data. Only after the user completes the account login can the application access the relevant services safely and effectively. Therefore, the system needs to check whether the user has logged in in the specified business App to determine whether a persistent long link can be created. When the user is not logged in, the system will prevent the creation of a long link to ensure the security of user data.
[0054] In this step, by pre-judging the device status and application status, the connection efficiency of the system can be significantly improved and the user waiting time can be shortened. The establishment and maintenance of long links consume bandwidth and power, and the preset conditions help avoid unnecessary waste of resources. Users do not need to log in or wait for connections repeatedly, and the above conditions ensure that their user experience is smoother. In addition, the present invention can reduce the risk of unauthorized access and provide protection for user information security by checking the account login status.
[0055] It can be seen that in this step, pre-setting the creation conditions of long links can give full play to the interaction efficiency between devices and services, achieve optimal allocation of resources, ensure the security of user data, and provide end users with a seamless user experience.
[0056] Step S200, monitoring service events of service equipment;
[0057] The present invention controls and monitors whether a specified business event occurs in a business device; the business event includes a log sent during a business logic operation process; and by detecting the log sent by the business device during the business logic operation process, it monitors whether a specified business event occurs in the business device.
[0058] The business events in the embodiments of the present invention actually refer to the logs sent during the business logic operation process. For example, during the app startup process, application startup logs and user login logs will be sent, which basically correspond to the creation conditions. For example, if there is a user login log, it can be determined that the user has logged in.
[0059] In this step, in the embodiment, business events are first defined. Business events refer to important state changes or operation results generated by devices or systems during the operation of specific business logic. These events can be user operations, system state changes, data transmission, error occurrence, etc. In order to effectively monitor, it is first necessary to clarify which events need to be paid attention to, such as device startup, successful data upload, user login, device failure, etc.
[0060] Executed through the logging mechanism, specifically in the process of business logic operation of the present invention, the device needs to record relevant log information in real time. These logs usually include timestamps, event types, event descriptions and related data, etc. By setting up a suitable logging mechanism, it can be ensured that the occurrence of each business event is accurately recorded.
[0061] In the present invention, these logs are scanned and analyzed periodically or in real time to find specific business events. Automated tools and algorithms can be used to process log data and identify events that meet the conditions.
[0062] In the present invention, once a specified business event is monitored, corresponding measures can be taken according to a preset response mechanism.
[0063] It can be seen that the present invention can monitor the status of equipment in real time and find potential problems in time by monitoring business events. Once a specified business event occurs, the system can take action quickly to reduce the impact of the failure on the business.
[0064] Step S300: Analyze the service event of the service device, and determine whether the service event of the service device is a service event that requires starting a long link according to a preset long link creation condition;
[0065] In the embodiment of the present invention, analyzing business events and making judgments based on preset long link creation conditions is an important step to ensure efficient and timely operation of the system. The core of this step is to identify which specific events trigger the establishment of long links, so as to facilitate persistent and stable communication between devices and services.
[0066] Specifically, in the embodiment of the present invention, during the operation of the service device, all important events related to the device need to be captured and recorded. These events may include the receipt of user instructions, changes in device status, triggering of fault alarms, execution of scheduled tasks, etc. Each event should include the corresponding timestamp, event type, event description, and context information of its impact when recorded.
[0067] Regarding the preset long link creation conditions: specifically, a series of pre-set rules to indicate which business events should start long links. These rules can be planned based on dimensions such as event type, frequency of occurrence, importance, and impact on business decisions. For example, whether the device has been started, whether the user has opened a specific business app, or whether the user has completed account login in the business corresponding app, etc., are the creation conditions for starting long links.
[0068] In an embodiment of the present invention, once business events are captured and recorded, the system will automatically analyze these events to determine whether they meet the conditions for creating a long link. This process may use a data-driven algorithm or a rule-based judgment mechanism to quickly identify events that meet the startup conditions. For example, when it is detected that the device enters a fault state, the system will immediately identify the event as an event that "requires the initiation of a long link." For another example, when it is detected that a user has opened a game application using a smart phone and logged into a game account, the embodiment of the present invention will determine that the game business event of the current business device is a business event that requires the initiation of a long link.
[0069] For example, when a company launched a smart security camera that allows users to view video streams and receive abnormal alerts in real time through a mobile app, the company's system implemented business event analysis and long-link initiation rules to best and efficiently manage the interaction between the device and the service.
[0070] Capture and record of business events: The camera will record various events in real time, such as "motion detected", "video stream start / stop", "abnormal access attempt", etc.
[0071] The preset long link creation conditions may be: The conditions are pre-defined: only when a "motion detected" or "abnormal access attempt" event occurs, the system will start a long link to support higher frequency real-time data communication.
[0072] The business event analysis can be as follows: once the camera detects the "motion detected" event, the system will analyze the event and confirm that it meets the conditions for starting a long link. At this time, the system will automatically determine to start a long link so that users can view the video stream involved in the event in real time.
[0073] Regarding the specific decision execution: In the context of the "motion detected" event, the present invention will quickly establish a long link. The user's mobile app immediately receives the connection request and transmits the video stream to the user's view in real time. At the same time, the present invention can also monitor the stability of the connection in the background to ensure that there is no delay at the critical moment.
[0074] Through this analysis and response mechanism, smart security cameras can provide a fast and stable data channel when critical events occur, improving security and user satisfaction.
[0075] The benefit of this step is that by quickly analyzing business events, it is possible to decide in time when to start a long link, ensuring faster interaction between devices and services. When long links are started only for necessary business events, resource consumption can be effectively reduced, and unnecessary network traffic and power consumption can be avoided. In addition, long links can maintain a persistent connection state, improve data transmission efficiency, and reduce instability caused by frequent disconnections. Moreover, when users need to obtain device status or control instructions immediately, they can get a faster response through long links, improving the overall user experience.
[0076] It can be seen from the above that the present invention can not only significantly improve the response speed and stability of the system by performing a detailed analysis of the business events of the business equipment and determining whether they meet the conditions for starting a long link, but also effectively optimize the use of resources, enhance user experience, and provide strong support for business development.
[0077] In a further embodiment of the present invention, it also includes: analyzing the business events of the business device, and judging whether the business events of the business device are connection events that require connection to a remote server according to the preset long link creation conditions. For example, if a business device is a smart phone, it is detected and judged whether a certain APP application installed on the smart phone needs to be connected to a remote server when it is opened, so as to judge the long link creation conditions. For example, when a user enters an account to log in to an online banking APP on a smart phone, it is necessary to connect to a remote server to operate the online banking, and this business event is regarded as a long link creation condition.
[0078] Step S400: When it is determined that the service event of the service device is a service event that requires starting a long link, automatically creating a long link for the service event of the service device;
[0079] In the embodiment of the present invention, business events are continuously monitored. Once the system identifies a specific event that meets the preset conditions for starting a long link (such as "a game APP of a business device logs in to a user account and starts", "abnormal access attempt" or "high-frequency video stream access"), the creation process of the long link will be triggered. This process requires extremely fast and accurate response to ensure that user needs are met in a timely manner.
[0080] In the embodiment of the present invention, the process of creating a long link is as follows:
[0081] Connection preparation: First, the business device prepares to establish a long connection through a specific network protocol (such as WebSocket or TCP). This stage verifies the network status of the device to ensure that it can establish a persistent connection with the server.
[0082] Then, identity authentication is performed: the service device in the present invention sends the initial identity authentication information (such as an API key or token) to the server to ensure that only authorized devices can create a long link. At this time, if the authentication is successful, the server returns a confirmation message, allowing the device to establish a long link.
[0083] Connection establishment: After authentication, the device will send a request to create a long link. Once the server accepts and responds to the connection request, the two parties will complete the handshake process and establish a stable data channel.
[0084] Continuous monitoring: Once the long link of the present invention is established, the device will continuously monitor the connection status, and will control the long link to continue to maintain as long as there is a need for communication to prevent accidental disconnection. At the same time, the system will regularly send heartbeat packets to keep the connection alive.
[0085] Data synchronization and real-time interaction: Once a long link is established in the embodiment of the present invention, the device will be able to send data updates or receive instructions in real time. For example, a smart camera can upload the detected motion information to the server in a timely manner, and the user can obtain video push and alarm information in real time through the application for real-time monitoring and control.
[0086] For example, when a smart home security application, its core attack is to control the smart door lock, it can remotely unlock and monitor the door status through a mobile phone application.
[0087] About event identification and triggering: When a user tries to unlock the door lock through the application, the system detects the business event of "trying to unlock" and determines that the event is a business event that requires the initiation of a long link.
[0088] Then proceed with the long link creation process:
[0089] Connection preparation: The smart door lock checks its Wi-Fi connection status to confirm that it can access the Internet.
[0090] Authentication: The door lock sends the user's identity information (for example, the user's account ID and token) to the server for verification.
[0091] Connection establishment: After verification, the smart door lock initiates a long link request, and the server establishes a long-term data interaction channel after confirmation.
[0092] Data synchronization and real-time interaction: Through long links, door lock status information will be updated in real time. Users can see the open and closed status of the door lock in the mobile app, and can also receive door lock alarm information in real time, such as detected illegal unlocking attempts.
[0093] In the embodiment of the present invention, during operation, if the long link is disconnected due to a network failure, the door lock system will automatically try to reconnect and maintain timely data transmission to ensure that the user can control the door lock at any time.
[0094] The benefit of the present invention is that long links enable devices to receive and send data instantly, support real-time monitoring, alarm and control, and greatly improve the timeliness of user interaction. Compared with frequent re-establishment of connections, long links can significantly reduce the consumption of network resources, thereby reducing bandwidth usage and battery consumption. Long links improve the stability of network communications, reduce errors and delays, and provide a reliable data channel for critical applications (such as security monitoring).
[0095] As can be seen from the above, the present invention not only optimizes the data transmission efficiency and ensures the user's rapid response, but also greatly improves the user experience and the intelligence level of the device by judging the real-time events of the business device and controlling it to automatically create a long link.
[0096] In the embodiment of the present invention, when it is determined that the service event of the service device is a service event that requires starting a long link, a request to start a long link is sent, and control is performed to automatically create a long link for the service event of the service device.
[0097] In a further embodiment, the step S400 specifically includes:
[0098] S401, when it is determined that the service event of the service device is a service event that requires starting a long link, the service device is recorded as a state in which a long link can be created; and a long link is automatically created for the service event of the service device;
[0099] That is, in the embodiment of the present invention, first, the business event triggered by the business device is monitored to determine whether the event belongs to the category that requires the initiation of a long link. For example, if the device needs to frequently exchange data or maintain real-time communication, it can be considered that this is a business event that requires the initiation of a long link.
[0100] In the embodiment of the present invention, if it is indeed a business event that requires starting a long link, the business device will be marked as "can create a long link state". This means that the network connection of the device will be prepared to be maintained for a long time, avoiding the overhead caused by frequent establishment and disconnection of connections.
[0101] After determining that a device can create a long link, the present invention will automatically establish a long link for the device. Compared with a short link, a long link can reduce handshake delay and improve data transmission efficiency.
[0102] S402: When it is determined that the service event of the service device is not a service event that requires starting a long link, the service device is configured to be unable to create a long link, and the conclusion is stored.
[0103] In an embodiment of the present invention, when the monitoring system finds that a service event of a service device is not an event that requires initiating a long link, for example, the device only needs to send a small amount of data occasionally, in this case, the present invention will configure the device to not be able to create a long link.
[0104] In the embodiment of the present invention, this decision is recorded and the device is marked as not being able to create a long link, so as to reduce resource waste and optimize the network management of the device. In this way, it is possible to avoid establishing a long link when it is not necessary, thereby saving bandwidth and server resources.
[0105] For example, when a smart home company launches a smart door lock, the smart door lock is controlled by the user's mobile phone terminal corresponding to the door lock APP, which controls the smart door lock to receive user instructions (such as unlocking and locking). Therefore, in this case, the business event of the smart door lock controlled by the user account logged in by the mobile phone terminal corresponding to the door lock APP should be identified as requiring the initiation of a long link. According to step S401, the business event of the smart door lock controlled by the user account logged in by the mobile phone terminal corresponding to the door lock APP is marked as "can create a long link state", and a long link is automatically established with the server.
[0106] Meanwhile, if the user's mobile phone terminal downloads files through a browser, only a temporary connection is needed for downloading, and the system will configure it to not create a long link through step S402, thereby saving battery and network resources.
[0107] The benefit of this step is that by dynamically creating or closing long links, network resources and computing power can be saved, and unnecessary connection waste can be avoided. The use of long links can significantly reduce the delay in connection establishment, which is particularly important for applications that require real-time data transmission. And for battery-powered devices, frequent establishment and closing of connections will result in additional energy consumption, and the long link method can effectively reduce power consumption, thereby extending the life cycle of the device. This method of the present invention enables the system to flexibly adjust the connection strategy according to actual conditions to adapt to different business needs.
[0108] It can be seen that the present invention can not only respond to user instructions in a timely manner through such dynamic management, but also reduce power consumption when it is not frequently used, thereby ensuring long standby time and normal operation.
[0109] Step S500: Continue to monitor the service events of the service device. When the service events of the service device do not meet the long link creation condition, control to temporarily disconnect the corresponding long link.
[0110] In this step embodiment, the service events of the service device will continue to be monitored to ensure the validity and necessity of the long link. When the monitored service event no longer meets the conditions for creating a long link, the present invention will automatically control to temporarily disconnect the corresponding long link. This process is very important in a dynamic network environment, especially in a frequently changing business scenario, and can effectively manage network resources.
[0111] In specific implementation, the present invention continuously observes and analyzes the operation of service devices, especially the various service events triggered by these devices, which means that monitoring is not a one-time operation, but a continuous process, which can capture the changes of device status and behavior in real time.
[0112] When business events are detected, the present invention checks whether these events meet the previously set long link creation conditions. For example, it may be judged based on parameters such as the frequency of event occurrence, the size of data transmission, and the response time.
[0113] In the embodiment of the present invention, if the monitoring result shows that the service event of the service device no longer meets the conditions for creating a long link, the currently established long link will be disconnected. Such disconnection is "temporary", which means that if the future event meets the conditions again, the system can re-create the long link.
[0114] That is, in the embodiment of the present invention, when the creation condition of the long link changes from a satisfied state to an unsatisfied state, the long connection is disconnected and the creation is canceled. For example, if the conditions have been met before, but the user logs out of the account, in this case, the state of not meeting the creation condition is changed again, and the connection will be disconnected at this time. If the user just exits the app and does not use it temporarily, there is no need to disconnect the connection.
[0115] The advantages of the present invention are:
[0116] 1) It can effectively save resources: By promptly disconnecting long links that are no longer needed, it can significantly save network bandwidth and server resources and avoid waste of resources.
[0117] 2) Improve connection efficiency: Dynamically manage the establishment and disconnection of long links to ensure network connection efficiency. When a device does not need to maintain a connection for a long time, disconnecting can reduce network congestion and improve the communication quality of other devices.
[0118] 3) Optimize performance: For battery-powered devices, maintaining a long connection means continuous consumption of power. By temporarily disconnecting the long connection, the power consumption of the device can be reduced, helping to extend the battery life of the device.
[0119] 4) It can reduce the risk of failure: Maintaining a connection for a long time may lead to resource leakage or other potential failures. By disconnecting regularly, this risk can be reduced and the stability of the system can be maintained.
[0120] In a further embodiment, the step S500 specifically includes:
[0121] S501, continue to monitor the business events of the business equipment;
[0122] In this step, the present invention will always keep monitoring the business equipment, and any activities and events related to the equipment (such as uploading data, receiving instructions, etc.) will be tracked in real time. The purpose of monitoring is to ensure that the system can respond to business needs and environmental changes in a timely manner, so as to effectively manage the connection status of the equipment.
[0123] S502: When a business event of a corresponding APP application account logging out is detected during the specified time period of the long link creation, it is determined that the business event of the business device does not meet the long link creation condition, and the corresponding long link is temporarily disconnected;
[0124] If the present invention detects that the application (APP) account corresponding to the business device has been logged out within the specified time period of the long link creation, the present invention will evaluate this situation. At this time, according to the conditions set in the early stage, it will be determined that the business event no longer meets the conditions for creating a long link, so the control system will temporarily disconnect the corresponding long link.
[0125] In the embodiment of the present invention, the account logout of the designated application of the business device means that the user terminates the session with the application, which means that the continuous connection between the device and the server may not be needed temporarily. This helps the system decide when to safely interrupt the long connection to save bandwidth and resources.
[0126] S503: When, during the specified time period created by the long link, it is detected that the account of the corresponding APP application has not been logged out and the corresponding APP application has only been temporarily logged out, there is no need to disconnect the current long link.
[0127] This step is used to determine the business event of temporary account logout: Compared with the previous step, if the account is not logged out during the specified time period of the long link creation, but only the application is temporarily logged out, this usually means that the user may log in again later. In this case, the present invention determines that it is not necessary to disconnect the long link at present, because the user may resume the activity at any time. The system will maintain the long link in this case to ensure the connection stability and response speed when the user uses the device again.
[0128] The benefit of this step is that by monitoring and judging the account status, the present invention can effectively manage long links and ensure that the connection is maintained only when it is really needed. This helps save network bandwidth, server resources and device battery. And timely judgment of changes in account status can ensure that when users return to the application, they can quickly obtain real-time data without reconnecting to the server, thereby improving user experience. In addition, the present invention can adjust the connection strategy in real time according to user behavior, increase flexibility and adaptability. It can respond to user usage patterns in a timely manner and adapt to different operational requirements. In addition, the present invention can also reduce the risk of failure: because long-term long links may cause unnecessary resource consumption and potential failure risks. Dynamically disconnecting long links can reduce the risk of overall system failure and maintain a healthy state of data transmission.
[0129] For example, if there is a smart home control app that allows users to control home devices such as lighting and temperature in real time, users may frequently enter and exit the app during daily use.
[0130] Scenario S502: When the user chooses to log out after using the smart home app at night, the system detects this event and promptly determines that the long link is no longer needed. It is determined that the service event of the service device does not meet the long link creation conditions, and the corresponding long link is temporarily disconnected. At this time, the battery life is also extended by saving network resources.
[0131] Scenario S503: If the user temporarily returns to the main interface of the mobile phone while using the smart home APP, but does not log out, the system detects this behavior and decides to maintain the long connection. For example, the user is using the application to control the temperature, but just leaves the APP to browse other information. Since the user is still logged in, the implementation of the present invention chooses to maintain the long connection status in this case, so that when the user returns to the APP again after a few minutes, the operation can be seamlessly connected, and the lighting and temperature settings can be kept in real time.
[0132] It can be seen that, through this intelligent monitoring mechanism, the smart home system of the present invention can ensure both the effective use of resources and the improvement of user experience, presenting a good balance.
[0133] The present invention is further described in detail below through specific application examples;
[0134] In this specific application embodiment, after the device of the prior art is started, a long link will be automatically created regardless of whether the user uses this function, resulting in a large number of useless long links on the cloud server, increasing cost.
[0135] In a specific application embodiment of the present invention, before a device creates a long link, a control system is added to control whether the device needs to automatically create a long link, thereby reducing the creation of unnecessary long links and reducing cost.
[0136] like Figure 2 As shown, a long link creation control method provided in the second embodiment includes the following steps:
[0137] Step S10, start, and proceed to step S11;
[0138] Step S11, enter the long link creation conditions of the business device, and proceed to step S12;
[0139] In the embodiment of the present invention, the conditions for creating a long link of a device of a specific service can be pre-entered in the system (such as whether the device has been started, whether the user has opened a specific service App, or whether the user has completed account login in the service corresponding App).
[0140] Step S12: The business system monitors a specific event and proceeds to step S13;
[0141] Step S13, sending the monitoring event to the control system, and proceeding to step S14;
[0142] Step S14, the control system determines whether the creation condition is met, if it is met, it proceeds to step S15, if it is not met, it responds to step S12;
[0143] Step S15, record the device as being in a state where a long link can be created, and proceed to step S16;
[0144] Step S16, end.
[0145] In the embodiment of the present invention, when the business device or system detects that a specific situation has occurred, the relevant log is sent to the system. The system records the log and determines whether the condition is met. If the condition is met, the device is configured to create a long link. Otherwise, the device is configured not to create a long link and the conclusion is stored.
[0146] Further implementation such as Figure 3 As shown,
[0147] Step S20: The service device is started, and the process proceeds to step S21;
[0148] Step S21, inquiring whether the control system of the present invention can create a long link, if yes, proceeding to step S22, if no, proceeding to step S23;
[0149] Step S22, start creating a long link and proceed to step S23;
[0150] Step S23, end.
[0151] In this transmission and absorption embodiment, when the business device is started, the interface of the control system of the present invention is accessed, the system obtains the stored conclusion, and returns the result to the device, and the device decides whether to create a long link based on this result.
[0152] It can be seen that the present invention proposes a persistent connection control system based on system policy judgment. The system only creates persistent connections for user devices that meet specific conditions, and does not create them for those that do not meet the conditions. In this way, the number of unnecessary persistent connections can be effectively reduced, thereby reducing cost.
[0153] Exemplary Devices
[0154] like Figure 4 As shown, an embodiment of the present invention provides a long link creation control device, the device comprising:
[0155] The presetting module 310 is used to pre-set the long link creation conditions of the business device; the long link creation conditions include: whether the device has been started, whether the specified business App has been opened, or whether the account login has been completed in the business corresponding App;
[0156] A monitoring module 320, used to monitor service events of service devices;
[0157] The judgment module 330 is used to analyze the business event of the business device and judge whether the business event of the business device is a business event that requires starting a long link according to the preset long link creation condition;
[0158] The control module 340 is used for automatically creating a long link for the business event of the business device when it is determined that the business event of the business device is a business event that requires starting a long link;
[0159] The long link disconnection module 350 is used to continue monitoring the service events of the service device, and when the service events of the service device do not meet the long link creation conditions, control to temporarily disconnect the corresponding long link created, as described above.
[0160] Based on the above embodiments, the present invention further provides a service device, whose principle block diagram can be shown as follows: Figure 5As shown. The business device includes a processor, a memory, a network interface, a display screen, and a database connected via a system bus. Among them, the processor of the business device is used to provide computing and control capabilities. The memory of the business device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the business device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a long link creation control method is implemented. The database of the business device is used to store a long link creation control program.
[0161] Those skilled in the art will understand that Figure 5 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the business equipment to which the scheme of the present invention is applied. The specific business equipment may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0162] In one embodiment, a service device is provided, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:
[0163] Monitor business events of business equipment;
[0164] Analyze the business event of the business device, and determine whether the business event of the business device is a business event that requires starting a long link according to the preset long link creation condition;
[0165] When it is determined that the service event of the service device is a service event that requires starting a long link, controlling to automatically create a long link for the service event of the service device;
[0166] Continue to monitor the service events of the service device. When the service events of the service device do not meet the long link creation condition, control to temporarily disconnect the corresponding long link created, as described above.
[0167] The step of monitoring the service events of the service device includes:
[0168] Pre-set the long link creation conditions of the business device; the long link creation conditions include: whether the device has been started, whether the specified business App has been opened, or whether the account login has been completed in the business corresponding App.
[0169] The step of monitoring the service events of the service equipment includes:
[0170] Control and monitor whether a specified business event occurs in the business device; the business event includes the log sent during the business logic operation process;
[0171] By detecting the logs sent by the business equipment during the business logic operation process, it is possible to monitor whether the business equipment has a specified business event.
[0172] The step of analyzing the service event of the service device and judging whether the service event of the service device is a service event that requires starting a long link according to the preset long link creation condition further includes:
[0173] The service event of the service device is analyzed, and according to the preset long link creation condition, it is determined whether the service event of the service device is a connection event that requires connection to a remote server.
[0174] Wherein, when it is determined that the service event of the service device is a service event that requires starting a long link, the step of controlling to automatically create a long link for the service event of the service device includes:
[0175] When it is determined that the service event of the service device is a service event that requires starting a long link, the service device is recorded as a state in which a long link can be created; and a long link is automatically created for the service event of the service device;
[0176] When it is determined that the service event of the service device is not a service event that requires starting a long link, the service device is configured to be unable to create a long link, and the conclusion is stored.
[0177] Wherein, when it is determined that the service event of the service device is a service event that requires starting a long link, the step of controlling to automatically create a long link for the service event of the service device includes:
[0178] When it is determined that the service event of the service device is a service event that requires starting a long link, a request to start a long link is sent, and control is performed to automatically create a long link for the service event of the service device.
[0179] The step of continuing to monitor the service events of the service device and controlling to temporarily disconnect the corresponding created long link when the service events of the service device do not meet the long link creation condition comprises:
[0180] Continue to monitor business events of business equipment;
[0181] When a business event of a corresponding APP account logging out is detected during the specified time period of the long link creation, it is determined that the business event of the business device does not meet the long link creation conditions, and the corresponding long link is temporarily disconnected;
[0182] When during the specified time period created by the long link, it is detected that the account of the corresponding APP application has not logged out and the corresponding APP application has only been temporarily logged out, there is no need to disconnect the current long link, as described above.
[0183] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0184] In summary, the present invention provides a long link creation control method, device, business equipment and storage medium. The present invention adds a connection requirement judgment before the device creates a long link to determine whether it is necessary to automatically create a long link. The long link is created only when necessary, which can effectively reduce the number of unnecessary long connections and thus reduce cost.
Claims
1. A long link creation control method, characterized in that: include: Monitor business events of business equipment; Analyze the business event of the business device, and determine whether the business event of the business device is a business event that requires starting a long link according to the preset long link creation condition; When it is determined that the service event of the service device is a service event that requires starting a long link, controlling to automatically create a long link for the service event of the service device; Continue to monitor the service events of the service device, and when the service events of the service device do not meet the long link creation conditions, control to temporarily disconnect the corresponding long link.
2. The long link creation control method according to claim 1, characterized in that: The step of monitoring the service events of the service device includes: Pre-set the long link creation conditions of the business device; the long link creation conditions include: whether the device has been started, whether the specified business App has been opened, or whether the account login has been completed in the business corresponding App.
3. The long link creation control method according to claim 1, characterized in that: The step of monitoring the service events of the service device comprises: Control and monitor whether a specified business event occurs in the business device; the business event includes the log sent during the business logic operation process; By detecting the logs sent by the business equipment during the business logic operation process, it is possible to monitor whether the business equipment has a specified business event.
4. The long link creation control method according to claim 1, characterized in that: The step of analyzing the service event of the service device and judging whether the service event of the service device is a service event that requires starting a long link according to the preset long link creation condition further includes: The service event of the service device is analyzed, and according to the preset long link creation condition, it is determined whether the service event of the service device is a connection event that requires connection to a remote server.
5. The long link creation control method according to claim 1, characterized in that: When it is determined that the service event of the service device is a service event that requires starting a long link, the step of controlling to automatically create a long link for the service event of the service device comprises: When it is determined that the service event of the service device is a service event that requires starting a long link, the service device is recorded as a state in which a long link can be created; and a long link is automatically created for the service event of the service device; When it is determined that the service event of the service device is not a service event that requires starting a long link, the service device is configured to be unable to create a long link, and the conclusion is stored.
6. The long link creation control method according to claim 1, characterized in that: When it is determined that the service event of the service device is a service event that requires starting a long link, the step of controlling to automatically create a long link for the service event of the service device comprises: When it is determined that the service event of the service device is a service event that requires starting a long link, a request to start a long link is sent, and control is performed to automatically create a long link for the service event of the service device.
7. The long link creation control method according to claim 1, characterized in that: The step of continuing to monitor the service events of the service device and controlling to temporarily disconnect the corresponding created long link when the service events of the service device do not meet the long link creation condition comprises: Continue to monitor business events of business equipment; When a business event of a corresponding APP account logging out is detected during the specified time period of the long link creation, it is determined that the business event of the business device does not meet the long link creation conditions, and the corresponding long link is temporarily disconnected; If, during the specified time period created by the long link, it is detected that the corresponding APP account has not logged out and the corresponding APP is only temporarily logged out, there is no need to disconnect the current long link.
8. A long link creation control device, characterized in that: The device comprises: A pre-setting module is used to pre-set the long link creation conditions of the business device; the long link creation conditions include: whether the device has been started, whether the specified business app has been opened, or whether the account login has been completed in the business corresponding app; A monitoring module, used to monitor business events of business equipment; A judgment module, used to analyze the business event of the business device and judge whether the business event of the business device is a business event that requires starting a long link according to a preset long link creation condition; A control module, configured to control automatic creation of a long link for the business event of the business device when determining that the business event of the business device is a business event that requires starting a long link; The long link disconnection module is used to continue monitoring the service events of the service device, and when the service events of the service device do not meet the long link creation conditions, control to temporarily disconnect the corresponding long link.
9. A service device, characterized in that: The device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include being used to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as described in any one of claims 1 to 7.