Method and device for determining network configuration parameters

By dynamically updating the configuration parameters of the network protocol stack of the MCU, the problem of static configuration parameters in the existing technology is solved, efficient communication in a diversified network environment is achieved, and communication performance and stability are improved.

CN119697026APending Publication Date: 2025-03-25SUNGROW CHARGING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411570111.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When existing MCUs communicate on Ethernet network, the configuration parameters of the network protocol stack are static and cannot adapt to a diverse network environment, resulting in poor communication performance and cannot optimize parameters without firmware upgrades.

Method used

By obtaining the data packets received by the network protocol stack, determining the network environment characteristic value, combining multiple candidate network environments and configuration parameters, dynamically update the configuration parameters of the network protocol stack to adapt to different network environments.

Benefits of technology

It realizes rapid update of network configuration parameters, improves network functions and communication performance, optimizes packet loss problems under complex networks, and improves communication stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697026A_ABST
    Figure CN119697026A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for determining network configuration parameters, and belongs to the field of network communication. The method for determining the network configuration parameters comprises the following steps: acquiring a first data packet received by a network protocol stack in unit time; based on the first data packet, determining a first network environment characteristic value corresponding to the network protocol stack to obtain a first network environment where the network protocol stack is located; acquiring a plurality of groups of candidate network configuration parameters corresponding to the plurality of candidate network environments; and determining a first network configuration parameter corresponding to the first network environment based on the first network environment, the plurality of candidate network environments and the plurality of groups of candidate network configuration parameters. According to the method for determining the network configuration parameter, the first network configuration parameter of the network protocol stack can be quickly updated based on the network environment type, so that the network function is improved, and the network communication performance and the communication stability of network environments of different sites are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communications, and more particularly to a method and device for determining network configuration parameters. Background Art

[0002] When the existing MCU uses Ethernet network communication, the network protocol stack of the transport layer and the network layer is initialized only according to static parameters, and then the Ethernet peripherals of the data link layer (MAC) registered in the network protocol stack and the drivers of the PHY chip of the physical layer are called back. In other words, the configuration parameters related to the network protocol stack, ETH, and PHY are often statically fixed in the code, which cannot meet the communication requirements in a diverse network environment, and cannot be optimized without firmware upgrades, resulting in poor network communication. In related technologies, it is usually possible to use the method of importing configuration files for on-site network configuration, but after the network environment changes, the imported configuration files cannot be changed, resulting in poor communication and difficulty in operation and maintenance. Summary of the invention

[0003] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes a method and device for determining network configuration parameters, which can realize the rapid update of the first network configuration parameters of the network protocol stack based on the network environment type, thereby improving the network function and improving the network communication performance and communication stability of the network environment in different sites.

[0004] In a first aspect, the present application provides a method for determining a network configuration parameter, comprising:

[0005] Obtaining the first data packet received by the network protocol stack within a unit time;

[0006] Based on the first data packet, determine a first network environment characteristic value corresponding to the network protocol stack to obtain a first network environment in which the network protocol stack is located, wherein the first network environment characteristic value is used to indicate the first network environment;

[0007] Acquire multiple groups of candidate network configuration parameters corresponding to multiple candidate network environments, wherein one candidate network environment corresponds to one group of candidate network configuration parameters;

[0008] Based on the first network environment, the multiple candidate network environments, and the multiple groups of candidate network configuration parameters, a first network configuration parameter corresponding to the first network environment is determined.

[0009] According to the method for determining network configuration parameters of the present application, based on the first data packet received by the network protocol stack within a unit time, the first network environment characteristic value corresponding to the network protocol stack is determined to obtain the first network environment in which the network protocol stack is located, and then based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters corresponding to the obtained multiple candidate network environments, the first network configuration parameters corresponding to the first network environment are determined. This can realize the judgment of the network environment type, i.e., the first network environment, based on the first data packet, and can realize the determination of the first network configuration parameters under the first network environment based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters, so that the network configuration parameters of the network protocol stack can be adaptively adjusted based on changes in the network environment, thereby realizing the update of the network configuration parameters of the network protocol stack based on the network environment type, providing a more convenient parameter optimization method, thereby improving network functions, optimizing packet loss problems in complex networks, and improving the communication performance and communication stability of network environments in different sites.

[0010] According to an embodiment of the present application, determining, based on the first data packet, a first network environment characteristic value corresponding to the network protocol stack includes:

[0011] Performing feature extraction of N dimensions on the first data packet to obtain N first feature data, wherein one dimension corresponds to one first feature data;

[0012] Based on a first weight sequence, weighted sum is performed on the N first characteristic data to obtain the first network environment characteristic value; wherein N is a positive integer.

[0013] According to an embodiment of the present application, performing feature extraction of N dimensions on the first data packet to obtain N first feature data includes:

[0014] Performing feature extraction of a first dimension on the first data packet, wherein the N dimensions include the first dimension;

[0015] In the case where the first dimension includes M sub-dimensions, respectively obtaining a proportion of each sub-dimension in the first data packet to obtain M second feature data;

[0016] Based on a second weight sequence, weighted sum is performed on the M second feature data to obtain first feature data corresponding to the first dimension, where M is a positive integer.

[0017] According to an embodiment of the present application, the dimension of the first data packet includes at least one of the following:

[0018] The number of the first data packets, the data type of the first data packets, and the size of the first data packets.

[0019] According to an embodiment of the present application, determining the first network configuration parameter corresponding to the first network environment based on the first network environment, the multiple candidate network environments, and the multiple groups of candidate network configuration parameters includes:

[0020] In a case where the first network environment characteristic value matches the target candidate network environment characteristic value, determining the target candidate network configuration parameter corresponding to the target candidate network environment among the multiple candidate network environments as the first network configuration parameter;

[0021] The target candidate network environment characteristic value is used to indicate the target candidate network environment.

[0022] According to an embodiment of the present application, before obtaining the first data packet received by the network protocol stack within a unit time, the method further includes:

[0023] Under multiple candidate network environments, respectively obtaining sample data packets received by the network protocol stack within a unit time;

[0024] Performing feature extraction of N dimensions on each of the sample data packets respectively to obtain N first sample feature data corresponding to each of the candidate network environments, wherein one dimension corresponds to one first sample feature data;

[0025] Based on a first weight sequence, weighted sum is performed on N first sample feature data under the same candidate network environment to obtain a candidate network environment feature value corresponding to each candidate network environment, and the first weight sequence is used to process the sample data packet, wherein N is a positive integer.

[0026] According to an embodiment of the present application, before performing weighted summation on N first sample feature data in the same candidate network environment based on the first weight sequence, the method further includes:

[0027] Assigning weights to N first sample feature data under the same candidate network environment, wherein the N weight data constitute a third weight sequence;

[0028] Based on the third weight sequence, weighted summing is performed on the N first sample feature data corresponding to each of the candidate network environments to obtain a candidate network environment feature value corresponding to each of the candidate network environments;

[0029] Based on multiple candidate network environment feature values, the third weight sequence is adjusted to obtain the first weight sequence, wherein the multiple candidate network environment feature values ​​correspond one-to-one to the multiple candidate network environments.

[0030] According to an embodiment of the present application, determining the first network configuration parameter corresponding to the first network environment based on the first network environment, the multiple candidate network environments, and the multiple groups of candidate network configuration parameters includes:

[0031] In a case where the first network environment characteristic value does not match the characteristic values ​​of each of the candidate network environments, initializing the network protocol stack based on candidate network configuration parameters corresponding to each of the candidate network environments;

[0032] Obtaining network quality after initialization using each group of candidate configuration parameters;

[0033] Determine the candidate network configuration parameter corresponding to the optimal network quality as the first network configuration parameter corresponding to the first network environment;

[0034] or,

[0035] Obtaining a difference between the first network environment characteristic value and each of the candidate network environment characteristic values;

[0036] Determine the candidate network configuration parameter corresponding to the candidate network environment corresponding to the candidate network environment characteristic value with the smallest difference as the first network configuration parameter;

[0037] According to an embodiment of the present application, after determining, based on the first data packet, a first network environment characteristic value corresponding to the network protocol stack to obtain the first network environment in which the network protocol stack is located, the method further includes:

[0038] When the first network environment characteristic value does not match any of the candidate network environment characteristic values, a prompt message is output, where the prompt message is used to prompt the MCU data to be modified.

[0039] In a second aspect, the present application provides a device for determining network configuration parameters of a network protocol stack, comprising:

[0040] An acquisition module, used for acquiring a first data packet received by the network protocol stack within a unit time;

[0041] A determination module, configured to determine, based on the first data packet, a first network environment characteristic value corresponding to the network protocol stack, so as to obtain a first network environment in which the network protocol stack is located, wherein the first network environment characteristic value is used to indicate the first network environment;

[0042] The acquisition module is further used to acquire multiple groups of candidate network configuration parameters corresponding to multiple candidate network environments, wherein one candidate network environment corresponds to one group of candidate network configuration parameters;

