WO2023231373A1 - 设备连接方法、装置、电子设备及存储介质 - Google Patents

设备连接方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2023231373A1
WO2023231373A1 PCT/CN2022/139451 CN2022139451W WO2023231373A1 WO 2023231373 A1 WO2023231373 A1 WO 2023231373A1 CN 2022139451 W CN2022139451 W CN 2022139451W WO 2023231373 A1 WO2023231373 A1 WO 2023231373A1
Authority
WO
WIPO (PCT)
Prior art keywords
connection
mode
connection mode
duration
application
Prior art date
Application number
PCT/CN2022/139451
Other languages
English (en)
French (fr)
Inventor
黄诚
Original Assignee
浙江宇视科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 浙江宇视科技有限公司 filed Critical 浙江宇视科技有限公司
Publication of WO2023231373A1 publication Critical patent/WO2023231373A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • This application relates to the technical field of device interconnection, for example, to a device connection method, device, electronic device and storage medium.
  • Direct connection means that the application and the device are in the same local area network and can be accessed directly and quickly without going through a cloud deployment server as an intermediate node.
  • This method is fast and efficient.
  • Both tunnel connection and forwarding require servers to be deployed in the cloud as intermediate nodes to provide end-to-end connections between applications and devices.
  • Tunnel connection has low consumption of network resources on the cloud server, and the connection success rate and stability are average. It can be implemented through Transmission Control Protocol (TCP) or User Datagram Protocol (UDP). However, when implemented using TCP, due to its general stability, it often causes message congestion and other situations, so UDP is more appropriate. Forwarding connections consumes a lot of network resources on the cloud server, but the connection success rate and stability are better. This can be achieved via TCP or UDP. When implemented using UDP, the overall stability of the forwarding connection is often reduced due to UDP reliability issues.
  • TCP Transmission Control Protocol
  • UDP User Datagram Protocol
  • connection mode between the application software and the device is less intelligent and has at least one or more of the following problems: low connection speed, low success rate, high resource consumption, etc.
  • low connection speed low success rate
  • high resource consumption etc.
  • how to set up device connection methods to improve intelligence has become a difficult problem to be solved.
  • This application provides an equipment connection method, device, electronic equipment and storage medium to improve the intelligence of equipment connection.
  • this application provides a device connection method, which is used to connect a device to an application.
  • the method includes:
  • connection information between the application and the device includes the fastest connection flag information, and the fastest connection flag information includes the connection mode that is the fastest to establish a connection when multiple connection modes are parallel;
  • connection mode that accounts for the largest proportion of the fastest connection mark information within the first predetermined period N as the first connection mode
  • the first set is used as the parallel connection mode for the first connection between the device and the application.
  • this application provides an equipment connection device, including:
  • Obtain module set to obtain the connection information between the application and the device
  • the data processing module is configured to generate a preferred connection mode and a parallel connection mode for the first connection between the device and the application based on the connection information, and update the switching connection strategy between the device and the application based on the switching connection information;
  • a control module configured to control the device to establish a connection with an application based on the preferred connection mode, the parallel connection mode and the switching connection policy.
  • the present application provides an electronic device, including a memory, a processor, and a computer program stored in a storage medium of the memory and executable on the processor.
  • the processor executes the computer program.
  • the present application provides a storage medium that stores a computer program.
  • the computer program is executed by a processor, the above device connection method is implemented.
  • Figure 1 is a schematic flowchart of a device connection method provided by an embodiment of the present application.
  • Figure 2 is a partial flow diagram of another device connection method provided by an embodiment of the present application.
  • Figure 3 is a schematic structural diagram of a matrix model provided by an embodiment of the present application.
  • Figure 4 is a schematic structural diagram of an equipment connection device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the device terminal initiates a connection request to the application device based on multiple connection modes at the same time. Multiple connection modes are parallel, and the connection is established in the connection mode that is connected first.
  • This method has fast connection speed and high connection efficiency, but it requires a large amount of consumption. network resources, which is not conducive to establishing multiple connections at the same time. When a connection mode actually cannot be connected or the probability of successful connection is less than the set probability, this method cannot save bandwidth and will cause a large amount of system resources to be consumed unnecessarily.
  • the connection environment conditions of application devices and device terminals are different. Using a unified connection strategy will cause a large amount of resource consumption in the entire system.
  • the latest connection mode between the application device and the device terminal is obtained, and compared with a preset first priority connection mode to determine which connection mode is used to connect the application device and the device terminal.
  • the default tunnel connection is the first priority connection mode. If the latest connection mode is forwarding and the tunnel connection can also be connected, the connection mode is saved as tunnel connection for the next connection. If the tunnel connection cannot be connected, the forwarding connection is saved for the next connection. Saving the latest connection mode for the next connection can indeed greatly improve the success rate of the connection, but the connection efficiency is poor.
  • This method only focuses on whether the connection can be successful, but does not take into account the connection speed and cannot bring a better user experience when connecting.
  • the first priority connection mode of the application device and the device terminal is tunnel connection. The tunnel connection can be connected successfully, but the speed of the tunnel connection is low, so each connection between the application device and the device terminal will take a lot of time.
  • Figure 1 is a schematic flowchart of a device connection method provided by an embodiment of the present application.
  • a device connection method provided by an embodiment of the present application is applied to a server.
  • it is applied to a cloud server and includes the following steps:
  • Step S101 Obtain the connection information between the application and the device.
  • the connection information includes the fastest connection flag information.
  • the fastest connection flag information includes the fastest connection mode marked when multiple connection modes are parallel.
  • connection information is used to represent the historical connection information of the application and the device.
  • the application and the device are both connected to the public network and managed through the cloud server.
  • the cloud server assigns cloud accounts and passwords to applications and devices.
  • the application and the device try to connect in parallel through multiple connection modes, and the connection is established in the connection mode that connects first.
  • the application reports the information of successful connection establishment to the cloud server for storage.
  • the information includes cloud account, device identification information, type of connection method, connection time, fastest connection mark, etc.
  • Step S102 Obtain the connection mode with the largest proportion in the fastest connection mark information within the first predetermined period N as the first connection mode.
  • the proportion in this embodiment is the ratio of the number of each connection mode to the total number in the fastest connection mark information.
  • the first connection mode is the connection mode with the largest number of fastest connection mark information in the first predetermined period N.
  • Step S103 Obtain at least one connection mode in the front preset position among the connection modes sorted from large to small in the fastest connection mark information in the second predetermined period M, forming a first set, M greater than N.
  • N is the duration of the first predetermined period
  • M is the duration of the second predetermined period.
  • the units of N and M can be years, months, days, or hours, minutes, and seconds.
  • N and M The units can be the same or different, N can be 3 days, M can be 15 days, N can also be 1 hour, M can also be 5 hours, N can also be 1 month, M can also be 3 moon.
  • the ratio of N and M can be 1/3, 1/5 or 1/10.
  • Step S104 Set the first connection mode as the preferred connection mode for the first connection between the device and the application.
  • the first connection is the first connection after the application is disconnected from the device.
  • Step S105 Use the first set as the parallel connection mode for the first connection between the device and the application.
  • the method provided in this embodiment can be applied to applications initiating connections to devices, and devices to initiating connections to applications.
  • the cloud server sends the preferred connection mode and the parallel connection mode to the application program, so that the application program attempts to establish a connection with the device through the preferred connection mode and the parallel connection mode.
  • the device connection method provided by the embodiments of the present application is designed to extract connection modes for two predetermined periods respectively, and can comprehensively compare and filter the connection efficiency of multiple connection modes to avoid accidental conditions affecting the selection of connection modes. Improve the connection success rate and connection efficiency of the first connection between the application and the device, and improve the intelligence of the first connection.
  • the step before step S105, the step further includes: determining whether the connection mode with the largest proportion in the fastest connection mark information in the second predetermined period M is the same as the first connection mode to obtain the first determination result.
  • step S105 is continued to be executed, and the first set is used as the parallel connection mode for the first connection between the device and the application program.
  • step S105 will continue to be executed, and the first set will be used as the parallel connection mode for the first connection between the device and the application program.
  • the first connection mode has advantages compared with other connection modes. Only the first connection mode is used as the first connection mode between the application and the device, which can take into account both the connection success rate and the connection success rate. efficiency.
  • the first connection mode has no advantage compared with other connection modes, and the connection success rate and efficiency are still increased through parallel connection.
  • step S105 before step S105, it also includes: determining whether the available network resources are greater than the preset value, and if the available network resources are not greater than the preset value, giving up the parallel connection mode of using the first set as the first connection between the device and the application. .
  • the parallel connection is abandoned and the connection is first established through the first connection mode, which can adapt to the actual application environment and improve the intelligence of the connection.
  • the first preset threshold may be 1%, the first preset threshold may also be 2%, and the first preset threshold may also be 3%.
  • the second preset threshold may be 1%, the second preset threshold may also be 2%, and the second preset threshold may also be 3%.
  • FIG. 2 is a partial flowchart of another device connection method provided by an embodiment of the present application. As shown in Figure 2, in some embodiments, the following steps are also included after step S105:
  • Step S106 Obtain the switching connection information after the first successful connection between the device and the application in the current connection period.
  • the switching connection information includes the connection duration ratio of the connection mode after the switching connection in a single connection period, the connection success rate, the connection period duration K1 and
  • the number of connections C1 includes at least one connection cycle in one unit time, and the number of connections in one connection cycle is at least once.
  • connection mode after switching is the target connection mode
  • resource consumption per unit time of the target connection mode is less than the resource consumption per unit time of the connection mode before switching.
  • the unit of the connection cycle length K1 can be year, month, day, or hour, minute, or second, and the number of connections C1 is an integer greater than or equal to 0.
  • K1 can be 5 minutes
  • C1 can be 10
  • K1 can also be 1 hour
  • C1 can also be 100.
  • the application and the device attempt to switch the connection mode to the target connection mode within a single connection cycle of duration K1 until the switch is successful.
  • the number of attempts in a single connection cycle is C1, and the cloud server obtains the switching connection information from the application.
  • Step S107 Optimize the connection cycle duration K1 of the target connection mode based on the connection duration proportion and connection success rate corresponding to the current connection cycle to obtain the connection cycle duration K of the target connection mode in the next connection cycle, and calculate the number of connections C1 of the target connection mode. Optimize to obtain the number of connections C in the next connection cycle for the target connection mode.
  • the target connection mode is the switching connection mode in the current connection cycle after the device and the application successfully connect for the first time.
  • the cloud server generates the connection cycle duration K and the number of connections C for the next connection cycle based on the switching connection information of the current connection cycle.
  • the connection cycle duration of the target connection mode of the next connection cycle is updated to K, and the number of connections is updated to C.
  • the switching connection strategy is that the application and the device try to connect within a single connection cycle of duration K. The mode switches to the target connection mode until the switch is successful. The number of attempts in a single connection cycle is C.
  • the connection mode is switched.
  • the cloud server obtains the switching connection information through the application, and generates a switching connection policy based on the switching connection information, and switches the connection mode.
  • the connection policy is sent to the application, and the application switches the connection mode based on the switching connection policy.
  • the device connection method provided in this embodiment periodically obtains the switching connection information and iteratively updates the switching connection mode, which helps to reduce the consumption of system resources and improve the switching efficiency and success rate of the connection mode.
  • C1 is optimized according to the proportion of connection duration corresponding to the current connection period to obtain C; when the proportion of connection duration corresponding to the current connection period is greater than or equal to the upper limit of duration, C1 is assigned to C.
  • the connection The duration ratio is the ratio of the connection duration of the target connection mode after switching to the connection cycle duration K.
  • the upper limit of the duration can be 75%, the upper limit of the duration can also be 80%, and the upper limit of the duration can also be 90%.
  • the connection duration ratio is already within the optimal threshold range, and there is no need to optimize the number of connections.
  • a*C1 is assigned to C.
  • a is greater than 1, a can be 1.5, a can also be 1.8, a It can also be 2.
  • the lower limit of the duration is 10%, the lower limit of the duration may also be 5%, and the lower limit of the duration may also be 15%.
  • connection duration corresponding to the current connection period is less than the lower limit of duration
  • b*C1 is assigned to C, where b is less than a, b can be 0, b can also be 0.5, and b can also be 0.3.
  • the connection duration corresponding to the current connection cycle is less than 10%, the resources consumed by switching the connection mode are greater than the resources saved by switching the connection mode. Reduce or set the number of connections in the next connection cycle to 0 to avoid wasting resources.
  • the device connection method provided in this embodiment comprehensively considers the resources consumed before the connection mode is successfully switched and the resources saved after the connection mode is successfully switched, and the number of connections is adjusted to avoid resource waste.
  • optimizing K1 to obtain the connection cycle duration K of the next connection cycle includes: optimizing K1 to obtain K according to the connection duration proportion corresponding to the current connection cycle and the connection success rate corresponding to the current connection cycle.
  • connection success rate corresponding to the current connection period is greater than or equal to the upper limit of the success rate
  • K1 is assigned to K.
  • the upper limit of the success rate is 70%
  • the upper limit of the success rate may also be 80%
  • the upper limit of the success rate may also be 90%.
  • connection success rate corresponding to the current connection period is greater than or equal to the lower limit of the success rate and less than the upper limit of the success rate, determine whether the connection duration corresponding to the current connection period is less than the preset proportion. If the connection duration corresponding to the current connection period is less than the preset proportion, Then c*K1 is assigned to K.
  • c is less than 1, c can be 0.3, c can also be 0.5, c can also be 0.8.
  • d is greater than 1, d can be 1.2, d can also be 1.5, and d can also be 1.8.
  • the lower limit of the success rate can be 10%, the lower limit of the success rate can also be 8%, and the lower limit of the success rate can also be 5%.
  • the preset proportion is greater than the lower limit of the success rate and less than the upper limit of the success rate.
  • the preset proportion can be 50%.
  • the set proportion can also be 55%, and the preset proportion can also be 60%.
  • connection duration is not less than 50%, the benefits brought by switching the connection are If it is higher, the connection cycle duration will be increased inversely according to the connection success rate to increase the connection success rate. If the connection duration is less than 50%, the benefits from switching connections will be low. The connection cycle duration will be reduced based on the success rate to reduce resource and performance consumption caused by multiple connection switches.
  • connection success rate corresponding to the current connection period is less than the lower limit of the success rate
  • e*K1 is assigned to K, where e is less than c, e can be 0.2, e can also be 0.1, and e can also be 0.
  • the connection success rate is less than 10%, the resources consumed before the connection is successfully switched are greater than the resources saved after the connection is successfully switched.
  • the connection period is reduced or set to 0 to avoid resource waste.
  • the device connection method provided in this embodiment comprehensively considers the resources consumed before the connection mode is successfully switched and the resources saved after the connection mode is successfully switched, and the connection cycle length is adjusted to avoid resource waste.
  • Figure 3 is a schematic structural diagram of a matrix model provided by an embodiment of the present application. As shown in Figure 3, in some embodiments, a matrix model is established based on the connection duration ratio and connection success rate of the target connection mode.
  • the abscissa is the connection duration ratio
  • the ordinate is the connection success rate.
  • the connection duration ratio sets intervals according to different gradients, and the overall interval is divided into three types:
  • the proportion of connection duration is greater than or equal to the upper limit of duration, and the connection success rate is greater than or equal to the upper limit of success rate.
  • the optimal interval can be set according to system requirements. In some embodiments, the interval in which the connection duration is greater than or equal to 75% and the connection success rate is greater than or equal to 70% is the optimal interval.
  • connection duration ratio and connection success rate are within the optimal range, it is considered that the default parameters of the target connection mode of the current connection cycle (connection cycle duration K and number of connections C) do not need to be changed.
  • the interval (or worst interval), the proportion of connection duration is less than the lower limit of duration, or the connection success rate is less than the lower limit of success rate.
  • the discard interval (or worst interval) can be set according to system requirements. In some embodiments, if the connection duration is less than 10%, or the connection success rate is less than 10%, the target connection mode will be discarded strategically and the target will not be carried out. Switching the connection mode.
  • the cloud server sends the connection cycle duration K and the number of connections C to the application, so that the application initiates a switching connection to the device based on the connection cycle duration K and the number of connections C.
  • the current connection mode between the application and the device is a forwarding connection
  • the switching connection mode is a tunnel connection.
  • the tunnel connection is calculated based on the proportion of connection time in the first connection period after the switching connection.
  • the number of switching connections C of the connection in the next connection cycle is optimized to obtain C1, which is the number of connections of the tunnel connection in the next connection cycle:
  • Connection duration ratio T Optimized number of connections C1 T ⁇ 10% 0 10% ⁇ T ⁇ 50% 2*C 50% ⁇ T ⁇ 75% 1.5*C T ⁇ 75% 1*C
  • connection cycle duration K is optimized based on Table 2 to obtain K1.
  • K1 is the connection cycle duration of the tunnel connection in the next connection cycle:
  • the ratio of the connection duration of the tunnel connection to the unit time is 75%, and the connection success rate of the tunnel connection during the handover process is 50%, it is considered that the benefits brought by the handover after the connection is successful are higher, and the connection period can be increased by increasing the connection period. Duration, improve the connection success rate, in order to expect the connection to be successful as soon as possible and obtain higher benefits. If the connection success rate is 25%, the increase in the connection period is higher than when the connection success rate is 50%, in order to increase the connection success rate and obtain higher benefits.
  • the ratio of the tunnel connection duration to unit time after the switch is less than 10% and the connection success rate is less than 10%, it is considered that the benefits brought by the switch after the connection is successful or the success rate is low, and the connection cycle length or the number of connections is set to If it is 0, parallel connections will not be performed to avoid unnecessary performance consumption.
  • the cloud service In the device connection method provided by this application, the cloud service generates a switching connection strategy through the data analysis module, and sends the switching connection strategy to the application through the instruction issuing module. After receiving the switching connection policy, the application attempts to switch the connection mode to the target connection mode within a connection period of K duration until it succeeds. The number of attempts in each connection period is C.
  • the cloud server periodically updates K and C by periodically obtaining switching connection information.
  • the increase or decrease multiples of K and C can be set in the cloud server.
  • the multiples of C1 and K1 in the table are only examples.
  • the difference compared with related technologies is that the cloud server analyzes the recorded information of the application and the device during the switching process, builds a matrix model, and calculates the connection mode duration after switching and the success rate during the switching process. Switch the connection strategy to update.
  • targeted parallel strategies can be adaptively generated to more accurately balance performance consumption and benefits after switching, which can effectively improve the benefits after switching. , and can also avoid unnecessary performance consumption of applications and cloud servers.
  • Figure 4 is a schematic structural diagram of an equipment connection device provided by an embodiment of the present application.
  • an embodiment of the present application provides a device connection device, including:
  • the acquisition module 401 is configured to obtain connection information between the application program and the device.
  • the data processing module 402 is configured to generate a preferred connection mode and a parallel connection mode for the first connection between the device and the application based on the connection information, and is also configured to update the switching connection strategy between the device and the application based on the switching connection information.
  • the data processing module 402 generates the preferred connection mode, parallel connection mode and switching connection strategy for the first connection between the device and the application based on the device connection method provided in any of the above embodiments.
  • the control module 403 is configured to control the device to establish a connection with the application based on the preferred connection mode, parallel connection mode and switching connection policy.
  • the acquisition module 401 includes a first acquisition unit, a second acquisition unit and a third data acquisition unit.
  • the data processing module 402 includes a first data processing unit and a second data processing unit.
  • the first acquisition unit is configured to acquire the connection information between the application and the device.
  • the connection information includes the fastest connection mark information, and the fastest connection mark information includes the fastest connection mode marked when multiple connection modes are parallel.
  • the second acquisition unit It is set to obtain the connection mode with the largest proportion in the fastest connection mark information within the first predetermined period N as the first connection mode;
  • the third acquisition unit is set to obtain the fastest connection mark information in the second predetermined period M according to Among the connection modes sorted from large to small in proportion, at least one connection mode in the previous preset position forms the first set, M is greater than N;
  • the first data processing unit is configured to use the first connection mode as the device and The preferred connection mode for the first connection of the application program;
  • the second data processing unit is set to use the first set as the parallel connection mode for the first connection of the device and the application program.
  • the device connection device provided by the embodiments of the present application is designed to extract connection modes for two predetermined periods respectively, and can comprehensively compare and filter the connection efficiency of multiple connection modes to avoid accidental conditions affecting the selection of connection modes. Improve the connection success rate and connection efficiency of the first connection between the application and the device, and improve the intelligence of the first connection.
  • the acquisition module 401 further includes a fourth acquisition unit
  • the data processing module 402 further includes a third data processing unit.
  • the fourth acquisition unit is configured to obtain the switching connection information after the first successful connection between the device and the application in the current connection period.
  • the switching connection information includes the connection duration ratio of the connection mode after the switching connection in a single connection period, the connection success rate, and the connection period.
  • Optimize the connection number C1 of the target connection mode to obtain the connection number C of the target connection mode in the next connection cycle.
  • the target The connection mode is at least one switching connection mode in the current connection cycle after the device and the application successfully connect for the first time.
  • the device connection device provided by the embodiment of the present application comprehensively considers the resources consumed before the connection mode is successfully switched and the resources saved after the connection mode is successfully switched, and adjusts the connection cycle length to avoid resource waste.
  • the embodiment of the present application provides an electronic device, including a memory 10, a processor 20, and a computer program stored in a storage medium of the memory 10 and executable on the processor 20.
  • the processor 20 executes the computer program.
  • the program implements the method provided by any of the above embodiments.
  • Embodiments of the present application also provide a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform the method provided by any of the above embodiments.
  • the storage medium can be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), etc.
  • the storage medium may be a non-transitory storage medium.
  • embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Moreover, the present application may use one or more computer-usable storage media (including but not limited to magnetic disk storage, Compact Disk Read-Only Memory (CD-ROM), optical memory) containing computer-usable program code. etc.) in the form of a computer program product implemented on.
  • computer-usable storage media including but not limited to magnetic disk storage, Compact Disk Read-Only Memory (CD-ROM), optical memory
  • CD-ROM Compact Disk Read-Only Memory
  • optical memory containing computer-usable program code. etc.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Communication Control (AREA)

