A data transmission method, device, system, equipment and medium

By monitoring the remaining traffic of the device and stopping the pulling of the flow when the traffic is below the threshold and maintaining the heartbeat to maintain the activeness, the problem of the device being disconnected from the cloud platform due to traffic exhaustion is solved, and the rapid recovery of data transmission and improvement of work efficiency is achieved.

CN119545328BActive Publication Date: 2025-05-09ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510080384.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-09
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

In the data transmission between wireless network devices and cloud platforms, the device is broken from the link with the cloud platform due to exhaustion of traffic, resulting in the inability to remote fault location and repair. Users need to manually restart the device to restore the connection, which is inefficient.

Method used

By monitoring the remaining flow of the device, when the flow is below the preset threshold, the flow is stopped and the heartbeat is maintained, and when the flow is sufficient, data transmission is resumed.

Benefits of technology

This avoids the equipment from breaking the link with the cloud platform due to traffic exhaustion, realizes the rapid recovery of data transmission between the equipment and the cloud platform, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119545328B_ABST
    Figure CN119545328B_ABST
Patent Text Reader

Abstract

The present application discloses a data transmission method, apparatus, system, device and medium, which are used to avoid the device from being disconnected from the cloud platform due to traffic exhaustion, so that when the traffic of the device is sufficient, the data transmission between the device and the cloud platform can be quickly restored. In the process of pulling the stream from the first device and forwarding it to the second device through the current SIM card of the first device that establishes a data transmission connection with the cloud platform, if the current SIM card is a SIM card for managing traffic on the cloud platform, the remaining traffic of the current SIM card is monitored; when it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, the stream is stopped from being pulled from the first device through the current SIM card, and based on the remaining traffic of the current SIM card of the first device, the heartbeat keep-alive between the first device and the first device is maintained; when it is determined that the first device meets the conditions for continuing to pull the stream, the stream is continued to be pulled from the first device and forwarded to the second device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data transmission method, device, system, equipment and medium. Background Art

[0002] Wireless network equipment is widely used in scenes where wiring is inconvenient, such as parks and fish ponds. Video surveillance in these places is mostly achieved through Wi-Fi and cellular networks, and the collected real-time video data is finally transmitted to the back-end monitoring cloud platform. The wireless link between the device and the cloud platform is very critical. Once interrupted, the device will become an island, and it will be impossible to locate and repair the fault through remote technology. The traditional repair solution is that technical support personnel arrive at the site to connect to the device through the serial port or Ethernet port of the device, and then reproduce the problem for fault analysis and repair. In particular, due to the problem of offline due to overdraft of traffic, the device cannot automatically go online after the user recharges, and the user needs to rush to the site to restart the device before it can go online, so the work efficiency is very low. Summary of the invention

[0003] The embodiments of the present application provide a data transmission method, apparatus, system, device and medium, which are used to monitor the remaining traffic of a device that transmits data between a cloud platform to avoid the device being disconnected from the cloud platform due to traffic exhaustion, so that when the device traffic is sufficient, data transmission between the device and the cloud platform can be quickly restored.

[0004] A data transmission method provided in an embodiment of the present application includes:

[0005] In the process of pulling a stream from a first device and forwarding it to a second device through a current SIM card of a first device that establishes a data transmission connection with a cloud platform, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform, monitoring the remaining traffic of the current SIM card;

[0006] When it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, stop pulling traffic from the first device through the current SIM card, and maintain a heartbeat keep-alive with the first device based on the remaining traffic of the current SIM card of the first device;

[0007] When it is determined that the first device meets the condition for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device.

[0008] The data transmission method provided in the embodiment of the present application, in the process of pulling the flow from the first device and forwarding it to the second device through the current SIM card of the first device that establishes a data transmission connection with the cloud platform, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform, the remaining traffic of the current SIM card is monitored; when it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, the flow pulling from the first device through the current SIM card is stopped, and based on the remaining traffic of the current SIM card of the first device, the heartbeat keep-alive between the first device and the first device is maintained; when it is determined that the first device meets the conditions for continuing to pull the flow, the flow pulling from the first device continues and forwarding it to the second device, thereby avoiding the device from being disconnected from the cloud platform due to traffic exhaustion by monitoring the remaining traffic of the device that performs data transmission with the cloud platform, so that when the traffic of the device is sufficient, the data transmission between the device and the cloud platform can be quickly restored.

[0009] In some embodiments, when it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, the method further includes: sending a notification to the second device to stop pulling traffic for the first device and that the remaining traffic of the current SIM card of the first device is insufficient;

[0010] When it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0011] When it is determined that the remaining traffic of the current SIM card of the first device is greater than the preset threshold, the traffic is continued to be pulled from the first device and forwarded to the second device.

[0012] In some embodiments, when it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0013] If it is determined that there is a backup SIM card in the first device, the backup SIM card is also a SIM card whose traffic management is implemented by the cloud platform, and the remaining traffic of the backup SIM card is greater than a preset threshold, the first device is notified to switch the current SIM card to the backup SIM card, and continue to pull traffic from the first device and forward it to the second device.

[0014] In some embodiments, when it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0015] If it is determined that there is a standby SIM card in the first device, and the standby SIM card is not a SIM card for which traffic management is implemented by the cloud platform, notifying the first device to switch the current SIM card to the standby SIM card;

[0016] If it is determined that the first device has re-established a data transmission connection with the cloud platform, the stream is continued to be pulled from the first device and forwarded to the second device.

[0017] In some embodiments, the method further comprises:

[0018] When receiving a stream pulling request from the second device for the first device, if it is determined that the current SIM card of the first device is not a SIM card whose traffic management is implemented by the cloud platform, determining whether the heartbeat keep-alive link of the first device is normal;

[0019] If yes, pull the stream from the first device and forward it to the second device;

[0020] Otherwise, the connection with the first device is disconnected, and a notification is sent to the second device that the first device is offline and the user is required to recharge or replace the SIM card in the first device.

[0021] In some embodiments, the method further comprises:

[0022] Based on the time when the second device logs into the cloud platform, and / or the user's behavior of viewing the data stream transmitted by the first device, a first time period is determined and sent to the first device, so that the first device increases the switching frequency of the SIM card in the first time period, and / or increases the frequency of re-entry operations.

[0023] Accordingly, on the first device side, an embodiment of the present application provides a data transmission method, including:

[0024] When a data transmission connection is established between the first device and the cloud platform based on the current SIM card of the first device, if a stream pulling request from the cloud platform is received, a data stream is sent to the cloud platform based on the stream pulling request, so that the cloud platform forwards the data stream to the second device for the user to view;

[0025] When receiving the notification sent by the cloud platform to stop pulling the stream and maintain the heartbeat keepalive between the first device and the cloud platform, stop sending the data stream to the cloud platform, and maintain the heartbeat keepalive between the first device and the cloud platform based on the remaining traffic of the current SIM card.

[0026] In some embodiments, the method further comprises:

[0027] During the heartbeat keep-alive period between the first device and the cloud platform:

[0028] When receiving a notification from the cloud platform to switch the current SIM card to a standby SIM card, executing an operation of switching the SIM card, and continuing to transmit data streams to the cloud platform based on the switched SIM card;

