A data processing method and a home smart gateway

CN122578451APending Publication Date: 2026-08-14HISENSE BROADBAND MULTIMEDIA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]为解决服务器偶发的业务压力大的技术问题,本实施例提供了一种数据处理方法及家庭智能网关

Benefits of technology

[0024] In some embodiments, a data processing method is provided for a server, which further includes, before sending a service request forwarding instruction to a first terminal device:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122578451A_ABST
    Figure CN122578451A_ABST
Patent Text Reader

Abstract

This disclosure provides a data processing method and a home smart gateway. The method includes: monitoring the resource consumption rate of a server; when the resource consumption rate reaches a first threshold, sending a service request forwarding instruction to a first terminal device, wherein the service request forwarding instruction includes a first communication address of a backup device, the backup device including a terminal device capable of communicating with the server, so that the first terminal device sends a second service request to be sent to the server to the backup device according to the first communication address, instead of sending it to the server; when the resource consumption rate is less than a second threshold, sending a service request recovery instruction to the first terminal device, so that the first terminal device sends a third service request to be sent to the server to the server, instead of sending it to the backup device. This disclosure solves the technical problem of occasional high service pressure on the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of server technology, and in particular to a data processing method and a home smart gateway. Background Technology

[0002] With the rapid development of IoT technology, there are now more and more IoT devices in users' homes. These IoT devices can communicate with servers located outside the local area network by joining the user's home network. Users can interact with the server through smart terminals and control the IoT devices through the server.

[0003] As the number of IoT devices continues to grow exponentially, the number of business requests from these devices on servers is increasing. In some scenarios, these requests exceed the server's processing capacity. For example, between 6 PM and 7 PM, a large number of IoT devices power on during this period and send upload requests, including heartbeat packets, to the server, requiring it to handle a massive volume of requests. Related technologies aim to alleviate this occasional business pressure by increasing server configuration to improve processing capacity. However, even with increased server configuration, significant amounts of resources remain idle when business pressure is low. Summary of the Invention

[0004] To address the technical challenge of occasional heavy server workloads, this embodiment provides a data processing method and a home smart gateway.

[0005] In some embodiments, a data processing method is provided for a server, comprising:

[0006] Monitor server resource consumption;

[0007] When the resource consumption rate reaches a first threshold, a service request forwarding instruction is sent to the first terminal device. The service request forwarding instruction includes the first communication address of the backup device. The backup device includes a terminal device that can communicate with the server, so that the first terminal device sends the second service request to be sent to the server to the backup device according to the first communication address, instead of sending it to the server.

[0008] When the resource consumption rate is less than the second threshold, a service request recovery instruction is sent to the first terminal device so that the first terminal device sends the third service request to be sent to the server to the server, instead of sending it to the backup device.

[0009] One of the above technical solutions has the following advantages or beneficial effects: When the server's resource consumption rate reaches a first threshold, a service request forwarding instruction containing the first communication address of the backup device is sent to the first terminal device, enabling the first terminal device to send the second service request to the backup device instead of the server. After the server's resource consumption rate decreases, the backup device is deactivated through a service request recovery instruction, allowing the first terminal device to send the third service request to the server. This achieves the goal of sharing the server's service load by using a terminal device connected to the server as a backup device when the server's service load is high. Compared with the prior art, which increases the server's configuration, the above technical solution uses the backup device to handle the second service request, eliminating the need to increase the server's configuration. This solves the problem of a large amount of idle server resources when the service load is low after increasing the server's configuration.

[0010] In some embodiments, a data processing method is provided for a server, which further includes, before monitoring the server's resource consumption rate:

[0011] During the target time period, the monitoring data of the terminal devices in multiple preset dimensions are statistically analyzed.

[0012] If the monitoring data meets the preset rules, the terminal device will be designated as the backup device for the target time period.

[0013] One of the above technical solutions has the following advantages or beneficial effects: by monitoring multiple terminal devices in advance for a target time period, some terminal devices are identified as backup devices during the target time period, which increases the probability that the terminal devices can handle business requests when they are used as backup devices, and improves the reliability of the backup devices.

[0014] In some embodiments, a data processing method is provided for a server, the method further comprising:

[0015] At the start of the second time period, if the resource consumption rate reaches the first threshold, a service request forwarding update instruction is sent to the first terminal device. The second time period is the next time period after the first time period, and the first time period is the time period when the service request forwarding instruction is sent. Both the first time period and the second time period belong to the target time period. The service request forwarding update instruction includes the second communication address of the backup device in the second time period, so that the first terminal device can send the third service request to be sent to the server to the backup device in the second time period according to the second communication address, instead of sending it to the server.

[0016] One of the above technical solutions has the following advantages or beneficial effects: Since the backup devices may be different in different time periods, if the server's resource consumption rate is still high when the second time period begins, the first terminal device can interact with the backup device in the second time period by resending the service request forwarding instruction, thus ensuring the reliability of the interaction between the first terminal device and the backup device.

[0017] In some embodiments, a data processing method is provided for a server, the method further comprising:

[0018] When the resource consumption rate is less than the third threshold, the processing result of the backup equipment is obtained, and a response is made based on the processing result, wherein the third threshold is less than or equal to the first threshold.