[0043] The determination module is further configured to determine the first network configuration parameter corresponding to the first network environment based on the first network environment, the multiple candidate network environments, and the multiple groups of candidate network configuration parameters.

[0044] According to the network configuration parameter determination device of the present application, based on the first data packet received by the network protocol stack in a unit time, the first network environment characteristic value corresponding to the network protocol stack is determined to obtain the first network environment in which the network protocol stack is located, and then based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters corresponding to the obtained multiple candidate network environments, the first network configuration parameters corresponding to the first network environment are determined. This can realize the judgment of the network environment type, i.e., the first network environment, based on the first data packet, and can realize the determination of the first network configuration parameters under the first network environment based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters, so that the network configuration parameters of the network protocol stack can be adaptively adjusted based on changes in the network environment, thereby realizing the update of the network configuration parameters of the network protocol stack based on the network environment type, providing a more convenient parameter optimization method, thereby improving network functions, optimizing packet loss problems in complex networks, and improving the communication performance and communication stability of network environments in different sites.

[0045] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for determining network configuration parameters as described in the first aspect above is implemented.

[0046] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for determining the network configuration parameters as described in the first aspect above is implemented.

[0047] In a fifth aspect, the present application provides a chip, including a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method for determining network configuration parameters as described in the first aspect above.

[0048] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0049] Based on the first data packet received by the acquired network protocol stack within a unit time, a first network environment characteristic value corresponding to the network protocol stack is determined to obtain the first network environment in which the network protocol stack is located, and then based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters corresponding to the acquired multiple candidate network environments, the first network configuration parameters corresponding to the first network environment are determined. This can realize the judgment of the network environment type, i.e., the first network environment, based on the first data packet, and can realize the determination of the first network configuration parameters under the first network environment based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters, so that the network configuration parameters of the network protocol stack can be adaptively adjusted based on changes in the network environment, thereby realizing the update of the network configuration parameters of the network protocol stack based on the network environment type, providing a more convenient parameter optimization method, thereby improving network functions, optimizing the packet loss problem in complex networks, and improving the communication performance and communication stability of network environments in different sites.

[0050] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0052] Figure 1 This is one of the flow charts of the method for determining network configuration parameters provided in the embodiment of the present application;

[0053] Figure 2 This is a second flow chart of a method for determining network configuration parameters provided in an embodiment of the present application;

[0054] Figure 3 This is a flowchart of a method for determining network configuration parameters provided in an embodiment of the present application;

[0055] Figure 4 It is a schematic diagram of the structure of the network protocol stack provided in the embodiment of the present application;

[0056] Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0057] Figure 6 It is a structural diagram of a device for determining network configuration parameters provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0059] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0060] In conjunction with the accompanying drawings, the following describes in detail the method for determining network configuration parameters, the device for determining network configuration parameters, the electronic device, and the readable storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.

[0061] The method for determining the network configuration parameters may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.

[0062] The terminal includes but is not limited to portable communication devices such as mobile phones or tablet computers. It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer.

[0063] The method for determining network configuration parameters provided in the embodiments of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the method for determining network configuration parameters. The electronic devices mentioned in the embodiments of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The method for determining network configuration parameters provided in the embodiments of the present application is described below using an electronic device as an example of an execution subject.

[0064] like Figure 1 As shown, the method for determining the network configuration parameters includes: step 110, step 120, step 130 and step 140.

[0065] The network protocol stack (TCP / IP) is a multi-layer network communication model used for data exchange between different computer systems.

[0066] like Figure 4As shown, the network protocol stack may include: a physical layer, a data link layer, a network layer, a transport layer, and an application layer.

[0067] The physical layer is responsible for transmitting the original bit stream on the physical medium.

[0068] The data link layer (MAC layer) is responsible for transmitting frames between adjacent network nodes.

[0069] The network layer is responsible for routing packets between multiple networks.

[0070] The transport layer is responsible for providing reliable data transmission between two nodes in the network.

[0071] The application layer is responsible for handling application-specific details.

[0072] In some embodiments, the physical layer and the data link layer may be combined and referred to as the network interface layer.

[0073] In some embodiments, when the MCU uses Ethernet communication, the application layer is a user-defined code that processes the sent and received business data; the transport layer and the network layer can be implemented based on a third-party network protocol stack, such as LwIP; the data link layer can be the MCU's own ETH (Ethernet) peripheral, and the physical layer is an independent PHY chip.

[0074] In the actual execution process, the driver of the ETH peripheral and the driver of the PHY chip will be registered as abstract objects in the network protocol stack. The network protocol stack is generally statically configured in the code. When the system is powered on, the network protocol stack will be initialized according to the static parameters, and then the registered ETH and PHY drivers will be called back.

[0075] Among them, the initialization drive of MAC and PHY can be completed by operating the relevant peripheral registers of MCU.

[0076] It is understandable that the network configuration parameters of the network protocol stack may include network parameters such as TCP parameters, IP parameters and third-party protocol stack parameters, as well as hardware configuration parameters such as network card parameters and driver parameters.

[0077] Step 110, obtaining the first data packet received by the network protocol stack within a unit time;

[0078] In this step, the unit time may be the duration of the first data packet obtained by the network protocol stack.

[0079] For example, the unit time may be 3s, 5s or 7s, etc. Of course, it may also be other durations, which are not limited in this application.

[0080] Data packets are the basic unit of network communication.

[0081] In actual implementation, packets can be encapsulated and decapsulated at different network levels.

[0082] The first data packet may be a data packet received by the network protocol stack within a unit time.

[0083] The first data packet may be used to reflect the network condition or performance of the network environment.

[0084] The network environment is a virtual environment formed by the connection and information sharing between various devices achieved through Internet technology.

[0085] In the actual implementation process, the network environment is the background and place for the network protocol stack to play a role.

[0086] Network environments can be divided into many types.

[0087] Different types of network environments may include different network conditions or capabilities.

[0088] For example, different types of network environments may include different bandwidths, delays, jitters, or packet loss rates.

[0089] It is understandable that different first data packets may correspond to different network environments.

[0090] In actual implementation, the first data packet may include multiple types.

[0091] For example, unicast data packets, multicast data packets, and broadcast data packets.

[0092] Among them, unicast is when the sender sends the data packet directly to a specific receiver, that is, it is used for point-to-point communication.

[0093] Multicast is a method in which a sender sends a data packet to a specific group of multiple receivers, such as a video conference or online live broadcast.

[0094] Broadcasting is when the sender sends data packets to all devices in the network. It is used for scenarios such as service discovery or network management within the local area network.

[0095] The first data packet may also include multiple quantities or multiple data packet sizes, etc.

[0096] For example, the number of first data packets received by the network protocol stack per unit time is 2, that is, 2 first data packets are received, one of which is a unicast data packet, and the size of the unicast data packet is less than 512 bytes; the other is a multicast data packet, and the size of the multicast data packet is between 512 bytes and 1024 bytes.

[0097] Step 120: Determine a first network environment characteristic value corresponding to the network protocol stack based on the first data packet to obtain a first network environment in which the network protocol stack is located;

[0098] In this step, the first network environment may be a network environment type determined based on the first data packet.

[0099] The network environment type can be distinguished by customized network environment type information.

[0100] The network environment type information may be a number, code, logo or letter, etc., used to distinguish different network environment types.

[0101] For example, there are three network environments, and the network environment type information of the three network environments may be defined as A, B, and C, respectively, wherein the three network environments may be distinguished based on A, B, and C.

[0102] The first network environment characteristic value may be used to indicate the first network environment.

[0103] In an actual execution process, the first network environment characteristic value may be a representative value abstracted from the first network environment.

[0104] For example, the first network environment characteristic value of network environment type A may be a value, and the a value may indicate the network environment type A.

[0105] For example, the value of a may be 100, 200, 300 or 400, etc.

[0106] Of course, in other embodiments, the first network environment characteristic value may also be other values, which is not limited in this application.

[0107] In the actual implementation process, the network environment type information is abstracted into a network environment characteristic value, which can realize the quantification of the network environment type, so that different network environments can be distinguished based on the network environment characteristic value. At the same time, the degree of difference between various network environment types can also be compared based on the network environment characteristic value.

[0108] In some embodiments, clustering can be performed based on the first data packet and the historical data packets to obtain multiple network environment types, and then the first network environment in which the network protocol stack is located can be predicted based on the first data packet.

[0109] In this embodiment, clustering is a technology for finding the intrinsic structure between data.

[0110] Clustering can be specifically used to cluster and differentiate different network environments based on the first data packet and the historical data packet.

[0111] The historical data packets may be data packets received by the network protocol stack within a unit time at a historical moment.