[0029] When it is detected that the first device has a spare SIM card, the SIM card is switched and it is determined whether the switched SIM card can be online. If yes, the data stream is continuously transmitted to the cloud platform based on the switched SIM card; otherwise, the original SIM card is switched back to maintain the heartbeat keepalive between the first device and the cloud platform;

[0030] When receiving a notification that the user has successfully recharged the SIM card in the first device, the SIM card that has been successfully recharged is set as the current SIM card, and the data stream continues to be transmitted to the cloud platform.

[0031] In some embodiments, the method further comprises:

[0032] When the heartbeat keepalive between the first device and the cloud platform fails:

[0033] If the first device does not have a spare SIM card, re-initiate a network registration operation based on the current SIM card, and determine whether the heartbeat keepalive between the first device and the cloud platform can be restored;

[0034] If the first device has a spare SIM card, the SIM card is switched and the network registration operation is re-initiated based on the switched SIM card. When the first device fails to go back online, the SIM card is switched periodically and the network registration operation is re-initiated based on the switched SIM card.

[0035] In some embodiments, the method further includes: receiving a first time period notified by the cloud platform; the first time period is a time period determined by the cloud platform based on the time when the second device logs into the cloud platform and / or the behavior of the user viewing the data stream transmitted by the first device;

[0036] The operation of re-initiating network registration based on the current SIM card is performed periodically, and the period of re-initiating network registration based on the current SIM card in the first time period is higher than the period of re-initiating network registration based on the current SIM card in a non-first time period;

[0037] In the first time period, the period of switching SIM cards and re-initiating network registration based on the switched SIM card is higher than the period of switching SIM cards and re-initiating network registration based on the switched SIM card during a period other than the first time period.

[0038] On the cloud platform side, an embodiment of the present application provides a data transmission device, including:

[0039] a remaining traffic monitoring unit, configured to monitor the remaining traffic of the current SIM card in the process of pulling traffic from the first device and forwarding it to the second device through the current SIM card of the first device that establishes a data transmission connection with the cloud platform, if the current SIM card is a SIM card for which traffic management is implemented by the cloud platform;

[0040] A pausing flow pulling unit is used to stop pulling the flow from the first device through the current SIM card when it is determined that the remaining flow of the current SIM card of the first device is lower than a preset threshold, and maintain a heartbeat keep-alive between the first device and the first device based on the remaining flow of the current SIM card of the first device;

[0041] The stream-pulling continuing unit is configured to, when it is determined that the first device meets the conditions for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device.

[0042] Accordingly, on the first device side, an embodiment of the present application provides a data transmission device, including:

[0043] A data stream sending unit, configured to, when a data transmission connection is established between the first device and the cloud platform based on the current SIM card of the first device, send a data stream to the cloud platform based on a stream pulling request from the cloud platform, so that the cloud platform forwards the data stream to the second device for viewing by the user;

[0044] The data stream pause unit is used to stop sending data stream to the cloud platform when receiving a notification from the cloud platform to stop pulling streams and maintain heartbeat keep-alive between the first device and the cloud platform, and maintain heartbeat keep-alive between the first device and the cloud platform based on the remaining traffic of the current SIM card.

[0045] A data transmission system provided in an embodiment of the present application includes: at least one first device and at least one second device on a cloud platform; wherein:

[0046] The cloud platform is used for:

[0047] In the process of pulling a stream from a first device and forwarding it to a second device through a current SIM card of the first device that establishes a data transmission connection with the cloud platform, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform, monitoring the remaining traffic of the current SIM card;

[0048] When it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, stop pulling traffic from the first device through the current SIM card, and maintain a heartbeat keep-alive with the first device based on the remaining traffic of the current SIM card of the first device;

[0049] When it is determined that the first device meets the condition for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device;

[0050] The first device is used for:

[0051] When a data transmission connection is established between the first device and the cloud platform based on the current SIM card of the first device, if a stream pulling request from the cloud platform is received, a data stream is sent to the cloud platform based on the stream pulling request, so that the cloud platform forwards the data stream to the second device for the user to view;

[0052] When receiving the notification sent by the cloud platform to stop pulling the stream and maintain the heartbeat keepalive between the first device and the cloud platform, stop sending the data stream to the cloud platform, and maintain the heartbeat keepalive between the first device and the cloud platform based on the remaining traffic of the current SIM card.

[0053] Another embodiment of the present application provides an electronic device, which includes a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions stored in the memory and execute any one of the methods according to the obtained program.

[0054] Another embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute any one of the methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. 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 paying creative work.

[0056] Figure 1 A flowchart of a data transmission method on a cloud platform side provided in an embodiment of the present application;

[0057] Figure 2 A schematic diagram of a flow chart of a data transmission method on a device side provided in an embodiment of the present application;

[0058] Figure 3 A schematic diagram of the system framework provided for an embodiment of the present application;

[0059] Figure 4 A schematic diagram of the working principle of the first device provided in an embodiment of the present application;

[0060] Figure 5 A schematic diagram of a specific flow chart of a data transmission method of the entire system provided in an embodiment of the present application;

[0061] Figure 6 A schematic diagram of a specific flow chart of a data transmission method of the entire system provided in an embodiment of the present application;

[0062] Figure 7 A schematic diagram of the structure of a data transmission system provided in an embodiment of the present application;

[0063] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0064] Fig. 9 A schematic diagram of the structure of a data transmission device on a cloud platform side provided in an embodiment of the present application;

[0065] Fig.10 A schematic diagram of the structure of a data transmission device on the device side provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] 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. 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.

[0067] The embodiments of the present application provide a data transmission method, apparatus, system, device and medium, which are used to monitor the remaining traffic of a device that transmits data between a cloud platform to avoid the device being disconnected from the cloud platform due to traffic exhaustion, so that when the device traffic is sufficient, data transmission between the device and the cloud platform can be quickly restored.

[0068] Among them, the method and the device, system, equipment, and medium are based on the same application concept. Since the principles of solving problems by the method and the device, equipment, and medium are similar, the implementation of the device, equipment, medium, and method can refer to each other, and the repeated parts will not be repeated.

[0069] The terms "first", "second", etc. (if any) in the specification and claims of the embodiments of the present application and the drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in a sequence other than the content illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0070] The following examples and embodiments are to be understood as illustrative examples only. Although this specification may refer to "one", "an" or "some" examples or embodiments in several places, this does not mean that each such reference relates to the same example or embodiment, nor does it mean that the feature applies only to a single example or embodiment. Individual features of different embodiments may also be combined to provide other embodiments. In addition, terms such as "including" and "comprising" should be understood as not limiting the described embodiments to consist only of those features that have been mentioned; such examples and embodiments may also include features, structures, units, modules, etc. that are not specifically mentioned.

[0071] The following is a detailed description of each embodiment of the present application in conjunction with the accompanying drawings. It should be noted that the display order of the embodiments of the present application only represents the order of the embodiments, and does not represent the advantages and disadvantages of the technical solutions provided by the embodiments.

[0072] On the cloud platform side, see Figure 1 , a data transmission method provided in an embodiment of the present application includes:

[0073] S101. In a process of pulling a data stream from a first device and forwarding it to a second device through a current SIM card of the first device that establishes a data transmission connection with a cloud platform, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform, monitoring the remaining traffic of the current SIM card;

[0074] The current SIM card is a SIM card whose traffic management is implemented by the cloud platform, that is, a SIM card belonging to the cloud platform.

[0075] The SIM card belonging to the cloud platform described in the embodiment of the present application means that the traffic management and tariff of the current SIM card are managed by the cloud platform. The user can recharge the SIM card belonging to the cloud platform through the SIM card recharge interface of the second device, and view the video captured by the first device based on the SIM card.

[0076] The third-party SIM card described in the embodiment of the present application, that is, the SIM card not belonging to the cloud platform, is a SIM card purchased by the user himself. The first device and the cloud platform cannot accurately know the traffic package information and remaining traffic information of the third-party SIM card, that is, it is impossible to implement traffic management, tariff management, etc. of the third-party SIM card.

[0077] The first device described in the embodiment of the present application may be, for example, a monitoring device: a camera, etc.;

[0078] The first device described in the embodiment of the present application is connected to the cloud platform and can be any IoT device that performs data transmission based on a cellular network, and is not limited to video-type data transmission devices.

[0079] The second device described in the embodiment of the present application may be, for example, a user equipment (UE).

[0080] S102: when it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, stop pulling traffic from the first device through the current SIM card, and maintain a heartbeat keep-alive with the first device based on the remaining traffic of the current SIM card of the first device;

[0081] S103: When it is determined that the first device meets the condition for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device.

[0082] In some embodiments, when it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, the method further includes: sending a notification to the second device to stop pulling traffic for the first device and that the remaining traffic of the current SIM card of the first device is insufficient;

[0083] When it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0084] When it is determined that the remaining traffic of the current SIM card of the first device is greater than a preset threshold (for example, the user recharges successfully), the traffic continues to be pulled from the first device and forwarded to the second device.

[0085] In some embodiments, when it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0086] If it is determined that there is a backup SIM card in the first device, the backup SIM card is also a SIM card whose traffic management is implemented by the cloud platform, and the remaining traffic of the backup SIM card is greater than a preset threshold, the first device is notified to switch the current SIM card to the backup SIM card, and continue to pull traffic from the first device and forward it to the second device.

[0087] In some embodiments, when it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0088] If it is determined that there is a standby SIM card in the first device, and the standby SIM card is not a SIM card for which traffic management is implemented by the cloud platform, notifying the first device to switch the current SIM card to the standby SIM card;

[0089] If it is determined that the first device has re-established a data transmission connection with the cloud platform, the stream is continued to be pulled from the first device and forwarded to the second device.

[0090] In some embodiments, the method further comprises:

[0091] When receiving a stream pulling request from the second device for the first device, if it is determined that the current SIM card of the first device is not a SIM card whose traffic management is implemented by the cloud platform (i.e., a third-party SIM card), determining whether the heartbeat keep-alive link of the first device is normal;

[0092] If yes, pull the stream from the first device and forward it to the second device;

[0093] Otherwise, the connection with the first device is disconnected, and a notification is sent to the second device that the first device is offline and the user is required to recharge or replace the SIM card in the first device.

[0094] In some embodiments, the method further comprises:

[0095] Based on the time when the second device logs into the cloud platform, and / or the user's behavior of viewing the data stream transmitted by the first device, a first time period (i.e., the user's active time period) is determined and sent to the first device, so that the first device increases the switching frequency of the SIM card in the first time period, and / or increases the frequency of re-entry operations.

[0096] Accordingly, on the first device side, see Figure 2 , a data transmission method provided in an embodiment of the present application includes:

[0097] S201, when a data transmission connection is established between the first device and the cloud platform based on the current SIM card of the first device, if a stream pulling request from the cloud platform is received, a data stream is sent to the cloud platform based on the stream pulling request, so that the cloud platform forwards the data stream to the second device for the user to view;

[0098] S202. When receiving the notification from the cloud platform to stop streaming and maintain the heartbeat keepalive between the first device and the cloud platform, stop sending data streams to the cloud platform, and maintain the heartbeat keepalive between the first device and the cloud platform based on the remaining traffic of the current SIM card.

[0099] In some embodiments, the method further comprises:

[0100] During the heartbeat keep-alive period between the first device and the cloud platform:

[0101] When receiving a notification from the cloud platform to switch the current SIM card to a standby SIM card, executing an operation of switching the SIM card, and continuing to transmit data streams to the cloud platform based on the switched SIM card;

[0102] When it is detected that the first device has a spare SIM card, for example, by using a GPIO detection pin to monitor in real time whether a new SIM card is inserted into the first device, the SIM card is switched and it is determined whether the switched SIM card can be online. If so, the data stream is continuously transmitted to the cloud platform based on the switched SIM card; otherwise, the original SIM card is switched back to maintain the heartbeat keep-alive between the first device and the cloud platform;

[0103] When receiving a notification that the user has successfully recharged the SIM card in the first device, the SIM card that has been successfully recharged is set as the current SIM card, and the data stream continues to be transmitted to the cloud platform. The notification may be sent by the second device, the cloud platform, or other devices. The SIM card that has been successfully recharged may be the first SIM card or the second SIM card.

[0104] In some embodiments, the method further comprises:

[0105] When the heartbeat keepalive between the first device and the cloud platform fails:

[0106] If the first device does not have a spare SIM card, re-initiate a network registration operation based on the current SIM card, and determine whether the heartbeat keepalive between the first device and the cloud platform can be restored;

[0107] If the first device has a spare SIM card, the SIM card is switched and the network registration operation is re-initiated based on the switched SIM card. When the first device fails to go back online, the SIM card is switched periodically and the network registration operation is re-initiated based on the switched SIM card.

[0108] In some embodiments, the method further includes: receiving a first time period notified by the cloud platform; the first time period is a time period determined by the cloud platform based on the time when the second device logs into the cloud platform and / or the behavior of the user viewing the data stream transmitted by the first device;

[0109] The operation of re-initiating network registration based on the current SIM card is performed periodically, and the period of re-initiating network registration based on the current SIM card in the first time period is higher than the period of re-initiating network registration based on the current SIM card in a non-first time period;

[0110] In the first time period, the period of switching SIM cards and re-initiating network registration based on the switched SIM card is higher than the period of switching SIM cards and re-initiating network registration based on the switched SIM card during a period other than the first time period.

[0111] For example, the system provided in the embodiment of the present application, see Figure 3 , mainly including the offline problem of cellular first devices (such as monitoring devices) due to cellular network traffic overdraft. The first device integrated with the cellular module pushes the collected video information to the monitoring cloud platform in real time through the cellular network. The first device and the cloud platform are interconnected through the cellular network to achieve remote video monitoring. The user's second device (such as a mobile phone) connects to the monitoring cloud platform through wifi, sends a stream request to the first device, and then the first device pushes the code stream to the second device in real time through the cellular network.

[0112] The working principle of the first device is as follows Figure 4 As shown, DSP is the main processor of the first device, also called the main control, which is responsible for the implementation and execution of all the logic of the first device. The cellular module is connected to the main control through the USB bus, and the cellular module is connected to the card slots of two SIM cards (SIM1 and SIM2) through the SIM switch. The main control can control the SIM switch as needed to connect the cellular module to the specified SIM, thereby switching the cellular network.