[0019] One of the above technical solutions has the following advantages or beneficial effects: when the server's resource consumption rate is low, by obtaining the processing result of the backup device and responding according to the processing result, the normal operation of the thread or service that applies the processing result is guaranteed.

[0020] In some embodiments, a data processing method is provided for a server, the method further comprising:

[0021] Before sending the service request forwarding instruction to the first terminal device, the first service request sent by the first terminal device is forwarded to the backup device for processing;

[0022] A service request forwarding instruction is generated, which also includes first information indicating that the first service request is processed by the backup device.

[0023] One of the above technical solutions has the following advantages or beneficial effects: for the first business request that has been received, by distributing it to the backup device for processing, the business pressure on the server can be quickly reduced and the smooth operation of the server can be ensured.

[0024] In some embodiments, a data processing method is provided for a server, which further includes, before sending a service request forwarding instruction to a first terminal device:

[0025] Determine the backup device corresponding to the first terminal device;

[0026] Obtain the first IP address and first port number of the backup device corresponding to the first terminal device in the wide area network, and the second IP address and second port number in the local area network, and generate a first communication address containing the first IP address, first port number, second IP address and second port number.

[0027] One of the above technical solutions has the following advantages or beneficial effects: by determining a corresponding backup device for the first terminal device, and sending the first communication address of the backup device, which includes a first IP address, a first port number, a second IP address, and a second port number, to the first terminal device, the first terminal device can send the second service request to the backup device through the first communication address, without having to send it to the server, thus reducing the service pressure on the server.

[0028] In some embodiments, a data processing method is provided for a server to determine a backup device corresponding to a first terminal device, including:

[0029] If a first target device exists, and the first IP address of the first target device is the same as the first IP address of the first terminal device, then the first target device is identified as the backup device corresponding to the first terminal device.

[0030] In some embodiments, a home smart gateway is provided, comprising:

[0031] The wireless module enables communication with the server and backup devices.

[0032] The processor, connected to the wireless module, is configured as follows:

[0033] Receive a service request forwarding instruction from the server, wherein the service request forwarding instruction includes the first communication address of the backup device, and the backup device includes a terminal device capable of communicating with the server;

[0034] In response to the service request forwarding instruction, after receiving the second service request to be sent to the server, the second service request is sent to the backup device according to the first communication address, and is not sent to the server;

[0035] Receive a service request recovery command from the server;

[0036] In response to a service request recovery command, after receiving a third service request to be sent to the server, the third service request is sent to the server, but not to the backup device.

[0037] One of the above technical solutions has the following advantages or beneficial effects: After receiving a service request forwarding instruction, the home smart gateway, based on the first communication address information of the backup device contained therein, sends the second service request to be sent to the server to the terminal device that is the backup device, instead of sending it to the server. After receiving a service request recovery instruction, it sends the third service request to be sent to the server to the server, instead of sending it to the backup device. This realizes the reduction of service pressure on the server by utilizing the terminal device. Compared with the existing technology that increases the server configuration to cope with service pressure, the above technical solution does not require increasing the server configuration, thus solving the problem of a large amount of idle server resources when the service pressure is low.

[0038] In some embodiments, a home smart gateway is provided, wherein the processor is further configured to: update the destination address of the service type corresponding to the service request forwarding instruction to a first communication address in response to the service request forwarding instruction.

[0039] One of the above technical solutions has the following advantages or beneficial effects: by updating the destination address of the service type corresponding to the service request forwarding instruction to the first communication address after receiving the service request forwarding instruction, the second service request can be sent to the backup device in a timely manner after receiving the second service request.

[0040] In some embodiments, a home smart gateway is provided, wherein the processor is further configured to: update the destination address of the service type corresponding to the service request recovery instruction to the communication address of the server in response to the service request recovery instruction.

[0041] One of the above technical solutions has the following advantages or beneficial effects: by updating the destination address of the service type corresponding to the service request recovery instruction to the communication address of the server after receiving the service request recovery instruction, the third service request can be sent to the server in a timely manner after receiving the third service request. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in this disclosure, the accompanying drawings used in some embodiments of this disclosure will be briefly described below. Obviously, the drawings described below are only drawings of some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings. In addition, the drawings described below can be regarded as schematic diagrams and are not intended to limit the actual size of the product, the actual flow of the method, the actual timing of the signals, etc. involved in the embodiments of this disclosure.

[0043] Figure 1 This is a schematic diagram of an Internet of Things (IoT) scenario provided according to some embodiments of this disclosure;

[0044] Figure 2 This is a schematic diagram illustrating the interaction between a terminal device and a server according to some embodiments;

[0045] Figure 3 This is a flowchart illustrating a data processing method according to some embodiments;

[0046] Figure 4 This is a flowchart illustrating a method for determining a backup device according to some embodiments;

[0047] Figure 5 This is a flowchart illustrating a method for allocating backup equipment according to some embodiments;

[0048] Figure 6 This is a flowchart illustrating a data processing method according to some embodiments;

[0049] Figure 7 This is a schematic diagram of the architecture of a data processing system according to some embodiments;