[0112] During the actual execution process, clustering can be performed based on the various network conditions or performances of the network environment represented by the first data packet and the historical data packets to obtain multiple data packet clusters; wherein each data packet cluster can include at least one data packet, and each data packet cluster can represent a network environment, and each data packet cluster can be represented by a network environment characteristic value, that is, each network environment characteristic value can be used to indicate each network environment type; during the actual application process, the data packet cluster where the first data packet is located can be queried to determine the first network environment characteristic value corresponding to the first data packet to obtain the first network environment where the network protocol stack is located.

[0113] In some embodiments, when various network conditions or performances of the network environment represented by the first data packet and the historical data packets are clustered to obtain multiple network environments, and then the first network environment in which the network protocol stack is located is predicted based on the first data packet, a correspondence table between the network environment characteristic value and the network environment can be constructed, thereby facilitating obtaining the first network environment indicated by the first network environment characteristic value when the first network environment characteristic value is obtained.

[0114] In other embodiments, some representative network conditions or performances represented by the first data packet and the historical data packet may be selected for clustering to obtain multiple network environments.

[0115] Among them, some representative network conditions or performances can be understood as: these network conditions or performances can well distinguish different network environment types.

[0116] In the actual implementation process, some representative network conditions or performances can be determined through experiments with the goal of best distinguishing network environment categories.

[0117] Step 130: Obtain multiple groups of candidate network configuration parameters corresponding to multiple candidate network environments;

[0118] In this step, the candidate network environment may be a predetermined network environment type, and the multiple candidate network environments are multiple predetermined selectable network environment types.

[0119] In some embodiments, the multiple candidate network environments may be multiple network environment types pre-clustered based on historical data packets.

[0120] Alternatively, in other embodiments, the multiple candidate network environments may also be multiple network environment types obtained by artificially classifying historical data packets.

[0121] The number of candidate network environments can be customized.

[0122] For example, the number of candidate network environments may be 10, 20, 30, or 40, etc.

[0123] Of course, in other embodiments, the number of candidate network environments may be other numbers, which is not limited in this application.

[0124] The candidate network configuration parameters are network configuration parameters of a network protocol stack that are determined in advance.

[0125] It is understandable that the candidate network configuration parameters may include network parameters such as TCP parameters, IP parameters and third-party protocol stack parameters under the candidate network environment, as well as hardware configuration parameters such as network card parameters and driver parameters.

[0126] A candidate network environment may correspond to a set of candidate network configuration parameters.

[0127] It can be understood that the multiple candidate network environments correspond one-to-one to the multiple groups of candidate network configuration parameters.

[0128] For example, when the multiple candidate network environments include a first candidate network environment, a second candidate network environment, and a third candidate network environment, and the multiple groups of candidate network configuration parameters include a first group of candidate network configuration parameters, a second group of candidate network configuration parameters, and a third group of candidate network configuration parameters, the first candidate network environment can correspond to the first group of candidate network configuration parameters, the second candidate network environment can correspond to the second group of candidate network configuration parameters, and the third candidate network environment can correspond to the third group of candidate network configuration parameters.

[0129] Among them, using the corresponding candidate network configuration parameters in the candidate network environment can optimize the network quality of the candidate network environment.

[0130] In the actual execution process, the candidate network environments, the candidate network configuration parameters, and the one-to-one correspondence between multiple candidate network environments and multiple groups of candidate network configuration parameters can be pre-stored in the MCU for subsequent acquisition and use.

[0131] In some embodiments, the candidate network configuration parameters may be based on user-defined settings.

[0132] In this embodiment, the user can customize and set corresponding candidate network configuration parameters for different candidate network environments based on experience.

[0133] During the setting process, the principle should be followed: under the candidate network environment, the candidate network configuration parameters corresponding to the candidate network environment can enable the candidate network environment to have the best communication capability, that is, under the candidate network environment, the network packet loss rate of network communication using the candidate network configuration parameters corresponding to the candidate network environment is as small as possible, and the transmission accuracy is as large as possible.

[0134] In some embodiments, the candidate network configuration parameters may be configuration parameters of the debugging MCU under a determined candidate network environment to obtain candidate network configuration parameters corresponding to the candidate network environment.

[0135] In this embodiment, the configuration parameters of the MCU may include network parameters such as TCP parameters, IP parameters, and third-party network protocol stack parameters, as well as hardware configuration parameters such as a network card and a driver, ie, network configuration parameters of a network protocol stack.

[0136] like Figure 2 As shown, in the actual execution process, the configuration parameters of the MCU can be manually debugged in a determined candidate network environment to obtain a group of MCU configuration parameters with relatively best communication capabilities in the candidate network environment, and then this group of configuration parameters can be determined as the candidate network configuration parameters corresponding to the candidate network environment.

[0137] It is understandable that if Figure 2 As shown, the configuration parameters of the MCU in each candidate network environment can be manually debugged to obtain the candidate network configuration parameters with the best communication capability in each candidate network environment, thereby obtaining multiple sets of one-to-one matching candidate network environments and candidate network configuration parameters.

[0138] like Figure 2 As shown, in some embodiments, a correspondence table between candidate network environments and candidate network configuration parameters may be constructed, so that subsequent table lookup based on the candidate network environment may facilitate obtaining corresponding candidate network configuration parameters.

[0139] In this embodiment, by debugging the configuration parameters of the MCU in a determined candidate network environment to obtain the candidate network configuration parameters corresponding to the candidate network environment, the optimal candidate network configuration parameters corresponding to each candidate network environment can be obtained, so that the optimal first network configuration parameters corresponding to the first network environment can be determined based on the first network environment, multiple candidate network environments, and the optimal candidate network configuration parameters corresponding to the multiple candidate network environments, thereby improving the adaptability of the first network configuration parameters under the first network environment and thus improving the communication capability of the network environment.

[0140] Step 140: Determine first network configuration parameters corresponding to the first network environment based on the first network environment, multiple candidate network environments, and multiple groups of candidate network configuration parameters.

[0141] In this step, the first network configuration parameter may be a network configuration parameter that enables the first network environment to have better communication capability.

[0142] The first network configuration parameters may include network parameters such as TCP parameters, IP parameters, and third-party protocol stack parameters under the first network environment, as well as hardware configuration parameters such as network card parameters and driver parameters.

[0143] It can be understood that different first network environments, candidate network environments, and candidate network configuration parameters may determine different first network configuration parameters.

[0144] In the actual execution process, the first network environment may be matched with a plurality of candidate network environments, and then based on the matching result, the first network configuration parameter corresponding to the first network environment may be determined.

[0145] In the case where the first network environment matches any one of the multiple candidate network environments, the candidate network configuration parameters corresponding to the candidate network environment matching the first network environment may be determined as the first network configuration parameters corresponding to the first network environment.

[0146] It is understandable that, when a correspondence table between candidate network environments and candidate network configuration parameters has been stored, as long as it is determined which candidate network environment the first network environment matches, the first network configuration parameters suitable for use in the first network environment can be quickly determined.

[0147] Alternatively, when the first network environment does not match any of the candidate network environments, other measures may be taken to determine the first network configuration parameters.

[0148] For example, the difference between the first network environment and each candidate network environment is compared, and the candidate network configuration parameters corresponding to the candidate network environment with the smaller difference are determined as the first network configuration parameters.

[0149] During the research and development process, the inventors discovered that the network environment faced by the equipment on site is complex and diverse, and the parameters are generally solidified in the code. The fixed network parameters cannot meet the communication requirements under diverse network environments, and parameter optimization cannot be performed without firmware upgrades. In related technologies, network configuration can be performed by importing configuration files, but the network environment is too complex and the network environment at different sites is very different, making operation and maintenance difficult.

[0150] In the present application, based on the first data packet received by the network protocol stack within a unit time, the first network environment characteristic value corresponding to the network protocol stack is determined to obtain the first network environment in which the network protocol stack is located, and then based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters corresponding to the obtained multiple candidate network environments, the first network configuration parameters corresponding to the first network environment are determined. This can realize the judgment of the network environment type, i.e., the first network environment, based on the network data throughput and data characteristics obtained by the first data packet, and can realize the determination of the first network configuration parameters including network parameters and hardware configuration parameters under the first network environment based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters, so that the network configuration parameters of the network protocol stack can be adaptively adjusted based on changes in the network environment, thereby realizing the update of the network configuration parameters of the network protocol stack based on the network environment type, providing a more convenient parameter optimization method, thereby improving network functions, optimizing packet loss problems in complex networks, and improving communication performance and communication stability in network environments at different sites.

[0151] The following describes a method for determining the first network environment characteristic value.

[0152] In some embodiments, determining, based on the first data packet, a first network environment characteristic value corresponding to the network protocol stack may include:

[0153] Performing feature extraction of N dimensions on the first data packet to obtain N first feature data, wherein one dimension corresponds to one first feature data;

[0154] Based on the first weight sequence, weighted summing is performed on the N first characteristic data to obtain a first network environment characteristic value;

[0155] In this embodiment, N is a positive integer.

