Network path determination method and device, storage medium and electronic device

CN120498914APending Publication Date: 2025-08-15QINGDAO HAIER INTELLIGENT HOME APPLIANCE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510591282.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种网络通路的确定方法和装置、存储介质及电子装置,以至少解决相关技术中用户家庭大多只使用一台路由器与多个网器连接,路由器与网器之间的连接存在距离过远、墙体阻隔等因素造成的连接不稳定问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120498914A_ABST
    Figure CN120498914A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for determining a network path, a storage medium and electronic equipment, and relates to the technical field of smart home, and the method for determining the network path comprises the following steps: when a network environment between a target network device and a router is determined to be a weak network environment, determining the network environment between the target network device and the router; determining a first interaction time and a first packet loss rate when the target network device interacts with the router through each first network path, wherein the first network path is used for indicating a path where the target network device interacts with the router through other network devices; and determining a target network path in the plurality of first network paths according to the first interaction time and the first packet loss rate, and determining an optimal network path for interaction between the target network device and the router according to the target network path. By adopting the technical scheme, the problem of unstable connection caused by factors such as over-long distance, wall obstruction and the like of the connection between the router and the network devices due to the fact that most of user families only use one router to connect with a plurality of network devices in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home technology, and more specifically, to a method and device for determining a network path, a storage medium, and an electronic device. Background Art

[0002] With the development and popularization of artificial intelligence technology, smart homes are becoming a major trend in future development, and more and more users are choosing Lianyun smart devices. However, most current user homes only use a single router. This can lead to unstable connections between the router and Lianyun network devices due to factors such as long distances and wall obstructions, directly affecting the user's voice experience.

[0003] In the related technology, most user households only use one router to connect to multiple network devices. The connection between the router and the network devices is unstable due to factors such as long distance and wall obstruction, and no effective solution has been proposed yet. Summary of the Invention

[0004] The embodiments of the present application provide a method and apparatus for determining a network path, a storage medium, and an electronic device to at least address the problem in the related art that most user households use only one router to connect to multiple network devices, and the connection between the router and the network devices is unstable due to factors such as long distances and wall obstructions.

[0005] According to one embodiment of the present application, a method for determining a network path is provided, comprising: when it is determined that the network environment between a target network device and a router is a weak network environment, determining a first interaction time and a first packet loss rate for the target network device to interact with the router via each first network path, wherein the first network path is used to indicate a path for the target network device to interact with the router via other network devices, and the other network devices and the target network device share the router; determining a target network path from a plurality of first network paths based on the first interaction time and the first packet loss rate, and determining an optimal network path for interaction between the target network device and the router based on the target network path.

[0006] In an exemplary embodiment, before determining a first interaction time and a first packet loss rate for the target network device to interact with the router through each first network path, the method further includes: when the target network device sends a first request message to the cloud platform, determining whether a first response message sent by the cloud platform based on the first request message is received within a first time period, the target network device interacting with the cloud platform through the router; when it is determined that the first response message is not received within the first time period, sending a second request message to the cloud platform multiple times within a second time period, and determining a first number of times that the second response message sent by the cloud platform is not received within a third time period after each sending of the second request message to the cloud platform; determining a first magnitude relationship between the first magnitude relationship and a preset magnitude relationship; when the first magnitude relationship indicates that the first magnitude relationship is greater than or equal to the preset magnitude relationship, determining that the network environment between the target network device and the router is the weak network environment; when the first magnitude relationship indicates that the first magnitude relationship is less than the preset magnitude relationship, determining that the network environment between the target network device and the router is the strong network environment, wherein the network environment includes: the weak network environment and the strong network environment.

[0007] In an exemplary embodiment, determining a target network path among a plurality of first network paths based on the first interaction time and the first packet loss rate includes: determining a first weight corresponding to the first interaction time and a second weight corresponding to the first packet loss rate; inputting the first interaction time with the first weight and the first packet loss rate with the second weight into a particle swarm algorithm to score each of the first network paths according to the particle swarm algorithm; and determining the first transmission path with the highest score as the target network path.

[0008] In an exemplary embodiment, determining an optimal network path for interaction between the target network device and the router based on the target network path includes: transmitting a third request message to the router through the target network path and a second network path within a fourth time period, so that the router forwards the third request message to a cloud platform, wherein the second network path is a path for direct interaction between the target network device and the router; determining a second number of times that third response messages sent by the cloud platform preferentially through the target network path are received, and determining a first number of messages of the third request message, wherein the third response message is a response message corresponding to the third request message; calculating a first ratio of the second number to the first number of messages; and determining the target network path as the optimal network path for interaction between the target network device and the router when it is determined that the first ratio is greater than or equal to a preset ratio.

[0009] In an exemplary embodiment, after calculating a first ratio of the second number of times to the first number of messages, the method further includes: if it is determined that the first ratio is less than the preset ratio, determining a third network path from a set of network paths based on the first interaction time and the first packet loss rate, wherein the set of network paths is other network paths in the plurality of first network paths excluding the target network path; transmitting a fourth request message to the router via the second network path and the first network path in a fifth time period, so that the router forwards the fourth request message to the cloud platform; determining a third number of times a fourth response message is received that is preferentially sent by the cloud platform via the third network path, and determining a second number of messages for the fourth request message, wherein the fourth response message is a response message corresponding to the fourth request message; determining a second ratio of the third number to the second number of messages; and if it is determined that the second ratio is greater than or equal to the preset ratio, determining the third network path as the optimal network path for interaction between the target network device and the router.

[0010] In an exemplary embodiment, after determining the optimal network path for interaction between the target network device and the router based on the target network path, the method further includes: determining, based on a preset period, a second interaction time and a second transmission packet loss rate for the target network device to interact with the router via each of the first network paths; scoring each of the first network paths based on the second interaction time and the second transmission packet loss rate, and determining a fourth network path from the plurality of first network paths based on the scoring results; determining whether the fourth network path and the target network path are the same network path; if it is determined that the fourth network path and the target network path are not the same network path, determining a first score corresponding to the fourth network path and a second score corresponding to the target network path based on the scoring results, and determining a difference between the first score and the second score; if the difference is greater than or equal to a preset threshold, updating the target network path based on the fourth network path; and if the difference is less than the preset threshold, determining that updating the target network path is not permitted.