[0050] Figure 8 This is a timing diagram illustrating data processing according to some embodiments;

[0051] Figure 9 This is a timing diagram illustrating data processing according to some embodiments;

[0052] Figure 10 This is a timing diagram illustrating data processing according to some embodiments;

[0053] Figure 11 This is a timing diagram illustrating data processing according to some embodiments;

[0054] Figure 12 This is a schematic diagram illustrating the processing of business requests according to some embodiments. Detailed Implementation

[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a” and “the” as used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0057] Figure 1 This is a schematic diagram of an Internet of Things (IoT) scenario provided according to some embodiments of this disclosure. For example... Figure 1 As shown, a user's home includes various devices such as modem 100, router 200, smart set-top box 300, smart TV 400, smart device 500, and control device 600. Among these devices, some are Internet of Things (IoT) devices. For example, except for control device 600, all other devices are IoT devices.

[0058] Modem 100 converts the optical signal in the fiber optic cable into an electrical signal. Router 200 is connected to modem 100. Router 200 builds a local area network (LAN) for the user's home based on the electrical signal output by modem 100. After devices such as smart set-top box 300 and smart TV 400 join the LAN, they can communicate with devices in the wide area network (WAN), including server 400.

[0059] In some embodiments, the Internet of Things (IoT) scenario includes a smart home gateway, which can integrate the functions of the modem 100 and the router 200 into one device, and can also provide a control center and plug-ins for users, providing users with a comprehensive and intelligent home network solution.

[0060] Server 700 is a server of a certain brand located in a certain region. Figure 2 This is a schematic diagram illustrating the interaction between a terminal device and a server according to some embodiments, such as... Figure 2 As shown, server 700 can communicate and connect with multiple IoT devices within a home. Figure 2 In this context, terminal device 1 to terminal device N are all Internet of Things (IoT) devices.

[0061] In some scenarios, the concentrated communication between these IoT devices and server 700 can lead to significant workload on server 700, making it unable to process the IoT devices' requests in a timely manner. For example, between 6 PM and 7 PM, a large number of IoT devices, after being powered on during this period, will periodically send upload requests containing heartbeat packets to server 700, requiring server 700 to handle a large number of requests.

[0062] To alleviate the workload on servers, this disclosure provides a data processing method. When the workload on a server is high, this method uses some terminal devices that are connected to the server as backup devices to share the workload, thus ensuring the smooth operation of the server.

[0063] Figure 3 This is a flowchart illustrating a data processing method according to some embodiments, which can be applied to a server, such as... Figure 3 As shown, the method may include the following steps:

[0064] Step S110: Monitor the server's resource consumption rate.

[0065] In some embodiments, the resource consumption rate of a server refers to the consumption rate of one or more resources that affect the smooth operation of the server, such as the consumption rate of CPU resources, memory resources, disk resources, and network resources. CPU resources may include CPU utilization, memory resources may include memory usage, disk resources may include disk I / O, and network resources may include network bandwidth. The server can monitor the consumption rates of these resources in real time and, when the consumption rate of one resource reaches a threshold, or the consumption rates of multiple resources reach a threshold, or the average consumption rate of multiple resources reaches a threshold, or the weighted average consumption rate of multiple resources reaches a threshold, activate backup equipment to share the business load. For example, the resource consumption rate is the average consumption rate of the aforementioned multiple resources.

[0066] In some embodiments, since each backup device is a terminal device in the user's home, the computing power varies greatly, and the power-on time and number of power-off cycles also have a significant impact on the distribution of the server's workload. Therefore, in order to ensure computing performance, it is necessary to select some reliable devices from a large number of terminal devices as backup devices.

[0067] Figure 4 This is a flowchart illustrating a method for determining a backup device according to some embodiments, such as... Figure 4 As shown, the method may include steps S101-S102.

[0068] Step S101: During the target time period, collect monitoring data from the terminal devices in multiple preset dimensions.

[0069] In some embodiments, a day can be divided into multiple time periods, such as one time period every hour. Only during target time periods, such as periods when the server is prone to peak business pressure, the server collects monitoring data from multiple preset dimensions of the terminal devices to reduce the workload of statistics. The preset dimensions are those affecting the reliability of the terminal devices and may include the device's frequent online time, online duration, number of times the device is shut down within the online duration, network conditions, CPU, memory, and disk I / O information. These dimensions all affect the reliability of the terminal device as a backup device.

[0070] In some embodiments, the target time period can also be the entire time period, that is, the terminal device is monitored 24 hours a day to flexibly respond to the peak business pressure that may occur at any time.

[0071] Step S102: If the monitoring data meets the preset rules, the terminal device is identified as the backup device for the target time period.

[0072] In some embodiments, a corresponding scoring standard can be set for each preset dimension, which is used to score the monitoring data. For example, the scoring range for each preset dimension can be set to 1 to 10 points, with 1 to 10 corresponding to different scoring standards.

[0073] For all preset dimensions, the usability score can be set as a weighted sum of the scores for all preset dimensions.

[0074] For a terminal device, an availability score for the target time period can be generated based on monitoring data for that time period and the corresponding scoring criteria.