[0156] Dimensions are used to represent different aspects of the first data packet that can be quantified and distinguished.

[0157] For example, Figure 2 As shown, the dimensions may include data packet throughput (number of data packets), data packet type, or data packet size distribution, etc.

[0158] It can be understood that a first feature data may be feature data extracted from a dimension and may represent the overall feature of the dimension.

[0159] The first characteristic data may be a specific value.

[0160] It can be understood that the multiple first characteristic data of the first data packet can represent the network conditions or performance of the network environment represented by the first data packet, that is, the type of network environment.

[0161] The first network environment characteristic value may be obtained by weighted summing up multiple groups of first characteristic data based on the first data packet.

[0162] It is understandable that when multiple first feature data are obtained by performing feature extraction on the first data packet in multiple dimensions, the multiple first feature data can be unified into a first network environment feature value, so as to more clearly distinguish different network environments and better represent the type of network environment.

[0163] In the actual implementation process, weights can be assigned based on the importance of the dimensions, and then weighted summation is performed based on the first feature data of each dimension and the assigned weights, so as to obtain a more representative and more accurate first network environment feature value.

[0164] The first weight sequence is a sequence composed of optimal weights of the first feature data of each dimension of the first data packet.

[0165] During the actual execution process, the first network environment characteristic value obtained by weighted summing up the first characteristic data of each dimension based on the first weight sequence has the best discrimination and representativeness of the network environment type, that is, the first network environment characteristic values ​​obtained based on the first weight sequence can optimally represent the characteristics of each network environment type while maximizing the characteristic difference between the network environment types represented by the first network environment characteristic values.

[0166] In some embodiments, multiple groups of weight sequences can be determined based on multiple weight assignment tests for the first feature data of each dimension, and then the multiple groups of weight sequences are screened to obtain the optimal weight sequence, and the optimal weight sequence is determined as the first weight sequence.

[0167] In some embodiments, the first network environment characteristic value can be calculated based on the following formula:

[0168] E=z1*S+z2*T+z3*P

[0169] Among them, E is the first network environment characteristic value, z1, z2 and z3 are the weights of each first characteristic data, z1, z2 and z3 constitute a first weight sequence, and S, T and P are the first characteristic data.

[0170] It can be understood that in the above example, three-dimensional feature extraction is performed on the first data packet to obtain three first feature data S, T, and P respectively, so that the first network environment feature value can be calculated according to the corresponding weights.

[0171] In this embodiment, N first feature data are obtained by performing feature extraction in N dimensions based on the first data packet, and then weighted summation is performed based on the first weight sequence to obtain the first network environment feature value, thereby realizing feature extraction of multiple dimensions in the first data packet to obtain multiple quantized first feature data, and then obtaining the first network environment feature value quantified for the first network environment, so that different network environments can be distinguished more clearly.

[0172] In some embodiments, performing feature extraction of N dimensions on the first data packet to obtain N first feature data may include:

[0173] Performing feature extraction of a first dimension on the first data packet, wherein the N dimensions include the first dimension;

[0174] In the case where the first dimension includes M sub-dimensions, respectively obtain a proportion value of each sub-dimension in the first data packet to obtain M second feature data;

[0175] Based on the second weight sequence, weighted sum is performed on the M second feature data to obtain the first feature data corresponding to the first dimension.

[0176] In this embodiment, the first dimension may be any one of the N dimensions.

[0177] The first dimension may further include M sub-dimensions, where M is a positive integer.

[0178] For example, when the first dimension is the data type of the first data packet, the data type of the first data packet may also include sub-dimensions such as unicast message, multicast message, and broadcast message.

[0179] For another example, when the first dimension is the data packet size distribution of the first data packet, the first dimension may also include sub-dimensions such as data packet size less than 512 bytes and data packet size greater than 512 bytes and less than 1024 bytes.

[0180] A second feature data may be feature data extracted from one of the M sub-dimensions and may represent the overall feature of the sub-dimension.

[0181] Among them, each second characteristic data is the proportion of each sub-dimension in the first data packet.

[0182] For example, when the first dimension is the data type of the first data packet, and the data type of the first data packet can also include sub-dimensions such as unicast messages, multicast messages and broadcast messages, each second characteristic data can be the proportion of sub-dimensions such as unicast message ratio, multicast message ratio and broadcast message ratio in the first data packet.

[0183] During the actual execution process, when the first dimension includes M sub-dimensions, the feature extraction result corresponding to the first dimension (i.e., the first feature data) can be obtained by fusing the feature extraction results corresponding to each sub-dimension in all the sub-dimensions included in the first dimension (i.e., the second feature data).

[0184] The second weight sequence is a sequence composed of weights corresponding to the M sub-dimensions of the first dimension.

[0185] It can be understood that if there are multiple first dimensions including M sub-dimensions, the number M of sub-dimensions in different first dimensions may be different, and for different first dimensions, the second weight sequences composed of weights corresponding to the sub-dimensions may also be different.

[0186] In the actual execution process, the second feature data corresponding to each sub-dimension of the first dimension may be weighted and summed based on the second weight sequence to perform fusion processing on the second feature data, thereby obtaining the first feature data.

[0187] It should be noted that the second weight sequence is a sequence composed of optimal weights of each second feature data corresponding to each sub-dimension of the first dimension.

[0188] During the actual execution process, the first feature data obtained by weighted summing the second feature data of each sub-dimension of each first dimension based on the second weight sequence has the optimal discrimination and representativeness of each first dimension, that is, the first feature data obtained based on the second weight sequence can optimally represent the features of each first dimension while maximizing the feature differences between the first dimensions represented by the first feature data.

[0189] In some embodiments, weight sequences of multiple groups of second feature data can be determined based on multiple weight assignment tests, and then the multiple groups of weight sequences can be screened to obtain the optimal second feature data weight sequence, and the optimal second feature data weight sequence can be determined as the second weight sequence.

[0190] In some embodiments, the second weight sequence can also be obtained through a network model, and the network model can be a neural network model. The specific implementation method will be described in the following embodiments and will not be described here in detail.

[0191] In some embodiments, when the weight of each second feature data is obtained, the corresponding first feature data can be calculated based on a formula.

[0192] For example, when the first dimension is the data packet type, the unicast message ratio, multicast message ratio, and broadcast message ratio in the first data packet are obtained respectively. The first feature data of the data packet type dimension can be calculated based on the following formula:

[0193] T1=D*x1+Z*x2+G*x3

[0194] Among them, T1 is the first characteristic data of the data packet type dimension, D is the unicast message ratio, Z is the multicast message ratio, G is the broadcast message ratio, and x1, x2 and x3 are the weights of D, Z and G respectively.

[0195] Among them, the unicast message ratio, the multicast message ratio and the broadcast message ratio are the second characteristic data corresponding to each sub-dimension in the data packet type dimension; x1, x2, and x3 constitute the second weight sequence of the data packet type dimension.

[0196] For another example, when the first dimension is the data packet size distribution, the proportion of data packets with a size less than 512 bytes, the proportion of data packets with a size greater than 512 bytes and less than 1024 bytes, and the proportion of data packets with a size greater than 1024 bytes in the first data packet are obtained. The first characteristic data of the data packet size distribution dimension can be calculated based on the following formula:

[0197] T2=U*y1+V*y2+F*y3

[0198] Among them, T2 is the first characteristic data of the packet size distribution dimension, U is the proportion of packet sizes less than 512 bytes, V is the proportion of packet sizes greater than 512 bytes and less than 1024 bytes, F is the proportion of packet sizes greater than 1024 bytes, and y1, y2 and y3 are the weights of U, V and F respectively.

[0199] Among them, the proportion of data packet size less than 512 bytes, the proportion of data packet size greater than 512 bytes and less than 1024 bytes, and the proportion of data packet size greater than 1024 bytes are the second feature data corresponding to each sub-dimension of the data packet size distribution dimension; y1, y2, and y3 constitute the second weight sequence of the data packet size distribution dimension.

[0200] In the actual implementation process, when extracting the features of a dimension of the first data packet, or further extracting the features of a sub-dimension in the dimension, a customized selection can be made for multiple dimensions or sub-dimensions in the first data packet that can reflect the network communication capabilities.

[0201] Exemplarily, taking the first dimension as the data packet type dimension, unicast messages, multicast messages, and broadcast messages belong to sub-dimensions in the data packet type, and anycast messages, directed broadcast messages, and cyclic broadcast messages also belong to sub-dimensions in the data packet type. In the actual execution process, when choosing to extract features from the data packet type dimension and further extract features from each sub-dimension of the data packet type dimension, you can customize the sub-dimensions included in the data packet type dimension based on actual needs.

[0202] For example, in addition to extracting features from the sub-dimensions of unicast messages, multicast messages, and broadcast messages, you can also choose to extract features from the sub-dimensions of anycast messages, directed broadcast messages, and cyclic broadcast messages to obtain the second feature data corresponding to the sub-dimensions of the data packet type dimension such as anycast messages, directed broadcast messages, and cyclic broadcast messages, and then based on the second weight sequence, obtain the first feature data of the data packet type dimension.