[0113] The cellular module is, for example, a dual-SIM single-standby module, that is, the module can only work on the Internet based on one SIM card at a time, and cannot achieve dual-SIM standby or Internet access at the same time.

[0114] Sim1_detect and Sim2_detect are detection pins for the first SIM card and the second SIM card respectively, used to detect whether a SIM card is inserted into the first SIM card slot and the second SIM card slot, and to realize real-time perception of SIM card insertion through the interrupt GPIO pin of the main control.

[0115] See also Figure 5 The data transmission method of the entire system provided in the embodiment of the present application includes:

[0116] If there is at least one SIM card in the card slot of the first device that belongs to the cloud platform, then after the first device is powered on, it registers to access the Internet based on the current SIM card;

[0117] The current SIM card may be the first SIM card or the second SIM card. Assuming that the current SIM card is the first SIM card, that is, the first device currently performs data transmission based on the first SIM card, after the first device is powered on, it initiates registration with the cloud platform through the first SIM card, and reports the SIM card number of the first device to the cloud platform;

[0118] If SIM cards are inserted into both card slots of the current first device, the card numbers of the two cards, namely ICCIDs (Integrated circuit card identity, i.e., the card numbers of the SIM cards), are reported to the cloud platform.

[0119] The cloud platform will record the information of the first device (including the card numbers of the first SIM card and the second SIM card) for later SIM card switching strategies.

[0120] If the card number provided by the first device is the SIM card belonging to the cloud platform, the cloud platform will perform traffic management on the first device and monitor the remaining traffic of the current SIM card in real time to prevent the first device from being offline due to overspending.

[0121] Among them, when the remaining traffic of the first SIM card is lower than the preset threshold (for example, 200M), the cloud platform notifies the first device to stop streaming, and notifies the second device that the current traffic of the first SIM card is insufficient, please recharge or replace the current SIM card of the first device in time.

[0122] During the connection between the second device and the cloud platform, that is, during the period when the APP of the user's second device (that is, the APP corresponding to the first device, for example, which can be used to view the video captured by the first device) is opened, the cloud platform continues to pay attention to the recharge status of the current SIM card of the first device.

[0123] In some embodiments, if the second SIM card is also inserted into the first device and is also the SIM card belonging to the cloud platform, the cloud platform will simultaneously monitor the recharge status of the first SIM card and the second SIM card. If any SIM card is recharged successfully, the cloud platform will automatically switch to the SIM card after the recharge is successful, and automatically start the code stream transmission for the first device.

[0124] If the user does not recharge the first SIM card during the connection between the second device and the cloud platform, and the second SIM card is a third-party SIM card, then when the APP related to the first device in the second device is not in use, that is, when the user is not using the first device, the first device is notified to try to switch to the second SIM card. If the second SIM card can be online, the current second SIM card will be kept working, otherwise it will be switched back to the first SIM card immediately. Based on the guaranteed remaining traffic, the heartbeat between the first device and the cloud platform is maintained, but the traffic is not pulled to the first device, waiting for the user to recharge the first SIM card or replace the current SIM card of the first device. Among them, after switching the SIM card, the first device will log in to the cloud platform again. If the first device and the cloud platform can interact with data normally or the heartbeat is kept alive, it is considered that the second SIM card is online.

[0125] During the period when the remaining flow of the current SIM card of the first device is insufficient, the first device will monitor in real time whether a new SIM card is inserted into the first device through the GPIO detection pin. If the insertion of a new SIM card is sensed, the cellular module will be immediately controlled to switch to the new SIM card to confirm whether the new SIM card can be online. If it is online, it will work based on the current new SIM card. If the inserted new SIM card cannot be online, it will switch back to the original first SIM card, re-establish a heartbeat keep-alive with the cloud platform, and wait for the recharge information for the first SIM card from the user's second device. If a message is received that the user has successfully recharged the SIM card in the first device (it may be the current SIM card or the backup SIM card), the currently working SIM card is determined to be the SIM card that has been successfully recharged (it may be the current SIM card or it may need to be switched to the backup SIM card) based on the message, and the flow is started.

[0126] See also Figure 6 Another data transmission method of the entire system provided in an embodiment of the present application includes:

[0127] In the case where the user replaces the current SIM card of the first device with a third-party SIM card, for example, both SIM cards are third-party SIM cards, or only one SIM card is inserted and it is a third-party SIM card:

[0128] Since the cloud platform cannot know the accurate traffic information of the current SIM card of the first device, if the second device requests to pull the stream, the cloud platform will forward the video stream and cannot perform minimum traffic control.

[0129] When the current SIM card traffic of the first device is exhausted, the first device and the cloud platform will be disconnected, and the first device will be unable to respond to the streaming instructions of the cloud platform subsequently.