Abstract

本申请提供了一种设备连接方法、装置、电子设备及存储介质。该设备连接方法包括获取应用程序与设备的连接信息,连接信息包括最快连接标记信息,最快连接标记信息包括多种连接模式并行时标记的最快建立连接的连接模式;获取第一预定周期N内,最快连接标记信息中占比最大的连接模式,作为第一连接模式;获取第二预定周期M内,最快连接标记信息中按照占比由大到小顺序排序的连接模式中占比排序位于前预设位的至少一个连接模式,组成第一集合,M大于N;将第一连接模式作为设备与应用程序首次连接的首选连接模式;将第一集合作为设备与应用程序首次连接的并行连接模式。

Description

设备连接方法、装置、电子设备及存储介质
本申请要求在2022年06月01日提交中国专利局、申请号为202210618481.7的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及设备互连技术领域,例如涉及一种设备连接方法、装置、电子设备及存储介质。
背景技术
随着物联网领域的飞速发展,生活中可使用的应用程序越来越多,越来越多的物联网设备,例如视频监控摄像头,将会通过公网进行网络通信和流媒体服务等业务。相关技术中,应用程序软件与设备的连接有多种方式,比如:直连、隧道连接或转发连接是比较通用的技术,这些技术原理不同,连接的速度和成功率各不相同。
直连是指应用程序和设备处在同一个局域网内,可以直接快速访问,不需要经过云端部署服务器作为中间节点,这种方式快速、高效。隧道连接和转发均需要在云端部署服务器作为中间节点,提供应用程序和设备的端到端的连接。隧道连接,对云服务器的网络资源消耗低,连接成功率和稳定性一般。可以通过传输控制协议(Transmission Control Protocol,TCP)或用户数据报协议(User Datagram Protocol,UDP)实现。但是使用TCP实现时,因其稳定性一般,往往会造成消息拥堵等情况,采用UDP更加合适。转发连接,对云服务器的网络资源消耗多,连接成功率和稳定性较好。可以通过TCP或UDP实现。采用UDP实现时,因UDP的可靠性问题,往往造成转发连接的整体稳定性下降。
应用程序软件与设备的连接模式智能化程度较低,至少存在下述一种或几种问题:连接速度低、成功率低、资源消耗高等。在这种混合组网的情况下,以怎样的方式设置设备连接方法以提高智能化程度,成为了一个要解决的难题。
发明内容
本申请提供一种设备连接方法、装置、电子设备及存储介质,用以提高设备连接的智能化程度。
第一方面,本申请提供了一种设备连接方法,所述连接方法应用于设备与应用程序连接,该方法包括:
获取应用程序与设备的连接信息,所述连接信息包括最快连接标记信息,所述最快连接标记信息包括多种连接模式并行时标记的最快建立连接的连接模式;
获取第一预定周期N内,最快连接标记信息中占比最大的连接模式,作为第一连接模式;
获取第二预定周期M内,最快连接标记信息中按照占比由大到小顺序排序的连接模式中占比排序位于前预设位的至少一个连接模式,组成第一集合,M大于N;
将所述第一连接模式作为设备与应用程序首次连接的首选连接模式;
将所述第一集合作为设备与应用程序首次连接的并行连接模式。
第二方面,本申请提供了一种设备连接装置,包括:
获取模块,设置为获取应用程序与设备的连接信息;
数据处理模块,设置为基于所述连接信息生成设备与应用程序首次连接的首选连接模式和并行连接模式,基于切换连接信息更新设备与应用程序的切换连接策略;
控制模块,设置为基于所述首选连接模式、所述并行连接模式和所述切换连接策略控制设备与应用程序建立连接。
第三方面,本申请提供了一种电子设备,包括存储器、处理器以及存储在所述存储器的存储介质中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述的设备连接方法。
第四方面,本申请提供了一种存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述的设备连接方法。
附图说明
图1是本申请实施例提供的一种设备连接方法的流程示意图;
图2是本申请实施例提供的另一种设备连接方法的部分流程示意图;
图3是本申请实施例提供的一种矩阵模型的结构示意图;
图4是本申请实施例提供的一种设备连接装置的结构示意图;
图5是本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
下面结合具体实施方式并参照附图,对本申请进行说明。这些描述只是示例性的。此外,在以下说明中,省略了对公知结构和技术的描述。
所描述的实施例是本申请一部分实施例。
在本申请的描述中术语“第一”、“第二”仅用于区分目的。
相关技术中,设备终端基于多种连接模式同时向应用程序设备发起连接请求,多种连接模式并行,以先连通的连接模式建立连接,该方法的连接速度快,连接效率高,但需要消耗大量的网络资源,不利于同时建立多路连接。当一种连接模式实际不能连通或连通成功的概率小于设定概率时,该方法不能节省带宽,同时会导致大量的系统资源无谓地消耗。应用程序设备与设备终端的连接环境条件不同,采用统一的连接策略,会造成整个系统大量的资源消耗。例如,假定应用程序设备和设备终端通过隧道连接(点对点(Piont to Piont,P2P)连接)的成功率极低,同时并行转发连接和隧道连接时,链路中通过隧道连接的每个节点(应用程序设备、设备终端、云服务器等)都会产生大量的资源消耗。
相关技术中,获取应用程序设备与设备终端最近一次的连接模式,并与预先设置的第一优先级连接模式比较,判断采用哪种连接模式连接应用程序设备与设备终端。例如,预设隧道连接为第一优先级连接模式,若最近一次的连接模式为转发,而隧道连接也能连通,则保存连接模式为隧道连接用于下一次连接。若隧道连接不能连通,则保存转发连接用于下一次连接。保存最近一次的连接模式用于下一次连接,确实可以极大程度的提高连接的成功率,但是连接的效率差。该方法仅着眼于连接是否能成功,却并未兼顾连接速度,无法在连接时带来更佳的用户体验。例如,应用程序设备和设备终端的第一优先级连接模式是隧道连接,隧道连接能够成功连通,但是隧道连接的速度低,则该应用程序设备和设备终端每次连接均会花费大量的时间。
图1是本申请实施例提供的一种设备连接方法的流程示意图。
如图1所示,本申请实施例提供的一种设备连接方法,应用于服务器,本实施例中应用于云服务器,包括如下步骤:
步骤S101:获取应用程序与设备的连接信息,连接信息包括最快连接标记信息,最快连接标记信息包括多种连接模式并行时标记的最快建立连接的连接模式。
本实施例中,连接信息用于表征应用程序与设备的历史连接信息,应用程序与设备均接入公网,通过云服务器进行管理。云服务器分配云账号、密码给应用程序和设备。系统初始建立时,应用程序与设备通过多种连接模式并行尝试连接,以先连通的连接模式建立连接。应用程序将建立连接成功的信息上报 给云服务器进行存储。信息包含云账号、设备标识信息、连接方式的类型、连接时间、最快连接标记等。
步骤S102:获取第一预定周期N内,最快连接标记信息中占比最大的连接模式,作为第一连接模式。
本实施例中的占比为最快连接标记信息中,每种连接模式的数量与总数的比值。第一连接模式为第一预定周期N内,最快连接标记信息中数量最多的连接模式。
步骤S103:获取第二预定周期M内,最快连接标记信息中按照占比由大到小顺序排序的连接模式中占比排序位于前预设位的至少一个连接模式,组成第一集合,M大于N。
在一种实施例中,N为第一预定周期的时长,M为第二预定周期的时长,N和M的单位可以为年、月、日,也可以为时、分、秒,N和M的单位可以相同,也可以不相同,N可以为3天,M可以为15天,N也可以为1小时,M也可以为5小时,N也可以为1个月,M也可以为3个月。N和M的比值可以为1/3、1/5或1/10。
步骤S104:将第一连接模式作为设备与应用程序首次连接的首选连接模式。
本实施例中,首次连接为应用程序与设备断开后再进行连接的第一次连接。
步骤S105:将第一集合作为设备与应用程序首次连接的并行连接模式。
本实施例提供的方法可以应用于应用程序向设备发起连接,也可以应用于设备向应用程序发起连接。本实施例中,云服务器将首选连接模式和并行连接模式发送给应用程序,以使应用程序通过首选连接模式与并行连接模式尝试与设备建立连接。
本申请实施例提供的设备连接方法,通过分别对两个预定周期进行连接模式提取的设计,能够全面地对多个连接模式的连接效率进行比较和筛选,避免偶发性条件影响连接模式的选取,提高应用程序与设备首次连接的连接成功率和连接效率,提高首次连接的智能化程度。
在一些实施例中,在步骤S105之前还包括:判断第二预定周期M内的最快连接标记信息中占比最大的连接模式与第一连接模式是否相同得到第一判断结果。
第一判断结果为是,则判断第二预定周期M内,最快连接标记信息中占比排序位于前2位的连接模式的占比差距是否超过预定阈值,得到第二判断结果。第一判断结果为否,则继续执行步骤S105,将第一集合作为设备与应用程序首次连接的并行连接模式。
第二判断结果为是,则放弃将第一集合作为设备与应用程序首次连接的并行连接模式。第二判断结果为否,则继续执行步骤S105,将第一集合作为设备与应用程序首次连接的并行连接模式。
本实施例中,两次判断结果均为是时,第一连接模式与其它连接模式相比具有优势,仅以第一连接模式作为应用程序与设备的首次连接模式,能够兼顾连接成功率与连接效率。
第一判断结果为否,则首先通过首选连接模式尝试连接设备与应用程序,同时并行通过第一集合内的连接模式尝试连接设备与应用程序。
第二判断结果为否,则首先通过首选连接模式尝试连接设备与应用程序,同时并行通过第一集合内的连接模式尝试连接设备与应用程序。
两次判断结果中有至少一个为否时,第一连接模式与其它连接模式相比不具有优势,仍通过并行连接的方式增加连接成功率与效率。
在一些实施例中,在步骤S105之前还包括:判断可用网络资源是否大于预设值,若可用网络资源不大于预设值,则放弃将第一集合作为设备与应用程序首次连接的并行连接模式。
本实施例中,在可用网络资源不足的情况下,放弃并行连接,优先通过第一连接模式建立连接,能够适应实际的应用程序环境,提高连接的智能化程度。
在一些实施例中,在获取应用于设备的连接信息之后,放弃将当前连接周期内连接时长占比小于第一预设阈值或当前连接周期内连接成功率小于第二预设阈值的连接模式作为下个连接周期的切换连接模式。本实施例中,第一预设阈值可以为1%,第一预设阈值也可以为2%,第一预设阈值也可以为3%。第二预设阈值可以为1%,第二预设阈值也可以为2%,第二预设阈值也可以为3%。
图2是本申请实施例提供的另一种设备连接方法的部分流程示意图。如图2所示,在一些实施例中,在步骤S105之后还包括下述步骤:
步骤S106:获取当前连接周期内设备与应用程序首次连接成功后的切换连接信息,切换连接信息包括单个连接周期内的切换连接后连接模式的连接时长占比、连接成功率、连接周期时长K1和连接次数C1,一个单位时间内包含至少一个连接周期,一个连接周期内的连接次数为至少一次。
本实施例中,切换后的连接模式为目标连接模式,目标连接模式在单位时间内的资源消耗量小于切换前的连接模式在单位时间内的资源消耗量。连接周期时长K1的单位可以为年、月、日,也可以为时、分、秒,连接次数C1为大于或等于0的整数。K1可以为5分钟,C1可以为10,K1也可以为1小时,C1也可以为100。应用程序与设备在时长为K1的单个连接周期内尝试将连接模式切换为目 标连接模式直至切换成功。在单个连接周期内尝试的次数为C1,云服务器从应用程序获取切换连接信息。
步骤S107:基于当前连接周期对应的连接时长占比和连接成功率对目标连接模式的连接周期时长K1进行优化得到目标连接模式在下个连接周期的连接周期时长K,对目标连接模式的连接次数C1进行优化得到目标连接模式在下个连接周期的连接次数C,目标连接模式为设备与应用程序首次连接成功后的当前连接周期的切换连接模式。
本实施例中,云服务器基于当前连接周期的切换连接信息生成下个连接周期的连接周期时长K和连接次数C。本实施例中,将下个连接周期的目标连接模式的连接周期时长更新为K,连接次数更新为C,其中切换连接策略为,应用程序与设备在时长为K的单个连接周期内尝试将连接模式切换为目标连接模式直至切换成功。在单个连接周期内尝试的次数为C。
本实施例中,在应用程序和设备首次连接成功后,为了降低系统资源的消耗,对连接模式进行切换,云服务器通过应用程序获取切换连接信息,并基于切换连接信息生成切换连接策略,将切换连接策略发送给应用程序,应用程序基于切换连接策略切换连接模式。
本实施例提供的设备连接方法,通过周期性地获取切换连接信息,对切换连接模式进行迭代更新,有助于降低系统资源的消耗,提高连接模式的切换效率和成功率。
在一些实施例中,根据当前连接周期对应的连接时长占比对C1进行优化得到C;当前连接周期对应的连接时长占比大于或等于时长上限时,将C1赋予C,本实施例中,连接时长占比为切换后目标连接模式的连接时长与连接周期时长K的比值,时长上限可以为75%,时长上限也可以为80%,时长上限也可以为90%。当前连接周期的对应连接时长占比大于或等于时长上限时,连接时长占比已经处于最佳阈值区间,不需要对连接次数进行优化。
当前连接周期对应的连接时长占比大于或等于时长下限且小于时长上限时,将a*C1赋予C,在一种实施例中,a大于1,a可以为1.5,a也可以为1.8,a也可以为2。当前连接周期对应的连接时长占比越大a越小。本实施例中,时长下限为10%,时长下限也可以为5%,时长下限也可以为15%。当前连接周期对应的连接时长占比大于或等于10%且小于或等于75%时,切换连接模式节约的资源大于切换连接模式消耗的资源,通过增大连接次数有助于提高切换后的连接模式在下个连接周期的连接时长占比,进而增加系统资源的节约量。
当前连接周期对应的的连接时长占比小于时长下限时,将b*C1赋予C,其中, b小于a,b可以为0,b也可以为0.5,b也可以为0.3。当前连接周期对应的连接时长占比小于10%时,切换连接模式消耗的资源大于切换连接模式节约的资源,将下个连接周期的连接次数减少或设为0,避免造成资源浪费。
本实施例提供的设备连接方法,综合考虑了切换连接模式成功前消耗的资源与切换连接模式成功后的节约的资源,对连接次数进行调整,以避免资源浪费。
在一些实施例中,对K1进行优化得到下个连接周期的连接周期时长K包括:根据当前连接周期对应的连接时长占比和当前连接周期对应的连接成功率对K1进行优化得到K。
当前连接周期对应的连接成功率大于或等于成功率上限时,将K1赋予K。本实施例中,成功率上限为70%,成功率上限也可以为80%,成功率上限也可以为90%。当前连接周期对应的连接成功率大于70%时,连接成功率已经处于最佳阈值区间,不需要对连接周期时长进行优化。
当前连接周期对应的连接成功率大于或等于成功率下限且小于成功率上限时,判断当前连接周期对应的连接时长是否小于预设占比,若当前连接周期对应的连接时长小于预设占比,则将c*K1赋予K,本实施例中,c小于1,c可以为0.3,c也可以为0.5,c也可以为0.8,连接成功率越大c越大,当前连接周期对应的连接时长不小于预设占比,则将d*K1赋予K,本实施例中,d大于1,d可以为1.2,d也可以为1.5,d也可以为1.8,连接成功率越大d越小。成功率下限可以为10%,成功率下限也可以为8%,成功率下限也可以为5%,预设占比大于成功率下限且小于成功率上限,预设占比可以为50%,预设占比也可以为55%,预设占比也可以为60%。本实施例中,当前连接周期对应的连接成功率大于或等于10%小于70%时,判断连接时长占比是否小于50%,若连接时长占比不小于50%,则切换连接带来的收益较高,根据连接成功率的高低反向增加连接周期时长,增大连接成功率。若连接时长占比小于50%,则切换连接带来的收益偏低,根据成功率的高低降低连接周期时长,以减少多次切换连接带来的资源与性能的消耗。
当前连接周期对应的连接成功率小于成功率下限时,将e*K1赋予K,其中,e小于c,e可以为0.2,e也可以为0.1,e也可以为0。本实施例中,连接成功率小于10%时,切换连接成功前消耗的资源大于切换连接成功后节约的资源,将连接周期时长降低或设为0,避免造成资源浪费。
本实施例提供的设备连接方法,综合考虑了切换连接模式成功前消耗的资源与切换连接模式成功后的节约的资源,对连接周期时长进行调整,以避免资源浪费。
图3是本申请实施例提供的一种矩阵模型的结构示意图。如图3所示,在一些实施例中,根据目标连接模式的连接时长占比和连接成功率建立矩阵模型,横坐标为连接时长占比,纵坐标为连接成功率,将连接时长占比、连接成功率按照不同的梯度设置区间,将整体区间分为三种:
最佳区间,连接时长占比大于或等于时长上限,且连接成功率大于或等于成功率上限。最佳区间可以根据系统需求设置,在一些实施例中,连接时长占比大于或等于75%,且连接成功率大于或等于70%的区间为最佳区间。连接时长占比和连接成功率处于最佳区间的情况下,认为当前连接周期的目标连接模式的默认参数(连接周期时长K和连接次数C)不需要做改变。
舍弃区间(或最差区间),连接时长占比小于时长下限,或连接成功率小于成功率下限。舍弃区间(或最差区间)可以根据系统需求设置,在一些实施例中,连接时长占比小于10%,或连接成功率小于10%,在策略上将舍弃该目标连接模式,不进行该目标连接模式的切换。
引导区间:除最佳区间和舍弃区间外的其它区间为引导区间,可以以达到最佳区间为目的,改变引导区间内的连接周期时长K和连接次数C以实现精细化的引导。
云服务器将连接周期时长K和连接次数C发送给应用程序,以使应用程序基于连接周期时长K和连接次数C向设备发起切换连接。
在一个实施例中,应用程序与设备当前的连接模式为转发连接,切换连接模式为隧道连接,基于表1,根据隧道连接在切换连接后的第一个连接周期内的连接时长占比对隧道连接在下一个连接周期内的切换连接次数C进行优化得到C1,C1为隧道连接在下个连接周期的连接次数:
表1
连接时长占比T 优化后的连接次数C1
T<10% 0
10%≤T<50% 2*C
50%≤T<75% 1.5*C
T≥75% 1*C
当连接时长占比T大于或等于50%时,基于表2对连接周期时长K进行优化得到K1,K1为隧道连接在下个连接周期的连接周期时长:
表2
连接成功率P 优化后的连接周期时长K1
P<10% 0
10%≤P<30% 4*K
30%≤P<70% 2*K
P≥70% 1*K
表3
成功率P 优化后的连接周期时长K1
P<10% 0
10%≤P<30% 0.5*K 1
30%≤P<70% 0.8*K 1
P≥70% 1*K 1
将表1、表2和表3结合,得到完整的切换连接策略模型,如表4所示:
表4
Figure PCTCN2022139451-appb-000001
Figure PCTCN2022139451-appb-000002
例如,若隧道连接的连接时长与单位时间的比值为75%,且在切换过程中隧道连接的连接成功率为50%,则认为连接成功后切换带来的收益较高,可通过增加连接周期时长,提高连接成功率,以期望尽快连接成功,获得更高的收益。若连接成功率为25%,则连接周期增加的时长要高于连接成功率为50%的情况下连接周期增加的时长,以期望提高连接成功率,获得更高收益。
若切换后隧道连接连接时长与单位时间的比值为20%,且在切换过程中隧道连接的成功率为50%,则认为连接成功后切换带来的收益不高,可通过降低连接周期时长和连接次数,减少应用程序和云服务器的性能消耗。
若切换后隧道连接连接时长与单位时间的比值小于10%且连接成功率小于10%,则认为连接成功后切换带来的收益较低或成功率较低,则将连接周期时长或连接次数置为0,不进行并行连接,避免无谓的性能消耗。
本申请提供的设备连接方法,云服务通过数据分析模块生成切换连接策略,通过指令下发模块将切换连接策略发送给应用程序。应用程序在接收到该切换连接策略后,在时长为K的连接周期内,尝试将连接模式切换为目标连接模式直至成功,在每个连接周期内尝试的次数为C。云服务器通过周期性地获取切换连接信息,对K和C进行周期性的更新。另外,K和C增大或缩小的倍数可以在云服务器中设置,表格中的C1和K1的倍数仅是举例说明。
相比于相关技术的不同在于:云服务器根据应用程序与设备的在切换过程中的记录信息进行分析,构建矩阵模型,通过切换后的连接模式的时长占比和切换过程中的成功率,对切换连接策略进行更新。
带来的好处是,针对应用程序和设备的不同网络情况,自适应的生成针对性的并行策略,更精准的平衡性能消耗和切换后带来的收益,既有效的提高切换后带来的收益,也能避免应用程序和云服务器不必要的性能消耗。
图4是本申请实施例提供的一种设备连接装置的结构示意图。
如图4所示,基于同一构思,本申请实施例提供的一种设备连接装置,包括:
获取模块401,设置为获取应用程序与设备的连接信息。
数据处理模块402,设置为基于连接信息生成设备与应用程序首次连接的首选连接模式和并行连接模式,还设置为基于切换连接信息更新设备与应用程序的切换连接策略。
本实施例中,数据处理模块402基于上述任一实施例提供的设备连接方法生成设备与应用程序首次连接的首选连接模式、并行连接模式和切换连接策略。
控制模块403,设置为基于首选连接模式、并行连接模式和切换连接策略控制设备与应用程序建立连接。
在一些实施例中,获取模块401包括第一获取单元、第二获取单元和第三数据获取单元。数据处理模块402包括第一数据处理单元和第二数据处理单元。
第一获取单元设置为获取应用程序与设备的连接信息,连接信息包括最快连接标记信息,最快连接标记信息包括多种连接模式并行时标记的最快建立连接的连接模式;第二获取单元设置为获取第一预定周期N内,最快连接标记信息中占比最大的连接模式,作为第一连接模式;第三获取单元设置为获取第二预定周期M内,最快连接标记信息中按照占比由大到小顺序排序的连接模式中占比 排序位于前预设位的至少一个连接模式,组成第一集合,M大于N;第一数据处理单元设置为将第一连接模式作为设备与应用程序首次连接的首选连接模式;第二数据处理单元设置为将第一集合作为设备与应用程序首次连接的并行连接模式。
本申请实施例提供的设备连接装置,通过分别对两个预定周期进行连接模式提取的设计,能够全面地对多个连接模式的连接效率进行比较和筛选,避免偶发性条件影响连接模式的选取,提高应用程序与设备首次连接的连接成功率和连接效率,提高首次连接的智能化程度。
在一些实施例中,获取模块401还包括第四获取单元,数据处理模块402还包括第三数据处理单元。
第四获取单元设置为获取当前连接周期内设备与应用程序首次连接成功后的切换连接信息,切换连接信息包括单个连接周期内的切换连接后连接模式的连接时长占比、连接成功率、连接周期时长K1和连接次数C1,其中,一个单位时间内包含至少一个连接周期,一个连接周期内的连接次数为至少一次;第三数据处理单元设置为基于当前连接周期对应的连接时长占比和连接成功率对目标连接模式的连接周期时长K1进行优化得到目标连接模式在下个连接周期的连接周期时长K,对目标连接模式的连接次数C1进行优化得到目标连接模式在下个连接周期的连接次数C,目标连接模式为设备与应用程序首次连接成功后的当前连接周期的至少一个切换连接模式。
本申请实施例提供的设备连接装置,综合考虑了切换连接模式成功前消耗的资源与切换连接模式成功后的节约的资源,对连接周期时长进行调整,以避免资源浪费。
如图5所示,本申请实施例提供了一种电子设备,包括存储器10、处理器20以及存储在存储器10的存储介质中并可在处理器20上运行的计算机程序,处理器20执行计算机程序时实现上述任一实施例提供的方法。
本申请实施例还提供一种包含计算机可执行指令的存储介质,计算机可执行指令在由计算机处理器执行时用于执行上述任一实施例提供的方法。其中,存储介质可为磁碟、光盘、只读存储器(Read-Only Memory,ROM)或随机存取存储器(Random Access Memory,RAM)等。存储介质可为非暂态存储介质。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、 光盘只读存储器(Compact Disk Read-Only Memory,CD-ROM)、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。