[0203] For example, when the accuracy requirement for the first feature data corresponding to the first dimension is high, while extracting features from the sub-dimensions of unicast messages, multicast messages, and broadcast messages, feature extraction can also be performed on sub-dimensions such as anycast messages, directed broadcast messages, and cyclic broadcast messages to obtain second feature data corresponding to more sub-dimensions, and then based on the second weight sequence, obtain the first feature data of the data packet type dimension with higher accuracy.

[0204] It can be understood that, under the same first dimension, the second weight sequences corresponding to different sub-dimensions may also be different, wherein different second weight sequences may be reflected in that the specific weight values ​​and weight quantities included may be different.

[0205] For example, in the above example, when feature extraction is performed on sub-dimensions such as unicast messages, multicast messages, and broadcast messages, or feature extraction is performed on sub-dimensions such as anycast messages, directed broadcast messages, and cyclic broadcast messages, the specific weight values ​​contained in the corresponding second weight sequences may be different.

[0206] For example, in the above example, when feature extraction is performed on sub-dimensions of unicast messages, multicast messages, and broadcast messages, or feature extraction is performed on sub-dimensions such as unicast messages, multicast messages, broadcast messages, anycast messages, directed broadcast messages, and cyclic broadcast messages, the corresponding second weight sequences contain a different number of weights, and the specific weight values ​​contained may also be different.

[0207] In this embodiment, by further dividing the first dimension into sub-dimensions, the proportion of each sub-dimension in the first data packet is obtained respectively to obtain multiple second feature data, and then based on the second weight sequence, the multiple second feature data are weighted and summed to obtain the first feature data corresponding to the first dimension. The sub-dimension can be selected according to needs to obtain representative first feature data.

[0208] In some embodiments, the dimension of the first data packet includes at least one of the following:

[0209] The number of first data packets, the data types of the first data packets, and the size of the first data packets.

[0210] In this embodiment, feature extraction may be performed on the first data packet based on at least one dimension of the number of the first data packet, the data type, and the size of the first data packet to obtain at least one set of first feature data.

[0211] In this embodiment, feature extraction is performed on the first data packet in multiple dimensions, including the number of the first data packet, the data type, and the size of the first data packet, and multiple groups of representative first feature data are obtained for different aspects of the first data packet. Therefore, based on the multiple groups of first feature data, first network environment feature values ​​that can better characterize the current network environment situation can be obtained to more accurately indicate the current first network environment.

[0212] The following describes a method for determining the first network configuration parameters corresponding to the first network environment.

[0213] In some embodiments, step 140 may include:

[0214] In a case where the first network environment characteristic value matches the target candidate network environment characteristic value, determining the target candidate network configuration parameter corresponding to the target candidate network environment among the multiple candidate network environments as the first network configuration parameter;

[0215] In this embodiment, the first network environment characteristic value is used to indicate the first network environment.

[0216] The candidate network environment characteristic value is used to indicate the candidate network environment.

[0217] In the actual execution process, the characteristic value of the candidate network environment may be a representative value abstracted from the candidate network environment.

[0218] It can be understood that the candidate network environment characteristic values ​​correspond to the candidate network environments one by one.

[0219] For example, when multiple candidate network environments include a first candidate network environment, a second candidate network environment, and a third candidate network environment, and multiple candidate network environment characteristic values ​​include a first candidate network environment characteristic value, a second candidate network environment characteristic value, and a third candidate network characteristic value, the first candidate network environment corresponds to the first candidate network environment characteristic value, the second candidate network environment corresponds to the second candidate network environment characteristic value, and the third candidate network environment corresponds to the third candidate network environment characteristic value.

[0220] The target candidate network environment characteristic value is used to indicate the target candidate network environment.

[0221] The target candidate network environment is any one of multiple candidate network environments.

[0222] The target candidate network environment feature value is a candidate network environment feature value corresponding to the target candidate network environment.

[0223] In the actual implementation process, the candidate network environment characteristic value may be a characteristic value or a characteristic value range.

[0224] For example, the candidate network environment characteristic value may be a characteristic value such as 100, 200 or 300, or a characteristic value range such as [100, 200], [200, 300] or [300, 400].

[0225] In some embodiments, historical data packets can be clustered to obtain multiple data packet clusters, where a data packet cluster can represent a candidate network environment, and each data packet cluster is assigned a value, so that the value assigned to each data packet cluster can be determined as the characteristic value of each candidate network environment corresponding to each candidate network environment.

[0226] Of course, in other embodiments, the network model may also be used to obtain the candidate network environment characteristic value corresponding to the candidate network environment. The specific implementation method will be described in the following embodiments and will not be described in detail here.

[0227] In the actual execution process, the first network environment characteristic value may be matched with each candidate network environment characteristic value, and then based on the matching result, the first network configuration parameter under the first network environment may be determined.

[0228] The matching of the first network environment characteristic value and the target candidate network environment characteristic value can be understood as that the first network environment characteristic value is equal to the target candidate network environment characteristic value, or the first network characteristic value is within the characteristic value range of the target candidate network environment characteristic value.

[0229] The target candidate network environment feature value is a candidate network environment feature value that matches the first network environment feature value.

[0230] During the actual execution process, the characteristic value of the first network environment matches the characteristic value of the target candidate network environment, that is, the first network environment can be considered to be the same as the target candidate network environment. Then, the target candidate network configuration parameters corresponding to the target candidate network environment can be determined as the first network configuration parameters to optimize the network communication capability under the first network environment based on the first network configuration parameters.

[0231] In this embodiment, by determining the target candidate network configuration parameters corresponding to the target candidate network environment among multiple candidate network environments as the first network configuration parameters when the characteristic value of the first network environment matches the characteristic value of the target candidate network environment, the optimal network configuration parameters in the first network environment can be quickly determined, the efficiency of determining the first network configuration parameters can be improved, and thus the communication efficiency of the first network environment can be improved.

[0232] In some embodiments, step 140 may include:

[0233] In a case where the first network environment characteristic value does not match the characteristic values ​​of each candidate network environment, initializing the network protocol stack based on the candidate network configuration parameters corresponding to each candidate network environment;

[0234] Obtaining network quality after initialization using each set of candidate configuration parameters;

[0235] The candidate network configuration parameters corresponding to the optimal network quality are determined as the first network configuration parameters corresponding to the first network environment.

[0236] In this embodiment, the network quality may include the size of the network packet loss rate and the accuracy rate.

[0237] The optimal network quality can be understood as the first network environment after being configured using the network configuration parameters having the best network communication capability. Specific standards for measuring network quality may include network packet loss rate, data transmission accuracy, etc. For example, if the first network environment configured using a certain set of candidate network configuration parameters can obtain the minimum network packet loss rate and the highest transmission accuracy during network communication, then the candidate network configuration parameters are considered to be the candidate network configuration parameters corresponding to the optimal network quality.

[0238] It can be understood that the situation where the first network environment characteristic value does not match any candidate network environment characteristic value may be that the first network environment characteristic value is not equal to any candidate network environment characteristic value, or the first network environment characteristic value is not within the characteristic value range of any candidate network environment characteristic value.

[0239] During the actual execution process, when the characteristic value of the first network environment does not match the characteristic values ​​of each candidate network environment, each candidate network configuration parameter can be used as the network configuration parameter under the first network environment and the network protocol stack can be initialized. The network packet loss rate and data transmission accuracy under each candidate network configuration parameter are counted, that is, the network quality is judged, and then the candidate network configuration parameter with the best network quality (which can be candidate network configuration parameter 1) is determined as the first network configuration parameter corresponding to the first network environment, thereby ensuring that even if the characteristic value of the first network environment does not match the characteristic values ​​of each candidate network environment, the network protocol stack can be configured.

[0240] In some embodiments, after the candidate network configuration parameters under the condition of optimal network quality are determined as the first network configuration parameters corresponding to the first network environment, the correspondence between the characteristic value of the first network environment and the candidate network configuration parameters can be recorded in the MCU (i.e., a correspondence between the first network environment characteristic value and the candidate network configuration parameter 1 is established). In subsequent applications, if the network environment characteristic value calculated based on the data packet does not match the characteristic values ​​of each candidate network environment, but is the same as or similar to the above-mentioned first network environment characteristic value, the above-mentioned candidate network configuration parameter 1 can be directly used to directly configure the parameters of the network environment, thereby improving the configuration efficiency of the network.

[0241] For example, when there are three candidate network environments, whose characteristic values ​​are 100 (corresponding to the first candidate network environment), 200 (corresponding to the second candidate network environment) and 300 (corresponding to the third candidate network environment), and the characteristic value of the first network environment is 2000, it can be seen that the characteristic value of the first network environment does not match the characteristic values ​​of each candidate network environment. Therefore, the three network configuration parameters corresponding to the first candidate network environment, the second candidate network environment and the third candidate network environment can be used as parameters of the first network environment in turn, and the network protocol stack is initialized, and the corresponding network quality is detected respectively.