[0011] In an exemplary embodiment, after determining the optimal network path for interaction between the target network device and the router based on the target network path, the method further includes: upon determining that the network environment between the target network device and the router has changed from the weak network environment to the strong network environment, transmitting a fifth request message to the router via the target network path and a second network path within a sixth time period, so that the router forwards the fifth request message to the cloud platform, wherein the second network path is a path for direct interaction between the target network device and the router; determining a fourth number of times one or more fifth response messages are received from the cloud platform preferentially via the target network path, and a fifth number of times one or more fifth response messages are received from the cloud platform preferentially via the second network path, wherein the fifth response message is a response message corresponding to the fifth request message; determining a maximum number between the fourth number and the fifth number; and determining the network path corresponding to the maximum number as the optimal network path.

[0012] According to another embodiment of the present application, a network path determination device is further provided, comprising: a first determination module for, when determining that the network environment between a target network device and a router is a weak network environment, determining a first interaction time and a first packet loss rate for the target network device to interact with the router through each first network path, wherein the first network path is used to indicate a path through which the target network device interacts with the router through other network devices, and the other network devices share the router with the target network device; and a second determination module for determining a target network path from a plurality of first network paths based on the first interaction time and the first packet loss rate, and determining an optimal network path for interaction between the target network device and the router based on the target network path.

[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned method for determining a network path when running.

[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for determining the network path through the computer program.

[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to perform the method.

[0016] In an embodiment of the present application, when the network environment between the target network device and the router is a weak network environment, the first interaction time and first packet loss rate of the target network device interacting with the router through each first network path used to instruct the target network device to interact with the router through other network devices are determined; the target network path is determined from multiple first network paths based on the first interaction time and the first packet loss rate, and the optimal network path for interaction between the target network device and the router is determined based on the target network path. In other words, the embodiment of the present application determines the target network path by determining the first interaction time and the first packet loss rate of the target network device interacting with the router through each first network path, and then the optimal network path for interaction between the target network device and the router can be determined based on the target network path. Through the embodiment of the present application, the problem of unstable connection caused by factors such as long distance and wall obstruction in the relevant technology that most user households use only one router to connect to multiple network devices can be solved. The connection between the router and the network devices can be stably connected even if they are far away from an orchard or blocked by a wall. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0019] Figure 1 This is a schematic diagram of the hardware environment of a method for determining a network path according to an embodiment of the present application;

[0020] Figure 2 is a flow chart of a method for determining a network path according to an embodiment of the present application;

[0021] Figure 3 This is a framework diagram of a method for optimizing voice performance of a home network device in a weak network environment according to an optional embodiment of the present application;

[0022] Figure 4 This is a structural block diagram of a device for determining a network path according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned 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 of the present application described herein can be implemented in a sequence other than those 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.

[0025] According to one aspect of the embodiment of the present application, a method for determining a network path is provided. The method for determining a network path is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, Figure 1 This is a hardware environment diagram of a method for determining a network path according to an embodiment of the present application. In this embodiment, the above-mentioned method for determining a network path can be applied to Figure 1 In the hardware environment shown in FIG. 1 , which is composed of a terminal device 102 and a server 104. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or the client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0026] The aforementioned network may include, but is not limited to, at least one of the following: a wired network and a wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth. The terminal device 102 may be, but is not limited to, a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing machine, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, smart curtains, smart audio and video, a smart socket, a smart speaker, a smart fresh air device, smart kitchen and bathroom equipment, smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purifier, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0027] In this embodiment, a method for determining a network path is provided, which is applied to the above-mentioned terminal device. Figure 2 4 is a flow chart of a method for determining a network path according to an embodiment of the present application, the flow comprising the following steps:

[0028] Step S202: When it is determined that the network environment between the target network device and the router is a weak network environment, determining a first interaction time and a first packet loss rate for the target network device to interact with the router via each first network path, wherein the first network path is used to indicate a path for the target network device to interact with the router via other network devices, and the other network devices and the target network device share the router;

[0029] Step S204: determining a target network path from a plurality of first network paths according to the first interaction time and the first packet loss rate, and determining an optimal network path for interaction between the target network device and the router according to the target network path.

[0030] Through the above steps, when the network environment between the target network device and the router is a weak network environment, the first interaction time and the first packet loss rate of the target network device interacting with the router through each first network path used to instruct the target network device to interact with the router through other network devices are determined; the target network path is determined from multiple first network paths based on the first interaction time and the first packet loss rate, and the optimal network path for interaction between the target network device and the router is determined based on the target network path. In other words, the embodiment of the present application determines the target network path by determining the first interaction time and the first packet loss rate of the target network device interacting with the router through each first network path, and then the optimal network path for interaction between the target network device and the router can be determined through the target network path. Through the embodiment of the present application, the problem of unstable connection caused by factors such as long distance and wall obstruction in the connection between the router and the network device in the related art can be solved, so that the router and the network device can be stably connected even if they are far away from the orchard or blocked by a wall.

[0031] Optionally, before step S202, the method further includes: when the target network device sends a first request message to the cloud platform, determining whether a first response message sent by the cloud platform based on the first request message is received within a first time period, and the target network device interacts with the cloud platform through the router; when it is determined that the first response message is not received within the first time period, sending a second request message to the cloud platform multiple times within a second time period, and determining a first number of times that the second response message sent by the cloud platform is not received within a third time period after each sending of the second request message to the cloud platform; determining a first size relationship between the first number and a preset number; when the first size relationship indicates that the first number is greater than or equal to the preset number, determining that the network environment between the target network device and the router is the weak network environment; when the first size relationship indicates that the first number is less than the preset number, determining that the network environment between the target network device and the router is the strong network environment, wherein the network environment includes: the weak network environment and the strong network environment.