[0130] If the first device has dual SIM cards, the first device will automatically switch to the other SIM card. If the switched SIM card is also unable to go online, the first device will initiate a periodic card switching operation (for example, a card switching operation is performed every 6 minutes. The specific period can be determined based on the user's requirements for the timeliness of network recovery and the life of the SIM card), thereby ensuring that the user can quickly get back online when recharging any SIM card.

[0131] In some embodiments, the cloud platform will use the time when the second device logs into the cloud platform and the behavior of viewing the surveillance video collected by the first device to make AI statistics and intelligently predict the user's behavior when using the second device. The cloud platform will update the user's active time period when using the second device in real time to the first device (real-time update when the first device is online).

[0132] Therefore, the first device will dynamically switch SIM cards according to the active time period when the user uses the second device. During the active time period when the user uses the second device, the switching frequency of the SIM card will be increased to ensure that the first device can go online quickly after the user recharges any SIM card in the first device. During the user's inactive time period, the first device will reduce the switching frequency of the SIM card or even stop switching the SIM card. For example, the SIM card switching will stop during the user's rest in the early morning, thereby avoiding increased power consumption of the first device due to frequent switching of SIM cards and frequent network registration.

[0133] Similarly, if only one SIM card is inserted into the first device and it is a third-party SIM card, the first device will re-enter the network (soft restart of the module), that is, re-enter the network, the module enters the flight mode through CFUN=0, and then exits the flight mode again through CFUN=1, and starts to connect to the base station. At this time, the SIM card switching operation will not be performed.

[0134] Similarly, the module's action of reconnecting to the network can also be dynamically adjusted based on the user's active time period using the second device.

[0135] Among them, the active time period when the user uses the second device can be reasonably inferred as the user is more likely to use the second device to remotely view the first device. During the time period when the user may enable the first device, repeated network access actions will be performed at a higher frequency. Conversely, when the user has a low probability of using the second device, the frequency of repeated network access of the first device will be reduced.

[0136] In summary, the system provided in the embodiment of the present application involves a first device, a cloud platform and a second device. Through the linkage of the first device and the cloud platform, intelligent monitoring of traffic is realized. When the remaining traffic is lower than the threshold, the traffic will no longer be consumed, ensuring that the first device will not be disconnected from the cloud platform due to traffic exhaustion. At this time, a heartbeat keep-alive link with an extremely low data volume is maintained to receive recharge feedback from users on the second device end, so as to restore business data (video) transmission in a timely manner. The first device that supports single-mode dual-card single-standby dynamically senses the SIM card. When a new SIM card is detected to be connected to the first device, it will immediately try to switch to the new SIM card to ensure that the SIM card replaced by the user can be online as soon as possible.

[0137] Since the SIM card connected to the first device belongs to the cloud platform, the cloud platform will intelligently monitor the user's recharge behavior on the second device. When it is detected that the user has recharged a certain SIM card, it will quickly switch to the SIM card that has been successfully recharged, so that the first device can quickly get back online.

[0138] In view of the situation that all SIM cards used by the first device are third-party SIM cards, the cloud platform cannot accurately perceive the usage traffic and package information of the SIM cards. Therefore, when the first device goes offline due to insufficient traffic and arrears, the first device will periodically switch the first SIM card and the second SIM card to ensure that when any SIM card is recharged successfully, the business data transmission on the first device side can be quickly restored. Among them, the card switching cycle on the first device side can be dynamically adjusted according to the user's behavior of using the second device. When the user does not use the APP on the second device side (the APP corresponding to the business data transmission on the first device side), the SIM card switching is reduced or not performed, thereby reducing the power consumption of the first device; and during the activity of the APP on the second device side (the APP corresponding to the business data transmission on the first device side), the switching frequency between the first SIM card and the second SIM card is increased.

[0139] The following is an introduction to the system, device or apparatus provided in the embodiments of the present application, in which explanations or examples of technical features that are the same as or corresponding to those described in the method are not repeated hereafter.

[0140] See also Figure 7 , a data transmission system provided in an embodiment of the present application includes: a cloud platform 70, at least one first device 71, and at least one second device 72; wherein,

[0141] The cloud platform 70 is used for:

[0142] In the process of pulling a stream from the first device 71 and forwarding it to the second device 72 through the current SIM card of the first device 71 that establishes a data transmission connection with the cloud platform 70, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform 70, the remaining traffic of the current SIM card is monitored;

[0143] When it is determined that the remaining traffic of the current SIM card of the first device 71 is lower than a preset threshold, stop pulling traffic from the first device 71 through the current SIM card, and maintain a heartbeat keep-alive with the first device 71 based on the remaining traffic of the current SIM card of the first device 71;

[0144] When it is determined that the first device 71 meets the condition for continuing to pull the stream, continue to pull the stream from the first device 71 and forward it to the second device 72;

[0145] The first device 71 is used for:

[0146] When a data transmission connection is established between the first device 71 and the cloud platform 70 based on the current SIM card of the first device 71, if a stream pulling request from the cloud platform 70 is received, a data stream is sent to the cloud platform 70 based on the stream pulling request, so that the cloud platform 70 forwards the data stream to the second device 72 for the user to view;

[0147] When receiving the notification sent by the cloud platform 70 to stop pulling the stream and maintain the heartbeat keepalive between the cloud platform 70, stop sending the data stream to the cloud platform 70, and maintain the heartbeat keepalive between the first device 71 and the cloud platform 70 based on the remaining traffic of the current SIM card.

[0148] An electronic device provided in an embodiment of the present application, see Figure 8 , for example, including: a processor 600 and a memory 620, etc.

[0149] When the electronic device serves as a cloud platform:

[0150] The processor 600 is used to read the program in the memory 620 and execute the following process:

[0151] In the process of pulling a stream from a first device and forwarding it to a second device through a current SIM card of a first device that establishes a data transmission connection with a cloud platform, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform, monitoring the remaining traffic of the current SIM card;

[0152] When it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, stop pulling traffic from the first device through the current SIM card, and maintain a heartbeat keep-alive with the first device based on the remaining traffic of the current SIM card of the first device;

[0153] When it is determined that the first device meets the condition for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device.

[0154] In some embodiments, when it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, the processor 600 is further configured to read the program in the memory 620 and execute the following process: sending a notification to the second device to stop pulling traffic for the first device and that the remaining traffic of the current SIM card of the first device is insufficient;

[0155] When it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0156] When it is determined that the remaining traffic of the current SIM card of the first device is greater than the preset threshold, the traffic is continued to be pulled from the first device and forwarded to the second device.

[0157] In some embodiments, when it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0158] If it is determined that there is a backup SIM card in the first device, the backup SIM card is also a SIM card whose traffic management is implemented by the cloud platform, and the remaining traffic of the backup SIM card is greater than a preset threshold, the first device is notified to switch the current SIM card to the backup SIM card, and continue to pull traffic from the first device and forward it to the second device.

[0159] In some embodiments, when it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0160] If it is determined that there is a standby SIM card in the first device, and the standby SIM card is not a SIM card for which traffic management is implemented by the cloud platform, notifying the first device to switch the current SIM card to the standby SIM card;

[0161] If it is determined that the first device has re-established a data transmission connection with the cloud platform, the stream is continued to be pulled from the first device and forwarded to the second device.

[0162] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:

[0163] When receiving a stream pulling request from the second device for the first device, if it is determined that the current SIM card of the first device is not a SIM card whose traffic management is implemented by the cloud platform, determining whether the heartbeat keep-alive link of the first device is normal;

[0164] If yes, pull the stream from the first device and forward it to the second device;

[0165] Otherwise, the connection with the first device is disconnected, and a notification is sent to the second device that the first device is offline and the user is required to recharge or replace the SIM card in the first device.

[0166] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:

[0167] Based on the time when the second device logs into the cloud platform, and / or the user's behavior of viewing the data stream transmitted by the first device, a first time period is determined and sent to the first device, so that the first device increases the switching frequency of the SIM card in the first time period, and / or increases the frequency of re-entry operations.

[0168] When the electronic device serves as the first device:

[0169] The processor 600 is used to read the program in the memory 620 and execute the following process:

[0170] When a data transmission connection is established between the first device and the cloud platform based on the current SIM card of the first device, if a stream pulling request from the cloud platform is received, a data stream is sent to the cloud platform based on the stream pulling request, so that the cloud platform forwards the data stream to the second device for the user to view;

[0171] When receiving the notification sent by the cloud platform to stop pulling the stream and maintain the heartbeat keepalive between the first device and the cloud platform, stop sending the data stream to the cloud platform, and maintain the heartbeat keepalive between the first device and the cloud platform based on the remaining traffic of the current SIM card.

[0172] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:

[0173] During the heartbeat keep-alive period between the first device and the cloud platform:

[0174] When receiving a notification from the cloud platform to switch the current SIM card to a standby SIM card, executing an operation of switching the SIM card, and continuing to transmit data streams to the cloud platform based on the switched SIM card;

[0175] When it is detected that the first device has a spare SIM card, the SIM card is switched and it is determined whether the switched SIM card can be online. If yes, the data stream is continuously transmitted to the cloud platform based on the switched SIM card; otherwise, the original SIM card is switched back to maintain the heartbeat keepalive between the first device and the cloud platform;

[0176] When receiving a notification that the user has successfully recharged the SIM card in the first device, the SIM card that has been successfully recharged is set as the current SIM card, and the data stream continues to be transmitted to the cloud platform.