[0242] If it is determined that the network quality is optimal after configuring the first network environment using the third candidate network parameters corresponding to the third candidate network environment, a correspondence between the first network environment characteristic value 2000 and the third candidate network configuration parameters is established and can be recorded in the MCU. If the network environment characteristic value is around 2000 again in the future, the third candidate network configuration parameters can be directly used to configure the network environment, thereby improving the efficiency of network configuration.

[0243] In this embodiment, by initializing the network protocol stack based on the candidate network configuration parameters corresponding to various candidate network environments when the first network environment characteristic value does not match the characteristic values ​​of each candidate network environment, and determining the candidate network configuration parameters under the optimal network quality as the first network configuration parameters corresponding to the first network environment, a method for determining the first network configuration parameters when the first network environment characteristic value does not match the characteristic values ​​of each candidate network environment can be provided, thereby improving the flexibility of obtaining the first network configuration parameters, thereby improving the ability to adapt the network configuration parameters to complex on-site network environments, and further improving the communication capability of the network environment.

[0244] In some embodiments, step 140 may include:

[0245] In the case that the first network environment characteristic value does not match any of the candidate network environment characteristic values, obtaining a difference between the first network environment characteristic value and each of the candidate network environment characteristic values;

[0246] Determine the candidate network configuration parameter corresponding to the candidate network environment corresponding to the candidate network environment characteristic value with the smallest difference as the first network configuration parameter;

[0247] In this embodiment, the difference degree may be the difference degree between the first network environment characteristic value and each candidate network environment characteristic value.

[0248] Among them, the first network environment with the smallest difference can be considered to be the most similar to the candidate network environment, and the candidate network configuration parameters corresponding to the candidate network environment corresponding to the candidate network environment characteristic value with the smallest difference can be determined as the first network configuration parameters, thereby improving the adaptability of the first network configuration parameters determined when the first network environment characteristic value does not match the characteristic values ​​of each candidate network environment.

[0249] In some embodiments, the degree of difference may be determined based on a difference or ratio between the first network environment characteristic value and each candidate network environment characteristic value.

[0250] For example, when the first network environment characteristic value and each candidate network environment characteristic value are specific numerical values, the difference or ratio between the first network environment characteristic value and each candidate network environment characteristic value is calculated; when the absolute value of the difference or ratio is the smallest, the difference is the smallest.

[0251] In other embodiments, the degree of difference between the first network environment characteristic value and the candidate network environment characteristic value may be measured based on other methods, which is not limited in the present application.

[0252] In this embodiment, by obtaining the difference between the first network environment characteristic value and each candidate network environment characteristic value when the first network environment characteristic value does not match the characteristic value of each candidate network environment, the candidate network configuration parameter corresponding to the candidate network environment corresponding to the candidate network environment characteristic value with the smallest difference is determined as the first network configuration parameter. This can provide a method for determining the first network configuration parameter when the first network environment characteristic value does not match the characteristic value of each candidate network environment, improve the flexibility of obtaining the first network configuration parameter, thereby improving the ability to adapt the network configuration parameters to a complex on-site network environment, and further improving the communication capability of the network environment.

[0253] In some embodiments, after step 120, the following steps may also be included:

[0254] In the case that the first network environment characteristic value does not match any of the candidate network environment characteristic values, a prompt message is output, where the prompt message is used to prompt the MCU data to be modified.

[0255] In this embodiment, the prompt to modify the MCU data can be understood as prompting the user to initialize the network protocol stack based on the candidate network configuration parameters corresponding to the various candidate network environments, respectively, when the characteristic value of the first network environment does not match the characteristic values ​​of each candidate network environment, so as to screen out the optimal network configuration parameters corresponding to the first network environment.

[0256] In this embodiment, by outputting a prompt message when the first network environment characteristic value does not match the characteristic values ​​of each candidate network environment, the user can be prompted to select a method for modifying the MCU data to determine a first network configuration parameter with higher adaptability when the first network environment cannot be automatically matched to the optimal first network configuration parameter, so as to ensure that when the characteristic value of the first network environment does not match the characteristic value of each candidate network environment, the first network configuration parameter corresponding to the first network environment is determined smoothly.

[0257] The following describes the methods for determining the candidate network environment feature values ​​and the first weight sequence.

[0258] In some embodiments, before step 110, the following steps may also be included:

[0259] Under various candidate network environments, sample data packets received by the network protocol stack in a unit time are obtained respectively;

[0260] Performing feature extraction of N dimensions on each sample data packet respectively to obtain N first sample feature data corresponding to each candidate network environment, wherein one dimension corresponds to one first sample feature data;

[0261] Based on the first weight sequence, weighted summation is performed on N first sample feature data under the same candidate network environment to obtain a candidate network environment feature value corresponding to each candidate network environment. The first weight sequence is used to process the sample data packet.

[0262] In this embodiment, it can be understood that the method for acquiring the candidate network environment feature value may be similar to the method for acquiring the first network environment feature described above.

[0263] The sample data packets are data packets received by the network protocol stack within a unit time under various candidate network environments.

[0264] In the actual execution process, in each candidate network environment, the network protocol stack can receive equal or unequal numbers of sample data packets per unit time.

[0265] The sample data packets may be used to reflect network conditions or performance of various candidate network environments.

[0266] A first sample feature data may be feature data extracted from a dimension of a sample data packet in a candidate network environment, and may represent the overall feature of the dimension.

[0267] The first sample characteristic data may be a specific numerical value.

[0268] It can be understood that a plurality of first sample characteristic data of a sample data packet in a candidate network environment can represent the network condition or performance of the candidate network environment.

[0269] In the actual implementation process, multiple first sample feature data of a sample data packet under a candidate network environment can be unified into a candidate network environment feature value, so that various candidate network environments can be distinguished more clearly.

[0270] The candidate network environment characteristic value corresponding to the candidate network environment may be obtained by weighted summing of a plurality of first sample characteristic data of sample data packets corresponding to each candidate network environment.

[0271] In the actual execution process, each weight of the plurality of first sample feature data of the sample data packet corresponding to each candidate network environment may be a first weight sequence.

[0272] In some embodiments, multiple groups of weight sequences can be determined based on multiple weight assignment tests for the first sample feature data of each dimension, and then the multiple groups of weight sequences are screened to obtain the optimal weight sequence, and the optimal weight sequence is determined as the first weight sequence.

[0273] It can be understood that the candidate network environment feature values ​​obtained based on the first weight sequence have the best discrimination and representativeness of the candidate network environments.

[0274] In some embodiments, when the dimension of the sample data packet includes multiple sub-dimensions, a weighted summation can be performed based on the second sample feature data corresponding to each sub-dimension to obtain the first sample feature data corresponding to the dimension. The specific implementation method can be similar to the above-mentioned case of obtaining the first feature data based on the second feature data, and this application will not go into details here.

[0275] In this embodiment, for multiple candidate network environments, feature extraction of N dimensions is performed on sample data packets in each candidate network environment. Of course, feature extraction of sub-dimensions can also be further performed on the first dimension to obtain candidate network environment feature values ​​corresponding to each candidate network environment. Since the first weight sequence is the optimal weight sequence that makes the candidate network environment feature values ​​most distinguishable, the multiple candidate network environment feature values ​​obtained can more clearly indicate different candidate network environments.

[0276] In some embodiments, before performing weighted summation on N first sample feature data in the same candidate network environment based on the first weight sequence, the method may further include:

[0277] Assigning weights to N first sample feature data under the same candidate network environment, wherein the N weight data constitute a third weight sequence;

[0278] Based on the third weight sequence, weighted summing is performed on the N first sample feature data corresponding to each candidate network environment to obtain a candidate network environment feature value corresponding to each candidate network environment;

[0279] Based on multiple candidate network environment feature values, the third weight sequence is adjusted to obtain a first weight sequence, wherein the multiple candidate network environment feature values ​​correspond one-to-one to the multiple candidate network environments.

[0280] In this embodiment, the third weight sequence is composed of N weight data corresponding to N first sample feature data in the same candidate network environment.

[0281] It is understandable that, since different candidate network environments need to be distinguished according to multiple candidate network environment feature values ​​in the end, it is necessary for the multiple candidate network environment feature values ​​to have a sufficiently good degree of distinction.

[0282] It can be understood that the first weight sequence is obtained by adjusting the third weight sequence based on multiple candidate network environment feature values ​​for the purpose of obtaining an optimal weight sequence (the distinction between multiple feature values ​​is the best).

[0283] In some embodiments, the third weight sequence may be optimized once or multiple times, and the first weight sequence is obtained by the last optimization of the third weight sequence.