[0032] It is understood that embodiments of the present application can detect and determine the network environment (weak or strong). Specifically, the target network device sends a request message to the cloud platform: the target network device (i.e., the smart device whose network quality needs to be evaluated, which can be any network device in a household) sends a first request message to the cloud platform via a router. The target network device may be a device capable of cloud interaction, such as an intelligent voice assistant or smart home appliance.

[0033] First Response Detection: After the target network device sends a first request message to the cloud platform, it begins counting down the first time period to wait for the cloud platform's response. If the first response message from the cloud platform based on the first request message is successfully received within the first time period, communication in the current network environment is normal, and the network environment can be preliminarily determined to be strong.

[0034] Multiple retries and response detection: If the first response message is not received within the first time period, the target network device enters the second stage, which is to send a second request message to the cloud platform multiple times (the specific number is not determined, but at least once, for example: 5 times) within the second time period. After each second request message is sent, the third time period is re-timed to confirm whether the second response message from the cloud platform can be received within this time. The third time period here can be, for example, within 5 seconds after sending the second request message.

[0035] Count the number of retry unresponsiveness: The target network device will count the number of times it does not receive the second response information within each third time period, and record it as the first number.

[0036] Comparing the relationship with the preset number of times: The first number obtained by statistics is compared with a set of preset thresholds to determine the first magnitude relationship. The preset number of times can be understood as a judgment standard for determining whether the network environment is stable.

[0037] Determine the network environment: If the first count is greater than or equal to the preset number, it means that the target device has repeatedly failed to receive a response within the expected time while attempting to communicate with the cloud platform. This indicates an unstable network environment, and the network environment between the target device and the router can be determined to be weak. Conversely, if the first count is less than the preset number, communication is stable, and the network environment can be determined to be strong.

[0038] For example, if the second request information is sent five times in a row and the second response information is not received four times out of the five times, and the preset number of times is three, it can be determined that the network environment is a weak network environment.

[0039] This method can dynamically determine the type of network environment based on the actual communication effect, providing a basis for subsequent communication strategy adjustments. Especially in smart homes, corresponding optimization measures can be taken for different network conditions. For example, in a weak network environment, switching to a more reliable communication path can be used to improve the voice interaction performance and user experience of smart devices.

[0040] Optionally, the above-mentioned step S204 of determining a target network path among multiple first network paths based on the first interaction time and the first packet loss rate includes: determining a first weight corresponding to the first interaction time and a second weight corresponding to the first packet loss rate; inputting the first interaction time with the first weight and the first packet loss rate with the second weight into a particle swarm algorithm to score each of the first network paths according to the particle swarm algorithm; and determining the first transmission path with the highest score as the target network path.

[0041] It can be understood that the particle swarm algorithm is an optimization technology based on swarm intelligence, which simulates the foraging behavior of biological groups in nature (such as bird flocks and fish schools). In the algorithm, each potential solution is represented as a "particle", which moves in the solution space to find the optimal solution.

[0042] The movement of a particle is influenced by two main factors: the particle's own best historical position (called the individual best position, pBest), and the best position found so far by all particles in the entire swarm (called the group best position, gBest). By constantly adjusting their speed and position, particles gradually approach the optimal solution.

[0043] The particle swarm optimization algorithm is simple, efficient, easy to implement, and has strong global search capabilities and convergence. Therefore, the particle swarm optimization algorithm is widely used in various optimization problems, such as function optimization, neural network training, and combinatorial optimization.

[0044] The above technical solution involves the use of Particle Swarm Optimization (PSO) to evaluate and determine the pros and cons of network communication paths to ensure that in a weak network environment, home smart devices can conduct voice interaction with the cloud platform through the optimal network path. Specifically: Determine the weight value: The particle swarm algorithm needs to determine the weights of two important parameters, namely the first weight of the first interaction time and the second weight of the first packet loss rate. The first interaction time reflects the speed of communication, while the first packet loss rate reflects the reliability of communication. The weights of these two parameters may be set based on specific application requirements or scenarios. For example, if the application scenario has high requirements for response speed, the weight of the interaction time may be set higher.

[0045] Input parameters into the PSO algorithm: Input the first interaction time and the first packet loss rate (after adjusting the weights) into the PSO algorithm. In the PSO algorithm, each "particle" represents a possible network path. The algorithm iteratively updates the particle's position and velocity to find the optimal network path, i.e., the path that optimizes the weighted interaction time and packet loss rate.

[0046] First interaction time: refers to the time from when the smart device sends a request to the cloud platform to when it receives a response. This is a time indicator that reflects network latency.

[0047] First, packet loss rate: It indicates the proportion of data packets lost during transmission within a certain period of time. This is a reliability indicator that reflects the stability of the network.

[0048] Network Path Scoring: During each iteration of the particle swarm optimization algorithm, the algorithm calculates a quality score for each particle (i.e., each possible network path). This score is based on a weighted combination of first interaction time and first packet loss rate. A higher-scoring path indicates a better path, taking into account latency and stability.

[0049] Determining the optimal network path: After a series of iterations, the algorithm identifies the highest-scoring transmission path (i.e., network path) and determines it as the target network path. This means that when a smart device engages in voice interaction, it will prioritize communicating with the cloud platform using this highest-scoring path for optimal communication.

[0050] In this way, even in weak network environments, smart devices can find the most appropriate network path through particle swarm optimization, ensuring smooth and stable voice interaction and improving the user experience. This dynamic path selection mechanism can better adapt to changes in the home network environment, ensuring that devices can achieve optimal communication performance under different conditions.

[0051] Optionally, determining the optimal network path for interaction between the target network device and the router based on the target network path includes: transmitting a third request message to the router through the target network path and the second network path within a fourth time period, so that the router forwards the third request message to the cloud platform, wherein the second network path is a path for the target network device and the router to directly interact; determining a second number of times that the third response message sent by the cloud platform preferentially through the target network path is received, and determining a first number of messages of the third request message, wherein the third response message is the response message corresponding to the third request message; calculating a first ratio of the second number to the first number of messages; and when it is determined that the first ratio is greater than or equal to a preset ratio, determining the target network path as the optimal network path for interaction between the target network device and the router.