[0075] In some embodiments, the server can generate an availability score table for a target time period. When distributing service requests, a certain number of terminal devices can be selected as backup devices based on the availability score table and the current resource consumption rate. The higher the resource consumption rate, the more terminal devices can be selected as backup devices according to the availability score from high to low, which provides greater flexibility.

[0076] In some embodiments, the server may also generate a standby device table for each time period based on the availability score table. The number of standby devices for each time period can be determined based on the historical resource consumption rate of the server in the corresponding time period. Thus, when distributing service requests, the standby devices for the current time period can be quickly determined from the standby device table according to the availability score from high to low.

[0077] In some embodiments, the backup device table may include device information for backup devices, such as location information, device ID, and MAC address, facilitating the server's allocation of backup devices to terminal devices based on this information. In some embodiments, among a large number of terminal devices connected to the server, some terminal devices have system programs that include a first data processing program. This first data processing program handles preset types of business requests, enabling the terminal devices to act as backup devices and alleviate the server's workload. Other terminal devices do not have a first data processing program in their system programs and cannot act as backup devices to alleviate the server's workload. These terminal devices can acquire the first data processing program through system upgrades. The server can determine which terminal devices can act as backup devices based on their model, system version, and other information. It only collects monitoring data from these backup devices and calculates availability scores to conserve server resources.

[0078] Step S120: When the resource consumption rate reaches the first threshold, a service request forwarding instruction is sent to the first terminal device. The service request forwarding instruction includes the first communication address of the backup device. The backup device includes a terminal device that can communicate with the server, so that the first terminal device sends the second service request to be sent to the server to the backup device according to the first communication address, instead of sending it to the server.

[0079] In some embodiments, the first threshold may be 80%. When the server's resource consumption rate reaches the first threshold, the server experiences significant business pressure. To alleviate this pressure, backup devices for the current time period can be identified. Based on the device information of the backup devices, the communication addresses of these backup devices are obtained. These communication addresses may include the backup devices' first IP address and first port number on the wide area network (WAN), and second IP address and second port number on the local area network (LAN).

[0080] In some embodiments, there are multiple backup devices. The server needs to allocate backup devices to each terminal device. A backup device can share the business pressure from multiple terminal devices. The backup devices allocated to different terminal devices may be the same or different. The backup device allocated to a terminal device may be its own device.

[0081] In some embodiments, when the resource consumption rate reaches a first threshold, the server may allocate backup devices to some terminal devices, for example, allocate backup devices to the first terminal device.

[0082] In some embodiments, the server can identify terminal devices that have sent data to the server within a preset time period as potential backup devices. The preset time period can be set according to actual needs, for example, half an hour. Terminal devices that sent data to the server within the preset time period are more likely to send data to the server again within the current time period. For example, after starting up within the current time period, the terminal device may periodically send heartbeat packet upload requests to the server, allowing the server to determine that the terminal device is online based on these requests. By sending a service request forwarding instruction to the terminal device, the server can reduce the probability of the terminal device sending data to the server, thus alleviating the server's workload.

[0083] In some embodiments, the server can identify the terminal device corresponding to an unprocessed service request of a preset type as the terminal device to be assigned a backup device, thereby reducing the workload of assigning backup devices. After the server assigns a backup device to a terminal device, it can directly assign the unprocessed service requests of the preset type of the terminal device to the backup device for processing, thereby quickly reducing the server's resource consumption rate.

[0084] Taking the allocation of backup devices to a server as the first terminal device as an example, this disclosure provides a method for allocating backup devices.

[0085] Figure 5 This is a flowchart illustrating a method for allocating backup equipment according to some embodiments, such as... Figure 5 As shown, the method may include steps S121-S124.

[0086] Step S121: Obtain the communication address and location information of the first terminal device and the backup device respectively.

[0087] In some embodiments, each terminal device reports device information to the server after startup. The device information may include communication address and location information.

[0088] For the first terminal device to be assigned a backup device, the server can compare the device information of the first terminal device with the device information of the backup device. Step S122: Determine whether there is a backup device with the same first IP address as the first terminal device.

[0089] In some embodiments, if the backup device and the first terminal device are in the same household, that is, in the same local area network, the first IP address of the backup device is the same as the first IP address of the first terminal device, and the backup device is the first target device corresponding to the first terminal device.

[0090] Step S123: If there is a backup device with the same first IP address as the first terminal device, the backup device with the same first IP address is identified as the target backup device.

[0091] In some embodiments, if there is a backup device in the same local area network as the first terminal device, the backup device can be set as the target backup device for the first terminal device. The service requests of the first terminal device are processed through the target backup device, which ensures high data security.

[0092] Step S124: If there is no first IP address that is the same as the first terminal device, determine the target backup device based on the location information.

[0093] In some embodiments, if there is no backup device in the same local area network as the first terminal device, a backup device that has not reached the device limit can be selected as the target backup device of the first terminal device according to the location information from near to far. The target backup device is closer to the first terminal device, and the reliability and efficiency of data transmission are usually higher.