[0284] In the actual implementation process, the N first sample feature data corresponding to each candidate network environment can be first weighted and summed based on the third weight sequence to obtain a preliminary candidate network environment feature value corresponding to each candidate network environment. The third weight sequence can be subsequently adjusted, and the N first sample feature data corresponding to each candidate network environment can be weighted and summed based on the adjusted third weight sequence to obtain the adjusted candidate network environment feature value corresponding to each candidate network environment. This cycle is repeated until a round of weighted summation of the N first sample feature data corresponding to each candidate network environment has the best discrimination and representativeness. The N weight data in this round are determined as the first weight sequence, and the candidate network environment feature values ​​corresponding to various candidate network environments calculated based on the first weight sequence are used as the final candidate network environment feature values.

[0285] Exemplarily, when there are three candidate network environments, based on the third weight sequence, the N first sample feature data corresponding to the three candidate network environments are weighted and summed, and the preliminary candidate network feature values ​​corresponding to the three candidate network environments are 10, 12 and 15 respectively. It can be understood that the difference between the three preliminary candidate network feature values ​​is small. Therefore, the third weight sequence can be continuously adjusted in the future until the third weight sequence is adjusted to the first weight sequence. Based on the first weight sequence, the N first sample feature data corresponding to the three candidate network environments are weighted and summed, and the final candidate network feature values ​​corresponding to the three candidate network environments are 10, 100 and 300 respectively. It can be understood that at this time, the difference between the final candidate network feature values ​​corresponding to the three candidate network environments is large, so that the feature values ​​of each candidate network environment can be better distinguished, so that after the first network feature value is obtained based on the first data packet, it can be quickly matched with the target candidate network feature value, and the problem of each candidate network feature value being slightly different, resulting in a problem of being unable to match.

[0286] In some embodiments, the second weight sequence may also be obtained by adjusting the fourth weight sequence for fitting based on multiple candidate network environment feature values ​​for the purpose of obtaining the optimal weight sequence of each second sample feature data; wherein the second weight sequence is the optimal weight sequence of each second sample feature data, and the fourth weight sequence is a non-optimal weight sequence of each second sample feature data; the specific method of obtaining the second weight sequence based on the fourth weight sequence is similar to the specific method of obtaining the first weight sequence based on the third weight sequence, and this application will not elaborate on it here.

[0287] In this embodiment, by adjusting the third weight sequence for fitting based on multiple candidate network environment feature values ​​for the purpose of obtaining the optimal weight sequence to obtain the first weight sequence, it is possible to obtain candidate network environment feature values ​​corresponding to multiple candidate network environments that are more representative and more accurate, and a first weight sequence with optimal distinguishing ability, thereby facilitating the subsequent acquisition of more accurate and representative first network environment feature values ​​of the first network environment based on the first weight sequence.

[0288] In some embodiments, the process of adjusting the third weight sequence for fitting based on multiple candidate network environment feature values ​​to obtain the optimal weight sequence, thereby obtaining the first weight sequence, can be performed by an artificial neural network model.

[0289] In this embodiment, the artificial neural network model can be trained to obtain multiple candidate network environment feature values ​​with optimal discrimination and representativeness and an optimal weight sequence.

[0290] The optimal weight sequence may include a first weight sequence and a second weight sequence.

[0291] In the actual implementation process, the artificial neural network model can be based on the scikit-learn training framework, and the ANN model can be used to adjust the third weight sequence for fitting training based on multiple candidate network environment feature values ​​for the purpose of obtaining the optimal weight sequence, thereby obtaining the first weight sequence.

[0292] In this embodiment, multiple candidate network environment feature values ​​and a first weight sequence are trained based on an artificial neural network model. Based on the automatic feature extraction capability of the artificial neural network model, multiple candidate network environment feature values ​​and a first weight sequence can be obtained conveniently and quickly. The adaptive iterative update capability and learning capability of the artificial neural network model are utilized to optimize the model parameters in turn based on the third weight sequence output each time until the optimal weight sequence can be output, thereby improving the accuracy of the candidate network environment feature values ​​determined based on the optimal weight sequence.

[0293] The following describes an application method of the first network configuration parameter.

[0294] In some embodiments, after step 140, the method may further include:

[0295] The network protocol stack is initialized based on the first network configuration parameter.

[0296] In this embodiment, after the first network configuration parameter is determined, the network protocol stack may be initialized based on the first network configuration parameter so that the network environment has better communication capability.

[0297] like Figure 3As shown, in the actual execution process, when the system is powered on, the network protocol stack is first initialized with default parameters, and then the first data packet received by the network protocol stack in a unit time is obtained, and then based on the first data packet, the first network environment in which the network protocol stack is located is predicted, and then based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters, the first network configuration parameters corresponding to the first network environment are determined, and then the network protocol stack is initialized with the first network configuration parameters, and then formal network service interaction begins.

[0298] In this embodiment, by initializing the network protocol stack based on the first network configuration parameter, the network configuration parameter of the network protocol stack can be updated, thereby improving the communication capability of the network environment.

[0299] In some embodiments, the first network configuration parameter may also be set as a startup parameter for starting the network protocol stack next time.

[0300] In this embodiment, it can be understood that the first network configuration parameter can be set as a default parameter for starting the network protocol stack next time.

[0301] During the actual execution process, the first network configuration parameters may be written into the Flash. Next time the system is powered on, the network protocol stack may be directly initialized using the first network configuration parameters to start formal network service interaction.

[0302] In this embodiment, by setting the first network configuration parameter as the startup parameter of the network protocol stack for the next startup, the initialization of the network protocol stack for the next startup can be facilitated, the redundant steps can be reduced, and the efficiency of initializing network communication can be improved.

[0303] The embodiment of the present application also provides a device for determining network configuration parameters.

[0304] like Figure 6 As shown, the device for determining network configuration parameters includes: an acquisition module 610 and a processing module 620.

[0305] An acquisition module 610 is used to acquire a first data packet received by the network protocol stack within a unit time;

[0306] A determination module 620 is used to determine a first network environment characteristic value corresponding to the network protocol stack based on the first data packet to obtain a first network environment in which the network protocol stack is located, wherein the first network environment characteristic value is used to indicate the first network environment;

[0307] The acquisition module 610 is further used to acquire multiple groups of candidate network configuration parameters corresponding to multiple candidate network environments, wherein one candidate network environment corresponds to one group of candidate network configuration parameters;

[0308] The determination module 620 is further configured to determine the first network configuration parameter corresponding to the first network environment based on the first network environment, multiple candidate network environments, and multiple groups of candidate network configuration parameters.

[0309] In this embodiment, based on the first data packet received by the network protocol stack within a unit time, a first network environment characteristic value corresponding to the network protocol stack is determined to obtain the first network environment in which the network protocol stack is located, and then based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters corresponding to the obtained multiple candidate network environments, the first network configuration parameters corresponding to the first network environment are determined. This can realize the judgment of the network environment type, i.e., the first network environment, based on the first data packet, and can realize the determination of the first network configuration parameters under the first network environment based on the first network environment, multiple candidate network environments and multiple groups of candidate network configuration parameters, so that the network configuration parameters of the network protocol stack can be adaptively adjusted based on changes in the network environment, thereby realizing the update of the network configuration parameters of the network protocol stack based on the network environment type, providing a more convenient parameter optimization method, thereby improving network functions, optimizing packet loss problems in complex networks, and improving communication performance and communication stability in network environments at different sites.

[0310] In some embodiments, the determination module 620 may also be used to:

[0311] Performing feature extraction of N dimensions on the first data packet to obtain N first feature data, wherein one dimension corresponds to one first feature data;

[0312] Based on the first weight sequence, weighted sum is performed on N first characteristic data to obtain a first network environment characteristic value; wherein N is a positive integer.

[0313] In some embodiments, the determination module 620 may also be used to:

[0314] Performing feature extraction of a first dimension on the first data packet, wherein the N dimensions include the first dimension;

[0315] In the case where the first dimension includes M sub-dimensions, respectively obtain a proportion value of each sub-dimension in the first data packet to obtain M second feature data;

[0316] Based on the second weight sequence, weighted sum is performed on the M second feature data to obtain the first feature data corresponding to the first dimension, where M is a positive integer.

[0317] In some embodiments, the determination module 620 may also be used to:

[0318] In a case where the first network environment characteristic value matches the target candidate network environment characteristic value, determining the target candidate network configuration parameter corresponding to the target candidate network environment among the multiple candidate network environments as the first network configuration parameter;

[0319] The first network environment characteristic value is used to indicate the first network environment, and the target candidate network environment characteristic value is used to indicate the target candidate network environment.

[0320] In some embodiments, the determination module 620 may also be used to:

[0321] In a case where the first network environment characteristic value does not match the characteristic values ​​of each candidate network environment, initializing the network protocol stack based on the candidate network configuration parameters corresponding to each candidate network environment;