Claims (11)

  1. 一种设备连接方法,应用于设备与应用程序连接,包括:
    获取应用程序与设备的连接信息,其中,所述连接信息包括最快连接标记信息,所述最快连接标记信息包括多种连接模式并行时标记的最快建立连接的连接模式;
    获取第一预定周期N内,最快连接标记信息中占比最大的连接模式,作为第一连接模式;
    获取第二预定周期M内,最快连接标记信息中按照占比由大到小顺序排序的连接模式中占比排序位于前预设位的至少一个连接模式,组成第一集合,M大于N;
    将所述第一连接模式作为设备与应用程序首次连接的首选连接模式;
    将所述第一集合作为设备与应用程序首次连接的并行连接模式。
  2. 根据权利要求1所述的设备连接方法,在所述将所述第一集合作为设备与应用程序首次连接的并行连接模式前,还包括:
    判断所述第二预定周期M内的最快连接标记信息中占比最大的连接模式与所述第一连接模式是否相同;
    响应于所述第二预定周期M内的最快连接标记信息中占比最大的连接模式与所述第一连接模式相同,判断所述第二预定周期M内,最快连接标记信息中占比排序位于前2位的连接模式的占比差距是否超过预定阈值;
    响应于所述第二预定周期M内,最快连接标记信息中占比排序位于前2位的连接模式的占比差距超过所述预定阈值,放弃将所述第一集合作为设备与应用程序首次连接的并行连接模式。
  3. 根据权利要求2所述的设备连接方法,还包括:
    响应于所述第二预定周期M内的最快连接标记信息中占比最大的连接模式与所述第一连接模式不相同,通过所述首选连接模式尝试连接设备与应用程序,同时并行通过所述第一集合内的连接模式尝试连接设备与应用程序。
  4. 根据权利要求2所述的设备连接方法,还包括:
    响应于所述第二预定周期M内,最快连接标记信息中占比排序位于前2位的连接模式的占比差距不超过所述预定阈值,通过所述首选连接模式尝试连接设备与应用程序,同时并行通过所述第一集合内的连接模式尝试连接设备与应用程序。
  5. 根据权利要求1-4任一项所述的设备连接方法,还包括:
    获取当前连接周期内设备与应用程序首次连接成功后的切换连接信息,其中,所述切换连接信息包括单个连接周期内的切换连接后连接模式的连接时长占比、连接成功率、连接周期时长K1和连接次数C1,一个单位时间内包含至少一个连接周期,一个连接周期内的连接次数为至少一次;
    基于当前连接周期对应的连接时长占比和连接成功率对目标连接模式的连接周期时长K1进行优化得到所述目标连接模式在下个连接周期的连接周期时长K,对所述目标连接模式的连接次数C1进行优化得到所述目标连接模式在下个连接周期的连接次数C,其中,所述目标连接模式为所述设备与应用程序首次连接成功后的当前连接周期的切换连接模式。
  6. 根据权利要求5所述的设备连接方法,其中,所述对所述目标连接模式的连接次数C1进行优化得到所述目标连接模式在下个连接周期的连接次数C,包括:
    根据当前连接周期的目标连接模式的连接时长占比对C1进行优化得到C;
    其中,在当前连接周期的目标连接模式的连接时长占比大于或等于时长上限的情况下,将C1赋予C;在当前连接周期的目标连接模式的连接时长占比大于或等于时长下限且小于时长上限的情况下,将a*C1赋予C,当前连接周期的目标连接模式的连接时长占比越大a越小;在当前连接周期的目标连接模式的连接时长占比小于时长下限时,将b*C1赋予C,b小于a。
  7. 根据权利要求5所述的设备连接方法,其中,所述对所述目标连接模式的连接周期时长K1进行优化得到所述目标连接模式在下个连接周期的连接周期时长K,包括:
    根据当前连接周期的目标连接模式的连接时长占比和当前连接周期的目标连接模式的连接成功率对K1进行优化得到K;
    其中,在当前连接周期的目标连接模式的连接成功率大于或等于成功率上限的情况下,将K1赋予K;在当连接前周期的连接成功率大于或等于成功率下限且小于成功率上限的情况下,判断当前连接周期的连接时长占比是否小于预设占比,响应于当前连接周期的连接时长占比小于所述预设占比,将c*K1赋予K,所述连接成功率越大c越大,响应于当前连接周期的连接时长占比不小于所述预设占比,将d*K1赋予K,所述连接成功率越大d越小;在当前连接周期的连接成功率小于成功率下限的情况下,将e*K1赋予K,e小于c。
  8. 根据权利要求5所述的设备连接方法,还包括:
    放弃将当前连接周期内连接时长占比小于第一预设阈值或当前周期内连接成功率小于第二预设阈值的连接模式作为下个连接周期的切换连接模式。
  9. 一种设备连接装置,包括:
    获取模块,设置为获取应用程序与设备的连接信息;
    数据处理模块,设置为基于所述连接信息生成设备与应用程序首次连接的首选连接模式和并行连接模式,基于切换连接信息更新设备与应用程序的切换连接策略;
    控制模块,设置为基于所述首选连接模式、所述并行连接模式和所述切换连接策略控制设备与应用程序建立连接。
  10. 一种电子设备,包括存储器、处理器以及存储在所述存储器的存储介质中并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现如权利要求1至8任一项所述的设备连接方法。
  11. 一种存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至8任一项所述的设备连接方法。
