A data traffic management method, an electronic device, and a storage medium
By receiving function activation requests on the cloud server, determining and distributing the remaining resources, it enables refined and dynamic traffic management of IoT devices, solving the problems of easy tampering in local control and the coarseness of cloud control, and improving system security and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN MAMMOTION INNOVATION CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, data traffic management for IoT devices suffers from problems such as easy tampering of local controls, rigid policy adjustments, and cloud server control leading to excessive consumption of local functions and service interruptions due to coarse granularity.
By receiving device function activation requests on the cloud server, determining and distributing the remaining available resources, fine-grained and dynamic management of target functions can be achieved. This includes performing shutdown or degradation operations when resource consumption reaches a threshold, and accumulating resource consumption in real time on the device to ensure the continuity of core functions.
It enhances system security and the flexibility of policy adjustments, enables precise isolation and control of resource usage, and ensures the continuity of core equipment services and user experience.
Smart Images

Figure CN122293585A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication management technology, specifically to a data traffic management method, electronic device, and storage medium. Background Technology
[0002] In the field of data traffic management for existing IoT devices (such as smart lawnmowers), there are two main types of technical solutions. The first type is a device-based local traffic limiting solution. This solution embeds traffic monitoring logic and thresholds directly into the device firmware, allowing a local program to monitor traffic consumption in real time. Once a preset value is reached, it automatically triggers traffic limiting mechanisms such as frequency reduction or network disconnection. This is common in cost-sensitive or simple, closed device systems. The second type is a cloud server-based traffic limiting solution. This solution relies on a cloud service platform to monitor the overall traffic consumption of the device. When the total traffic approaches or exceeds the limit, the cloud server directly issues instructions to cut off or restrict the device's overall network access permissions.
[0003] However, device-local solutions have significant security and flexibility deficiencies. Since the rate limiting logic and thresholds are stored locally on the device, they are easily tampered with by users through methods such as flashing the firmware and reverse engineering, leading to control failure. At the same time, this solution lacks dynamic adjustment capabilities. If a policy change is required, firmware upgrades must be performed on a massive number of devices, which is cumbersome and delayed, making it difficult to adapt to the flexible management needs of large-scale, multi-scenario applications. It is only suitable for closed environments that are completely controlled by the manufacturer.
[0004] In contrast, while cloud server-based solutions offer strong centralized management capabilities, their core flaw lies in their overly coarse-grained control. This approach uses the "whole device" as the smallest management unit, failing to differentiate between various internal business functions. Once high-traffic functions (such as high-definition video streaming) exhaust the package limit and trigger traffic throttling, the system will abruptly cut off all network connections, causing even low-traffic core functions like status reporting and command reception to cease operation. This phenomenon, where localized overconsumption leads to overall service unavailability, severely disrupts the continuity of core services and user experience. The root cause lies in the lack of current technology's ability to finely differentiate and independently manage data traffic at the "functional level." Summary of the Invention
[0005] This invention provides a data traffic management method, electronic device, and storage medium to solve the problems of easy tampering of local control, rigid policy adjustment, and service interruption of the whole machine due to excessive consumption of local functions caused by coarse-grained control of cloud servers.
[0006] In a first aspect, the present invention provides a data traffic management method applied to a cloud server, comprising the following steps: receiving a function activation request for a target function in a device; responding to the function activation request, determining the remaining available resources corresponding to the target function; generating function activation parameters containing the remaining available resources, and sending the function activation parameters to the device; wherein the function activation parameters are configured to: trigger the device to start the target function, accumulate resource consumption in real time during the operation of the target function, and perform resource control operations on the target function when the resource consumption reaches a first threshold determined based on the remaining available resources; wherein the resource control operations include: shutting down the target function, or switching the target function to a low resource consumption mode; the resource consumption rate per unit time in the low resource consumption mode is lower than that in the previous operating mode.
[0007] This invention discloses a cloud server data traffic management method. By receiving device function activation requests on the cloud server and determining and allocating remaining available resources based on function granularity, it achieves refined and dynamic management of IoT device data traffic. This invention stores control logic and policies on the cloud server, effectively avoiding the risk of local firmware tampering and improving system security and policy adjustment flexibility. Simultaneously, by implementing independent resource limits and real-time cumulative monitoring on a function-by-function basis, excessive consumption by high-traffic functions (such as video streaming) only affects their own operation (e.g., shutdown or degradation) without interrupting low-traffic core functions such as device status reporting and command reception. This ensures the continuity of core device services while achieving precise isolation and control of resource usage, significantly improving user experience and management efficiency.
[0008] In one optional implementation, in response to a function activation request, determining the remaining available resources corresponding to the target function includes: parsing the function activation request to obtain the target function; obtaining a preset correspondence between functions and resource quotas, wherein the correspondence between functions and resource quotas includes quota data configured for each function of the device; and querying the correspondence between functions and resource quotas using the target function to obtain the remaining available resources corresponding to the target function.
[0009] This implementation pre-establishes and maintains a mapping between functions and resource quotas on a cloud server. This allows the system to quickly and accurately retrieve the remaining resource quota for a function upon receiving a function activation request by querying the mapping. This ensures the consistency and accuracy of resource allocation logic. Furthermore, when adjusting the resource limits for a specific function, only the quota data in the mapping needs to be updated on the cloud server, without requiring any modification or upgrade to the device firmware. This significantly reduces maintenance costs and improves response speed. In an optional implementation, after sending the function activation parameters to the devices, the method further includes: receiving unreported existing resources sent by the devices after recovering from a network outage or shutdown state; and adjusting the remaining available resources for the target function based on the unreported existing resources.
[0010] This implementation method enables the cloud server to receive and process the backlog of unreported existing resources after the device regains network connectivity or restarts, thereby achieving final consistency and data integrity in data traffic statistics. It effectively solves the problem of missing data statistics on the cloud server caused by network fluctuations or unexpected device shutdowns, ensuring that the cloud server can accurately correct the remaining available resource quantity based on complete historical records.
[0011] Secondly, the present invention also provides a data traffic management method applied to a device. The method includes the following steps: receiving function activation parameters issued by a cloud server, wherein the function activation parameters include the remaining available resources corresponding to the target function; starting the target function in response to the function activation parameters; during the operation of the target function, accumulating resource consumption in real time; and when the resource consumption reaches a first threshold determined based on the remaining available resources, performing resource control operations on the target function; wherein the resource control operations include: shutting down the target function, or switching the target function to a low resource consumption mode; the resource consumption rate per unit time in the low resource consumption mode is lower than that in the previous operating mode.
[0012] The device-side data traffic management method of this invention achieves resource monitoring and closed-loop control for specific functions by receiving fine-grained function activation parameters from the cloud server on the device side. During operation, the device accumulates resource consumption in real time and performs shutdown or downgrade to a low-resource-consumption mode when a first threshold is reached, ensuring the real-time performance and reliability of local execution and effectively alleviating the real-time control pressure on the cloud server. Moreover, it achieves resource isolation between functions, preventing local excessive consumption from causing service interruption of the entire machine, thereby ensuring user experience while achieving fine-grained and intelligent management of resource consumption.
[0013] In some optional implementations, after activating the target function, the following steps are also included: generating business data through the target function and pushing the business data to the client associated with the device; periodically checking whether a status indication message indicating that the client is in the target function interface is received from the client; if no status indication message is detected within the first time window, the client connection is determined to be abnormal, and an observation period of the second time window is entered; if no status indication information is detected at the end of the observation period, the pushing of business data is stopped and the target function is closed.
[0014] When this implementation detects a status indication message indicating that the client has not returned to the target function interface within a set window period, it determines that the connection is abnormal and enters an observation period. If the connection is not restored by the end of the observation period, it automatically stops data push and closes the target function. This effectively avoids the continuous transmission of invalid data in scenarios where the network connection is unstable or the user has left the target interface, and significantly reduces unnecessary resource consumption.
[0015] In some optional implementations, after activating the target function, the following steps are also included: obtaining the cumulative runtime of the target function; if the cumulative runtime reaches a preset second threshold, shutting down the target function; wherein the second threshold is a fixed duration limit set independently of the remaining available resources.
[0016] This implementation introduces a local time threshold, or second threshold, independent of cloud server resource quotas, to set a hard upper limit on the running time of the target function. It can forcibly terminate the function's operation in the event of missing cloud server instructions or abnormal communication links (such as the APP exiting unexpectedly), thereby effectively solving the problem of function malfunction caused by control signal interruption, avoiding the ineffective occupation of device resources and potential hardware damage, and significantly improving the security of system operation and the controllability of billing.
[0017] In some optional implementations, after activating the target function, the following steps are also included: generating service data through the target function and pushing the service data to the client associated with the device; when a network connection interruption with the client is detected, temporarily storing the service data in a local buffer and performing a reconnection operation; if the network connection with the client is successfully restored within a preset reconnection time window, reading the service data from the local buffer and sending it to the client; if the connection is not restored after the preset reconnection time window has expired, stopping the shutdown of the target function.
[0018] This implementation automatically triggers a local buffer and reconnection mechanism when a network interruption is detected, enabling breakpoint resumption of business data and handling without packet loss. At the same time, a reconnection time window is set as a boundary condition for function operation, automatically terminating the target function when the connection remains abnormal, avoiding resource waste and system load accumulation caused by the device running in an invalid state.
[0019] Thirdly, the present invention also provides a data traffic management method applied to a client, the method comprising the following steps: receiving function activation parameters issued by a cloud server, wherein the function activation parameters include the remaining available resources corresponding to the target function; establishing a data communication connection with the device based on the function activation parameters and displaying the business data of the target function; accumulating resource consumption in real time while maintaining the data communication connection with the device; when the resource consumption reaches a first threshold determined based on the remaining available resources, sending a resource control instruction to the device to instruct the device to perform resource control operations; wherein the resource control operations include: shutting down the target function, or switching the target function to a low resource consumption mode; the resource consumption rate per unit time in the low resource consumption mode is lower than that in the operating mode before the switch.
[0020] The data traffic management method for the client side of this invention pushes the decision-making logic of traffic control down to the user interaction front end by performing real-time monitoring and threshold determination of resource consumption on the client side. When the cumulative consumption reaches the threshold, the client actively sends control instructions to the device. This not only effectively avoids the problem of device-side execution lag caused by network transmission delay and ensures that resource usage is strictly controlled within the preset quota, but also triggers the device to shut down or switch to a low-resource consumption mode through front-end instructions. Thus, while ensuring the user's right to know, it improves the real-time performance and reliability of traffic management.
[0021] Fourthly, the present invention also provides an electronic device, including a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the data flow management method described in the first aspect or any corresponding embodiment thereof.
[0022] Fifthly, the present invention also provides a computer-readable storage medium storing computer instructions, which are used to cause a computer to perform the data traffic management method described in the first aspect or any corresponding embodiment thereof.
[0023] In a sixth aspect, the present invention also provides a computer program product, including computer instructions for causing a computer to execute the data traffic management method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0024] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of an application scenario according to an embodiment of the present invention; Figure 2 This is a first flowchart of a data traffic management method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a method for determining the amount of remaining available resources according to an embodiment of the present invention; Figure 4 This is a second flowchart of a data traffic management method according to an embodiment of the present invention; Figure 5 This is a flowchart of the client status monitoring process according to an embodiment of the present invention; Figure 6 This is a flowchart of a forced shutdown process based on a second threshold according to an embodiment of the present invention; Figure 7 This is a flowchart of network interruption buffer retransmission and timeout termination according to an embodiment of the present invention; Figure 8 This is a third flowchart of the data traffic management method according to an embodiment of the present invention; Figure 9 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0028] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0029] As an optional application scenario of this invention, such as Figure 1As shown, the system architecture mainly includes a cloud server 101, a device 102, and a client 103. The device 102 and the client 103 establish a communication connection through the network, while the cloud server 101 interacts with both the device 102 and the client 103 through the network to realize the policy distribution and data exchange of the cloud server 101.
[0030] Specifically, device 102 can be from the field of intelligent robots such as lawnmowers, pool robots, snowplows, and sweepers. Taking a lawnmower as an example, its core function is mowing, and traffic is mainly used for basic tasks such as positioning and remote control, which are indispensable for completing the mowing task; while scenarios such as video interaction are additional functions, so traffic limits need to be imposed on them. Client 103 can be a user operation terminal such as a smartphone, tablet, or wearable device; cloud server 101 is used to provide resource management services. The network can be a wired or wireless network such as a mobile communication network, Wi-Fi, Bluetooth, or the Internet.
[0031] It should be noted that the system architecture of this embodiment may also include only a cloud server and a device. In this architecture, the cloud server interacts directly with the device, enabling the device to independently respond to resource quotas and control commands issued by the cloud without relying on the client.
[0032] According to an embodiment of the present invention, a data traffic management method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0033] This embodiment provides a data traffic management method that can be used on cloud servers. Figure 2 This is a first flowchart of a data traffic management method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Receive a function enable request for a target function in the device.
[0034] The target function refers to the business function module equipped on the device that has network data interaction attributes, such as remote high-definition monitoring, real-time FPV video transmission, remote control, and targeted data transmission.
[0035] Step S202: In response to the function activation request, determine the amount of remaining available resources corresponding to the target function.
[0036] The remaining available resources are the consumable quotas pre-allocated for a single business function module in the device, which can be one or both of the function usage time and data transmission traffic.
[0037] Step S203: Generate function activation parameters containing the remaining available resources and send the function activation parameters to the device; wherein the function activation parameters are configured to: trigger the device to start the target function, accumulate resource consumption in real time during the operation of the target function, and perform resource control operation on the target function when the resource consumption reaches the first threshold determined according to the remaining available resources.
[0038] Specifically, resource management operations include: shutting down the target function or switching the target function to a low-resource-consumption mode; the resource consumption rate per unit time in the low-resource-consumption mode is lower than that in the previous operating mode.
[0039] The data traffic management method provided in this embodiment achieves refined and dynamic management of IoT device data traffic by receiving device function activation requests on a cloud server and determining and allocating remaining available resources based on function granularity. This invention stores control logic and policies on a cloud server, effectively avoiding the risk of local firmware tampering and improving system security and policy adjustment flexibility. Simultaneously, by implementing independent resource limits and real-time cumulative monitoring on a function-by-function basis, excessive consumption by high-traffic functions only affects their own operation (e.g., shutdown or degradation) without interrupting low-traffic core functions such as device status reporting and command reception. This ensures the continuity of core device services while achieving precise isolation and control of resource usage, significantly improving user experience and management efficiency.
[0040] In one alternative implementation, such as Figure 3 As shown, in response to a function activation request, determining the remaining available resources corresponding to the target function includes steps S2021 to S2023.
[0041] Step S2021: Parse the function enable request to obtain the target function.
[0042] Step S2022: Obtain the preset correspondence between functions and resource quotas, wherein the correspondence between functions and resource quotas includes the quota data configured for each function of the device.
[0043] Specifically, the resource quota included in the correspondence between functions and resource quotas is not a pre-defined static fixed value, but is calculated by the cloud server based on the preset total quota and the actual resources consumed by the device. For example, the resource quota is obtained by subtracting the consumed resources from the total quota.
[0044] The total quota can be periodic, and the periodicity can be monthly, weekly, daily, or even per transaction. For example, the total quota for the in-vehicle video surveillance function is 10GB per month, the total quota for the remote diagnostic function is 500MB per month, and the total quota for the entertainment system function is 5GB of traffic per month.
[0045] Step S2023: Use the correspondence between the target function query function and the resource quota to obtain the remaining available resources corresponding to the target function.
[0046] By pre-establishing and maintaining the mapping relationship between functions and resource quotas on the cloud server, the system can quickly and accurately obtain the remaining resource quota for a function by querying the mapping relationship when it receives a function activation request. This not only ensures the consistency and accuracy of resource allocation logic, but also, when it is necessary to adjust the resource limit of a specific function, only the quota data (such as the total quota) in the mapping relationship needs to be updated on the cloud server. No modifications or upgrades to the device firmware are required, which significantly reduces operation and maintenance costs and improves response speed.
[0047] In actual operation, devices are often forced offline due to entering signal dead zones or unexpected shutdowns. During this period, the target functions of the device may still be consuming resources locally, but due to network interruption, this "consumed" data cannot be reported to the cloud server in real time for deduction, resulting in a discrepancy between the amount of remaining available resources recorded by the cloud server and the actual remaining amount of resources on the device.
[0048] Based on this, in an optional implementation, after the function activation parameters are sent to the devices respectively, the method further includes: receiving the unreported existing resources sent by the devices after they recover from a network outage or power-off state; and correcting the remaining available resources of the target function based on the unreported existing resources.
[0049] As a result, the cloud server can receive and process the backlog of unreported existing resources after the device regains network access or restarts, achieving consistency and integrity in data traffic statistics; effectively solving the problem of missing cloud server statistics due to network fluctuations or unexpected device shutdowns, and ensuring that the cloud server can accurately correct the remaining available resources based on complete historical records.
[0050] This embodiment provides a data traffic management method that can be used on the device side. Figure 4 This is a second flowchart of the data traffic management method according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps: Step S401: Receive the function activation parameters sent by the cloud server, wherein the function activation parameters include the amount of remaining available resources corresponding to the target function.
[0051] Step S402: In response to the function enable parameter, start the target function.
[0052] Step S403: During the operation of the target function, the resource consumption is accumulated in real time. When the resource consumption reaches the first threshold determined based on the remaining available resources, resource control operations are performed on the target function.
[0053] Resource management operations include: shutting down the target function or switching the target function to a low-resource-consumption mode; the resource consumption rate per unit time in the low-resource-consumption mode is lower than that in the previous operating mode.
[0054] The first threshold can be determined based on the remaining available resources. When the resource control operation is to shut down the target function, the first threshold can be equal to the remaining available resources; when the resource control operation is to switch the target function to a low resource consumption mode, the first threshold can be less than or equal to the remaining available resources.
[0055] For example, when the remaining available time or remaining available traffic for a certain function is exhausted, the function is not completely cut off. Instead, the cloud server issues an instruction to switch to a low-traffic consumption mode, such as downgrading the video stream from 1080P to 480P, or only providing snapshots of key data, thus strictly controlling the flow while ensuring the core experience.
[0056] The data traffic management method provided in this embodiment achieves resource monitoring and closed-loop control for specific functions by receiving fine-grained function activation parameters from the cloud server at the device end. During operation, the device accumulates resource consumption in real time and performs shutdown or downgrade to a low resource consumption mode when the first threshold is reached. This ensures the real-time performance and reliability of local execution and effectively relieves the real-time control pressure on the cloud server. Moreover, it achieves resource isolation between functions to prevent local excessive consumption from causing service interruption of the entire machine. Thus, while ensuring user experience, it achieves fine-grained and intelligent management of resource consumption.
[0057] In practical applications, when the device pushes business data to the client, there are often abnormal offline situations such as client crashes, background killing, and network disconnection. If the device continues to push data meaninglessly to maintain the function, it will cause waste of resources and additional traffic consumption.
[0058] Based on this, in one alternative implementation, such as Figure 5 As shown, after the target function is started, the following steps S501 to S504 are also included.
[0059] Step S501: Generate business data through the target function and push the business data to the client associated with the device.
[0060] Step S502: Periodically check whether a status indication message indicating that it is in the target function interface has been received from the client.
[0061] For example, the status indication message can be a heartbeat message periodically sent by the client to the device; it can also be business interaction data generated by the client in the target function's running interface, such as video stream requests and control commands. By receiving this status indication message, the device indicates that the client is currently in the target function's running interface and the connection is normal, thereby enabling the monitoring of the client's resident status and online status.
[0062] Step S503: If no status indication message is detected within the first time window, the client connection is determined to be abnormal, and the observation period of the second time window begins.
[0063] Step S504: If no status indication information is detected at the end of the observation period, stop pushing business data and shut down the target function.
[0064] When this implementation detects a status indication message indicating that the client has not returned to the target function interface within a set window period, it determines that the connection is abnormal and enters an observation period. If the connection is not restored by the end of the observation period, it automatically stops data push and closes the target function. This effectively avoids the continuous transmission of invalid data in scenarios where the network connection is unstable or the user has left the target interface, and significantly reduces unnecessary resource consumption.
[0065] In scenarios where the client disconnects unexpectedly, the communication link between the device and the client will be interrupted. When the app crashes, is killed in the background by the system, or the client loses network access, preventing the normal exit process from being executed, the app will be unable to send a clear function shutdown command to the device. At this time, because the device does not receive a termination signal, it may mistakenly determine that the client is still in normal operation and continue to maintain the target function. This "missing command" will cause the device to continuously consume resources, resulting in resource waste and potentially leading to billing disputes due to actual usage time exceeding user expectations. For example, in the scenario of a smart lawnmower, when a user enables the "real-time video monitoring" function through a mobile app, if the phone suddenly shuts down due to battery depletion or the app is forcibly closed due to system memory cleanup, the app cannot send a "stop video upload" command to the lawnmower. Because the lawnmower does not receive a clear shutdown signal, it will continue to maintain functions such as camera capture, video stream encoding, and 4G network upload, resulting in continuous consumption of mobile data traffic and prolonged occupation of the camera module. This not only causes unnecessary resource waste but may also lead to user complaints due to abnormal billing.
[0066] Based on this, in one alternative implementation, such as Figure 6 As shown, after the target function is started, the following steps S601 to S602 are also included.
[0067] Step S601: Obtain the cumulative runtime of the target function.
[0068] Step S602: If the cumulative runtime reaches a preset second threshold, shut down the target function; wherein the second threshold is a fixed duration limit set independently of the remaining available resources.
[0069] The second threshold is a preset time limit on the device, used to define the maximum allowed duration for a single run of the target function. Unlike the remaining available resources allocated by the cloud server, the second threshold is a fixed value or a constant set based on the device's security policy.
[0070] Specifically, the value of the second threshold can be configured according to the hardware characteristics or business rules of the actual application scenario. For example, considering the heat dissipation requirements of the lawnmower's video module or the battery life limit of the entire machine, the maximum continuous working time of the video interaction function can be set to 1 hour; or in multi-user management scenarios such as parks, in order to prevent a single user from occupying the lawnmower for a long time for video field inspection, thus preventing other administrators from viewing the device status, the maximum usage limit of the single video function can be set to 30 minutes.
[0071] This implementation introduces a local time threshold, or second threshold, independent of cloud server resource quotas, to set a hard upper limit on the running time of the target function. It can forcibly terminate the function's operation in the event of missing cloud server instructions or abnormal communication links (such as the APP exiting unexpectedly), thereby effectively solving the problem of function malfunction caused by control signal interruption, avoiding the ineffective occupation of device resources and potential hardware damage, and significantly improving the security of system operation and the controllability of billing.
[0072] During the synchronization of business data between devices and clients (such as real-time recording and operation log push), network signal fluctuations or momentary interruptions may occur (e.g., a vehicle entering a signal dead zone). In such risky scenarios, if the device discards the business data being generated the moment it detects a network interruption, it will result in the loss of user data; however, if the device waits indefinitely for the network to recover, it may cause the function to suspend due to prolonged occupation of local storage resources.
[0073] Taking a smart lawnmower as an example, when a user activates the "real-time video monitoring" function via a mobile app, the lawnmower needs to continuously push the video stream data collected by the camera to the mobile app for real-time display. If the lawnmower suddenly enters an area with dense trees or buildings that obstructs the 4G signal during operation, and if the lawnmower directly discards the video stream data it is generating, the user will find that the monitored screen is blank when they re-enter the signal coverage area, making it impossible to fully view the operation status of the lawn and causing a gap in the monitoring experience. If the lawnmower waits indefinitely for the network to recover, it will continuously occupy the camera acquisition module and local cache space, causing it to be unable to respond to video viewing requests from other administrators, and even causing the device system to freeze.
[0074] Based on this, in one alternative implementation, such as Figure 7 As shown, after the target function is started, the following steps S701 to S704 are also included.
[0075] Step S701: Generate business data through the target function and push the business data to the client associated with the device.
[0076] Step S702: When a network connection interruption with the client is detected, the service data is temporarily stored in the local buffer and a reconnection operation is performed.
[0077] Specifically, the local buffer is a pre-defined circular queue of fixed size; when the buffer is full and a reconnection has not yet been successful, the oldest business data is overwritten according to the first-in-first-out principle, or new business data is stopped from being generated to protect historical data.
[0078] Step S703: If the network connection with the client is successfully restored within the preset reconnection time window, read the service data from the local buffer and send it to the client.
[0079] Step S704: If the connection is not restored after the preset reconnection time window has expired, then stop shutting down the target function.
[0080] The preset reconnection time window is set according to the business type of the target function. For example, real-time karaoke is set to 10 seconds and log upload is set to 60 seconds to balance user experience and resource consumption.
[0081] This implementation automatically triggers a local buffer and reconnection mechanism when a network interruption is detected, enabling breakpoint resumption of business data and handling without packet loss. At the same time, a reconnection time window is set as a boundary condition for function operation, automatically terminating the target function when the connection remains abnormal, avoiding resource waste and system load accumulation caused by the device running in an invalid state.
[0082] This embodiment provides a data traffic management method that can be used on a client side.Figure 8 This is a third flowchart of the data traffic management method according to an embodiment of the present invention, such as... Figure 8 As shown, the process includes the following steps: Step S801: Receive the function activation parameters sent by the cloud server, wherein the function activation parameters include the remaining available resources corresponding to the target function.
[0083] Step S802: Establish a data communication connection with the device based on the function activation parameters, and display the service data of the target function.
[0084] Step S803: During the data communication connection with the device, the resource consumption is accumulated in real time.
[0085] Step S804: When the resource consumption reaches a first threshold determined based on the remaining available resources, a resource control command is sent to the device to instruct the device to perform resource control operations.
[0086] Resource management operations include: shutting down the target function or switching the target function to a low-resource-consumption mode; the resource consumption rate per unit time in the low-resource-consumption mode is lower than that in the previous operating mode.
[0087] The client-side data traffic management method in this embodiment pushes the traffic control decision-making logic down to the user interaction front end by performing real-time monitoring and threshold determination of resource consumption on the client side. When the cumulative consumption reaches the threshold, the client actively sends control commands to the device. This not only effectively avoids the problem of device-side execution lag caused by network transmission delays and ensures that resource usage is strictly controlled within the preset quota, but also triggers the device to shut down or switch to a low-resource consumption mode through front-end commands. Thus, while ensuring the user's right to know, it improves the real-time performance and reliability of traffic management.
[0088] It should be noted that the data traffic management method provided in this embodiment can be applied to a three-way interaction architecture of "cloud server-device-client". In some application scenarios, such as for some smart hardware devices that do not require complex client interaction or display, the system architecture can be simplified to a two-way architecture of "device-cloud server". In this simplified architecture, the decision and execution of function start and stop no longer depend on the client's forwarding, but are controlled autonomously by the device based on local preset logic, or directly respond to the control commands issued by the cloud server. Correspondingly, the deduction of remaining available resources and the status reporting process are also completed directly in a closed loop between the device and the cloud server, thereby effectively reducing the system's interaction complexity and deployment cost while meeting basic traffic management requirements.
[0089] To illustrate the data traffic management method of this embodiment more clearly, a specific example is given, such as... Figure 9As shown, this example includes the following steps: S1: Feature Activation Request. When a user triggers the activation of a specific online feature (such as FPV video streaming) on a client (such as an app), the client then sends a request to the cloud server to obtain the parameters required to activate the feature.
[0090] S2: Cloud Server Duration Reduction and Distribution. Upon receiving a request, the cloud server queries the database for the remaining available time for the corresponding function on the device and distributes a function activation parameter package containing the current remaining available time to the device. After receiving the parameter package, the device confirms receipt with the cloud server and simultaneously reports any previously incomplete usage time (if any). The cloud server then calculates and reduces the available time, and finally distributes the determined remaining available time back to the device. The device confirms receipt, ensuring data consistency through a two-way confirmation mechanism.
[0091] S3: Function service startup. After receiving the final parameters, the device starts the corresponding function service (such as turning on the camera or joining the video streaming channel) and begins pushing function data to the client.
[0092] S4: Client Function Demonstration. The cloud server simultaneously sends the function activation parameters (including remaining available time) to the client, which then activates the function interface and receives and displays the function data pushed by the device.
[0093] S5: Function Ends. The function ends when any of the following occurs: a) the user actively closes the function on the client; b) the client exits abnormally and this is detected by the device; c) the remaining available time is exhausted.
[0094] S6: Usage Duration Reporting. After the function ends, the device reports the accurate duration of the function usage to the cloud server, and the cloud server updates the remaining available time in the database.
[0095] The data traffic management method provided in this embodiment has the following beneficial effects: (1) Achieved refined management and control: For the first time in the Internet of Things field, the granularity of data traffic management and control has been refined from the device level to the function level, effectively avoiding the impact of a single high-traffic function on the overall networking capability of the device.
[0096] (2) Enhanced security and flexibility: The core control policies are placed on the cloud server, which is tamper-proof and can realize remote, batch and real-time policy adjustments, which greatly improves management efficiency and adaptability.
[0097] (3) Ensured service reliability and user experience: Through multi-terminal collaborative verification and anomaly handling mechanisms such as network outage resume reporting and service degradation, the reliability and continuity of functional services were ensured, and user satisfaction was improved.
[0098] (4) Strong architecture adaptability: It can be adapted to various network types (cellular network, Wi-Fi, Bluetooth) and product forms, and has a wide range of industrial application value.
[0099] This invention can be widely applied to all smart devices with network connectivity and require differentiated resource management of functions. Specific products and application solutions include: (1) Smart lawnmower: Set independent traffic quotas for high-traffic value-added functions such as real-time video monitoring and 3D lawn modeling, and basic control functions such as remote start / stop and status reporting, to prevent unnecessary data such as video streams from exhausting traffic and causing users to be unable to remotely control the lawnmower; (2) Smart pool machine: Allocate different priorities and traffic quotas for underwater high-definition camera live streaming and path planning data synchronization services to ensure that core cleaning task data is transmitted first; (3) Smart snow removal machine: Set traffic limits for key operation and maintenance functions such as operation trajectory recording and remote fault diagnosis that are independent of additional functions such as entertainment information push.
[0100] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0101] The following is a detailed reference. Figure 9 This diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 901, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 902 or a program loaded from memory 908 into random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device. The processor 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0102] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0103] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a memory 908, or installed from a ROM 902. When the computer program is executed by the processor 901, it performs the functions defined in the data traffic management method of the embodiments of the present invention.
[0104] Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0105] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the data traffic management method shown in the above embodiments is implemented.
[0106] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0107] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A data traffic management method, characterized in that, Applied to a cloud server, the method includes: Receive a function enable request for a target function in the device; In response to the function activation request, determine the remaining available resources corresponding to the target function; Generate function activation parameters containing the remaining available resource amount, and send the function activation parameters to the device; The function activation parameters are configured to: trigger the device to start the target function, accumulate resource consumption in real time during the operation of the target function, and perform resource control operations on the target function when the resource consumption reaches a first threshold determined based on the remaining available resources; wherein the resource control operations include: shutting down the target function, or switching the target function to a low resource consumption mode; the resource consumption rate per unit time in the low resource consumption mode is lower than that in the previous operating mode.
2. The method according to claim 1, characterized in that, In response to the function activation request, determining the remaining available resources corresponding to the target function includes: The target function is obtained by parsing the function enable request; Obtain the preset correspondence between functions and resource quotas, wherein the correspondence between functions and resource quotas includes quota data configured for each function of the device. By using the target function to query the correspondence between the function and the resource quota, the remaining available resources corresponding to the target function can be obtained.
3. The method according to claim 1, characterized in that, After sending the function activation parameters to the devices respectively, the method further includes: Receive unreported existing resources sent by the device after it recovers from a network outage or power-off state; Based on the unreported existing resources, the remaining available resources for the target function are adjusted.
4. A data traffic management method, characterized in that, Applied to the device side, the method includes: Receive function activation parameters from the cloud server, wherein the function activation parameters include the amount of remaining available resources corresponding to the target function; In response to the function activation parameter, the target function is activated; During the operation of the target function, the resource consumption is accumulated in real time. When the resource consumption reaches a first threshold determined based on the remaining available resources, a resource control operation is performed on the target function. The resource control operation includes shutting down the target function or switching the target function to a low resource consumption mode. The resource consumption rate per unit time in the low resource consumption mode is lower than that in the previous operating mode.
5. The method according to claim 4, characterized in that, After activating the target function, the following is also included: Business data is generated through the target function, and the business data is pushed to the client associated with the device; Periodically check whether a status indication message indicating that it is in the target function interface has been received from the client; If the status indication message is not detected within the first time window, the client connection is determined to be abnormal, and the client enters the observation period of the second time window. If the status indication information is not detected by the end of the observation period, the push of the business data will be stopped and the target function will be turned off.
6. The method according to claim 4, characterized in that, After the target function is activated, the following is also included: Obtain the cumulative runtime of the target function; If the cumulative runtime reaches a preset second threshold, the target function is turned off; wherein the second threshold is a fixed duration limit set independently of the remaining available resources.
7. The method according to claim 4, characterized in that, After activating the target function, the following is also included: Business data is generated through the target function, and the business data is pushed to the client associated with the device; When a network connection interruption with the client is detected, the service data is temporarily stored in a local buffer, and a reconnection operation is performed. If the network connection with the client is successfully restored within the preset reconnection time window, the service data is read from the local buffer and sent to the client. If the connection is not restored after the preset reconnection time window, the target function will be stopped from being disabled.
8. A data traffic management method, characterized in that, Applied to a client, the method includes: Receive function activation parameters from the cloud server, wherein the function activation parameters include the remaining available resources corresponding to the target function; Based on the aforementioned function activation parameters, a data communication connection is established with the device, and the business data of the target function is displayed; While maintaining a data communication connection with the device, the resource consumption is accumulated in real time; When the resource consumption reaches a first threshold determined based on the remaining available resources, a resource management instruction is sent to the device to instruct the device to perform a resource management operation; wherein, the resource management operation includes: shutting down the target function, or switching the target function to a low resource consumption mode; the resource consumption rate per unit time in the low resource consumption mode is lower than that in the operating mode before the switch.
9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the data flow management method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the data traffic management method according to any one of claims 1 to 8.
11. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the data traffic management method according to any one of claims 1 to 8.