[0052] It is understood that a smart device (e.g., the target network device of this application) can send a request to a router via multiple paths, which is then forwarded by the router to the cloud platform, which ultimately evaluates and determines the optimal network path. Specifically, the third request information is transmitted via multiple paths during the fourth time period: After the target network device detects that the network environment between it and the router is unstable (i.e., a weak network environment), the third request information is simultaneously sent to the router via two different network paths during the fourth time period. These two paths are: the target network path (i.e., the potential optimal path previously evaluated by the particle swarm algorithm) and the second network path (i.e., the path for the target network device to communicate directly with the router).

[0053] Receive Third Response: The target device receives the third response from the cloud platform. This third response is in response to the third request. It's important to note that the cloud platform prioritizes sending the third response via the target network path, but the target device receives it via both paths simultaneously.

[0054] Counting the number of receptions: The target network device will count the number of times it successfully receives the third response message through the target network path during the fourth time period, recording it as the second number. At the same time, it will also record the total number of third request messages sent, recording it as the first number.

[0055] Calculating a reception ratio: further calculating a first ratio between a second number of times the third response information is successfully received through the target network path and a first number of third request information that is totally sent.

[0056] Determining the optimal network path: If the calculated first ratio is greater than or equal to a preset ratio, this indicates that the target network path has a high reliability and success rate for communication with the cloud platform. The target network device then determines the target network path as the optimal path for data exchange with the router, indicating that this path will be preferred for future communications, ensuring a more stable and faster voice interaction experience.

[0057] This method, through actual communication testing and data statistics, effectively evaluates the performance of different network paths, thereby determining the optimal communication path for the current network environment. Especially in weak network environments, by comparing the communication performance between direct communication and potentially optimal paths, it ensures that smart devices select the optimal path for data transmission, improving the reliability of voice interaction and user experience. Furthermore, by setting preset ratios, the system's requirements for network path stability and success rate can be flexibly adjusted to suit different network environments and device performance requirements.

[0058] After calculating a first ratio of the second number of times to the first number of messages, the method further includes: if it is determined that the first ratio is less than the preset ratio, determining a third network path in a set of network paths based on the first interaction time and the first packet loss rate, wherein the set of network paths is other network paths in the plurality of first network paths excluding the target network path; transmitting a fourth request message to the router via the second network path and the first network path in a fifth time period, so that the router forwards the fourth request message to the cloud platform; determining a third number of times a fourth response message is received that is preferentially sent by the cloud platform via the third network path, and determining a second number of messages for the fourth request message, wherein the fourth response message is a response message corresponding to the fourth request message; determining a second ratio of the third number to the second number of messages; and if it is determined that the second ratio is greater than or equal to the preset ratio, determining the third network path as the optimal network path for interaction between the target network device and the router.

[0059] It is understandable that in a weak network environment, the optimal path can be dynamically adjusted and determined by testing and comparing the performance of different network paths. Specifically: after the target network device passes the test in the fourth time period, if the calculated first ratio (i.e., the proportion of cloud platform response information successfully received through the target network path) is less than the preset ratio, this means that the performance of the currently considered target network path has not met the expected stability and efficiency standards. At this time, the particle swarm algorithm will determine the third network path based on the two key indicators of the first interaction time and the first packet loss rate in other first network paths other than the target network path. This process can again use the particle swarm algorithm or other optimization methods to select a new potential optimal path.

[0060] After determining the third network path as the new test path, the target network device sends a fourth request message to the router through the second network path (i.e., the path for direct communication with the router) and the third network path (the newly selected candidate path) within the fifth time period to test the actual communication effects of the two paths.

[0061] Calculate the reception ratio of the new path: Use the same method as described above to determine whether the third network path meets the expected stability and efficiency standards. Specifically, the target network device counts the third number of successful fourth response messages from the cloud platform received via the third network path, and records the total number of second messages of the fourth request message sent. Then, calculate the second ratio of the third number to the second number.

[0062] Re-determine the optimal network path: If the second ratio is greater than or equal to the preset ratio, this indicates that the third network path meets performance requirements and can stably and quickly complete voice requests and responses. In this case, the third network path is determined as the new optimal network path, the most preferred path for communication between the target device and the router.

[0063] In this way, when the performance of the currently considered optimal network path degrades, it can proactively search for and test new paths to ensure an efficient communication path is always maintained. This mechanism improves the voice interaction capabilities of smart devices in smart home environments, especially in unstable networks or interference situations, allowing them to quickly adapt and select the optimal communication solution, ensuring a continuous and high-quality user experience.

[0064] Optionally, after determining the optimal network path for interaction between the target network device and the router based on the target network path in step S206, the method further includes: determining, based on a preset period, a second interaction time and a second transmission packet loss rate for the target network device to interact with the router through each of the first network paths; scoring each of the first network paths based on the second interaction time and the second transmission packet loss rate, and determining a fourth network path from the plurality of first network paths based on the scoring results; determining whether the fourth network path and the target network path are the same network path; if it is determined that the fourth network path and the target network path are not the same network path, determining a first score corresponding to the fourth network path and a second score corresponding to the target network path based on the scoring results, and determining a difference between the first score and the second score; if the difference is greater than or equal to a preset threshold, updating the target network path based on the fourth network path; and if the difference is less than the preset threshold, determining that updating the target network path is not permitted.

[0065] It is understood that the intelligent device (target network device) can periodically evaluate and update the optimal network path for communication between it and the router to adapt to changes in the network environment. Specifically: Periodic Evaluation: The particle swarm algorithm automatically evaluates the performance of the target network device interacting with the router through each first network path (i.e., all possible communication paths) based on a preset period (e.g., weekly, monthly, etc.). The performance evaluation includes measuring the second interaction time (i.e., response time) and the second transmission packet loss rate (i.e., data packet loss rate), which reflect the response speed and transmission stability of the path.