PCT/CN2022/139451 2022-06-01 2022-12-16 设备连接方法、装置、电子设备及存储介质 WO2023231373A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210618481.7 2022-06-01
CN202210618481.7A CN115037781B (zh) 2022-06-01 2022-06-01 设备连接方法、装置及电子设备

Publications (1)

Publication Number Publication Date
WO2023231373A1 true WO2023231373A1 (zh) 2023-12-07

Family

ID=83123395

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/139451 WO2023231373A1 (zh) 2022-06-01 2022-12-16 设备连接方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN115037781B (zh)
WO (1) WO2023231373A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115037781B (zh) * 2022-06-01 2024-02-02 浙江宇视科技有限公司 设备连接方法、装置及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107734032A (zh) * 2017-10-16 2018-02-23 北京旷视科技有限公司 网络连接建立方法和装置
CN111200557A (zh) * 2019-11-22 2020-05-26 华为技术有限公司 一种连接建立方法及终端设备
CN111770229A (zh) * 2020-06-02 2020-10-13 维沃移动通信有限公司 网络连接方式设置方法及装置
CN114422574A (zh) * 2022-02-10 2022-04-29 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备和计算机可读存储介质
CN115037781A (zh) * 2022-06-01 2022-09-09 浙江宇视科技有限公司 设备连接方法、装置及电子设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140126055A (ko) * 2013-04-22 2014-10-30 삼성전자주식회사 데이터 송신 방법 및 그 전자 장치
CN110876162B (zh) * 2018-08-29 2023-05-19 中兴通讯股份有限公司 一种mtc设备的随机接入方法和装置
CN109660411B (zh) * 2019-02-25 2022-03-01 北京云中融信网络科技有限公司 一种优化即时通信网络链路连接的方法及装置
CN113225233B (zh) * 2021-05-24 2023-03-28 京东方科技集团股份有限公司 健康小屋及其网络选择方法、装置和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107734032A (zh) * 2017-10-16 2018-02-23 北京旷视科技有限公司 网络连接建立方法和装置
CN111200557A (zh) * 2019-11-22 2020-05-26 华为技术有限公司 一种连接建立方法及终端设备
CN111770229A (zh) * 2020-06-02 2020-10-13 维沃移动通信有限公司 网络连接方式设置方法及装置
CN114422574A (zh) * 2022-02-10 2022-04-29 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备和计算机可读存储介质
CN115037781A (zh) * 2022-06-01 2022-09-09 浙江宇视科技有限公司 设备连接方法、装置及电子设备