[0177] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process:

[0178] When the heartbeat keepalive between the first device and the cloud platform fails:

[0179] If the first device does not have a spare SIM card, re-initiate a network registration operation based on the current SIM card, and determine whether the heartbeat keepalive between the first device and the cloud platform can be restored;

[0180] If the first device has a spare SIM card, the SIM card is switched and the network registration operation is re-initiated based on the switched SIM card. When the first device fails to go back online, the SIM card is switched periodically and the network registration operation is re-initiated based on the switched SIM card.

[0181] In some embodiments, the processor 600 is further configured to read a program in the memory 620 and execute the following process: receiving a first time period notified by the cloud platform; the first time period is a time period determined by the cloud platform based on the time when the second device logs into the cloud platform and / or the behavior of the user viewing the data stream transmitted by the first device;

[0182] The operation of re-initiating network registration based on the current SIM card is performed periodically, and the period of re-initiating network registration based on the current SIM card in the first time period is higher than the period of re-initiating network registration based on the current SIM card in a non-first time period;

[0183] In the first time period, the period of switching SIM cards and re-initiating network registration based on the switched SIM card is higher than the period of switching SIM cards and re-initiating network registration based on the switched SIM card during a period other than the first time period.

[0184] The transceiver 610 is configured to receive and send data under the control of the processor 600 .

[0185] Among them, Figure 8 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 600 and various circuits of memory represented by memory 620 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 610 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium, including wireless channels, wired channels, optical cables, and other transmission media. For different user devices, the user interface 630 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.

[0186] The processor 600 is responsible for managing the bus architecture and general processing, and the memory 620 can store data used by the processor 600 when performing operations.

[0187] In some embodiments, the processor 600 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or a CPLD (Complex Programmable Logic Device), and the processor may also adopt a multi-core architecture.

[0188] The processor calls the computer program stored in the memory to execute any of the methods provided in the embodiments of the present application according to the obtained executable instructions. The processor and the memory can also be arranged physically separately.

[0189] It should be noted here that the device provided in the embodiment of the present application can implement all the method steps implemented in the method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.

[0190] On the cloud platform side, see Fig. 9 , a data transmission device provided in an embodiment of the present application includes:

[0191] The remaining traffic monitoring unit 11 is used to monitor the remaining traffic of the current SIM card in the process of pulling traffic from the first device and forwarding it to the second device through the current SIM card of the first device that establishes a data transmission connection with the cloud platform, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform;

[0192] The pausing flow pulling unit 12 is used to stop pulling the flow from the first device through the current SIM card when it is determined that the remaining flow of the current SIM card of the first device is lower than a preset threshold, and maintain the heartbeat keep-alive between the first device and the first device based on the remaining flow of the current SIM card of the first device;

[0193] The stream-pulling continuing unit 13 is configured to, when it is determined that the first device meets the conditions for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device.

[0194] In some embodiments, when it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, the pausing stream pulling unit 12 is further used to: send a notification to the second device that the stream pulling for the first device is stopped and that the remaining traffic of the current SIM card of the first device is insufficient;

[0195] When it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0196] When it is determined that the remaining traffic of the current SIM card of the first device is greater than the preset threshold, the traffic is continued to be pulled from the first device and forwarded to the second device.

[0197] In some embodiments, when it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0198] If it is determined that there is a backup SIM card in the first device, the backup SIM card is also a SIM card whose traffic management is implemented by the cloud platform, and the remaining traffic of the backup SIM card is greater than a preset threshold, the first device is notified to switch the current SIM card to the backup SIM card, and continue to pull traffic from the first device and forward it to the second device.

[0199] In some embodiments, when it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes:

[0200] If it is determined that there is a standby SIM card in the first device, and the standby SIM card is not a SIM card for which traffic management is implemented by the cloud platform, notifying the first device to switch the current SIM card to the standby SIM card;

[0201] If it is determined that the first device has re-established a data transmission connection with the cloud platform, the stream is continued to be pulled from the first device and forwarded to the second device.

[0202] In some embodiments, the continuous flow pulling unit 13 is further used for:

[0203] When receiving a stream pulling request from the second device for the first device, if it is determined that the current SIM card of the first device is not a SIM card whose traffic management is implemented by the cloud platform, determining whether the heartbeat keep-alive link of the first device is normal;

[0204] If yes, pull the stream from the first device and forward it to the second device;

[0205] Otherwise, the connection with the first device is disconnected, and a notification is sent to the second device that the first device is offline and the user is required to recharge or replace the SIM card in the first device.

[0206] In some embodiments, the remaining flow monitoring unit 11 is further used for:

[0207] Based on the time when the second device logs into the cloud platform, and / or the user's behavior of viewing the data stream transmitted by the first device, a first time period is determined and sent to the first device, so that the first device increases the switching frequency of the SIM card in the first time period, and / or increases the frequency of re-entry operations.

[0208] Accordingly, on the first device side, see Fig.10 , a data transmission device provided in an embodiment of the present application includes:

[0209] The data stream sending unit 21 is used for, when the first device establishes a data transmission connection with the cloud platform based on the current SIM card of the first device, if a stream pulling request from the cloud platform is received, sending a data stream to the cloud platform based on the stream pulling request, so that the cloud platform forwards the data stream to the second device for the user to view;

[0210] The data stream pause unit 22 is used to stop sending data stream to the cloud platform when receiving a notification from the cloud platform to stop pulling streams and maintain heartbeat keep-alive between the first device and the cloud platform, and maintain heartbeat keep-alive between the first device and the cloud platform based on the remaining traffic of the current SIM card.

[0211] In some embodiments, the pause data stream unit 22 is further configured to:

[0212] During the heartbeat keep-alive period between the first device and the cloud platform:

[0213] When receiving a notification from the cloud platform to switch the current SIM card to a standby SIM card, executing an operation of switching the SIM card, and continuing to transmit data streams to the cloud platform based on the switched SIM card;

[0214] When it is detected that the first device has a spare SIM card, the SIM card is switched and it is determined whether the switched SIM card can be online. If yes, the data stream is continuously transmitted to the cloud platform based on the switched SIM card; otherwise, the original SIM card is switched back to maintain the heartbeat keepalive between the first device and the cloud platform;

[0215] When receiving a notification that the user has successfully recharged the SIM card in the first device, the SIM card that has been successfully recharged is set as the current SIM card, and the data stream continues to be transmitted to the cloud platform.

[0216] In some embodiments, the pause data stream unit 22 is further configured to:

[0217] When the heartbeat keepalive between the first device and the cloud platform fails:

[0218] If the first device does not have a spare SIM card, re-initiate a network registration operation based on the current SIM card, and determine whether the heartbeat keepalive between the first device and the cloud platform can be restored;

[0219] If the first device has a spare SIM card, the SIM card is switched and the network registration operation is re-initiated based on the switched SIM card. When the first device fails to go back online, the SIM card is switched periodically and the network registration operation is re-initiated based on the switched SIM card.

[0220] In some embodiments, the data stream pause unit 22 is further used to: receive a first time period notified by the cloud platform; the first time period is a time period determined by the cloud platform based on the time when the second device logs into the cloud platform and / or the behavior of the user viewing the data stream transmitted by the first device;