[0066] Each first network path is scored based on the second interaction time and the second transmission packet loss rate. This scoring process is similar to the one previously used using the particle swarm optimization algorithm, but in this stage, the scoring is based on the latest results of periodic testing. After the scoring is completed, the path with the highest score among the multiple first network paths is selected and recorded as the fourth network path, which serves as the potential new optimal path.

[0067] Evaluate whether the new and old optimal paths are the same: Determine whether the fourth network path is the same path as the currently used target network path. If not, it means that the network environment may have changed, and further evaluation is required to determine whether to update the optimal path.

[0068] Comparing score differences: If the fourth network path is different from the target network path, the algorithm compares their scores, i.e., the difference between the first score (the score of the fourth network path) and the second score (the score of the target network path). This difference reflects the performance gap between the two paths.

[0069] Determine whether to update the optimal path: If the score difference is greater than or equal to the preset threshold, this means that the performance of the fourth network path is significantly better than the target network path. Therefore, the fourth network path is updated to the target network path, i.e., the new optimal path. Conversely, if the score difference is less than the preset threshold, it means that the performance difference between the two paths is not significant. Therefore, the existing target network path remains unchanged and the optimal path is not updated.

[0070] Through this periodic evaluation and dynamic update mechanism, smart devices can proactively adapt to changes in the network environment, ensuring that voice interactions with the cloud platform always occur over the most stable and efficient path, providing a positive user experience even under poor network conditions. This approach avoids blindly switching paths or using degraded paths due to network fluctuations, thereby improving communication reliability and efficiency.

[0071] Optionally, after the above-mentioned step S206, the method further includes: when it is determined that the network environment between the target network device and the router has changed from the weak network environment to the strong network environment, transmitting a fifth request information to the router through the target network path and the second network path within a sixth time period, so that the router forwards the fifth request information to the cloud platform, wherein the second network path is a path for the target network device and the router to directly interact; determining a fourth number of times that one or more fifth response messages are received from the cloud platform preferentially through the target network path, and a fifth number of times that one or more fifth response messages are received from the cloud platform preferentially through the second network path, wherein the fifth response information is response information corresponding to the fifth request information; determining a maximum number between the fourth number and the fifth number; and determining the network path corresponding to the maximum number as the optimal network path.

[0072] It is understandable that when it is detected that the network environment changes from a weak network environment to a strong network environment, the optimal network path can be dynamically tested and re-determined. Specifically:

[0073] Environment Change Detection: The target device (i.e., the voice-controlled smart device) continuously monitors the network environment between it and the router during communication. If it detects a change in network conditions from weak to strong, it indicates a significant improvement in network signal and transmission performance.

[0074] Performance test during the sixth time period: After detecting an improvement in the network environment, the target router enters the sixth time period to conduct a new communication path performance test. It will simultaneously send a fifth request message to the router via the target network path (i.e., the current optimal path) and the second network path (i.e., the path through which the target router communicates directly with the router) to test the communication performance of these two paths in a strong network environment.

[0075] Response message reception statistics: The target network device will count the number of fifth response messages (i.e., responses to the fifth request message) sent by the cloud platform received through the target network path and the second network path during the sixth time period. These numbers are recorded as the fourth number and the fifth number, respectively.

[0076] Determining the maximum response times: After statistics are collected, the algorithm compares the fourth and fifth times to determine the maximum. This step helps identify which path is most effective in receiving responses from the cloud platform in a strong network environment, that is, which path performs better in the current network environment.

[0077] Update the optimal network path: The network path corresponding to the maximum number of times will be determined as the new optimal network path. This means that in subsequent communications, the target network device will give priority to using this path with the best test performance to interact with the cloud platform to ensure the stability and efficiency of communication.

[0078] The above technical solution ensures that smart devices can dynamically adjust and optimize their communication paths according to real-time changes in the network environment, so that they can quickly adapt even in a strong network environment, select the optimal path for data transmission, and improve the response speed and user satisfaction of interactions such as voice control. Especially when the network environment improves, it can fully utilize the network advantages to provide a smoother user experience.

[0079] In order to better understand the process of the above-mentioned method for determining the network path, the implementation method flow of the above-mentioned method for determining the network path is described below in combination with an optional embodiment, but it is not intended to limit the technical solution of the embodiment of the present application.

[0080] The smart devices in the smart home in the related technology only focus on the voice experience effect of the wireless local area network and the device itself, and do not efficiently link all the voice network devices in the home to improve the voice experience effect of all the voice network devices in the home.

[0081] In response to the above problems, an optional embodiment of the present application provides a voice experience optimization solution based on a cloud platform-multi-intelligent gateway environment. This solution reduces the problem of voice playback jamming caused by weak network signals when the router and home appliances are far apart or there are walls blocking them by adding a springboard forwarding, thereby optimizing the voice experience of multiple network devices in a weak network environment. The method describes in detail how the router selects a transmission route based on the transmission path score, thereby more stably transmitting voice information and optimizing the voice experience solution for weak networks; for scenarios where multiple network devices are interconnected, only the optimal information receiving network device can be selected in a weak network environment, and information is forwarded through the optimal network device, thereby optimizing the voice experience of multiple network devices. First, the cloud sends the control information to the router, and the router-related algorithm selects the optimal receiving network device. After receiving the information, the optimal receiving network device forwards it to the network device that needs to be controlled, avoiding the problem of network packet loss when the weak network is directly sent from the router to the controlled network device. This method has good universality and is applicable to a variety of user scenarios, which can significantly improve the user voice experience.

[0082] Figure 3 This is a framework diagram of a method for optimizing the voice performance of a home network device in a weak network environment according to an optional embodiment of the present application. Figure 3 As shown:

[0083] The user (i.e., the target object) interacts with the voice network device 5 (i.e., the target network device, i.e., network device 5). The voice network device 5 directly communicates with the router to request the intelligent cloud platform to process the interaction information. Due to a weak network signal, the voice network device 5 does not receive a reply from the intelligent cloud platform within a specified time (i.e., a first time period), and broadcasts a fallback reply stating that the network is poor.

