Equipment management method based on flow statistics and related device
Through the traffic statistics method between the Internet of Things devices and the cloud platform, the data on the device side and platform side are obtained, and the problem of inaccurate traffic data statistics of IoT devices is solved, the authenticity and integrity of the traffic data are realized, and the Equipment availability and statistical accuracy.
Patent Information
- Application Number
- CN202411126930.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-24
AI Technical Summary
The traffic data statistics of existing IoT devices rely on operator-side data, resulting in inaccurate statistics and poor availability. How to ensure the availability of equipment and the authenticity of traffic data has become an urgent problem.
By introducing traffic statistics methods between IoT devices and cloud platforms, the traffic data on the device side and platform side is obtained, the request failure compensation mechanism is used to ensure data integrity, and traffic statistics are carried out based on the Internet of Things card, and the operation is removed The dependence of the business side realizes closed-loop statistics of traffic data.
It ensures the authenticity and integrity of traffic data, improves the availability of IoT devices, and can detect the use of IoT card traffic in real time, so as to ensure the accuracy of traffic data statistics when the device changes the card or connects to the network cable.
Smart Images

Figure CN119182697A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things devices, and in particular to a device management method and related apparatus based on traffic statistics. Background Art
[0002] With the development of the Internet of Things, more and more equipment products are being selected by users. In the existing calculation method of the traffic of the device IoT card, the commonly used method mainly relies on the traffic data counted by the operator. If the operator does not support the traffic consumption data, the traffic data statistics will be inaccurate and untrue, resulting in poor device availability. In view of this, how to ensure the availability of the device and the authenticity of the traffic data has become an urgent problem to be solved. Summary of the invention
[0003] The main technical problem solved by the present application is to provide a device management method and related devices based on traffic statistics, which can ensure the availability of the device and the authenticity of the traffic data.
[0004] To solve the above technical problems, the first aspect of the present application provides a device management method based on traffic statistics, which is applied to an Internet of Things device traffic statistics system, wherein the Internet of Things device traffic statistics system includes an Internet of Things device and a cloud platform, and the method includes: obtaining device-side traffic within a first preset period, and obtaining platform-side traffic within the first preset period; wherein the device-side traffic includes a first traffic generated when the Internet of Things device interacts successfully with the cloud platform and a second traffic generated when the interaction fails, and the platform-side traffic includes a third traffic generated when the Internet of Things device interacts successfully with the cloud platform and a fourth traffic generated when the interaction fails, and the cloud platform includes a third traffic generated when the Internet of Things device interacts successfully with the cloud platform and a fourth traffic generated when the interaction fails, and the traffic statistics within the first preset period are obtained based on the device-side traffic and the platform-side traffic; the Internet of Things device is managed based on the traffic statistics and the current traffic of the Internet of Things card in the Internet of Things device; wherein the current traffic is the traffic in the Internet of Things card before the traffic statistics are obtained.
[0005] To solve the above technical problem, the second aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the method described in the first aspect.
[0006] In order to solve the above technical problem, the third aspect of the present application provides a computer-readable storage medium, which stores program instructions that can be executed by a processor, and the program instructions are used to implement the method described in the first aspect above.
[0007] The above scheme obtains the device-side traffic within the first preset period, and obtains the platform-side traffic within the first preset period; wherein the device-side traffic includes the first traffic generated when the IoT device interacts successfully with the cloud platform as counted by the IoT device, and the second traffic generated when the interaction fails; the platform-side traffic includes the third traffic generated when the IoT device interacts successfully with the cloud platform as counted by the cloud platform, and the fourth traffic generated when the interaction fails; by supplementing the request failure compensation mechanism between the IoT device and the cloud platform, it is ensured that data is not lost when the IoT device and the cloud platform interact, and the authenticity and integrity of the traffic data statistics are guaranteed; based on the device-side traffic and the platform-side traffic, the first preset period is obtained. The traffic statistics data during the period, through reasonable statistics and calculation of device-side traffic and platform-side traffic, and setting the statistical period within a reasonable range, removes the dependence on the operator side, ensures the authenticity of the traffic data statistics, and manages the status of the IoT devices based on the traffic statistics data and the current traffic of the IoT cards in the IoT devices. By using the IoT cards as the benchmark when counting traffic, it can ensure that the IoT devices can achieve a closed loop of traffic data statistics when replacing other IoT cards or connecting to network cables, thereby further ensuring the authenticity of the traffic data statistics. In addition, the traffic statistics data can detect the usage of the IoT card traffic in real time, ensuring the availability of the IoT devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0009] Figure 1 It is a flow chart of an implementation method of a device management method based on traffic statistics of the present application;
[0010] Figure 2 This is a structural diagram of an implementation method of an IoT device traffic statistics system of the present application;
[0011] Figure 3 This is a structural diagram of another implementation method of the IoT device traffic statistics system of the present application;
[0012] Figure 4 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0013] Figure 5 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments, and different implementation methods can be adaptively combined. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0015] See also Figure 1 and Figure 2 , Figure 1 This is a flow chart of an implementation method of a device management method based on traffic statistics of the present application. Figure 2 1 is a schematic diagram of the structure of an embodiment of the IoT device traffic statistics system of the present application. The method is applied to the IoT device traffic statistics system 1, which includes an IoT device 10 and a cloud platform 11. The device management method based on traffic statistics includes:
[0016] S101: Obtain device-side traffic within a first preset period, and obtain platform-side traffic within the first preset period; wherein the device-side traffic includes a first traffic generated when the IoT device interacts successfully with the cloud platform as counted by the IoT device, and a second traffic generated when the interaction fails; and the platform-side traffic includes a third traffic generated when the IoT device interacts successfully with the cloud platform as counted by the cloud platform, and a fourth traffic generated when the interaction fails.
[0017] Specifically, when the IoT card in the IoT device 10 is enabled, the traffic data of the IoT card will be consumed when the IoT device 10 interacts with the cloud platform 11, and the traffic data will be consumed when the IoT device 10 interacts with the cloud platform 11 successfully, and the traffic data will also be consumed when the interaction fails. When the IoT device 10 interacts with the cloud platform 11, a request failure compensation mechanism is adopted to obtain the device-side traffic counted by the IoT device 10 within a first preset period, which is composed of the first traffic generated when the interaction is successful and the second traffic generated when the interaction fails, and to obtain the third traffic generated by the cloud platform 11 within the first preset period, which is composed of the third traffic generated when the interaction is successful and the fourth traffic generated when the interaction fails. By supplementing the request failure compensation mechanism between the IoT device 10 and the cloud platform 11, it is ensured that data is not lost when the IoT device 10 and the cloud platform 11 interact, thereby ensuring the authenticity and integrity of the traffic data statistics.
[0018] Optionally, the Internet of Things card used in this embodiment can be an IoT 4G network card, or it can be other types of network cards that support the device to achieve Internet access function, and this application does not make specific restrictions on this.
[0019] It is understandable that the first preset period is set according to actual conditions, such as 1 hour, 1 day, etc., and this application does not impose any specific restrictions on this.
[0020] In one application mode, a traffic calculation module is respectively set in the IoT device 10 and the cloud platform 11. The IoT device 10 obtains the device-side traffic through the traffic calculation module, and the cloud platform 11 obtains the platform-side traffic through the traffic calculation module.
[0021] In another application mode, a traffic statistics model is pre-trained using a machine learning algorithm and applied to the IoT device 10 and the cloud platform 11, respectively, so that the device-side traffic and the platform-side traffic are obtained through the model.
[0022] S102: Obtain traffic statistics within a first preset period based on device-side traffic and platform-side traffic.
[0023] Specifically, based on the device-side traffic and the platform-side traffic, the traffic statistics within the first preset period are calculated. By reasonably calculating the device-side and platform-side traffic data and setting the statistical period within a reasonable range, the dependence on the operator side is removed, thereby ensuring the authenticity of the data statistics.
[0024] In one application mode, the sum of the device-side traffic and the platform-side traffic is obtained, and traffic statistics within a first preset period are determined based on the sum.
[0025] In an application scenario, traffic statistics within a first preset period are determined based on an average value of a sum of device-side traffic and platform-side traffic.
[0026] In another application, a weighted average is calculated based on the device-side traffic and the weight of the device-side traffic, as well as the platform-side traffic and the weight of the platform-side traffic, so as to determine the traffic statistics within the first preset period.
[0027] S103: Manage the IoT device based on the traffic statistics data and the current traffic of the IoT card in the IoT device; wherein the current traffic is the traffic in the IoT card before the traffic statistics data is obtained.
[0028] Specifically, the status of the IoT device 10 is managed based on the traffic statistics data and the current traffic of the IoT card in the IoT device 10, wherein the current traffic is the total traffic data remaining in the IoT card before obtaining the traffic statistics data within the first preset period. By using the IoT card as a benchmark when counting traffic, it is possible to ensure that the IoT device 10 achieves a closed loop of traffic data statistics when other IoT cards are replaced or a network cable is connected, thereby further ensuring the authenticity of the traffic data statistics. In addition, the traffic usage of the IoT card can be detected in real time through the traffic statistics data, thereby ensuring the availability of the IoT device 10.
[0029] In one application, when the difference between the current traffic of the IoT card in the IoT device 10 and the traffic statistical data meets the traffic threshold condition, a control instruction is sent to the IoT device 10 to manage the status of the IoT device 10.
[0030] In another application method, when the difference between the current traffic of the IoT card in the IoT device 10 and the traffic statistical data meets the traffic threshold condition, a control instruction and a corresponding prompt code are sent to the IoT device 10 to manage the status of the IoT device 10, and the user is prompted through the prompt code to satisfy the user's experience.
[0031] The above scheme obtains the device-side traffic within the first preset period, and obtains the platform-side traffic within the first preset period; wherein the device-side traffic includes the first traffic generated when the interaction between the IoT device 10 and the cloud platform 11 is successful and the second traffic generated when the interaction fails, and the platform-side traffic includes the third traffic generated when the interaction between the IoT device 10 and the cloud platform 11 is successful and the fourth traffic generated when the interaction fails, and the request failure compensation mechanism is supplemented between the IoT device 10 and the cloud platform 11 to ensure that data is not lost when the IoT device 10 and the cloud platform 11 interact, thereby ensuring the authenticity and integrity of the traffic data statistics. Based on the device-side traffic and the platform-side traffic, The traffic statistics data within the first preset period, through reasonable statistics and calculation of device-side traffic and platform-side traffic, and setting the statistical period within a reasonable range, removes the dependence on the operator side, ensures the authenticity of the traffic data statistics, and manages the status of the Internet of Things device 10 based on the traffic statistics data and the current traffic of the Internet of Things card in the Internet of Things device 10. By taking the Internet of Things card as the benchmark when counting traffic, it can ensure that the Internet of Things device 10 achieves a closed loop of traffic data statistics when other Internet of Things cards are replaced or network cables are connected, thereby further ensuring the authenticity of the traffic data statistics, and the use of the Internet of Things card traffic can be detected in real time through the traffic statistics data, thereby ensuring the availability of the Internet of Things device 10.
[0032] In one embodiment, see Figure 3 , Figure 3 It is a structural diagram of another embodiment of the IoT device traffic statistics system of the present application. The cloud platform 11 includes a device long connection gateway service module 110, a traffic aggregation statistics service module 111, a cache middleware module 112, a timed task module 113 and a business service module 114. The step S101 of obtaining the device side traffic within the first preset period specifically includes: using the device long connection gateway service module 110 to obtain the device side traffic sent by the IoT device 10; wherein the device long connection gateway service module 110 is used to transmit the uplink instruction sent by the IoT device 10 to the business service module 114; using the traffic aggregation statistics service module 111 to obtain the device side traffic sent by the device long connection gateway service module 110 according to the second preset period; using the cache middleware module 112 to obtain and store the device side traffic; using the timed task module 113 to obtain the device side traffic according to the first preset period.
[0033] Specifically, the cloud platform 11 uses the device long connection gateway service module 110 to obtain the device-side traffic sent by the Internet of Things device 10, and sends the device-side traffic to the traffic aggregation statistics service module 111 according to the second preset period, uses the cache middleware module 112 to obtain the device-side traffic in the traffic aggregation statistics service module 111 and stores it, and uses the scheduled task module 113 to obtain the device-side traffic stored in the cache middleware module 112 according to the first preset period, wherein the second preset period is specifically set according to the actual situation, such as 1 minute, 2 minutes, etc., and this application does not make any specific restrictions on this.
[0034] Optionally, the cache middleware module 112 may choose to use Redis (Remote Dictionary Server), MemCached (distributed cache system), etc., and this application does not impose any specific restrictions on this.
[0035] In one implementation scenario, the steps of obtaining and storing device-side traffic using the cache middleware module 112 specifically include: obtaining device-side traffic using the cache middleware module 112; storing the device-side traffic according to a first preset naming structure; wherein the first preset naming structure includes a first identifier, a field, and a storage value.
[0036] Specifically, after the cloud platform 11 obtains the device-side traffic using the cache middleware module 112 , the device-side traffic is stored according to a first preset structure of a first identifier, a field, and a storage value.
[0037] In a specific implementation scenario, please refer to Table 1, which is a device-side traffic data cache data structure, wherein the cache data structure type is a hash type, the first identifier is deviceCount:timeDay:{iccid}, deviceCount is the device identifier, timeDay is the time identifier specific to the day, the format is yyyyMMdd, and iccid is the card identifier of the Internet of Things card; the field uses the hour level and the interval minute (5 minutes is taken as an example in Table 1) as the naming format, and the specific algorithm rule is: String.format("%02d%s",hour,(minute / interval)*interval), hour is the current hour, minute is the current minute, and interval is the periodic interval; value is the traffic value consumed by the current card number, and the data features are stored as Long type.
[0038] Table 1: Data structure of device-side traffic data cache
[0039]
[0040] In one embodiment, obtaining the platform side traffic within the first preset period in step S101 specifically includes: in response to the platform side traffic satisfying the data statistical conditions, using the traffic aggregation statistics service module 111 to obtain the platform side traffic; using the cache middleware module 112 to obtain and store the platform side traffic; using the scheduled task module 113 to obtain the platform side traffic stored in the cache middleware module 112 according to the first preset period.
[0041] Specifically, when the platform-side traffic meets the data statistics conditions, the cloud platform 11 uses the traffic aggregation statistics service module 111 to obtain the platform-side traffic, and then uses the cache middleware module 112 to obtain the platform-side traffic in the traffic aggregation statistics service module 111 and store it, and uses the timing task module 113 to obtain the platform-side traffic stored in the cache middleware module 112 according to the first preset period, wherein the data statistics conditions may be that the statistical time meets the time threshold, or that the traffic value of the stored platform-side traffic meets the numerical condition, and the present application does not impose any specific restrictions on this.
[0042] In an implementation scenario, please continue to refer to Figure 3The cloud platform 11 also includes a device registration service module 115, a device media data processing service module 116, and a device real-time stream processing service module 117, wherein the step of using the traffic aggregation statistics service module 111 to obtain the platform-side traffic specifically includes: using the traffic aggregation statistics service module 111 to obtain the first traffic data generated when the device registration service module 115 interacts with the Internet of Things device 10; wherein the device registration service module 115 is used to register the Internet of Things device 10 to the cloud platform 11; using the traffic aggregation statistics service module 111 to obtain the first traffic data generated when the device long connection gateway service module 110 interacts with the Internet of Things device 10 The second flow data is generated when the device 10 interacts; the third flow data is generated when the device media data processing service module 116 interacts with the Internet of Things device 10 by using the flow aggregation statistics service module 111; wherein the device media data processing service module 116 is used to send the media data uploaded by the Internet of Things device 10 to the cloud platform 11; the fourth flow data is generated when the device real-time stream processing service module 117 interacts with the Internet of Things device 10 by using the flow aggregation statistics service module 111; wherein the device real-time stream processing service module 117 is used to process the real-time stream data sent by the Internet of Things device 10.
[0043] Specifically, the device registration service module 115 is used to register the IoT device 10 to the cloud platform 11, and calculate and count the network-side data of the device's registration request response to obtain the first traffic data; the device long connection gateway service is used to transmit the uplink instruction sent by the IoT device 10 to the business service module 114, and calculate and count the network-side data of these uplink instruction request responses to obtain the second traffic data; the device media data processing service module 116 is used to send the media data uploaded by the IoT device 10 to the cloud platform 11, and perform cloud storage, calculate and count the network-side data of these media data request responses to obtain the third traffic data; the device real-time stream processing service module 117 is used to process the real-time stream data sent by the IoT device 10, and calculate and count the network-side data of these real-time stream request responses to obtain the fourth traffic data, and use the traffic aggregation statistics service module 111 to obtain the platform-side traffic composed of the first traffic data, the second traffic data, the third traffic data and the fourth traffic data. Through the distributed service module architecture design, the general functions of the IoT device 10 can be realized, and the access and traffic statistics functions of various IoT devices 10 can be supported, thereby improving the versatility of traffic data statistics.
[0044] Furthermore, each service module can independently calculate and statistically calculate traffic. When the traffic of a service module increases, only more resources need to be added to the service module without affecting other service modules. This makes traffic statistics more accurate and can be performed based on the actual load of each service module, thereby improving the scalability of traffic data statistics. The traffic generated by the interaction of each service module can be recorded and analyzed in detail within it, without the need to collect data across modules, simplifying the statistical process and thus improving the availability of traffic data statistics.
[0045] In a specific implementation scenario, the first flow data, the second flow data, the third flow data, and the fourth flow data can be integrated into platform-side flow data using SDK (Software Development Kit). In other implementation scenarios, different integration methods can also be used to process the flow. This application does not impose any specific restrictions on this.
[0046] In one implementation scenario, the steps of using the cache middleware module 112 to obtain and store platform-side traffic specifically include: using the cache middleware module 112 to obtain platform-side traffic; storing the platform-side traffic according to a second preset naming structure; wherein the second preset naming structure includes a second identifier, a field, and a storage value.
[0047] Specifically, after the cloud platform 11 obtains the platform-side traffic using the cache middleware module 112 , the cloud platform 11 stores the platform-side traffic according to the second preset structure of the second identifier, field, and storage value.
[0048] In a specific implementation scenario, please refer to Table 2, which is a platform-side traffic data cache structure, wherein the cache data structure type is a hash type, the second identifier is cloudCount:timeDay:{iccid}, cloudCount is the cloud platform 11 identifier, timeDay is a specific time identifier for the day, the format is yyyyMMdd, and iccid is the card identifier of the Internet of Things card; the field uses hourly level and interval minutes (5 minutes is taken as an example in Table 2) as the naming format, and the specific algorithm rules can be found in the specific description of the above embodiment, which will not be repeated here.
[0049] Table 2: Platform-side traffic data cache data structure
[0050]
[0051] Optionally, the cloud platform 11 uses the scheduled task module 113 to obtain the device-side traffic and platform-side traffic within the first preset period, and then performs calculations to obtain traffic statistics, and sends the traffic statistics to the business service module 114. In some implementation scenarios, https or Kafka, RabbitMQ, ActiveMQ, RocketMQ and other message middleware can be used for sending, and this application does not impose any specific restrictions on this.
[0052] In one implementation scenario, the cloud platform 11 also includes a device login service module (not shown), which is used to log in to the IoT device 10. In step S103, based on the traffic statistics and the current traffic of the IoT card in the IoT device 10, managing the IoT device 10 specifically includes: in response to the business service module 114 detecting that the difference between the current traffic and the traffic statistics meets the traffic threshold condition, using the business service module 114 to send an offline instruction to the device login service module; using the device login service module to send the offline instruction to the IoT device 10; using the device registration service module 115 to obtain the registration instruction generated by the IoT device 10 in response to the offline instruction at a preset time interval; using the device registration service module 115 to detect whether the current traffic in the IoT card meets the traffic threshold condition based on the registration instruction, if it does, using the device login service module to log in to the IoT device 10, otherwise using the device registration service module 115 to send a status code to the IoT device 10, and returning to the step of using the device registration service module 115 to obtain the registration instruction generated by the IoT device 10 in response to the offline instruction at a preset time interval.
[0053] Specifically, when the flow of the IoT card in the IoT device 10 is sufficient, the IoT device 10 can log in normally and perform business operations. When the business service module 114 detects that the difference between the current flow and the flow statistics data meets the flow threshold condition, the business service module 114 is used to send an offline instruction to the device login service module, and the device login service module is used to send an offline instruction to the IoT device 10 to notify the IoT device 10 to go offline. After receiving the offline instruction, the IoT device 10 will generate a registration instruction and send the registration instruction to the device registration service module 115 at a preset time interval. The device registration service module After receiving the registration instruction, block 115 detects whether the current traffic in the IoT card meets the traffic threshold condition. If the traffic threshold condition is met, the device login module is used to log in to the IoT device 10. If the traffic threshold condition is not met, a status code is generated, which indicates that the registration is unsuccessful, and the device registration service module 115 is continued to be used to obtain the registration instruction generated by the IoT device 10 in response to the offline instruction at a preset time interval. The business service module 114 on the cloud platform 11 side detects whether the IoT card traffic in the IoT device 10 is available and notifies the offline mechanism, which can further ensure the reliability of traffic data statistics.
[0054] It is understandable that the preset time interval can be set according to actual conditions, such as 5 minutes, 10 minutes, etc., and this application does not impose any specific restrictions on this.
[0055] See also Figure 4 , Figure 44 is a schematic diagram of the structure of an embodiment of an electronic device of the present application, wherein the electronic device 40 comprises a memory 401 and a processor 402 coupled to each other, wherein the memory 401 stores program data (not shown), and the processor 402 calls the program data to implement the method in any of the above embodiments, and the description of the relevant contents can be found in the detailed description of the above method embodiments, which will not be repeated here. Specifically, the electronic device 40 includes but is not limited to: a desktop computer, a laptop computer, a tablet computer, a server, etc., which are not limited here. In addition, the processor 402 can also be referred to as a CPU (Center Processing Unit). The processor 402 may be an integrated circuit chip with signal processing capabilities. The processor 402 may also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 402 may be implemented by an integrated circuit chip.
[0056] See also Figure 5 , Figure 5 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 50 stores program data 500. When the program data 500 is executed by a processor, the method in any of the above embodiments is implemented. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0057] It should be noted that the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
[0058] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0059] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0060] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A device management method based on traffic statistics, characterized in that: Applied to an Internet of Things device traffic statistics system, the Internet of Things device traffic statistics system includes an Internet of Things device and a cloud platform, and the method includes: Obtain device-side traffic within a first preset period, and obtain platform-side traffic within the first preset period; wherein the device-side traffic includes a first traffic generated when the IoT device interacts successfully with the cloud platform and a second traffic generated when the interaction fails, and the platform-side traffic includes a third traffic generated when the IoT device interacts successfully with the cloud platform and a fourth traffic generated when the interaction fails, as counted by the cloud platform; Based on the device-side traffic and the platform-side traffic, obtaining traffic statistics data within the first preset period; Based on the traffic statistics data and the current traffic of the Internet of Things card in the Internet of Things device, the Internet of Things device is managed; wherein the current traffic is the traffic in the Internet of Things card before the traffic statistics data is obtained.
2. The method according to claim 1, characterized in that The cloud platform includes a device long connection gateway service module, a traffic aggregation statistics service module, a cache middleware module, a timed task module and a business service module; The obtaining of device-side traffic within a first preset period includes: The device-side traffic sent by the IoT device is obtained by using the device long connection gateway service module; wherein the device long connection gateway service module is used to transmit the uplink instruction sent by the IoT device to the business service module; Utilizing the traffic aggregation statistics service module to obtain the device-side traffic sent by the device long connection gateway service module according to a second preset period; Utilizing the cache middleware module to obtain and store the device-side traffic; The timing task module is used to obtain the device-side traffic according to the first preset period.
3. The method according to claim 2, characterized in that The using the cache middleware module to obtain and store the device-side traffic includes: Using the cache middleware module to obtain the device side traffic; The device-side traffic is stored according to a first preset naming structure; wherein the first preset naming structure includes a first identifier, a field, and a storage value.
4. The method according to claim 2, characterized in that: The obtaining of the platform side traffic within the first preset period includes: In response to the platform-side traffic satisfying a data statistics condition, using the traffic aggregation statistics service module to obtain the platform-side traffic; Utilize the cache middleware module to obtain and store the platform-side traffic; The timing task module is utilized to obtain the platform-side traffic stored in the cache middleware module according to the first preset period.
5. The method according to claim 4, characterized in that The cloud platform also includes a device registration service module, a device media data processing service module, and a device real-time stream processing service module; The obtaining the platform-side traffic by using the traffic aggregation statistics service module includes: The traffic aggregation statistics service module is used to obtain the first traffic data generated when the device registration service module interacts with the Internet of Things device; wherein the device registration service module is used to register the Internet of Things device to the cloud platform; The traffic aggregation statistics service module is used to obtain second traffic data generated when the device long connection gateway service module interacts with the Internet of Things device; The traffic aggregation statistics service module is used to obtain the third traffic data generated when the device media data processing service module interacts with the IoT device; wherein the device media data processing service module is used to send the media data uploaded by the IoT device to the cloud platform; The traffic aggregation statistics service module is used to obtain the fourth traffic data generated when the device real-time stream processing service module interacts with the Internet of Things device; wherein the device real-time stream processing service module is used to process the real-time stream data sent by the Internet of Things device.
6. The method according to claim 4, characterized in that The using the cache middleware module to obtain and store the platform-side traffic includes: Using the cache middleware module to obtain the platform side traffic; The platform-side traffic is stored according to a second preset naming structure; wherein the second preset naming structure includes a second identifier, a field, and a storage value.
7. The method according to claim 5, characterized in that The cloud platform also includes a device login service module; The managing the IoT device based on the traffic statistics data and the current traffic of the IoT card in the IoT device includes: In response to the business service module detecting that the difference between the current traffic and the traffic statistical data meets the traffic threshold condition, using the business service module to send an offline instruction to the device login service module; Using the device login service module to send the offline instruction to the Internet of Things device; Using the device registration service module to obtain the registration instruction generated by the IoT device in response to the offline instruction at a preset time interval; The device registration service module is used to detect whether the current traffic in the Internet of Things card meets the traffic threshold condition based on the registration instruction. If it does, the device login service module is used to log in to the Internet of Things device. Otherwise, the device registration service module is used to send a status code to the Internet of Things device, and return to the step of using the device registration service module to obtain the registration instruction generated by the Internet of Things device in response to the offline instruction at a preset time interval.
8. The method according to claim 1, characterized in that The obtaining, based on the device-side traffic and the platform-side traffic, traffic statistics data within the first preset period includes: The sum of the device-side traffic and the platform-side traffic is obtained, and the traffic statistical data within the first preset period is determined based on the sum.
9. An electronic device, characterized in that: The method comprises a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the method according to any one of claims 1 to 8.