[0221] The operation of re-initiating network registration based on the current SIM card is performed periodically, and the period of re-initiating network registration based on the current SIM card in the first time period is higher than the period of re-initiating network registration based on the current SIM card in a non-first time period;

[0222] In the first time period, the period of switching SIM cards and re-initiating network registration based on the switched SIM card is higher than the period of switching SIM cards and re-initiating network registration based on the switched SIM card during a period other than the first time period.

[0223] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0224] 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. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0225] Any of the devices or apparatuses provided in the embodiments of the present application may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc. It may include a central processing unit (CPU), a memory, an input / output device, etc. The input device may include a keyboard, a mouse, a touch screen, etc. The output device may include a display device, such as a liquid crystal display (LCD), a cathode ray tube (CRT), etc.

[0226] The memory may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor with program instructions and data stored in the memory. In the embodiment of the present application, the memory may be used to store the program of any of the methods provided in the embodiment of the present application.

[0227] The processor calls the program instructions stored in the memory, and the processor is used to execute any of the methods provided in the embodiments of the present application according to the obtained program instructions.

[0228] The present application embodiment also provides a computer program product or computer program, which includes a computer instruction, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction so that the computer device executes any of the methods described in the embodiments. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0229] The embodiment of the present application provides a computer-readable storage medium for storing computer program instructions used by the apparatus provided in the embodiment of the present application, which includes a program for executing any method provided in the embodiment of the present application. The computer-readable storage medium may be a non-transitory computer-readable medium.

[0230] The computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0231] It should be understood that:

[0232] The access technology through which entities in the communication network transmit traffic can be any suitable current or future technology, such as WLAN (Wireless Local Access Network), WiMAX (Worldwide Interoperability for Microwave Access), LTE, LTE-A, 5G, Bluetooth, infrared, etc.; in addition, the embodiments can also apply wired technology, for example, IP-based access technology, such as a wired network or a fixed line.

[0233] Embodiments suitable for being implemented as software code or a portion thereof and running using a processor or processing functionality are independent of the software code and may be specified using any known or future developed programming language, such as a high-level programming language such as objective-C, C, C++, C#, Java, Python, Javascript, other scripting languages, etc., or a low-level programming language such as machine language or assembler.

[0234] The implementation of the embodiments is hardware independent and may be implemented using any known or future developed hardware technology or any mixture thereof, such as a microprocessor or CPU (central processing unit), MOS (metal oxide semiconductor), CMOS (complementary MOS), BiMOS (bipolar MOS), BiCMOS (bipolar CMOS), ECL (emitter coupled logic) and / or TTL (transistor-transistor logic).

[0235] Embodiments may be implemented as separate devices, apparatuses, units, components, or functions, or in a distributed manner, for example, one or more processors or processing functions may be used or shared in a process, or one or more processing segments or processing portions may be used and shared in a process, wherein one physical processor or more than one physical processor may be used to implement one or more processing portions dedicated to a specific process as described.

[0236] The device may be implemented by a semiconductor chip, a chipset, or a (hardware) module including such a chip or chipset.

[0237] The embodiments may also be implemented as any combination of hardware and software, such as ASIC (Application Specific IC (Integrated Circuit)) components, FPGA (Field Programmable Gate Array) or CPLD (Complex Programmable Logic Device) components or DSP (Digital Signal Processor) components.

[0238] The embodiments may also be implemented as a computer program product including a computer usable medium having computer readable program code embodied therein, the computer readable program code being adapted to perform the processes as described in the embodiments, wherein the computer usable medium may be a non-transitory medium.

[0239] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.

[0240] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0241] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0242] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0243] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data transmission method, characterized in that: Applied to a cloud platform, the method includes: In the process of pulling a stream from a first device and forwarding it to a second device through a current SIM card of a first device that establishes a data transmission connection with a cloud platform, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform, monitoring the remaining traffic of the current SIM card; When it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, stop pulling traffic from the first device through the current SIM card, and maintain a heartbeat keep-alive with the first device based on the remaining traffic of the current SIM card of the first device; When it is determined that the first device meets the condition for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device; The method further comprises: When receiving a stream pulling request from the second device for the first device, if it is determined that the current SIM card of the first device is not a SIM card whose traffic management is implemented by the cloud platform, determining whether the heartbeat keep-alive link of the first device is normal; If yes, pull the stream from the first device and forward it to the second device; Otherwise, the connection with the first device is disconnected, and a notification is sent to the second device that the first device is offline and the user is required to recharge or replace the SIM card in the first device.

2. The method according to claim 1, characterized in that When it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, the method further includes: sending a notification to the second device to stop pulling traffic for the first device and that the remaining traffic of the current SIM card of the first device is insufficient; When it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes: When it is determined that the remaining traffic of the current SIM card of the first device is greater than the preset threshold, the traffic is continued to be pulled from the first device and forwarded to the second device.

3. The method according to claim 1, characterized in that When it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes: If it is determined that there is a backup SIM card in the first device, the backup SIM card is also a SIM card whose traffic management is implemented by the cloud platform, and the remaining traffic of the backup SIM card is greater than a preset threshold, the first device is notified to switch the current SIM card to the backup SIM card, and continue to pull traffic from the first device and forward it to the second device.

4. The method according to claim 1, characterized in that When it is determined that the first device meets the condition for continuing to pull the stream, continuing to pull the stream from the first device and forwarding it to the second device includes: If it is determined that there is a standby SIM card in the first device, and the standby SIM card is not a SIM card for which traffic management is implemented by the cloud platform, notifying the first device to switch the current SIM card to the standby SIM card; If it is determined that the first device has re-established a data transmission connection with the cloud platform, the stream is continued to be pulled from the first device and forwarded to the second device.

5. The method according to claim 1, characterized in that The method further comprises: Based on the time when the second device logs into the cloud platform, and / or the user's behavior of viewing the data stream transmitted by the first device, a first time period is determined and sent to the first device, so that the first device increases the switching frequency of the SIM card in the first time period, and / or increases the frequency of re-entry operations.

6. A data transmission method, characterized in that: Applied to the first device side, the method includes: When a data transmission connection is established between the first device and the cloud platform based on the current SIM card of the first device, if a stream pulling request from the cloud platform is received, a data stream is sent to the cloud platform based on the stream pulling request, so that the cloud platform forwards the data stream to the second device for the user to view; When receiving a notification from the cloud platform to stop pulling data and maintain heartbeat keepalive between the first device and the cloud platform, stop sending data streams to the cloud platform, and maintain heartbeat keepalive between the first device and the cloud platform based on the remaining traffic of the current SIM card; The method further comprises: When the cloud platform receives a stream pulling request from the second device for the first device, if the cloud platform determines that the current SIM card of the first device is not a SIM card for which traffic management is implemented by the cloud platform, then: If the cloud platform determines that the heartbeat keep-alive link of the first device is normal, based on the stream pulling request of the cloud platform, the cloud platform sends the data stream to the cloud platform, so that the cloud platform forwards the data stream to the second device for the user to view; If the cloud platform determines that the heartbeat keep-alive link of the first device is abnormal, the connection with the cloud platform is disconnected, so that the cloud platform sends a notification to the second device that the first device is offline and the user needs to recharge or replace the SIM card in the first device.