Also Published As

Publication number Publication date
CN115037781B (zh) 2024-02-02
CN115037781A (zh) 2022-09-09

Similar Documents

Publication Publication Date Title
US9609051B2 (en) Method and system of network transfer adaptive optimization in large-scale parallel computing system
US10171363B2 (en) Traffic control method and apparatus
US9338066B2 (en) Tunnel keep-alive timeout mechanism based on quality of service (QoS) value of received keep-alive messages
WO2023231373A1 (zh) 设备连接方法、装置、电子设备及存储介质
EP3337093B1 (en) Optimizing information related to a route and/or a next hop for multicase traffic
EP3621342A1 (en) Method and device for acquiring network resource, and scheduling server
US20190150034A1 (en) Service Traffic Control Method and System and Decision Network Element
US10135756B2 (en) Transparent and efficient multi-destination TCP communications based on bit indexed explicit replication
WO2022116665A1 (zh) Tcp流的调整方法和系统
CN108234309A (zh) 一种网络数据的传输方法
US20240106890A1 (en) Peer-to-peer network scheduling method and system
CN103763206A (zh) 一种网络调度方法及网关
WO2022170791A1 (zh) 一种状态上报方法、装置、设备和计算机可读存储介质
US11700189B2 (en) Method for performing task processing on common service entity, common service entity, apparatus and medium for task processing
CN115915098B (zh) 一种5g与tsn跨域ptp中bmca实现方法
EP4046420A1 (en) Congestion notification to a node not yet joined to a network, resulting in a dynamic join time
CN116471238A (zh) 基于新型网络拥塞通告及速率调整策略的拥塞管理方法
CN112533304B (zh) 自组网络管理方法、装置、系统、电子设备以及存储介质
Wang et al. Dynamic multi-level feedback queuing based packet scheduling for datacenter networks
KR20160083186A (ko) ICT 기반 대규모 재배시스템에서 서비스품질(QoS) 보장형 이미지 전송 방법
CN116582496B (zh) 令牌桶丢包优化方法及系统
WO2024036954A1 (zh) 意图处理方法、电子设备和存储介质
CN114827159B (zh) 网络请求路径优化方法、装置、设备和存储介质
WO2023184979A1 (zh) 超密集网络的基站节能方法、节能装置和可读存储介质
CN114025313B (zh) 一种无线路由方法、电子设备及计算机存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22944674

Country of ref document: EP

Kind code of ref document: A1