[0094] In some embodiments, the server can also directly and quickly allocate backup devices based on location information to improve allocation efficiency. In some embodiments, according to the above allocation method, after determining the backup device corresponding to the first terminal device, if the server has unprocessed service requests of a preset type from the first terminal device, it can process the service requests and then send a service request forwarding instruction to the first terminal device. The service request forwarding instruction includes the communication address of the backup device corresponding to the first terminal device in the current time period, i.e., the first communication address. This ensures that after receiving the service request forwarding instruction, if the first terminal device generates a new service request of a preset type to be sent to the server, it will not send the service request to the server, but instead send it to the backup device corresponding to the first terminal device, thereby reducing the server's service load.

[0095] In some embodiments, according to Figure 5 In the allocation method shown, after the server determines the backup device corresponding to the first terminal device, for service requests of a preset type sent by the first terminal device that the server has not yet processed, such as the first service request, the server can also forward these service requests to the backup device for processing, so as to quickly reduce the current business pressure on the server. After forwarding the first service request sent by the first terminal device to a backup device, such as the second terminal device, the server generates a service request forwarding instruction containing the first communication address of the second terminal device. This service request forwarding instruction may contain first information and second information. The first information indicates that the first service request sent by the first terminal device is processed by the backup device of the first communication address, and the second information indicates that the preset type of service request needs to be sent to the backup device of the first communication address. If the first service request sent by the first terminal device is a request that requires a response from the receiver, after processing the request, the backup device can send corresponding response information to the first terminal device, such as information indicating that the first service request has been received.

[0096] In some embodiments, the preset type of service request is a service request with low computational load or no computation required, in order to avoid the backup device being unable to complete the processing of the service request.

[0097] In some embodiments, a pre-defined type of service request may include a heartbeat packet upload request, which may include device information, such as a MAC address. After receiving a heartbeat packet upload request, if the server processes the service request, the processing method includes: updating the online status information of the terminal device that sent the heartbeat packet upload request based on the device information in the heartbeat packet upload request. If the server forwards the heartbeat packet upload request to a backup device for processing, the server does not update the online status information of the terminal device that sent the heartbeat packet upload request. After receiving the heartbeat packet upload request, the backup device processes the heartbeat packet upload request by storing it. The backup device can subsequently return the stored heartbeat packet upload request to the server. After receiving the heartbeat packet upload request from the backup device, the server responds based on the processing result of the heartbeat packet upload request by the backup device, that is, updating the online status information based on the heartbeat packet upload request stored by the backup device.

[0098] In some embodiments, in addition to updating online status information based on heartbeat packet upload requests, the server can also update online status information based on non-preset type service requests sent by the first terminal device to the server. This is to avoid the first terminal device's online status information not being updated while the backup device is processing the heartbeat packet request, thus affecting the user experience. For example, a non-preset type service request may include a power-on control request, which is used to control the IoT devices in the user's home to power on.

[0099] In some embodiments, if the server forwards a service request of a preset type from the first terminal device to a backup device for processing, it may pause the first thread or the first service. The first thread is a thread that processes the result of the service request of the preset type, and the first service is a service that processes the result of the service request of the preset type, so as to avoid the first thread or the first service from reporting an error or stopping operation due to not being able to obtain the processing result of the service request of the preset type.

[0100] In some embodiments, a preset type of business request may include a log upload request. After receiving the log upload request, if the server processes the request, the processing method includes storing the log information in the log upload request into a database. If the server forwards the log upload request to a backup device for processing, the server does not store the log information in the database. After receiving the log upload request, the backup device processes the request by storing it. The backup device may subsequently return the stored log upload request to the server. After receiving the log upload request from the backup device, the server responds according to the processing result of the backup device, that is, based on the log upload request saved by the backup device, it stores the log information in the log upload request into the database.

[0101] In some embodiments, the standby device is configured to process a service request in response to receiving a service request and store the processing result in the standby device.

[0102] In some embodiments, after receiving a service request forwarding instruction, the first terminal device, when generating a service request of a preset type, such as a second service request, sets the destination address to the communication address of the backup device corresponding to the service request forwarding instruction. This allows the second service request to be sent to the backup device instead of the server, thus reducing the server's load. For the first terminal device, since the default destination address for the preset type of service request is the server's communication address, this embodiment refers to the preset type of service request generated by the first terminal device, such as the second service request, as a service request to be sent to the server. In this embodiment, when generating the second service request, the destination address is set to the communication address of the backup device, so the second service request to be sent to the server can be sent to the backup device instead of the server.

[0103] In some embodiments, during the generation phase of the second service request, the destination address may still be the communication address of the server. After the second service request is generated, the destination address may be modified to the communication address of the backup device. In other words, as long as the destination address of the second service request is set to the communication address of the backup device before sending the second service request, it is sufficient.

[0104] In some embodiments, the backup device for the current time period may not be the backup device for the next time period. In the next time period, there may be situations such as increased shutdown probability and reduced idle resources, which are not conducive to processing business requests. To solve this problem, when the next time period arrives, that is, when the start time of the next time period arrives, if the server's business pressure is still high, the server can re-determine the backup device and resend the business request forwarding instruction to the first terminal device.