7. The method according to claim 6, characterized in that The method further comprises: During the heartbeat keep-alive period between the first device and the cloud platform: When receiving a notification from the cloud platform to switch the current SIM card to a standby SIM card, executing an operation of switching the SIM card, and continuing to transmit data streams to the cloud platform based on the switched SIM card; When it is detected that the first device has a spare SIM card, the SIM card is switched and it is determined whether the switched SIM card can be online. If yes, the data stream is continuously transmitted to the cloud platform based on the switched SIM card; otherwise, the original SIM card is switched back to maintain the heartbeat keepalive between the first device and the cloud platform; When receiving a notification that the user has successfully recharged the SIM card in the first device, the SIM card that has been successfully recharged is set as the current SIM card, and the data stream continues to be transmitted to the cloud platform.

8. The method according to claim 6, characterized in that The method further comprises: When the heartbeat keepalive between the first device and the cloud platform fails: If the first device does not have a spare SIM card, re-initiate a network registration operation based on the current SIM card, and determine whether the heartbeat keepalive between the first device and the cloud platform can be restored; If the first device has a spare SIM card, the SIM card is switched and the network registration operation is re-initiated based on the switched SIM card. When the first device fails to go back online, the SIM card is switched periodically and the network registration operation is re-initiated based on the switched SIM card.

9. The method according to claim 8, characterized in that The method further includes: receiving a first time period notified by the cloud platform; the first time period is a time period determined by the cloud platform based on the time when the second device logs into the cloud platform and / or the behavior of the user viewing the data stream transmitted by the first device; The operation of re-initiating network registration based on the current SIM card is performed periodically, and the period of re-initiating network registration based on the current SIM card in the first time period is higher than the period of re-initiating network registration based on the current SIM card in a non-first time period; In the first time period, the period of switching SIM cards and re-initiating network registration based on the switched SIM card is higher than the period of switching SIM cards and re-initiating network registration based on the switched SIM card during a period other than the first time period.

10. A data transmission device, characterized in that: Applied to a cloud platform, the device comprises: a remaining traffic monitoring unit, configured to monitor the remaining traffic of the current SIM card in the process of pulling traffic from the first device and forwarding it to the second device through the current SIM card of the first device that establishes a data transmission connection with the cloud platform, if the current SIM card is a SIM card for which traffic management is implemented by the cloud platform; A pausing flow pulling unit is used to stop pulling the flow from the first device through the current SIM card when it is determined that the remaining flow of the current SIM card of the first device is lower than a preset threshold, and maintain a heartbeat keep-alive between the first device and the first device based on the remaining flow of the current SIM card of the first device; A stream-pulling continuing unit, configured to, when determining that the first device meets the conditions for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device; The continuous flow pulling unit is also used for: When receiving a stream pulling request from the second device for the first device, if it is determined that the current SIM card of the first device is not a SIM card whose traffic management is implemented by the cloud platform, determining whether the heartbeat keep-alive link of the first device is normal; If yes, pull the stream from the first device and forward it to the second device; Otherwise, the connection with the first device is disconnected, and a notification is sent to the second device that the first device is offline and the user is required to recharge or replace the SIM card in the first device.

11. A data transmission device, characterized in that: Applied to the first device side, the apparatus comprises: A data stream sending unit, configured to, when a data transmission connection is established between the first device and the cloud platform based on the current SIM card of the first device, send a data stream to the cloud platform based on a stream pulling request from the cloud platform, so that the cloud platform forwards the data stream to the second device for viewing by the user; A data stream pausing unit is used to stop sending data streams to the cloud platform when receiving a notification from the cloud platform to stop pulling streams and maintain heartbeat keep-alive between the first device and the cloud platform, and maintain heartbeat keep-alive between the first device and the cloud platform based on the remaining traffic of the current SIM card; The pause data stream unit is further used for: When the cloud platform receives a stream pulling request from the second device for the first device, if the cloud platform determines that the current SIM card of the first device is not a SIM card for which traffic management is implemented by the cloud platform, then: If the cloud platform determines that the heartbeat keep-alive link of the first device is normal, based on the stream pulling request of the cloud platform, the cloud platform sends the data stream to the cloud platform, so that the cloud platform forwards the data stream to the second device for the user to view; If the cloud platform determines that the heartbeat keep-alive link of the first device is abnormal, the connection with the cloud platform is disconnected, so that the cloud platform sends a notification to the second device that the first device is offline and the user needs to recharge or replace the SIM card in the first device.

12. A data transmission system, characterized in that: The system comprises: at least one first device and at least one second device of a cloud platform; wherein, The cloud platform is used for: In the process of pulling a stream from a first device and forwarding it to a second device through a current SIM card of the first device that establishes a data transmission connection with the cloud platform, if the current SIM card is a SIM card whose traffic management is implemented by the cloud platform, monitoring the remaining traffic of the current SIM card; When it is determined that the remaining traffic of the current SIM card of the first device is lower than a preset threshold, stop pulling traffic from the first device through the current SIM card, and maintain a heartbeat keep-alive with the first device based on the remaining traffic of the current SIM card of the first device; When it is determined that the first device meets the condition for continuing to pull the stream, continue to pull the stream from the first device and forward it to the second device; When receiving a stream pulling request from the second device for the first device, if it is determined that the current SIM card of the first device is not a SIM card whose traffic management is implemented by the cloud platform, determining whether the heartbeat keep-alive link of the first device is normal; If yes, pull the stream from the first device and forward it to the second device; Otherwise, disconnect the first device and send a notification to the second device that the first device is offline and the user needs to recharge or replace the SIM card in the first device; The first device is used for: When a data transmission connection is established between the first device and the cloud platform based on the current SIM card of the first device, if a stream pulling request from the cloud platform is received, a data stream is sent to the cloud platform based on the stream pulling request, so that the cloud platform forwards the data stream to the second device for the user to view; When receiving a notification from the cloud platform to stop pulling data and maintain heartbeat keepalive between the first device and the cloud platform, stop sending data streams to the cloud platform, and maintain heartbeat keepalive between the first device and the cloud platform based on the remaining traffic of the current SIM card; When the cloud platform receives a stream pulling request from the second device for the first device, if the cloud platform determines that the current SIM card of the first device is not a SIM card for which traffic management is implemented by the cloud platform, then: If the cloud platform determines that the heartbeat keep-alive link of the first device is normal, based on the stream pulling request of the cloud platform, the cloud platform sends the data stream to the cloud platform, so that the cloud platform forwards the data stream to the second device for the user to view; If the cloud platform determines that the heartbeat keep-alive link of the first device is abnormal, the connection with the cloud platform is disconnected, so that the cloud platform sends a notification to the second device that the first device is offline and the user needs to recharge or replace the SIM card in the first device.

13. An electronic device, characterized in that: include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 9 according to the obtained program.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • SIM card automatic switching method and device and terminal equipment

    CN112312508A

  • Multi-channel switching method and device of wireless communication terminal and storage medium

    CN113573301A

  • Flow control method and device, storage medium and electronic device

    CN115915281A