Multi-device adaptive network distribution method and device, computer device and storage medium
By obtaining network card information in a multi-device environment and selecting appropriate strategies for adaptive distribution networking, the risk of IP address conflict and cross-platform networking problems are solved, and a stable multi-device automatic distribution networking is achieved.
Patent Information
- Application Number
- CN202411805819.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-01-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In a multi-device environment, the existing automatic distribution networking scheme has the risk of IP address conflicts and cannot achieve cross-platform networking.
By obtaining the network card information of each network device to be allocated in a cross-platform environment, selecting the appropriate processing strategy (cellular, wired, WLAN processing strategy) for adaptive distribution network, obtaining the IP address, and redistributing the network when a conflict is detected. Until conflict detection is passed.
It realizes automatic network distribution across multiple devices, avoids IP address conflicts, and ensures network stability and management efficiency.
Smart Images

Figure CN119300063A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network distribution technology, and in particular to a method, apparatus, computer equipment and storage medium for adaptive network distribution of multiple devices. Background Art
[0002] When using a smart device for the first time, the user needs to manually complete the initial network configuration operation of the smart device before the smart device can be connected to the network for use. Moreover, the operation steps are somewhat different for different device platforms. The current automatic network configuration solution is: configure the reference network environment in advance and set the initial parameters; and realize automatic network configuration based on the reference network environment and initial parameters. The disadvantage of this solution is that it is only suitable for the network configuration of a single device; in a multi-device environment, there is a certain risk of conflict in self-organizing networks, and cross-platform networking cannot be achieved.
[0003] There is a certain risk of IP address conflict in self-organizing networks in related technologies, and cross-platform networking cannot be achieved. No effective solution has been proposed yet. Summary of the invention
[0004] In this embodiment, a multi-device adaptive network configuration method, apparatus, computer equipment and storage medium are provided to solve the problems in the related art that there is a certain risk of IP address conflict in self-organizing networks and that cross-platform networking cannot be achieved.
[0005] In a first aspect, a multi-device adaptive network configuration method is provided in this embodiment, including: Obtain the network card information of each device to be configured in a cross-platform environment; Selecting a corresponding processing strategy according to the network card information, performing adaptive network configuration on each of the network devices to be configured, and obtaining an IP address of each of the network devices to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy, and a WLAN processing strategy; Based on the IP address, IP conflict detection is performed on each of the devices to be configured in the cross-platform environment; when an IP conflict is detected, the corresponding device to be configured is re-adaptively configured to obtain a new IP address until the corresponding device to be configured passes the IP conflict detection.
[0006] In some embodiments, a corresponding processing strategy is selected according to the network card information, and adaptive network configuration is performed on each of the devices to be networked to obtain an IP address of each of the devices to be networked, including: Determine the network card type of the to-be-configured device based on the network card information; If the device to be networked is a cellular network card, the selected processing strategy is the cellular processing strategy; based on the cellular processing strategy, the device to be networked is adaptively networked to obtain the IP address of the device to be networked; If the network device to be configured is a wired network card, the selected processing strategy is a wired processing strategy; based on the wired processing strategy, the network device to be configured is adaptively configured to obtain the IP address of the network device to be configured; If the device to be networked is a WLAN network card, the selected processing strategy is the WLAN processing strategy; based on the WLAN processing strategy, the device to be networked is adaptively networked to obtain the IP address of the device to be networked.
[0007] In some embodiments, based on the wired processing strategy, adaptive network configuration is performed on the device to be networked to obtain the IP address of the device to be networked, including: Obtaining a broadcast message of the wired local area network where the network device to be configured is located; Based on the broadcast message, determine the network segment that matches the device to be configured; Determine the IP address of the device to be networked according to the random number and the network segment; Perform network settings on the device to be networked based on the IP address.
[0008] In some of the embodiments, determining a network segment matching the to-be-configured network device based on the broadcast message includes: Select the gateway that appears most frequently in the broadcast message as the target gateway of the device to be configured; Use any network-configured device corresponding to the target gateway as a device in the same network segment as the device to be configured; Determine the network segment that matches the device to be networked according to the IP address and subnet mask of the device in the same network segment.
[0009] In some of the embodiments, determining the IP address of the device to be networked according to the random number and the network segment includes: Generate a random number within the range of the network segment; The random number is used as the last digit of the network segment to obtain the IP address of the device to be networked.
[0010] In some embodiments, based on the WLAN processing strategy, adaptive network configuration is performed on the device to be configured to obtain the IP address of the device to be configured, including: Obtaining the wireless network scanned by the device to be networked in the wireless local area network, and determining whether the device to be networked has an available wireless network; If there is an available wireless network, connect to the corresponding wireless network in order of signal strength from strong to weak, and determine whether the connection is successful; If the connection is successful, the IP address of the device to be networked is obtained, and network settings are performed on the device to be networked based on the IP address; If the wireless network is not available or the connection fails, a wireless network relay request is issued to the network element in the preset area; based on the wireless network relay request, the network element is allowed to create a new wireless network; and at the same time, the device to be networked is allowed to rescan the wireless network.
[0011] In some of the embodiments, based on the cellular processing strategy, adaptive network configuration is performed on the device to be networked to obtain the IP address of the device to be networked, including: Detect whether the communication of the network device to be configured is normal; If the communication of the device to be networked is normal, the corresponding base station allocates an IP address to the device to be networked, and performs network settings on the device to be networked based on the IP address; If the communication of the network device to be configured is abnormal, an alarm message is generated and reported.
[0012] In some of the embodiments, based on the IP address, performing IP conflict detection on each of the to-be-configured network devices in the cross-platform environment includes: For the to-be-configured network device of the cellular network card, performing IP conflict detection on each of the to-be-configured network devices in the cross-platform environment according to the heartbeat mechanism and the IP address; For the to-be-configured network devices of the wired network card and the WLAN network card, IP conflict detection is performed on each of the to-be-configured network devices in the cross-platform environment according to the ARP protocol and the IP address.
[0013] In a second aspect, a multi-device adaptive network configuration device is provided in the present embodiment, including: a network initialization module, a network setting hub module, and an IP conflict detection module; The network initialization module is used to obtain the network card information of each device to be configured in a cross-platform environment; The network setting central module is used to select a corresponding processing strategy according to the network card information, perform adaptive network configuration on each of the devices to be configured, and obtain the IP address of each of the devices to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy, and a WLAN processing strategy; The IP conflict detection module is used to perform IP conflict detection on each of the devices to be configured in the cross-platform environment based on the IP address; when an IP conflict is detected, the corresponding device to be configured is re-adaptively configured to obtain a new IP address until the corresponding device to be configured passes the IP conflict detection.
[0014] In a third aspect, a computer device is provided in this embodiment, 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 multi-device adaptive network configuration method described in the first aspect is implemented.
[0015] In a fourth aspect, in this embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the multi-device adaptive network configuration method described in the first aspect is implemented.
[0016] Compared with the related art, the multi-device adaptive network configuration method, apparatus, computer equipment and storage medium provided in this embodiment obtain the network card information of each device to be configured in a cross-platform environment; select the corresponding processing strategy according to the network card information, perform adaptive network configuration on each device to be configured, and obtain the IP address of each device to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy and a WLAN processing strategy; based on the IP address, perform IP conflict detection on each device to be configured in the cross-platform environment; when an IP conflict is detected, the corresponding device to be configured is adaptively configured again to obtain a new IP address until the corresponding device to be configured passes the IP conflict detection, which solves the problem in the related art that there is a certain risk of IP address conflict in self-organizing networks and that cross-platform networking cannot be achieved, realizes automatic network configuration of multiple devices across platforms, and can avoid the occurrence of IP address conflicts.
[0017] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 It is a hardware structure block diagram of a terminal device of a multi-device adaptive network configuration method provided in an embodiment of the present application; Figure 2 is a flow chart of a multi-device adaptive network configuration method provided by an embodiment of the present application; Figure 3 is a flowchart of step S220; Figure 4 is a flowchart of a multi-device adaptive network configuration method provided by another embodiment of the present application; Figure 5 is a flowchart of step S230; Figure 6 It is a structural block diagram of a multi-device adaptive network distribution device provided in one embodiment of the present application.
[0019] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 210, network initialization module; 220, network setting central module; 230, IP conflict detection module. DETAILED DESCRIPTION
[0020] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0021] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0022] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of a terminal of the multi-device adaptive network configuration method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the multi-device adaptive network configuration method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0025] In this embodiment, a multi-device adaptive network configuration method is provided. Figure 2 is a flow chart of the multi-device adaptive network configuration method of this embodiment. Figure 2 As shown, the process includes the following steps: Step S210, obtaining network card information of each to-be-configured network device in a cross-platform environment; Step S220, selecting a corresponding processing strategy according to the network card information, performing adaptive network configuration on each device to be configured, and obtaining the IP address of each device to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy, and a WLAN processing strategy; Step S230, based on the IP address, perform IP conflict detection on each device to be configured in the cross-platform environment; when an IP conflict is detected, re-adaptively configure the corresponding device to be configured to obtain a new IP address until the corresponding device to be configured passes the IP conflict detection.
[0026] Specifically, the devices to be configured refer to the devices waiting for network configuration. Generally, when the devices are used for the first time in a new network, the initial network configuration (network configuration) operation of the devices needs to be completed before the devices can be connected and used. Among them, the devices to be configured include but are not limited to smart cameras, TV boxes, smart switches, smart speakers, etc. These devices to be configured can be cross-platform environments. For example: smart cameras are connected to base stations via cellular, connected to routers via wired, or connected to wireless points via WLAN. For another example: smart cameras are connected to base stations via cellular, and smart speakers are connected to routers via wired, then smart cameras and smart speakers are devices to be configured in a cross-platform environment. Before network configuration, obtain the network card information of each device to be configured in a cross-platform environment. The network card information includes but is not limited to various network card type information, network configuration information (IP address and subnet mask), etc.
[0027] Wherein, the processing strategy is pre-set, which includes but is not limited to a cellular processing strategy, a wired processing strategy and a WLAN processing strategy. The processing strategy is adaptively selected using the network card information, and adaptive network configuration is performed on each device to be configured based on the selected processing strategy. The process of adaptive network configuration may be: based on the selected processing strategy, network scheduling is completed to obtain network configuration information, and the network configuration information is sent to the device to be configured. The device to be configured is connected to the wireless access point according to the network configuration information for network configuration, thereby realizing adaptive network configuration of each device to be configured in a cross-platform environment. Wherein, the network configuration information includes an IP address. In other embodiments, the processing strategy may also include a joint processing strategy. The joint processing strategy is at least two of the cellular processing strategy, the wired processing strategy and the WLAN processing strategy, which corresponds to solving the adaptive network configuration of the joint network card.
[0028] In this embodiment, IP conflict detection is used to solve the IP address conflict risk existing in the related technology. Specifically, based on the IP address allocated by the adaptive network configuration, IP conflict detection is performed on each network device to be configured in the cross-platform environment to determine whether there is an IP conflict between each network device to be configured in the new network configuration and other devices in the cross-platform environment; if an IP conflict is detected, the corresponding network device to be configured is re-adapted to configure the network to reallocate the IP address and obtain a new IP address until the corresponding network device to be configured passes the IP conflict detection; thereby avoiding the occurrence of IP address conflicts.
[0029] In the related art, the automatic network configuration scheme is: configure the reference network environment in advance and set the initial parameters; realize the automatic network configuration according to the reference network environment and the initial parameters. The disadvantage of this scheme is that it is suitable for the network configuration of a single device; in the environment of multiple devices, there is a certain risk of conflict in the self-organizing network, and it is impossible to realize the network configuration across platforms. In this embodiment, the network card information of each device to be configured in the cross-platform environment is obtained; the corresponding processing strategy is selected according to the network card information, and the network configuration of each device to be configured is adaptively performed to obtain the IP address of each device to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy and a WLAN processing strategy; based on the IP address, the IP conflict detection is performed on each device to be configured in the cross-platform environment; when an IP conflict is detected, the corresponding device to be configured is re-adaptively configured to obtain a new IP address, until the corresponding device to be configured passes the IP conflict detection, which solves the problem that there is a certain risk of IP address conflict in the self-organizing network in the related art, and it is impossible to realize the network configuration across platforms, and realizes the automatic network configuration of multiple devices across platforms, and can avoid the occurrence of IP address conflicts.
[0030] The following is a detailed description of each of the above steps: In some of the embodiments, Figure 3 As shown, the corresponding processing strategy is selected according to the network card information in step S220, and adaptive network configuration is performed on each device to be configured to obtain the IP address of each device to be configured, including the following steps: Step S221, determining the network card type of the device to be networked based on the network card information; Step S222: If the device to be networked is a cellular network card, the selected processing strategy is the cellular processing strategy; based on the cellular processing strategy, the device to be networked is adaptively networked to obtain the IP address of the device to be networked; Step S223: If the network device to be configured is a wired network card, the selected processing strategy is the wired processing strategy; based on the wired processing strategy, the network device to be configured is adaptively configured to obtain the IP address of the network device to be configured; Step S224: If the device to be configured is a WLAN network card, the selected processing strategy is the WLAN processing strategy; based on the WLAN processing strategy, adaptive configuration is performed on the device to be configured to obtain the IP address of the device to be configured.
[0031] Specifically, the network card information contains network card type information, and the network card type information can be used to confirm the network card type of the device to be configured. The device to be configured needs to generate and set the correct IP address before network communication can be carried out. It can be considered that: according to different network card types, different processing strategies are used to dynamically generate and configure the IP address of the network device, realize the unified management and automatic configuration of the IP address of the device in the entire network environment, optimize the allocation of network resources, and improve the efficiency and accuracy of network management.
[0032] For example: if the device to be configured is a cellular network card, the selected processing strategy is the cellular processing strategy; based on the cellular processing strategy, the device to be configured is adaptively configured to obtain the IP address of the device to be configured; if the device to be configured is a wired network card, the selected processing strategy is the wired processing strategy; based on the wired processing strategy, the device to be configured is adaptively configured to obtain the IP address of the device to be configured; if the device to be configured is a WLAN network card, the selected processing strategy is the WLAN processing strategy; based on the WLAN processing strategy, the device to be configured is adaptively configured to obtain the IP address of the device to be configured. In this embodiment, the specific strategies of the cellular processing strategy, the wired processing strategy, and the WLAN processing strategy can be generated using different network card configuration methods, such as: device hotspot configuration, mobile phone hotspot configuration, one-click configuration, etc., and there is no restriction on this.
[0033] Through this embodiment, the network card type of the device to be configured is determined by the network card information, and combined with the corresponding processing strategy to achieve adaptive network configuration compatible with different network cards (including wired network cards, cellular network cards, WLAN network cards, and combined network cards), achieve unified management and automatic configuration of the IP addresses of devices in the entire network environment, optimize the allocation of network resources, and improve the efficiency and accuracy of network management.
[0034] It should be noted that if Figure 4 As shown, for the selection of different strategies, a one-by-one judgment method can be adopted, for example: first determine whether it is a cellular network card based on the network card information; if it is a cellular network card, then based on the wired processing strategy, the network configuration device to be configured is adaptively configured to obtain the IP address of the network configuration device. Otherwise, based on the network card information, determine whether it is a wired network card. If it is a wired network card, then based on the wired processing strategy, the network configuration device to be configured is adaptively configured to obtain the IP address of the network configuration device. Otherwise, it is a WLAN network card, and based on the WLAN processing strategy, the network configuration device to be configured is adaptively configured to obtain the IP address of the network configuration device. The network configuration device to be configured here does not necessarily require a centralized manager in the environment, and the dependency between components is low. It is more tolerant of the number of network configuration devices in a cross-platform environment. To a certain extent, the larger the number of network configuration devices, the more conducive to implementation.
[0035] In some embodiments, in step S223, adaptive network configuration is performed on the device to be configured based on the wired processing strategy to obtain the IP address of the device to be configured, including the following steps: Obtain the broadcast message of the wired LAN where the device to be configured is located; Based on the broadcast message, determine the network segment that matches the device to be configured; Determine the IP address of the device to be configured based on the random number and network segment; Perform network settings for the devices to be configured based on IP addresses.
[0036] Specifically, all devices with wired network cards will form a wired LAN, and these devices will send their own broadcast messages to the wired LAN at regular intervals, including but not limited to LLDP, ARP, DHCP protocols, device information, IP address, default gateway, etc. Among them, the wired processing strategy corresponding to the wired network card is: when the device to be configured is connected, the broadcast message of the wired LAN where the device to be configured is located is obtained by capturing the broadcast of the wired LAN in a specific time window, so as to effectively and quickly capture the broadcast message and reduce omissions. For the captured broadcast message, the network segment matching the device to be configured is calculated using relevant data extraction and comparison algorithms. For example: collect the broadcast messages received by the device to be configured within 2 minutes, parse the broadcast message and save the corresponding network segment. Then, the specific IP address of the device to be configured is calculated by random number and network segment; then the network configuration of the device to be configured can be completed by setting the IP address to the network.
[0037] Through this embodiment, the IP address of the network device is dynamically generated and configured using the wired processing strategy, thereby achieving unified management and automatic configuration of the IP address under the wired network card, optimizing the allocation of network resources, and improving the efficiency and accuracy of network management.
[0038] In some of the embodiments, determining a network segment matching a to-be-configured network device based on a broadcast message includes the following steps: Select the gateway that appears most frequently in the broadcast message as the target gateway of the device to be configured; Use any network-configured device corresponding to the target gateway as a device in the same network segment as the device to be configured; Determine the network segment that matches the device to be configured based on the IP address and subnet mask of the device in the same network segment.
[0039] Specifically, the broadcast message can be parsed to obtain information such as the IP address and default gateway of each configured device in the current wired LAN; the default gateways are sorted by the number of times they appear, and the gateway that appears the most times in the broadcast message is selected as the target gateway for the device to be configured; any configured device corresponding to the target gateway is used as a device in the same network segment as the device to be configured; then, based on the IP address and subnet mask of the device in the same network segment, the network segment that matches the device to be configured is determined.
[0040] Among them, the specific process of determining the network segment that matches the network device to be configured according to the IP address and subnet mask of the device in the same network segment is: based on the range of the subnet mask and the IP address, according to the order from large to small (that is, the bits of the subnet mask and the IP address are reduced according to 255, 254, 252, 248, 240, 224, 192, 128, 0), the network segment is obtained. In other embodiments, binary network byte order can be used to save storage space for data transmission. For example: the IP address and subnet mask of the device in the same network segment are converted from a string to a binary network byte order, set to ipu and masku. Among them, ipu&masku represents the binary representation of the smallest address in the network segment, and ipu | (~masku) represents the binary representation of the largest address in the network segment. As the subnet mask continues to decrease, the possible network segments of the network device to be configured also increase successively. Every time a new network segment is obtained, a new IP address will be obtained again based on the random number and the network segment until an available address is generated.
[0041] Through this embodiment, the gateway that appears most times in the broadcast message is selected as the target gateway of the device to be configured; any configured device corresponding to the target gateway is used as the same network segment device of the device to be configured; the network segment matching the device to be configured is determined according to the IP address and subnet mask of the device in the same network segment, thereby effectively reducing the influence of other network cards on the device to be configured, improving the accuracy of IP address generation, and reducing repeated calculation processes.
[0042] In some of the embodiments, determining the IP address of the device to be networked according to the random number and the network segment includes the following steps: Generate random numbers within the network segment; Use the random number as the last digit of the network segment to obtain the IP address of the device to be configured.
[0043] Specifically, after obtaining the maximum possible network segment of the device to be configured, a random number is generated within the network segment to further improve the accurate selection of the IP address; that is, the random number is generated within the network segment, and the range of the random number is 2 to 254. For example: the maximum possible network segment starts at 192.168.1.0, and the subnet mask is 255.255.255.128. According to this situation, the range of the generated IP address is determined to be 192.168.1.1 to 192.168.1.28 (skipping 192.168.1.1, which is generally the gateway address. If the subnet mask is 255.255.255.0, 192.168.1.255 is also skipped). Subsequently, a random number between 2 and 28 is generated. The random number is used as the last digit of the IP address, and the IP address of the device to be configured is obtained after splicing.
[0044] Through this embodiment, the network device to be configured generates a random address rather than a fixed incremental address within a valid network segment, which can effectively avoid a large number of continuous IP conflicts and network crashes caused by simultaneous access of multiple network devices to be configured.
[0045] In some embodiments, in step S224, adaptive network configuration is performed on the device to be configured based on the WLAN processing strategy to obtain the IP address of the device to be configured, including the following steps: Obtain the wireless network scanned by the device to be configured in the wireless local area network, and determine whether the device to be configured has an available wireless network; If there is an available wireless network, the network connection is performed with the corresponding wireless network in order of signal strength from strong to weak, and it is determined whether the connection is successful; If the connection is successful, the IP address of the device to be configured is obtained, and the network settings of the device to be configured are performed based on the IP address; If there is no available wireless network or the connection fails, a wireless network relay request is sent to the network elements in the preset area; based on the wireless network relay request, the network elements are asked to create a new wireless network; and at the same time, the network-to-be-connected device is asked to rescan the wireless network.
[0046] Specifically, all devices with WLAN network cards will form a wireless local area network, in which there are wireless networks that the current network device to be configured can connect to. The WLAN processing strategy corresponding to the WLAN network card is: when the network device to be configured is connected, collect the wireless networks obtained by the network device to be configured within 2 minutes of scanning the wireless local area network, and save the relevant wireless network information (such as network name, signal strength, bandwidth, etc.).
[0047] Among them, the wireless network scanned by the device to be configured in the wireless local area network is obtained, and it is determined whether the device to be configured has an available wireless network; if the wireless network can be connected, it is considered that there is an available wireless network, and the device to be configured is connected to the corresponding wireless network in order of signal strength from strong to weak, and it is determined whether the connection is successful; if the connection is successful, the IP address of the device to be configured is obtained, and the network settings of the device to be configured are performed based on the IP address. If the connection fails, or there is no wireless network that can be connected in the scanned wireless network, it is considered that the device to be configured is in a weak network environment or a no network environment; at this time, the device to be configured sends a wireless network relay request to the network elements in the preset area (the request range set by the user can be set according to the usage scenario); the wireless network relay request is limited to a certain area. When other network elements in the area receive the wireless network relay request, for the network elements that have successfully connected to the wireless local area network, the network elements are allowed to create a new wireless network through wireless signal broadcasting to achieve the transition of the wireless repeater role. At the same time, the device to be configured is asked to rescan the wireless network. At this time, the device to be configured will reconnect to the newly acquired wireless network in descending order of signal strength until it is successfully connected. If the wireless network relay request is sent for 3 times without creating a new wireless network, an alarm will be issued, indicating that there is no available network or relay service within the current range. This allows timely network relay to be performed in the case of a weak network to enhance network strength.
[0048] It should be noted that when a device is connected to a wireless repeater (a network element that creates a wireless network), the wireless repeater, as the access point (AP) of the WLAN (wireless local area network), will assign a unique IP address to each device to be networked and provide network connection services. In addition, the wireless repeater also has the function of forwarding messages, which can route and transmit messages sent from one device to another in the network. And in this embodiment, all network elements, including network elements that send requests and network elements that receive requests. Sending requests and receiving requests are supporting protocols. After receiving a wireless network relay request, the network element automatically creates a new wireless network by identifying the wireless network relay request internally.
[0049] Through this embodiment, the IP address of the network device is dynamically generated and configured using the WLAN processing strategy, thereby achieving unified management and automatic configuration of the IP address under the WLAN network card, optimizing the allocation of network resources, and improving the efficiency and accuracy of network management.
[0050] In some embodiments, in step S222, adaptive network configuration is performed on the device to be configured based on the cellular processing strategy to obtain the IP address of the device to be configured, including the following steps: Check whether the communication of the equipment to be configured is normal; If the communication of the network device to be configured is normal, the corresponding base station will allocate an IP address to the network device to be configured, and perform network settings on the network device to be configured based on the IP address; If the communication of the network equipment to be configured is abnormal, an alarm message will be generated and reported.
[0051] Specifically, the cellular processing strategy corresponding to the cellular network card is: first detect whether the communication of the device to be configured is normal; that is, it will detect whether there is any arrears and whether the traffic is used normally. If the communication of the device to be configured is abnormal (arrears or the traffic cannot be used normally), the alarm mechanism is triggered, that is, an alarm message is generated and reported to ensure that the user can be notified of the abnormality in time and replace the SIM card. If the communication of the device to be configured is normal, the corresponding base station will assign an IP address to the device to be configured, and the network settings of the device to be configured will be performed based on the IP address.
[0052] Through this embodiment, the IP addresses of network devices are dynamically generated and configured using cellular processing strategies, thereby achieving unified management and automatic configuration of IP addresses under cellular network cards, optimizing the allocation of network resources, and improving the efficiency and accuracy of network management.
[0053] In some of the embodiments, Figure 5 As shown, in step S230, based on the IP address, IP conflict detection is performed on each network device to be configured in the cross-platform environment, including: Step S231, for the network devices to be configured of the cellular network card, perform IP conflict detection on each network device to be configured in a cross-platform environment according to the heartbeat mechanism and the IP address; Step S232: for the network devices to be configured of the wired network card and the WLAN network card, IP conflict detection is performed on each network device to be configured in the cross-platform environment according to the ARP protocol and the IP address.
[0054] Specifically, for the device to be configured with the cellular network card: use the heartbeat mechanism in combination with the IP address to perform IP conflict detection on each device to be configured in a cross-platform environment. For example: send a heartbeat signal to the operator system based on the IP address to verify the activity status and IP address of the device; if the verification passes, the IP conflict detection is completed. In other embodiments, if the device to be configured is a cellular network card, IP conflict detection may not be performed to reduce resource waste. The reason is that the IP address allocation method of the base station is relatively mature, and IP address conflicts rarely occur.
[0055] For the devices to be configured for wired network cards and WLAN network cards: Use the ARP protocol and IP address to perform IP conflict detection on each device to be configured in a cross-platform environment. For example: when filling the ARP message, the target MAC address is set to the broadcast address FF:FF:FF:FF:FF:FF, the target IP address is the address to be detected, and the source MAC address and source IP address are filled with the real MAC address and IP address of the device to be configured currently being detected. After the filling is completed, the ARP message is sent and the timing is started; the ARP messages received by the device to be configured within 5 seconds are collected, and the source IP is extracted and compared with the IP to be detected. If they are the same, it is considered that there is an IP conflict. If there is no identical IP address within 5 seconds, it is considered that there is no IP conflict.
[0056] Through this embodiment, IP address detection is used to improve network stability, avoid loss, leakage and tampering of device data, and improve data integrity and security.
[0057] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0058] In this embodiment, a multi-device adaptive network distribution device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0059] Figure 6 is a structural block diagram of the multi-device adaptive network distribution device of this embodiment, such as Figure 6 As shown, the device includes: a network initialization module 210, a network setting hub module 220, and an IP conflict detection module 230; The network initialization module 210 is used to obtain the network card information of each network device to be configured in a cross-platform environment; The network setting central module 220 is used to select a corresponding processing strategy according to the network card information, perform adaptive network configuration on each device to be configured, and obtain the IP address of each device to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy, and a WLAN processing strategy; The IP conflict detection module 230 is used to perform IP conflict detection on each network device to be configured in a cross-platform environment based on the IP address; when an IP conflict is detected, the corresponding network device to be configured is re-adaptively configured to obtain a new IP address until the corresponding network device to be configured passes the IP conflict detection.
[0060] Through the above-mentioned device, the problem that self-organizing networks have a certain risk of IP address conflicts and cannot achieve cross-platform networking in related technologies is solved, automatic networking of multiple devices across platforms is achieved, and the occurrence of IP address conflicts can be avoided.
[0061] In some of the embodiments, the network setting hub module 220 is further used to determine the network card type of the device to be networked based on the network card information; If the device to be configured is a cellular network card, the selected processing strategy is the cellular processing strategy; based on the cellular processing strategy, the device to be configured is adaptively configured to obtain the IP address of the device to be configured; If the device to be configured is a wired network card, the selected processing strategy is the wired processing strategy; based on the wired processing strategy, the device to be configured is adaptively configured to obtain the IP address of the device to be configured; If the device to be configured is a WLAN network card, the selected processing strategy is the WLAN processing strategy; based on the WLAN processing strategy, adaptive network configuration is performed on the device to be configured to obtain the IP address of the device to be configured.
[0062] In some of the embodiments, the network setting hub module 220 is also used to obtain broadcast messages of the wired local area network where the device to be configured is located; Based on the broadcast message, determine the network segment that matches the device to be configured; Determine the IP address of the device to be configured based on the random number and network segment; Perform network settings for the devices to be configured based on IP addresses.
[0063] In some of the embodiments, the network setting hub module 220 is further used to select the gateway that appears most times in the broadcast message as the target gateway of the device to be configured; Use any network-configured device corresponding to the target gateway as a device in the same network segment as the device to be configured; Determine the network segment that matches the device to be configured based on the IP address and subnet mask of the device in the same network segment.
[0064] In some of the embodiments, the network configuration hub module 220 is further configured to generate a random number within the range of the network segment; Use the random number as the last digit of the network segment to obtain the IP address of the device to be configured.
[0065] In some of the embodiments, the network setting hub module 220 is also used to obtain the wireless network scanned by the device to be configured in the wireless local area network, and determine whether the device to be configured has an available wireless network; If there is an available wireless network, the network connection is performed with the corresponding wireless network in order of signal strength from strong to weak, and it is determined whether the connection is successful; If the connection is successful, the IP address of the device to be configured is obtained, and the network settings of the device to be configured are performed based on the IP address; If there is no available wireless network or the connection fails, a wireless network relay request is sent to the network elements in the preset area; based on the wireless network relay request, the network elements are asked to create a new wireless network; and at the same time, the network-to-be-connected device is asked to rescan the wireless network.
[0066] In some of the embodiments, the network setting hub module 220 is also used to detect whether the communication of the device to be networked is normal; If the communication of the network device to be configured is normal, the corresponding base station will allocate an IP address to the network device to be configured, and perform network settings on the network device to be configured based on the IP address; If the communication of the network equipment to be configured is abnormal, an alarm message will be generated and reported.
[0067] In some of the embodiments, the IP conflict detection module 230 is also used to perform IP conflict detection on each network device to be configured in a cross-platform environment according to the heartbeat mechanism and the IP address of the network device to be configured of the cellular network card; For the devices to be configured for the wired network card and the WLAN network card, IP conflict detection is performed on each device to be configured in the cross-platform environment according to the ARP protocol and IP address.
[0068] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0069] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0070] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0071] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: S1, obtaining the network card information of each network device to be configured in a cross-platform environment; S2, selecting a corresponding processing strategy according to the network card information, performing adaptive network configuration on each device to be configured, and obtaining the IP address of each device to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy, and a WLAN processing strategy; S3, based on the IP address, perform IP conflict detection on each device to be configured in the cross-platform environment; when an IP conflict is detected, re-adaptively configure the corresponding device to be configured to obtain a new IP address until the corresponding device to be configured passes the IP conflict detection.
[0072] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0073] In addition, in combination with the multi-device adaptive network configuration method provided in the above embodiment, a storage medium can also be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any multi-device adaptive network configuration method in the above embodiment is implemented.
[0074] It should be noted that the information and data involved in this application are all authorized by the user or fully authorized by all parties and will be used legally.
[0075] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0076] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0077] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0078] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A multi-device adaptive network configuration method, characterized in that: include: Obtain the network card information of each device to be configured in a cross-platform environment; Selecting a corresponding processing strategy according to the network card information, performing adaptive network configuration on each of the network devices to be configured, and obtaining an IP address of each of the network devices to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy, and a WLAN processing strategy; Based on the IP address, performing IP conflict detection on each of the network devices to be configured in the cross-platform environment; When an IP conflict is detected, the corresponding device to be networked is re-adaptively configured to obtain a new IP address until the corresponding device to be networked passes the IP conflict detection.
2. The multi-device adaptive network configuration method according to claim 1, characterized in that: Selecting a corresponding processing strategy according to the network card information, performing adaptive network configuration on each of the devices to be configured, and obtaining an IP address of each of the devices to be configured, including: Determine the network card type of the to-be-configured device based on the network card information; If the device to be networked is a cellular network card, the selected processing strategy is the cellular processing strategy; based on the cellular processing strategy, the device to be networked is adaptively networked to obtain the IP address of the device to be networked; If the network device to be configured is a wired network card, the selected processing strategy is a wired processing strategy; based on the wired processing strategy, the network device to be configured is adaptively configured to obtain the IP address of the network device to be configured; If the device to be networked is a WLAN network card, the selected processing strategy is the WLAN processing strategy; based on the WLAN processing strategy, the device to be networked is adaptively networked to obtain the IP address of the device to be networked.
3. The multi-device adaptive network configuration method according to claim 2, characterized in that: Based on the wired processing strategy, adaptive network configuration is performed on the device to be configured to obtain the IP address of the device to be configured, including: Obtaining a broadcast message of the wired local area network where the network device to be configured is located; Based on the broadcast message, determine the network segment that matches the device to be configured; Determine the IP address of the device to be networked according to the random number and the network segment; Perform network settings on the device to be networked based on the IP address.
4. The multi-device adaptive network configuration method according to claim 3, characterized in that: Determining a network segment matching the to-be-configured network device based on the broadcast message includes: Select the gateway that appears most frequently in the broadcast message as the target gateway of the device to be configured; Use any network-configured device corresponding to the target gateway as a device in the same network segment as the device to be configured; Determine the network segment that matches the device to be networked according to the IP address and subnet mask of the device in the same network segment.
5. The multi-device adaptive network configuration method according to claim 3, characterized in that: Determining the IP address of the device to be networked according to the random number and the network segment includes: Generate a random number within the range of the network segment; The random number is used as the last digit of the network segment to obtain the IP address of the device to be networked.
6. The multi-device adaptive network configuration method according to claim 2, characterized in that: Based on the WLAN processing strategy, adaptive network configuration is performed on the device to be configured to obtain the IP address of the device to be configured, including: Obtaining the wireless network scanned by the device to be networked in the wireless local area network, and determining whether the device to be networked has an available wireless network; If there is an available wireless network, connect to the corresponding wireless network in order of signal strength from strong to weak, and determine whether the connection is successful; If the connection is successful, the IP address of the device to be networked is obtained, and network settings are performed on the device to be networked based on the IP address; If the wireless network is not available or the connection fails, a wireless network relay request is issued to the network element in the preset area; based on the wireless network relay request, the network element is allowed to create a new wireless network; and at the same time, the device to be networked is allowed to rescan the wireless network.
7. The multi-device adaptive network configuration method according to claim 2, characterized in that: Based on the cellular processing strategy, adaptively configuring the device to be configured to obtain the IP address of the device to be configured, including: Detect whether the communication of the network device to be configured is normal; If the communication of the device to be networked is normal, the corresponding base station allocates an IP address to the device to be networked, and performs network settings on the device to be networked based on the IP address; If the communication of the network device to be configured is abnormal, an alarm message is generated and reported.
8. The multi-device adaptive network configuration method according to claim 1, characterized in that: Based on the IP address, performing IP conflict detection on each of the network devices to be configured in the cross-platform environment includes: For the to-be-configured network device of the cellular network card, performing IP conflict detection on each to-be-configured network device in the cross-platform environment according to the heartbeat mechanism and the IP address; For the to-be-configured network devices of the wired network card and the WLAN network card, IP conflict detection is performed on each of the to-be-configured network devices in the cross-platform environment according to the ARP protocol and the IP address.
9. A multi-device adaptive network distribution device, characterized in that: include: Network initialization module, network setting hub module, IP conflict detection module; The network initialization module is used to obtain the network card information of each device to be configured in a cross-platform environment; The network setting central module is used to select a corresponding processing strategy according to the network card information, perform adaptive network configuration on each of the devices to be configured, and obtain the IP address of each of the devices to be configured; the processing strategy includes a cellular processing strategy, a wired processing strategy, and a WLAN processing strategy; The IP conflict detection module is used to perform IP conflict detection on each of the devices to be configured in the cross-platform environment based on the IP address; when an IP conflict is detected, the corresponding device to be configured is re-adaptively configured to obtain a new IP address until the corresponding device to be configured passes the IP conflict detection.
10. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps of the multi-device adaptive network configuration method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Train monitoring system based on WDS
CN103686089A
Address conflict detection method and device
CN105939403A
Method and device for configuring IP address
CN114513492A
Multi-network card management method and device, intelligent gateway and storage medium
CN117201296A
Method and device for detecting network address conflict
CN118200290A
Cited By
High-density small local area network multi-access cooperation rapid network distribution method and system
CN121842729A