[0084] If more than five requests to the intelligent cloud platform time out on the same day, the network environment can be determined to be a weak network environment. In the optional embodiment of the present application, the voice network device 5 traverses all routes that can reach the router (i.e., multiple first network paths), and calculates an optimal route to the router (i.e., the target network path) through a particle swarm algorithm according to the consideration indicators, for example, network device 5 - network device 4 - network device 1 - router;

[0085] After that, when the user interacts with the network device 5 by voice, the network device 5 will send two requests, one going through the network device 5-router, and one going through the network device 5-network device 4-network device 1-router;

[0086] The network device 5 plays the corresponding interactive reply based on the first received processing result;

[0087] If the proportion of playback results according to the path of device 5-device 4-device 1-router exceeds 80% within a week, the interactive device 5 will no longer communicate directly with the router, but will only request cloud data through device 5-device 4-device 1-router in the device data forwarding manner.

[0088] According to the above optional embodiments, the method defined in the optional embodiments of the present application is a solution for optimizing the voice experience of home appliances in a weak network environment when multiple voice network devices are used. Taking the smart home as a unit, voice network packets are relayed through network devices within the same smart home to optimize network transmission efficiency and improve the user's home appliance voice experience. The intelligent cloud platform uniformly handles the voice interaction of each device. When the direct communication between the network device and the router is inefficient, other voice network devices in the home take on the task of forwarding the interaction information. By forwarding information between network devices with stronger interconnected signals, the interaction information is transmitted to the router to complete the interaction with the intelligent cloud platform.

[0089] In the optional embodiment of this application, it is assumed that all voice network devices have the ability to transfer network packets. The main processing logic includes:

[0090] The smart network device performs voice interaction and requests information from the smart cloud platform. If it fails to receive a response from the smart cloud platform for more than 5 times per day, the smart network device will consider the current network signal to be weak.

[0091] In a weak network environment, interconnected intelligent network devices test the effectiveness of their interconnected information transmission and the effectiveness of direct information transmission with routers to determine the optimal information transmission path for each;

[0092] During voice interaction, the network device transmits voice signals to the router through two paths: direct communication with the router and communication with the optimal path determined in the second step to join the network device forwarding;

[0093] The first complete intelligent cloud platform response received is played back to the user as the voice interaction result.

[0094] If the device determines that the proportion of interaction results received through the network device forwarding method exceeds 80%, the device will no longer attempt to communicate directly with the router and the interaction will be directly forwarded through the network device;

[0095] The particle swarm optimization algorithm is an optimization technique based on swarm intelligence that simulates the foraging behavior of biological groups in nature (such as bird flocks and fish schools). In the algorithm, each potential solution is represented as a "particle" that moves in the solution space to find the optimal solution.

[0096] The movement of a particle is influenced by two main factors: the particle's own best historical position (called the individual best position, pBest), and the best position found so far by all particles in the entire swarm (called the group best position, gBest). By constantly adjusting their speed and position, particles gradually approach the optimal solution.

[0097] The particle swarm optimization algorithm is simple, efficient, easy to implement, and has strong global search capabilities and convergence. Therefore, the particle swarm optimization algorithm is widely used in various optimization problems, such as function optimization, neural network training, and combinatorial optimization.

[0098] An optional embodiment of the present application uses a particle swarm algorithm to score paths to determine the optimal network path. Specifically, the optimal path is determined by response time and transmission stability, with a weight of 1:1, where transmission stability is calculated as the packet loss rate over a period of time. The voice network device traverses all possible routes for sending data packets to the router, and scores each path using the particle swarm algorithm based on the considerations. The higher the score, the better the effect. The path with the highest score is taken and memorized. Voice interactions within a week are all conducted through this path for cloud interactions. The voice network device repeats the optimal path selection every month to adapt to changes in the user's home environment.

[0099] In summary, the optional embodiment of the present application does not communicate directly with the router in a weak network environment of the voice network device, but instead seeks to communicate indirectly with the router through relay forwarding through other network devices in the home to improve the stability of communication; further, the interaction time and transmission packet loss rate are considered as indicators, and a particle swarm algorithm scoring method is introduced to achieve efficient path selection; and the optional embodiment of the present application initially adopts two routes simultaneously, namely direct communication with the router and network device forwarding, to avoid the problem of incorrect path selection caused by short-term changes in the user's home environment; and the optional embodiment of the present application reselects the path every month. Considering that the user environment does not change frequently, this method can effectively maintain the optimality of the path and effectively improve the voice experience.

[0100] In other words, with the popularization of smart homes, voice network devices are increasingly entering user homes, and improving the user voice experience has become an important issue in smart homes. However, the complex and changeable weak network environment in user homes greatly reduces the voice experience. The optional embodiment of the present application avoids the problem of poor voice experience caused by poor network environment when the voice network device directly communicates with the router by introducing a method of forwarding voice information by the network device. By first sending the voice data to the relay network device with a better network environment, the relay network device transmits the data to the router. The introduction of the particle swarm algorithm can efficiently select the optimal path for network signal transmission, greatly improving the voice experience problem and allowing more users to better experience the comfort brought by smart homes.

[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0102] Figure 4 is a structural block diagram of a device for determining a network path according to an embodiment of the present application; Figure 4 As shown, including:

[0103] a first determining module 42 configured to, when determining that the network environment between the target network device and the router is a weak network environment, determine a first interaction time and a first packet loss rate for the target network device to interact with the router via each first network path, wherein the first network path indicates a path for the target network device to interact with the router via other network devices, and the other network devices and the target network device share the router;

[0104] The second determining module 44 is configured to determine a target network path from a plurality of first network paths according to the first interaction time and the first packet loss rate, and determine an optimal network path for interaction between the target network device and the router according to the target network path.