[0105] For ease of description, the current time period is referred to as the first time period, and the next time period is referred to as the second time period. The service request forwarding instruction sent by the server in the first time period includes the first communication address of the backup device allocated to the first terminal device in the first time period, and the service request forwarding instruction sent by the server in the second time period includes the second communication address of the backup device allocated to the first terminal device in the second time period.

[0106] Step S130: When the resource consumption rate is less than the second threshold, a service request recovery instruction is sent to the first terminal device so that the first terminal device sends the third service request to be sent to the server to the server, and does not send it to the backup device.

[0107] In some embodiments, after the resource consumption rate is less than a second threshold, the server sends a service request recovery instruction to the terminal device that has sent the service request forwarding instruction, such as the first terminal device. The second threshold is less than or equal to the first threshold and can be set according to actual needs. For example, the second threshold can be 60%.

[0108] The terminal device is configured to send the unsent preset type of service request to the server instead of the backup device if it receives a service request recovery instruction, thereby restoring communication with the server.

[0109] For the first terminal device, since the default destination address for a preset type of service request is the server's communication address, this embodiment of the disclosure refers to the preset type of service request generated by the first terminal device, such as a third service request, as a service request to be sent to the server. In this embodiment, when generating a third service request, the destination address is set to the server's communication address, so that the third service request to be sent to the server can be sent to the server and not to the backup device.

[0110] In some embodiments, when the resource consumption rate is less than a third threshold, the server obtains the processing result of the backup device and responds according to the processing result. The third threshold is less than or equal to the first threshold. The third threshold may be the same as or different from the second threshold and can be set according to actual needs. For example, the third threshold may be 70%.

[0111] In some embodiments, after the resource consumption rate falls below a third threshold, the server obtains the processing results from the backup device by sending a processing result upload instruction to the backup device. The backup device is configured to, upon receiving the processing result upload instruction, send the processing results stored locally, such as the processing results of the first service request and the processing results of the second service request, to the server.

[0112] When the resource consumption rate is less than the third threshold, the server has sufficient preset resources to process the business requests previously forwarded to the backup device. This allows the server to process the business requests forwarded to the backup device in a timely manner, avoiding any impact on the normal operation of threads or services that process these business requests.

[0113] In some embodiments, after receiving the processing result of a service request sent by a backup device, the server merges the processing result into the server's database, thereby centralizing the data in the processing result and completing the business loop.

[0114] As can be seen from the above embodiments, when the server's resource consumption rate reaches a first threshold, a service request forwarding instruction containing the first communication address of the backup device is sent to the first terminal device. This allows the first terminal device to send the second service request to the backup device instead of the server. After the server's resource consumption rate decreases, the backup device is deactivated through a service request recovery instruction, allowing the first terminal device to send the third service request to the server. This achieves the goal of sharing the server's service load by using a terminal device connected to the server as a backup device when the server's service load is high. Compared with the prior art, which increases the server's configuration, the above technical solution uses the backup device to handle the second service request, eliminating the need to increase the server's configuration. This solves the problem of a large amount of idle server resources when the service load is low after increasing the server's configuration.

[0115] In the above embodiments, the first terminal device may be a home smart gateway. The home smart gateway includes a wireless module and a processor. The wireless module can communicate with servers, backup devices and smart home devices, and supports multiple wireless protocols such as Wi-Fi, ZigBee and Bluetooth to achieve interconnection with servers, backup devices and smart home devices.

[0116] This disclosure also provides a data processing method for a home smart gateway to reduce the workload on the server.

[0117] Figure 6 This is a flowchart illustrating a data processing method according to some embodiments, which may include the following steps:

[0118] Step S210: Receive a service request forwarding instruction from the server, wherein the service request forwarding instruction includes the first communication address of the backup device, and the backup device includes a terminal device capable of communicating with the server.

[0119] Step S220: In response to the service request forwarding instruction, based on the first communication address, the second service request to be sent to the server is sent to the backup device instead of to the server.

[0120] In some embodiments, the smart home gateway stores the destination addresses corresponding to various types of service requests, i.e., the default destination addresses, for use when generating service requests. The destination address of the default type of service request is the communication address of the server.

[0121] After receiving a service request forwarding instruction, the smart home gateway can update the destination address of a preset type of service request to a first communication address. Thus, when the smart home gateway generates a preset type of service request, such as a second service request, it sets the destination address in the service request to the first communication address, so that the service request can be sent to a backup device based on the first communication address instead of being sent to the server.

[0122] Step S230: Receive a service request recovery instruction from the server.

[0123] Step S240: In response to the service request recovery instruction, after receiving the third service request to be sent to the server, the third service request is sent to the server, but not to the backup device.

[0124] In some embodiments, after receiving a service request forwarding instruction, the smart home gateway can update the destination address of a service request of a preset type to the communication address of the server. Thus, when the smart home gateway generates a service request of a preset type, such as a third service request, it sets the destination address in the service request to the communication address of the server, so that the service request can be sent to the server according to the first communication address instead of being sent to the backup device.