[0322] Obtaining network quality after initialization using each set of candidate configuration parameters;

[0323] Determine the candidate network configuration parameters corresponding to the optimal network quality as the first network configuration parameters corresponding to the first network environment;

[0324] or,

[0325] Obtaining a difference between the first network environment characteristic value and each candidate network environment characteristic value;

[0326] Determine the candidate network configuration parameter corresponding to the candidate network environment corresponding to the candidate network environment characteristic value with the smallest difference as the first network configuration parameter;

[0327] In some embodiments, the apparatus may further include a first processing module, configured to:

[0328] Before obtaining the first data packet received by the network protocol stack within a unit time, respectively obtaining sample data packets received by the network protocol stack within a unit time under multiple candidate network environments;

[0329] Performing feature extraction of N dimensions on each sample data packet respectively to obtain N first sample feature data corresponding to each candidate network environment, wherein one dimension corresponds to one first sample feature data;

[0330] Based on the first weight sequence, weighted sum is performed on N first sample feature data under the same candidate network environment to obtain a candidate network environment feature value corresponding to each candidate network environment. The first weight sequence is used to process sample data packets, where N is a positive integer.

[0331] In some embodiments, the apparatus may further include a second processing module, configured to:

[0332] Before weighted summing the N first sample feature data under the same candidate network environment based on the first weight sequence, weighting the N first sample feature data under the same candidate network environment, wherein the N weight data constitute a third weight sequence;

[0333] Based on the third weight sequence, weighted summing is performed on the N first sample feature data corresponding to each candidate network environment to obtain a candidate network environment feature value corresponding to each candidate network environment;

[0334] Based on multiple candidate network environment feature values, the third weight sequence is adjusted to obtain a first weight sequence, wherein the multiple candidate network environment feature values ​​correspond one-to-one to the multiple candidate network environments.

[0335] In some embodiments, the apparatus may further include a third processing module, configured to:

[0336] After determining the first network environment characteristic value corresponding to the network protocol stack based on the first data packet to obtain the first network environment in which the network protocol stack is located, if the first network environment characteristic value does not match the characteristic values ​​of each candidate network environment, a prompt message is output, and the prompt message is used to prompt the MCU data to be modified.

[0337] In some embodiments, the apparatus may further include a fourth processing module, configured to:

[0338] After determining first network configuration parameters corresponding to the first network environment based on the first network environment, multiple candidate network environments, and multiple groups of candidate network configuration parameters, initializing a network protocol stack based on the first network configuration parameters;

[0339] In some embodiments, the apparatus may further include a fifth processing module, configured to:

[0340] After determining the first network configuration parameter corresponding to the first network environment based on the first network environment, multiple candidate network environments, and multiple groups of candidate network configuration parameters, the first network configuration parameter is set as a startup parameter for starting the network protocol stack next time.

[0341] like Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, each process of the above-mentioned network configuration parameter determination method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0342] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0343] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned network configuration parameter determination method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0344] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0345] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned method for determining network configuration parameters when executed by a processor.

[0346] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0347] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned network configuration parameter determination method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0348] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0349] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

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

[0351] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0352] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0353] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for determining network configuration parameters, characterized in that: include: Obtaining the first data packet received by the network protocol stack within a unit time; Based on the first data packet, determine a first network environment characteristic value corresponding to the network protocol stack to obtain a first network environment in which the network protocol stack is located, wherein the first network environment characteristic value is used to indicate the first network environment; Acquire multiple groups of candidate network configuration parameters corresponding to multiple candidate network environments, wherein one candidate network environment corresponds to one group of candidate network configuration parameters; Based on the first network environment, the multiple candidate network environments, and the multiple groups of candidate network configuration parameters, a first network configuration parameter corresponding to the first network environment is determined.

2. The method for determining network configuration parameters according to claim 1, characterized in that: The determining, based on the first data packet, a first network environment characteristic value corresponding to the network protocol stack includes: Performing feature extraction of N dimensions on the first data packet to obtain N first feature data, wherein one dimension corresponds to one first feature data; Based on a first weight sequence, weighted sum is performed on the N first characteristic data to obtain the first network environment characteristic value; wherein N is a positive integer.

3. The method for determining network configuration parameters according to claim 2, characterized in that: The extracting features of the first data packet in N dimensions to obtain N first feature data includes: Performing feature extraction of a first dimension on the first data packet, wherein the N dimensions include the first dimension; In the case where the first dimension includes M sub-dimensions, respectively obtaining a proportion of each sub-dimension in the first data packet to obtain M second feature data; Based on a second weight sequence, weighted sum is performed on the M second feature data to obtain first feature data corresponding to the first dimension, where M is a positive integer.

4. The method for determining network configuration parameters according to claim 2, characterized in that: The dimension of the first data packet includes at least one of the following: The number of the first data packets, the data type of the first data packets, and the size of the first data packets.

5. The method for determining network configuration parameters according to any one of claims 1 to 4, characterized in that: The determining, based on the first network environment, the multiple candidate network environments, and the multiple groups of candidate network configuration parameters, a first network configuration parameter corresponding to the first network environment includes: In a case where the first network environment characteristic value matches the target candidate network environment characteristic value, determining the target candidate network configuration parameter corresponding to the target candidate network environment among the multiple candidate network environments as the first network configuration parameter; The target candidate network environment characteristic value is used to indicate the target candidate network environment.

6. The method for determining network configuration parameters according to any one of claims 1 to 4, characterized in that: Before obtaining the first data packet received by the network protocol stack within a unit time, the method further includes: Under multiple candidate network environments, respectively obtaining sample data packets received by the network protocol stack within a unit time; Performing feature extraction of N dimensions on each of the sample data packets respectively to obtain N first sample feature data corresponding to each of the candidate network environments, wherein one dimension corresponds to one first sample feature data; Based on a first weight sequence, weighted sum is performed on N first sample feature data under the same candidate network environment to obtain a candidate network environment feature value corresponding to each candidate network environment, and the first weight sequence is used to process the sample data packet, wherein N is a positive integer.

7. The method for determining network configuration parameters according to claim 6, characterized in that: Before performing weighted summation on the N first sample feature data in the same candidate network environment based on the first weight sequence, the method further includes: Assigning weights to N first sample feature data under the same candidate network environment, wherein the N weight data constitute a third weight sequence; Based on the third weight sequence, weighted summing is performed on the N first sample feature data corresponding to each of the candidate network environments to obtain a candidate network environment feature value corresponding to each of the candidate network environments; Based on multiple candidate network environment feature values, the third weight sequence is adjusted to obtain the first weight sequence, wherein the multiple candidate network environment feature values ​​correspond one-to-one to the multiple candidate network environments.

8. The method for determining network configuration parameters according to any one of claims 1 to 4, characterized in that: The determining, based on the first network environment, the multiple candidate network environments, and the multiple groups of candidate network configuration parameters, a first network configuration parameter corresponding to the first network environment includes: In a case where the first network environment characteristic value does not match the characteristic values ​​of each of the candidate network environments, initializing the network protocol stack based on candidate network configuration parameters corresponding to each of the candidate network environments; Obtaining network quality after initialization using each group of candidate configuration parameters; Determine the candidate network configuration parameter corresponding to the optimal network quality as the first network configuration parameter corresponding to the first network environment; or, Obtaining a difference between the first network environment characteristic value and each of the candidate network environment characteristic values; The candidate network configuration parameters corresponding to the candidate network environment corresponding to the candidate network environment characteristic value with the smallest difference are determined as the first network configuration parameters.

9. The method for determining network configuration parameters according to any one of claims 1 to 4, characterized in that: After determining, based on the first data packet, a first network environment characteristic value corresponding to the network protocol stack to obtain the first network environment in which the network protocol stack is located, the method further includes: When the first network environment characteristic value does not match any of the candidate network environment characteristic values, a prompt message is output, where the prompt message is used to prompt the MCU data to be modified.

10. A device for determining network configuration parameters, characterized in that: include: An acquisition module, used for acquiring a first data packet received by the network protocol stack within a unit time; A determination module, configured to determine, based on the first data packet, a first network environment characteristic value corresponding to the network protocol stack, so as to obtain a first network environment in which the network protocol stack is located, wherein the first network environment characteristic value is used to indicate the first network environment; The acquisition module is further used to acquire multiple groups of candidate network configuration parameters corresponding to multiple candidate network environments, wherein one candidate network environment corresponds to one group of candidate network configuration parameters; The determination module is further configured to determine the first network configuration parameter corresponding to the first network environment based on the first network environment, the multiple candidate network environments, and the multiple groups of candidate network configuration parameters.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for determining the network configuration parameters according to any one of claims 1 to 9 is implemented.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining the network configuration parameters as described in any one of claims 1 to 9 is implemented.

13. A chip comprising a processor and a communication interface, characterized in that: The communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method for determining the network configuration parameters according to any one of claims 1-9.