[0105] Through the above-mentioned device, when the network environment between the target network device and the router is a weak network environment, the first interaction time and the first packet loss rate of the target network device interacting with the router through each first network path used to instruct the target network device to interact with the router through other network devices are determined; the target network path is determined from multiple first network paths based on the first interaction time and the first packet loss rate, and the optimal network path for interaction between the target network device and the router is determined based on the target network path. In other words, the embodiment of the present application determines the target network path by determining the first interaction time and the first packet loss rate of the target network device interacting with the router through each first network path, and then the optimal network path for interaction between the target network device and the router can be determined through the target network path. Through the embodiment of the present application, the problem of unstable connection caused by factors such as long distance and wall obstruction in the connection between the router and the network device in the related art can be solved, so that the router and the network device can be stably connected even if they are far away from the orchard or blocked by a wall.

[0106] In an exemplary embodiment, the first determination module 42 is configured to determine, when the target network device sends a first request message to the cloud platform, whether a first response message sent by the cloud platform based on the first request message is received within a first time period, and the target network device interacts with the cloud platform through the router; when it is determined that the first response message is not received within the first time period, send a second request message to the cloud platform multiple times within a second time period, and determine a first number of times that the second response message sent by the cloud platform is not received within a third time period after each sending of the second request message to the cloud platform; determine a first size relationship between the first number and a preset number; when the first size relationship indicates that the first number is greater than or equal to the preset number, determine that the network environment between the target network device and the router is the weak network environment; when the first size relationship indicates that the first number is less than the preset number, determine that the network environment between the target network device and the router is the strong network environment, wherein the network environment includes: the weak network environment and the strong network environment.

[0107] In an exemplary embodiment, the second determination module 44 is further configured to determine a first weight corresponding to the first interaction time and a second weight corresponding to the first packet loss rate; input the first interaction time with the first weight and the first packet loss rate with the second weight into a particle swarm algorithm to score each of the first network paths according to the particle swarm algorithm; and determine the first transmission path with the highest score as the target network path.

[0108] In an exemplary embodiment, the second determination module 44 is further configured to transmit a third request message to the router through the target network path and the second network path within a fourth time period, so that the router forwards the third request message to the cloud platform, wherein the second network path is a path for the target network device and the router to directly interact; determine a second number of times the third response message sent by the cloud platform preferentially through the target network path is received, and determine a first number of messages of the third request message, wherein the third response message is a response message corresponding to the third request message; calculate a first ratio of the second number of times to the first number of messages; and when it is determined that the first ratio is greater than or equal to a preset ratio, determine the target network path as the optimal network path for interaction between the target network device and the router.

[0109] In an exemplary embodiment, the second determination module 44 is further configured to, if it is determined that the first ratio is less than the preset ratio, determine a third network path in a set of network paths based on the first interaction time and the first packet loss rate, wherein the set of network paths is other network paths in the plurality of first network paths except the target network path; transmit a fourth request message to the router through the second network path and the first network path in a fifth time period, so that the router forwards the fourth request message to the cloud platform; determine a third number of fourth response messages received from the cloud platform preferentially sent through the third network path, and determine a second number of messages of the fourth request message, wherein the fourth response message is a response message corresponding to the fourth request message; determine a second ratio of the third number to the second number of messages; and if it is determined that the second ratio is greater than or equal to the preset ratio, determine the third network path as the optimal network path for interaction between the target network device and the router.

[0110] In an exemplary embodiment, the second determining module 44 is further configured to determine, based on a preset period, a second interaction time and a second transmission packet loss rate of the target network device interacting with the router through each of the first network paths; score each of the first network paths based on the second interaction time and the second transmission packet loss rate, and determine a fourth network path from the plurality of first network paths based on the scoring results; determine whether the fourth network path and the target network path are the same network path; if it is determined that the fourth network path and the target network path are not the same network path, determine a first score corresponding to the fourth network path and a second score corresponding to the target network path based on the scoring results, and determine a difference between the first score and the second score; if the difference is greater than or equal to a preset threshold, update the target network path based on the fourth network path; and if the difference is less than the preset threshold, determine that updating the target network path is not permitted.

[0111] In an exemplary embodiment, the second determination module 44 is further configured to, upon determining that the network environment between the target network device and the router has changed from the weak network environment to the strong network environment, transmit a fifth request message to the router through the target network path and the second network path within a sixth time period, so that the router forwards the fifth request message to the cloud platform, wherein the second network path is a path for direct interaction between the target network device and the router; determine a fourth number of times one or more fifth response messages are received from the cloud platform preferentially through the target network path, and a fifth number of times one or more fifth response messages are received from the cloud platform preferentially through the second network path, wherein the fifth response message is a response message corresponding to the fifth request message; determine a maximum number between the fourth number and the fifth number; and determine the network path corresponding to the maximum number as the optimal network path.

[0112] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0113] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0114] S1, when it is determined that the network environment between the target network device and the router is a weak network environment, determining a first interaction time and a first packet loss rate for the target network device to interact with the router through each first network path, wherein the first network path is used to indicate a path for the target network device to interact with the router through other network devices, and the other network devices and the target network device share the router;

[0115] S2: Determine a target network path from a plurality of first network paths according to the first interaction time and the first packet loss rate, and determine an optimal network path for interaction between the target network device and the router according to the target network path.

[0116] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0117] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0118] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:

[0119] S1, when it is determined that the network environment between the target network device and the router is a weak network environment, determining a first interaction time and a first packet loss rate for the target network device to interact with the router through each first network path, wherein the first network path is used to indicate a path for the target network device to interact with the router through other network devices, and the other network devices and the target network device share the router;

[0120] S2: Determine a target network path from a plurality of first network paths according to the first interaction time and the first packet loss rate, and determine an optimal network path for interaction between the target network device and the router according to the target network path.

[0121] An embodiment of the present application further provides a computer program product, including a computer program, which is used by a processor to execute the steps in any of the above method embodiments.

[0122] Optionally, in this embodiment, the computer program product may be processed by a processor to execute the following steps:

[0123] S1, when it is determined that the network environment between the target network device and the router is a weak network environment, determining a first interaction time and a first packet loss rate for the target network device to interact with the router through each first network path, wherein the first network path is used to indicate a path for the target network device to interact with the router through other network devices, and the other network devices and the target network device share the router;

[0124] S2: Determine a target network path from a plurality of first network paths according to the first interaction time and the first packet loss rate, and determine an optimal network path for interaction between the target network device and the router according to the target network path.

[0125] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0126] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0127] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. Alternatively, they can be implemented using program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into separate integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0128] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for determining a network path, characterized in that: include: When it is determined that the network environment between the target network device and the router is a weak network environment, determining a first interaction time and a first packet loss rate for the target network device to interact with the router through each first network path, wherein the first network path is used to indicate a path for the target network device to interact with the router through other network devices, and the other network devices and the target network device share the router; A target network path is determined from a plurality of first network paths according to the first interaction time and the first packet loss rate, and an optimal network path for interaction between the target network device and the router is determined according to the target network path.

2. The method for determining a network path according to claim 1, wherein: Before determining a first interaction time and a first packet loss rate of the target network device interacting with the router through each first network path, the method further includes: In a case where the target network device sends a first request message to the cloud platform, determining whether a first response message sent by the cloud platform based on the first request message is received within a first time period, the target network device interacting with the cloud platform through the router; If it is determined that the first response information is not received within the first time period, sending a second request information to the cloud platform multiple times within a second time period, and determining a first number of times that the second response information sent by the cloud platform is not received within a third time period after each sending of the second request information to the cloud platform; Determining a first magnitude relationship between the first number and a preset number; If the first magnitude relationship indicates that the first number is greater than or equal to the preset number, determining that the network environment between the target network device and the router is the weak network environment; When the first size relationship indicates that the first number is less than the preset number, it is determined that the network environment between the target network device and the router is a strong network environment, wherein the network environment includes: the weak network environment and the strong network environment.

3. The method for determining a network path according to claim 1, wherein: Determining a target network path from a plurality of first network paths according to the first interaction time and the first packet loss rate includes: Determine a first weight corresponding to the first interaction time and a second weight corresponding to the first packet loss rate; inputting the first interaction time with the first weight and the first packet loss rate with the second weight into a particle swarm algorithm to score each of the first network paths according to the particle swarm algorithm; The first transmission path with the highest score is determined as the target network path.

4. The method for determining a network path according to claim 1, wherein: Determining an optimal network path for interaction between the target network device and the router according to the target network path includes: transmitting a third request message to the router via the target network path and the second network path within a fourth time period, so that the router forwards the third request message to the cloud platform, wherein the second network path is a path for direct interaction between the target network device and the router; determining a second number of times a third response message preferentially sent by the cloud platform through the target network path is received, and determining a first number of messages of the third request message, wherein the third response message is response information corresponding to the third request message; Calculating a first ratio of the second number of times to the first amount of information; When it is determined that the first ratio is greater than or equal to a preset ratio, the target network path is determined as an optimal network path for interaction between the target network device and the router.

5. The method for determining a network path according to claim 4, wherein: After calculating a first ratio of the second number of times to the first amount of information, the method further includes: If it is determined that the first ratio is less than the preset ratio, determining a third network path in a set of network paths according to the first interaction time and the first packet loss rate, wherein the set of network paths is other network paths in the plurality of first network paths except the target network path; transmitting fourth request information to the router through the second network path and the first network path in a fifth time period, so that the router forwards the fourth request information to the cloud platform; Determining a third number of fourth response messages received from the cloud platform preferentially sent through the third network path, and determining a second number of messages of the fourth request message, wherein the fourth response message is response information corresponding to the fourth request message; determining a second ratio of the third number to the second information quantity; When it is determined that the second ratio is greater than or equal to the preset ratio, the third network path is determined as the optimal network path for interaction between the target network device and the router.

6. The method for determining a network path according to claim 1, wherein: After determining the optimal network path for interaction between the target network device and the router according to the target network path, the method further includes: Determining, based on a preset period, a second interaction time and a second transmission packet loss rate for the target network device to interact with the router through each of the first network paths; scoring each of the first network paths according to the second interaction time and the second transmission packet loss rate, and determining a fourth network path from the plurality of first network paths according to the scoring results; determining whether the fourth network path and the target network path are the same network path; If it is determined that the fourth network path and the target network path are not the same network path, determining a first score corresponding to the fourth network path and a second score corresponding to the target network path according to the scoring result, and determining a difference between the first score and the second score; When the difference is greater than or equal to a preset threshold, updating the target network path according to the fourth network path; When the difference is smaller than the preset threshold, it is determined that updating of the target network path is not allowed.

7. The method for determining a network path according to claim 1, wherein: After determining the optimal network path for interaction between the target network device and the router according to the target network path, the method further includes: When it is determined that the network environment between the target network device and the router has changed from the weak network environment to the strong network environment, transmitting a fifth request message to the router via the target network path and a second network path within a sixth time period, so that the router forwards the fifth request message to the cloud platform, wherein the second network path is a path for direct interaction between the target network device and the router; determining a fourth number of times one or more fifth response messages are received from the cloud platform preferentially sent through the target network path, and a fifth number of times one or more fifth response messages are received from the cloud platform preferentially sent through the second network path, wherein the fifth response messages are response messages corresponding to the fifth request message; determining a maximum number of times among the fourth number of times and the fifth number of times; The network path corresponding to the maximum number of times is determined as the optimal network path.

8. A device for determining a network path, characterized in that: include: a first determining module configured to, when determining that the network environment between the target network device and the router is a weak network environment, determine a first interaction time and a first packet loss rate for the target network device to interact with the router via each first network path, wherein the first network path is used to indicate a path for the target network device to interact with the router via other network devices, and the other network devices and the target network device share the router; The second determining module is configured to determine a target network path among a plurality of first network paths according to the first interaction time and the first packet loss rate, and determine an optimal network path for interaction between the target network device and the router according to the target network path.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the method according to any one of claims 1 to 7 is executed when the program is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.