[0125] As can be seen from the above embodiments, after receiving a service request forwarding instruction, the home smart gateway, based on the first communication address information of the backup device contained therein, sends the second service request to be sent to the server to the terminal device acting as the backup device, instead of sending it to the server. After receiving a service request recovery instruction, it sends the third service request to be sent to the server to the server, instead of sending it to the backup device. This realizes the use of the backup device to reduce the service pressure on the server. Compared with the prior art, which addresses service pressure by increasing the server configuration, the above technical solution does not require increasing the server configuration and solves the problem of a large amount of idle server resources when the service pressure is low.

[0126] Based on the data processing methods in the above embodiments, this disclosure also provides a schematic diagram of the architecture of a data processing system.

[0127] Figure 7 This is a schematic diagram of a data processing system architecture according to some embodiments, such as Figure 7 As shown, the server communicates with multiple terminal devices, which report their device information and service requests to the server.

[0128] The server stores the device information and preset dimensions of monitoring data reported by the terminal devices into the database, and monitors the server's resource consumption rate in real time.

[0129] If the resource consumption rate is lower than the threshold, such as the first threshold, the server will start the business processing flow, which includes processing the business requests stored in the database and storing the processing results in the database.

[0130] If the resource consumption rate exceeds a threshold, such as the first threshold, the server initiates a business request forwarding process. This process includes generating a two-dimensional table for selecting backup devices based on the availability scores of each terminal device. This two-dimensional table includes the availability scores and device information of the backup devices.

[0131] Based on the two-dimensional table, the server selects terminal devices as backup devices, such as terminal devices 2 and 3, and forwards the service requests to the backup devices.

[0132] After receiving a service request, the backup device processes the request and stores the processing result in a local database.

[0133] When the resource consumption rate of the server exceeds the threshold, the data merging process is initiated. This process includes controlling the backup devices to return the processing results of their respective business requests to the server. The server then merges the received processing results into the server's database, thereby centralizing the data in the processing results and completing the business loop.

[0134] To further illustrate the data processing method of the embodiments of this disclosure, the interaction between the server and each terminal device, and between each terminal device, will be described below.

[0135] Figure 8 This is a timing diagram illustrating data processing according to some embodiments, such as Figure 8 As shown, taking an IoT device capable of communicating with a server, including a first terminal device and a second terminal device, as an example, the first terminal device and the second terminal device respectively send device information and monitoring data of preset dimensions to the server.

[0136] In some embodiments, the server generates availability scores for these terminal devices based on their device information. The availability scores include scores for multiple time periods.

[0137] In some embodiments, the server monitors server resource consumption. When the consumption rate reaches a first threshold, a backup device for the current time period is determined. For example, the determined backup device includes a second terminal device.

[0138] In some embodiments, the server assigns a second terminal device as a backup device to the first terminal device based on the backup devices available for the current time period.

[0139] In some embodiments, the server assigns a backup device to the second terminal device based on the backup devices available in the current time period.

[0140] The server can send a service request forwarding instruction to the first terminal device, so that after receiving the service request forwarding instruction, the first terminal device sends the newly generated service request of a preset type to the second terminal device. The second terminal device processes the service request and stores the processing result, thereby reducing the service load on the server.

[0141] Figure 9 This is a timing diagram illustrating data processing according to some embodiments, such as Figure 9 As shown, when the server detects that its resource consumption rate has reached a first threshold, it determines the backup device for the current time period. For example, the determined backup device includes a second terminal device.

[0142] After receiving a service request of a preset type from the first terminal device, the server does not process the service request temporarily. Instead, it allocates a backup device to the first terminal device. Taking the allocated backup device as the second terminal device as an example, the server forwards the service request to the second terminal device and sends a service request forwarding instruction to the first terminal device.

[0143] After receiving a service request from the first terminal device forwarded by the server, the second terminal device processes the service request and stores the processing result in the database of the second terminal device.

[0144] Based on the service request forwarding instruction, the first terminal device can send the new preset type of service request to the second terminal device instead of the server.

[0145] It should be noted that in some embodiments, while the second terminal device is processing a service request forwarded by the server, it may also receive a service request of a preset type sent by the first terminal device. In this case, the second terminal device may process these service requests in the order they are received.

[0146] After the backup devices process some business requests that originally needed to be handled by the server, the server's workload will be reduced.

[0147] In some embodiments, if the server's resource consumption rate is still higher than the second threshold when the next time period arrives, the server may perform actions such as... Figure 10 The data processing is shown.

[0148] Figure 10 This is a timing diagram illustrating data processing according to some embodiments, such as Figure 10 As shown, at the next time period, the server can re-determine backup devices based on availability scores and reassign backup devices to each terminal device. Each terminal device will send newly generated service requests of a preset type to the newly assigned backup device for processing.

[0149] For example, the server assigns a third terminal device as a backup device for the first terminal device and sends a service request forwarding instruction containing the communication address of the third terminal device to the first terminal device. After receiving the service request forwarding instruction, the first terminal device sends a request of a preset type to the third terminal device instead of sending it to the server.

[0150] In some embodiments, if the server's resource consumption rate is lower than a second threshold after data processing by each backup device, the server may perform the following actions: Figure 11 The data processing is shown.

[0151] Figure 11 This is a timing diagram illustrating data processing according to some embodiments, such as Figure 11 As shown, when the resource consumption rate is lower than the second threshold, the server can send a service request recovery instruction to the terminal device that sent the service request forwarding instruction, such as the first terminal device.

[0152] Upon receiving the service request recovery instruction, the first terminal device sends a newly generated service request of a preset type to the server, instead of sending it to the backup device. The server then processes the service request upon receipt.

[0153] In some embodiments, when the resource consumption rate is below a second threshold, the server also sends a processing result upload instruction to the backup device.

[0154] Backup devices, such as the second and third terminal devices, respond to the processing result upload command and upload their respective stored processing results to the server.

[0155] After receiving the processing results from the backup device, the server merges the data in the processing results into the server's database, thereby centralizing the processing of the data in the processing results and completing the business loop.

[0156] Figure 12 This is a schematic diagram illustrating the business request processing according to some embodiments, such as Figure 12As shown in this embodiment, during the time period t1-t2, the server's resource consumption rate does not reach the first threshold, so the server processes the business on the first terminal device. During the time period t2-t3, the server's resource consumption rate reaches the first threshold, so the server allocates a second terminal device as a backup device to process the business on the first terminal device. During the time period t3-t4, the server's resource consumption rate is still higher than the second threshold, so the server reallocates a third terminal device as a backup device to process the business on the first terminal device. After time t4, the server's resource consumption rate is lower than the second threshold, and the server processes the business on the first terminal device. Therefore, this embodiment utilizes terminal devices as backup devices, sharing the occasional business pressure on the server, and offers high flexibility.

[0157] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims. The above embodiments of this application do not constitute a limitation on the scope of protection of this application.

Claims

1. A data processing method, characterized in that, Applied to a server, the method includes: Monitor the resource consumption rate of the server; When the resource consumption rate reaches a first threshold, a service request forwarding instruction is sent to the first terminal device. The service request forwarding instruction includes a first communication address of a backup device. The backup device includes a terminal device that can communicate with the server, so that the first terminal device sends the second service request to be sent to the server to the backup device according to the first communication address, instead of sending it to the server. When the resource consumption rate is less than the second threshold, a service request recovery instruction is sent to the first terminal device, so that the first terminal device sends the third service request to be sent to the server to the server, and does not send it to the backup device.

2. The data processing method according to claim 1, characterized in that, Before monitoring the resource consumption rate of the server, the method further includes: During the target time period, the monitoring data of the terminal device in multiple preset dimensions are statistically analyzed. If the monitoring data meets the preset rules, the terminal device will be designated as the backup device for the target time period.

3. The data processing method according to claim 2, characterized in that, The method further includes: When the resource consumption rate reaches the first threshold at the start of the second time period, a service request forwarding update instruction is sent to the first terminal device. The second time period is the next time period after the first time period, and the first time period is the time period when the service request forwarding instruction is sent. Both the first time period and the second time period belong to the target time period. The service request forwarding update instruction includes the second communication address of the backup device in the second time period, so that the first terminal device sends the third service request to be sent to the server to the backup device in the second time period according to the second communication address, instead of sending it to the server.

4. The data processing method according to claim 1, characterized in that, The method further includes: When the resource consumption rate is less than a third threshold, the processing result of the backup device is obtained, and a response is made based on the processing result, wherein the third threshold is less than or equal to the first threshold.

5. The data processing method according to claim 1, characterized in that, The method further includes: Before sending the service request forwarding instruction to the first terminal device, the first service request sent by the first terminal device is forwarded to the backup device for processing; The service request forwarding instruction is generated, and the service request forwarding instruction further includes first information, the first information indicating that the first service request is processed by the backup device.

6. The data processing method according to claim 1, characterized in that, Before sending the service request forwarding instruction to the first terminal device, it also includes: Determine the backup device corresponding to the first terminal device; Obtain the first IP address and first port number of the backup device corresponding to the first terminal device in the wide area network, and the second IP address and second port number in the local area network, and generate the first communication address containing the first IP address, first port number, second IP address and second port number.

7. The data processing method according to claim 6, characterized in that, Determining the backup device corresponding to the first terminal device includes: If a first target device exists, wherein the first IP address of the first target device is the same as the first IP address of the first terminal device, then the first target device is determined as the backup device corresponding to the first terminal device.

8. A home smart gateway, characterized in that, include: The wireless module enables communication with the server and backup devices. The processor, connected to the wireless module, is configured to: Receive a service request forwarding instruction from the server, wherein the service request forwarding instruction includes a first communication address of the backup device, and the backup device includes a terminal device capable of communicating with the server; In response to the service request forwarding instruction, the second service request to be sent to the server is sent to the backup device according to the first communication address, and is not sent to the server; Receive a service request recovery command from the server; In response to the service request recovery instruction, the third service request to be sent to the server is sent to the server, but not to the backup device.

9. The home smart gateway according to claim 8, characterized in that, The processor is further configured to: in response to the service request forwarding instruction, update the destination address of the service type corresponding to the service request forwarding instruction to the first communication address.

10. The home smart gateway according to claim 8, characterized in that, The processor is further configured to: in response to the service request recovery instruction, update the destination address of the service type corresponding to the service request recovery instruction to the communication address of the server.