Communication connection method and device, electronic equipment and storage medium

By parsing communication commands to establish virtual network device connections, the communication difficulties between cloud computing platforms and IoT simulation platforms are resolved, the simulation capabilities of the test range are improved, and the compatibility and management of IoT devices are realized.

CN121284050APending Publication Date: 2026-01-06BEIJING HONGTENG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410876874.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

Cloud computing platforms cannot be directly integrated with IoT simulation platforms, resulting in communication difficulties and incompatibility with IoT device simulation technologies.

Method used

By acquiring communication commands between the IoT firmware simulation platform and the cloud computing platform, parsing the virtual network device identifier and device connection relationship, establishing the connection of the virtual network device, and realizing communication between the IoT firmware simulation platform and the cloud computing platform.

Benefits of technology

It enhances the simulation capabilities of the target range in the cloud computing platform, is compatible with the simulation technology of IoT devices, and enables virtual machines to call and manage IoT device images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121284050A_ABST
    Figure CN121284050A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a communication connection method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a communication instruction of an Internet of Things firmware simulation platform and a cloud computing platform, analyzing the communication instruction to obtain a virtual network equipment identifier and an equipment connection relation, and according to the equipment connection relation, obtaining a virtual network equipment identifier; and connecting the virtual network equipment corresponding to each virtual network equipment identifier with an Internet of Things firmware simulation platform and a cloud computing platform, so that the Internet of Things firmware simulation platform is connected with the cloud computing platform based on the virtual network equipment. Through configuration of a communication instruction, an Internet of Things firmware simulation platform and a cloud computing platform in the same device can be connected with a virtual network device according to a virtual network device identifier and a device connection relationship analyzed in the communication instruction. The virtual machine in the cloud computing platform calls and manages the mirror image of the Internet of Things equipment in the Internet of Things firmware simulation platform, and the simulation capability of the target range is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and in particular to communication connection methods, devices, electronic devices and storage media. Background Technology

[0002] With the continuous development of cloud computing technology, target range technology has become an indispensable part of scientific research, training, teaching, and attack-defense drills. Traditional target range construction methods use a cloud computing platform as a foundation to build various target images. These images then utilize the various virtualization technologies supported by the cloud computing platform to construct virtual machine targets, creating a Software-Defined Networking (SDN) replica range environment. Target images are pre-prepared virtual machine images containing specific operating systems, applications, vulnerabilities, or configurations, intended for deployment and operation in the target range for attack or defense. Virtual machine targets are virtual machine instances created in a virtualization environment using the prepared target images, simulating hosts, servers, or network devices in a real-world network environment. These virtual machine targets can include attack targets, attacked objects, and security defense devices, participating in attack and defense drills and experiments.

[0003] With the increasing demand for IoT device simulation, many IoT device images are created on IoT firmware simulation platforms. These IoT device images need to be driven using IoT-specific parameters, but cloud computing platforms cannot communicate with IoT simulation platforms, which prevents the two platforms from being directly integrated and used. Summary of the Invention

[0004] The main objective of this application is to provide a communication connection method, apparatus, electronic device, and storage medium, aiming to achieve communication connection between an IoT firmware simulation platform and a cloud computing platform. The technical solution is as follows:

[0005] In a first aspect, embodiments of this application provide a communication connection method, including:

[0006] Obtain communication commands between the IoT firmware simulation platform and the cloud computing platform;

[0007] The communication instructions are parsed to obtain the virtual network device identifier and the device connection relationship, wherein there are at least two virtual network device identifiers;

[0008] According to the device connection relationship, the virtual network devices corresponding to each of the virtual network device identifiers are connected to the IoT firmware simulation platform and the cloud computing platform, so that the IoT firmware simulation platform and the cloud computing platform are connected based on the virtual network devices.

[0009] Secondly, embodiments of this application provide a communication connection device, including:

[0010] The instruction acquisition module is used to acquire communication instructions between the IoT firmware simulation platform and the cloud computing platform.

[0011] A parsing module is used to parse the communication instructions to obtain the virtual network device identifier and the device connection relationship, wherein the virtual network device identifier is at least two;

[0012] The connection module is used to connect the virtual network devices corresponding to each of the virtual network device identifiers to the IoT firmware simulation platform and the cloud computing platform according to the device connection relationship, so that the IoT firmware simulation platform and the cloud computing platform are connected based on the virtual network devices.

[0013] Thirdly, embodiments of this application provide an electronic device, the electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described above.

[0014] Fourthly, embodiments of this application provide a storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described above.

[0015] In this embodiment, communication instructions between the IoT firmware simulation platform and the cloud computing platform are obtained and parsed to obtain virtual network device identifiers and device connection relationships. Based on these connections, the virtual network devices corresponding to each virtual network device identifier are connected to both the IoT firmware simulation platform and the cloud computing platform, enabling them to connect. By configuring communication instructions, the IoT firmware simulation platform and the cloud computing platform within the same device can connect to the virtual network devices based on the virtual network device identifiers and device connection relationships parsed from the communication instructions. Adding virtual network devices between the IoT firmware simulation platform and the cloud computing platform establishes a communication link, allowing the test range within the cloud computing platform to be compatible with IoT simulation technology. This enables the virtual machine in the cloud computing platform to call and manage the IoT device images in the IoT firmware simulation platform, thereby enhancing the simulation capabilities of the test range. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a system architecture diagram of a communication connection method provided in an embodiment of this application;

[0018] Figure 2 This is a flowchart illustrating a communication connection method provided in an embodiment of this application;

[0019] Figure 3 This is a flowchart illustrating a communication connection method provided in an embodiment of this application;

[0020] Figure 4 This is a flowchart illustrating a communication connection method provided in an embodiment of this application;

[0021] Figure 5 This is a system architecture diagram of a communication connection method provided in an embodiment of this application;

[0022] Figure 6 This is a general flowchart of a communication connection method provided in an embodiment of this application;

[0023] Figure 7 This is a schematic diagram of the structure of a communication connection device provided in an embodiment of this application;

[0024] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0026] In the description of this specification, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In the description of this specification, it should be noted that, unless otherwise expressly specified and limited, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. Those skilled in the art can understand the specific meaning of the above terms in this specification based on the specific circumstances. Furthermore, in the description of this specification, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0027] The communication connection device can be a terminal device such as a mobile phone, computer, tablet, smartwatch, or vehicle-mounted device, or it can be a module in the terminal device used to implement the communication connection method. The communication connection device can obtain the communication instructions between the IoT firmware simulation platform and the cloud computing platform, parse the communication instructions to obtain the virtual network device identifier and the device connection relationship. There are at least two virtual network devices. According to the device connection relationship, the virtual network devices corresponding to each virtual network device identifier are connected to the IoT firmware simulation platform and the cloud computing platform, so that the IoT firmware simulation platform and the cloud computing platform are connected based on the virtual network devices.

[0028] Please see also Figure 1 The diagram below illustrates a system architecture for a communication connection method as provided in this application. Figure 1 As shown, the system architecture includes an IoT firmware simulation platform 101, a virtual network device 102, and a cloud computing platform 103. The IoT firmware simulation platform 101, the virtual network device 102, and the cloud computing platform 103 are all built on the same device. When it is necessary to connect the IoT firmware simulation platform 101 and the cloud computing platform 103, the communication instructions between the IoT firmware simulation platform 101 and the cloud computing platform 103 are obtained and parsed to obtain the virtual network device identifier and the device connection relationship. According to the device connection relationship, the virtual network device 102 corresponding to each virtual network device identifier is connected to the IoT firmware simulation platform 101 and the cloud computing platform 103 respectively, so that the IoT firmware simulation platform 101 and the cloud computing platform 103 can communicate based on the virtual network device 102.

[0029] The communication connection method provided in this specification will be described in detail below with reference to specific embodiments.

[0030] Please see Figure 2 This is a flowchart illustrating a communication connection method provided in an embodiment of this application. Figure 2 As shown, the method described in this application embodiment may include the following steps S101-S103.

[0031] S101, Obtain communication instructions between the IoT firmware simulation platform and the cloud computing platform;

[0032] In one embodiment, communication commands can be obtained based on a pre-configured communication connection script. It is understood that a communication connection script for implementing communication between the IoT firmware emulation platform and the cloud computing platform can be pre-configured in the system, and communication commands can be obtained based on this script. For example, the cloud computing platform can be an open-source cloud computing platform, such as OpenStack.

[0033] Understandably, IoT firmware emulation platforms can utilize different virtual machine architectures to generate images of IoT devices, such as cameras, routers, and AI speakers. However, cloud computing platforms, acting as the testing ground, can only support one version of virtual machine software for a specific architecture. Therefore, it's possible to pre-install multiple versions and architectures of virtual machine emulators (virtual machine software) on the cloud computing platform. For example, many IoT device emulations require embedded architecture QEMU versions, such as qemu-system-mips and qemu-system-arm. Taking OpenStack as an example, the commonly installed QEMU version is qemu-system-x86. Therefore, multiple versions and architectures of QEMU virtual machine emulators can be installed on OpenStack compute nodes, allowing the IoT firmware emulation platform to specify a particular version and architecture of QEMU to launch the IoT device image. For example, in OpenStack, a multi-architecture virtual machine emulator can be installed using the following code: #qemu-system-arm-enable-kvm-name"vm1"-m 256-smp 1-drive file= / root / cirros-0.3.5-arm-disk.img,media=disk,if=virtio-net nic-net tap,ifname=tap-devicename,script=no,downscript=no-vnc0.0.0.0:99.

[0034] S102, parse the communication command to obtain the virtual network device identifier and device connection relationship;

[0035] In one embodiment, communication commands are parsed to obtain virtual network device identifiers and device connection relationships. There are at least two virtual network device identifiers. Device connection relationships can include connections between virtual network devices, connections between virtual network devices and an IoT firmware emulation platform, and connections between virtual network devices and a cloud computing platform. The virtual network device identifier is a unique identifier for the virtual network device, such as its name. In one feasible implementation, the virtual network device identifiers can include a first virtual device identifier, a second virtual device identifier, a third virtual device identifier, and a fourth virtual device identifier. Virtual network devices can include virtual network interface card (NIC) pairs, a third virtual NIC corresponding to the third virtual device identifier, and a virtual bridge corresponding to the fourth virtual device identifier. The virtual NIC pairs include a first virtual NIC corresponding to the first virtual device identifier and a second virtual NIC corresponding to the second virtual device identifier. In one feasible implementation, the device connection relationships include a first connection relationship, a second connection relationship, and a third connection relationship. Within each virtual NIC pair, there is a first connection relationship between the first virtual NIC and a virtual switch, a second connection relationship between the third virtual NIC and a virtual bridge, and a third connection relationship between the virtual bridge and the second virtual NIC.

[0036] S103, according to the device connection relationship, connect the virtual network devices corresponding to each virtual network device identifier to the IoT firmware simulation platform and the cloud computing platform, so that the IoT firmware simulation platform and the cloud computing platform are connected based on the virtual network devices;

[0037] In one embodiment, after obtaining the virtual network device identifier and device connection relationship, the virtual network devices corresponding to each virtual network device identifier are connected to the IoT firmware emulation platform and the cloud computing platform according to the device connection relationship. In a feasible implementation, the first virtual network card corresponding to the first virtual device identifier and the virtual switch are connected according to the first connection relationship. The second port identifier of the switch port of the virtual switch is obtained. Based on the second port identifier, the first port identifier of the virtual machine is obtained. The third port identifier corresponding to the first port identifier is obtained. The port of the IoT firmware emulation platform is set as the third port corresponding to the third port identifier. According to the second connection relationship, the third virtual network card corresponding to the third virtual device identifier is connected to one end of the virtual bridge corresponding to the fourth virtual device identifier. According to the third connection relationship, the second virtual network card corresponding to the second virtual device identifier is connected to the other end of the virtual bridge.

[0038] In this embodiment, communication instructions between the IoT firmware simulation platform and the cloud computing platform are obtained and parsed to obtain virtual network device identifiers and device connection relationships. Based on these connections, the virtual network devices corresponding to each virtual network device identifier are connected to both the IoT firmware simulation platform and the cloud computing platform, enabling them to connect. By configuring communication instructions, the IoT firmware simulation platform and the cloud computing platform within the same device can connect to the virtual network devices based on the virtual network device identifiers and device connection relationships parsed from the communication instructions. Adding virtual network devices between the IoT firmware simulation platform and the cloud computing platform establishes a communication link, allowing the test range within the cloud computing platform to be compatible with IoT simulation technology. This enables the virtual machine in the cloud computing platform to call and manage the IoT device images in the IoT firmware simulation platform, thereby enhancing the simulation capabilities of the test range.

[0039] Please see Figure 3 This is a flowchart illustrating a communication connection method provided in an embodiment of this application. Figure 3 As shown, the method described in this application embodiment may include the following steps S201-S206.

[0040] S201, Create a virtual network interface card (NIC) pair connected to the cloud computing platform, wherein the virtual NIC pair includes a first virtual NIC and a second virtual NIC connected to each other;

[0041] In one embodiment, a virtual network interface card (NIC) pair can be created before establishing a communication connection. A virtual NIC pair refers to a pair of virtual network interfaces, one end of which is connected to one network namespace and the other end to another network namespace, enabling communication between different network namespaces. Specifically, the virtual NIC pair includes a first virtual NIC and a second virtual NIC. For example, a virtual NIC pair (virtual veth peer bridge pair) can be created using the following code:

[0042] #ip link add qvb-devicename type veth peer name qvo-devicename

[0043] #ip link set qvb-devicename up

[0044] #ip link set qvb-devicename promisc on

[0045] #ip link set dev qvb-devicename mtu 1500

[0046] #ip link set qvo-devicename up

[0047] #ip link set qvo-devicename promisc on

[0048] #ip link set qvo-devicename mtu 1500

[0049] Note: `qvb-devicename` is a virtual network interface name starting with `qvb`, such as `qvb12345678-ab`. This network interface needs to be bridged to the Linux bridge for direct communication with the `tap` network interface. `qvo-devicename` is a virtual network interface name starting with `qvo`, such as `qvo12345678-ab`.

[0050] In one feasible implementation, the cloud computing platform includes virtual machines and virtual switches, and may further include:

[0051] S2011, Obtain the first port identifier of the target port of the virtual machine;

[0052] In one embodiment, the cloud computing platform includes virtual machines and virtual switches. Before creating a pair of virtual network interface cards (NICs) connected to the cloud computing platform, the first port identifier of the target port of the virtual machine can be obtained first, and the virtual machine and the virtual switch can be connected. Specifically, after starting the virtual machine in the cloud computing platform, the virtual machine can be connected to the virtual switch (OVS). The first port identifier of the target port currently allocated to the virtual machine is obtained. Each virtual machine's network port and OVS bridge port should have a unique identifier. The target port can be any randomly selected free port of the virtual machine. The first port identifier of the target port is obtained to confirm the corresponding port in the virtual switch. Taking OpenStack as an example, when a port is created in OpenStack, the OpenStack Neutron service communicates with OVS to associate the port with a specific virtual switch (such as an OVS bridge) and configures the corresponding OVS port to realize the network connection of the virtual machine or container. The first port identifier can be a tag.

[0053] S2012, confirm the second port identifier of the virtual switch that corresponds to the first port identifier, and connect the switch port corresponding to the second port identifier to the target port;

[0054] Specifically, the second port identifier in the virtual switch corresponding to the first port identifier is determined based on the first port identifier. For example, if the first port identifier is tag=8, the second port identifier can also be tag=8. The switch port with tag=8 is obtained and connected to the target port to realize communication between the virtual machine and the virtual switch.

[0055] In one feasible implementation, creating a virtual network interface card (NIC) pair connected to the cloud computing platform may include:

[0056] S2013, Create a virtual network interface card pair connected to the virtual switch;

[0057] Specifically, when both are on a virtual switch, a pair of virtual network interface cards (NICs) connected to the virtual switch is created. Specifically, the pair of virtual NICs may include a first virtual NIC and a second virtual NIC.

[0058] S2014, confirm the first connection relationship between the first virtual network card and the virtual switch in the virtual network card pair.

[0059] Specifically, the first virtual network interface card (NIC) in the virtual NIC pair needs to be connected to the virtual switch, so the connection relationship between the two is confirmed in advance to obtain the first connection relationship. This first connection relationship can be used to indicate how to connect each virtual network device.

[0060] S202, allocate the first virtual device identifier of the first virtual network card and the second virtual device identifier of the second virtual network card;

[0061] In one embodiment, after creating a virtual network interface card pair, a corresponding first virtual device identifier is assigned to the first virtual network interface card, and a second virtual device identifier is assigned to the second virtual network interface card.

[0062] S203, Create a third virtual network interface card and a virtual bridge connected to the IoT firmware emulation platform;

[0063] In one embodiment, a third virtual network interface card (NIC) and a virtual bridge connected to the IoT firmware emulation platform can be pre-created. The purpose of adding the third virtual NIC is to provide a virtual NIC for the IoT firmware emulation platform, and the purpose of adding the virtual bridge is to provide a "network cable" for the IoT firmware emulation platform to connect to. For example, the third virtual NIC can be a tap device, which is a network interface virtualized by the Linux kernel. The virtual bridge can be a Linux bridge, which is a network bridging tool implemented on the Linux operating system. It can connect multiple network interfaces, virtualize them as a single logical interface, and forward data packets at the network layer.

[0064] Taking the third virtual network interface card (NIC) as a tap device as an example, a tap virtual NIC can be created using the following code:

[0065] #ip tuntap add dev tap-devicename mode tap

[0066] #ip link set tap-devicename up

[0067] Note: tap-devicename is the name of the tap virtual network interface, such as tap12345678-ab. This network interface will need to be bridged to the Linux bridge later.

[0068] Taking a virtual network interface card (NIC) as a Linux bridge as an example, a Linux bridge can be created using the following code:

[0069] #brctl addbr qbr-devicename

[0070] #brctl setfd qbr-devicename 0

[0071] #brctl stp qbr-devicename off

[0072] Note: qbr-devicename is the Linux bridge name, such as qbr12345678-ab.

[0073] S204, Assign the third virtual device identifier of the third virtual network card and the fourth virtual device identifier of the virtual bridge;

[0074] In one embodiment, a corresponding third virtual device identifier is assigned to the third virtual network card created above, and a corresponding fourth virtual device identifier is assigned to the virtual bridge, so that each virtual network device can be directly and quickly invoked and connected in the future.

[0075] S205, confirm the second connection relationship between the third virtual network card and the virtual bridge;

[0076] In one embodiment, since the third virtual network interface card (NIC) needs to connect to the virtual bridge, a second connection relationship is generated between them. This second connection relationship indicates that the third virtual NIC is connected to the virtual bridge. It is understood that the second connection relationship can record the connection between the third virtual NIC and the virtual bridge, or it can record the connection between the third virtual device identifier of the third virtual NIC and the fourth virtual device identifier of the virtual bridge. Similarly, the first and third connection relationships can also be recorded based on their corresponding virtual device identifiers.

[0077] S206, confirm the third connection relationship between the virtual bridge and the second virtual network card.

[0078] In one embodiment, in order to enable communication, the other end of the virtual bridge needs to be connected to the second virtual network card in the virtual network card pair, thus creating a corresponding third connection relationship.

[0079] In this embodiment, by pre-creating virtual network interface card (NIC) pairs connected to the cloud computing platform, assigning a first virtual device identifier to the first virtual NIC and a second virtual device identifier to the second virtual NIC, creating a third virtual NIC and a virtual bridge connected to the IoT firmware emulation platform, assigning a third virtual device identifier to the third virtual NIC and a fourth virtual device identifier to the virtual bridge, and confirming the second connection relationship between the third virtual NIC and the virtual bridge, as well as the third connection relationship between the virtual bridge and the second virtual NIC, the virtual network device identifiers required for connecting the IoT firmware emulation platform and the cloud computing platform, as well as the device connection relationships between each virtual network device, can be obtained. Based on the virtual network device identifiers and device connection relationships, corresponding communication commands can be generated, facilitating the direct invocation of the created virtual network devices and the connection of the virtual network devices with the IoT firmware emulation platform and the cloud computing platform according to the device connection relationships, thereby achieving communication.

[0080] Please see Figure 4 This is a flowchart illustrating a communication connection method provided in an embodiment of this application. Figure 4 As shown, the method described in this application embodiment may include the following steps S301-S309.

[0081] S301, Connect the first virtual network card corresponding to the first virtual device identifier and the virtual switch according to the first connection relationship;

[0082] In one embodiment, the device connection relationships include a first connection relationship, a second connection relationship, and a third connection relationship. The virtual network device identifiers include a first virtual device identifier, a second virtual device identifier, a third virtual device identifier, and a fourth virtual device identifier. In a feasible implementation, when connecting the virtual network devices corresponding to each virtual network device identifier to the IoT firmware emulation platform and the cloud computing platform according to the device connection relationships, the first virtual network interface card and the virtual switch corresponding to the first virtual device identifier can be connected first according to the first connection relationship.

[0083] Taking the first virtual network interface card (NIC) as an example, the following code can be used to add the NIC to the virtual switch (ovs) port:

[0084] #ovs-vsctl----if-exists del-port br-int qvo-devicename

[0085] #ovs-vsctl--may-exist add-port br-int qvo-devicename.

[0086] S302, Obtain the second port identifier of the switch port of the virtual switch, and obtain the first port identifier of the virtual machine based on the second port identifier;

[0087] In one embodiment, if the virtual switch is connected to a virtual machine in a cloud computing platform, the first port identifier of the virtual machine can be obtained based on the second port identifier of the switch port of the virtual switch.

[0088] For example, the tag of the port in the virtual switch that communicates with the cloud computing platform (OpenStack) can be obtained by using the code ovs-vsctl list port dest-porth, and used as a second port identifier.

[0089] S303, obtain the third port identifier corresponding to the first port identifier, and set the port of the IoT firmware simulation platform to the third port corresponding to the third port identifier;

[0090] In one embodiment, after confirming the port used by the cloud computing platform, the port of the IoT firmware emulation platform can also be set to the corresponding port. For example, if the first port is identified as tag=8, then the third port identified as tag=8 is also selected in the IoT firmware emulation platform. Once the virtual machine port and the port set by the IoT firmware emulation platform correspond, communication can be achieved based on the virtual network device connected in the middle.

[0091] S304, according to the second connection relationship, connect the third virtual network card corresponding to the third virtual device identifier to one end of the virtual bridge corresponding to the fourth virtual device identifier;

[0092] In one embodiment, the virtual bridge is connected to a third virtual network interface card (NIC) and a second virtual NIC at its two ends, respectively. According to the second connection relationship, the third virtual NIC corresponding to the third virtual device identifier is connected to one end of the virtual bridge corresponding to the fourth virtual device identifier.

[0093] For example, taking the Linux bridge as the virtual bridge and the tap virtual network card as the third virtual network card, the tap virtual network card can be added to the Linux bridge using the following code: #brctl addif qbr-devicename tap-devicename.

[0094] S305, connect the second virtual network card corresponding to the second virtual device identifier to the other end of the virtual bridge according to the third connection relationship.

[0095] In one embodiment, based on the obtained third connection relationship, the second virtual network card corresponding to the second virtual device identifier is then connected to the other end of the virtual bridge.

[0096] For example, taking the Linux bridge as the virtual bridge and the qvb virtual network card as the second virtual network card, the qvb virtual network card can be added to the Linux bridge using the following code: #brctl addif qbr-devicename tap-devicename.

[0097] S306, Obtain the first Internet Protocol address of the cloud computing platform;

[0098] In one embodiment, after the virtual network device connection is completed, the IoT device firmware image file can be started using the QEMU of the IoT firmware emulation platform. An example code is as follows:

[0099] #qemu-system-arm-enable-kvm-name"vm1"-m 256-smp 1-drive file= / root / cirros-0.3.5-arm-disk.img,media=disk,if=virtio-net nic-net tap,ifname=tap-devicename,script=no,downscript=no-vnc 0.0.0.0:99.

[0100] Understandably, after starting the IoT device image, the first Internet Protocol address (IP address) of the cloud computing platform can be obtained. Taking OpenStack as an example, the first Internet Protocol address can be the IP address of the OpenStack virtual host.

[0101] S307, Set the Internet Protocol address of the IoT firmware emulation platform to a second Internet Protocol address with the same subnet mask as the first Internet Protocol address;

[0102] Specifically, the Internet Protocol (IP) address of the IoT firmware emulation platform is set to an address on the same network segment as the cloud computing platform. This means that the subnet mask of the cloud computing platform can be determined based on its first IP address, and the subnet mask of the IoT firmware emulation platform's IP address is set to be the same as that of the cloud computing platform, thus obtaining a second IP address. This enables communication with the cloud computing platform within the same network segment. For example, a Virtual Network Console (VNC) can be used to enter the started IoT device system, and `ifconfig` can be used to configure the corresponding IP address to be on the same network segment as the OpenStack virtual host IP address, such as: `#ifconfig eth0 10.10.10.201 netmask 255.255.255.0`.

[0103] S308, Based on the connection command, control the IoT firmware simulation platform to send a connection request to the cloud computing platform;

[0104] Specifically, after configuring the IP address, a connectivity test can be performed between the IoT firmware simulation platform and the cloud computing platform using a connectivity command. That is, by running a connectivity command, the IoT firmware simulation platform can be controlled to send a connectivity request to the cloud computing platform. Optionally, the cloud computing platform can also send a connectivity request to the IoT firmware simulation platform. For example, the connectivity request can be a "ping" command. The "ping" command sends a test data packet to a website address to check if the address responds and records the response time, thus testing network connectivity.

[0105] S309, when the return data generated by the cloud computing platform based on the connection request is obtained, it is confirmed that the IoT firmware simulation platform and the cloud computing platform have been connected.

[0106] In one embodiment, when the return data generated by the cloud computing platform based on the connection request is received, the IoT firmware simulation platform and the cloud computing platform are considered to be connected. Furthermore, communication speed can be tested based on the return data.

[0107] Please see Figure 5 , Figure 5 This is a system architecture diagram of a communication connection method provided in this application embodiment, showing the system architecture after the connection between the virtual network device 102 and the IoT firmware emulation platform 101 and the cloud computing platform 103 is completed. Specifically, the third virtual network card is connected to the IoT firmware emulation platform 101, and the third virtual network card is connected to the second virtual network card via a virtual bridge. The second virtual network card is connected to the virtual switch of the cloud computing platform 103 via a virtual network card to the first virtual network card at the other end, thereby completing the connection between the IoT firmware platform 101 and the cloud computing platform 103.

[0108] Please see Figure 6 , Figure 6 This is a general flowchart of a communication connection method provided in this application embodiment. Taking OpenStack as an example of a cloud computing platform, the process is as follows: First, install multiple versions and multi-system architecture versions of QEMU on the OpenStack computing node. This allows the IoT firmware emulation platform (IoT firmware platform) to specify a particular version and architecture of QEMU to start the firmware image. After installation, create a Tap virtual network interface and a Linux bridge for the IoT firmware emulation platform, and create a virtual bridge pair (Veth peer bridge pair includes QVB virtual network interface and QVO virtual network interface) for OpenStack. Connect the QVO virtual network interface in the virtual bridge pair to the OVS port, and set the QVO tag to the OVS port tag, that is, set the port tag of the IoT firmware emulation platform to the same tag as the cloud computing platform. Then, start the Linux bridge (which can be achieved using the up command), and then add the Tap virtual network interface and QVB virtual network interface to the Linux bridge. At this point, the QEMU of the physical network platform can be started, which in turn starts the IoT firmware emulation image (virtual machine). Set the IP address of the virtual machine in the IoT firmware platform, which needs to be in the same network segment as the virtual host IP address of OpenStack to complete the communication connection.

[0109] In this embodiment, by connecting the first virtual network card corresponding to the first virtual device identifier and the virtual switch according to the first connection relationship, the second port identifier of the switch port of the virtual switch is obtained. Based on the second port identifier, the first port identifier of the virtual machine is obtained, and the third port identifier corresponding to the first port identifier is obtained. The port of the IoT firmware simulation platform is set as the third port corresponding to the third port identifier. According to the second connection relationship, the third virtual network card corresponding to the third virtual device identifier is connected to one end of the virtual bridge corresponding to the fourth virtual device identifier. According to the third connection relationship, the second virtual network card corresponding to the second virtual device identifier is connected to the other end of the virtual bridge. This completes the connection between the virtual network device and the cloud computing platform and the IoT firmware simulation platform. Then, the first Internet Protocol address of the cloud computing platform is obtained, and the Internet Protocol address of the IoT firmware simulation platform is set to the second Internet Protocol address with the same subnet mask as the first Internet Protocol address. Based on the connection command, the IoT firmware simulation platform is controlled to send a connection request to the cloud computing platform. When the return data generated by the cloud computing platform based on the connection request is obtained, it is confirmed that the IoT firmware simulation platform and the cloud computing platform have been connected. This completes the entire process from connection to testing, ensuring that the IoT firmware simulation platform and the cloud computing platform can communicate successfully.

[0110] The following will be combined with the appendix Figures 6-7This application provides a detailed description of the communication connection device provided in the embodiments. It should be noted that the appendix... Figures 6-7 The communication connection device described herein is used to execute this specification. Figures 2-5 The methods shown in the embodiments are illustrated for ease of explanation, showing only the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this specification. Figures 2-5 The example shown.

[0111] Please see Figure 6 This illustration shows a schematic diagram of a communication connection device provided in an exemplary embodiment of this application. The communication connection device can be implemented as all or part of a device through software, hardware, or a combination of both. The device 1 includes a configuration acquisition module 11, a parsing module 12, a request module 13, a connection switching module 14, and an address modification module 15.

[0112] Configuration acquisition module 11 is used to acquire browser configuration data in response to the browser client's startup operation;

[0113] Parsing module 12 is used to parse the browser configuration data to confirm the browser's server address;

[0114] Request module 13 is used to obtain an address migration task from a first server based on the first server address when the server address is a first server address, wherein the address migration task includes the second server address of a second server.

[0115] Connection switching module 14 is used to establish a connection between the browser client and the second server based on the second server address;

[0116] The address modification module 15 is used to change the server address from the first communication connection address to the second server address when the browser client successfully connects to the second server.

[0117] Optionally, the configuration acquisition module 11 is further configured to acquire the local cache data of the browser client;

[0118] When an address migration task exists in the local cache data, the step of establishing a connection between the browser client and the second server based on the second server address is executed.

[0119] If the address migration task is not present in the local cache data, then the step of obtaining browser configuration data is executed.

[0120] Optionally, the address modification module 15 is further configured to send a connection request to the second server;

[0121] When the browser client receives the response data returned by the second server based on the connection request, it is confirmed that the connection between the browser client and the second server has been successful.

[0122] Optionally, the address modification module 15 is specifically used to obtain interface verification data in the response data when it receives response data returned by the second server based on the connection request;

[0123] Based on the interface verification data, a consensus data request is sent to the second server;

[0124] Receive the first agreed-upon data returned by the second server based on the agreed-upon data request;

[0125] When the first agreed data matches the second agreed data indicated by the interface verification data, it is confirmed that the browser client has successfully connected to the second server.

[0126] Optionally, the connection switching module 14 is further configured to store the address migration task in the browser's local cache data when the browser client fails to connect to the second server.

[0127] Optionally, the address modification module 15 is further configured to report a connection success message to the first server based on the identifier of the browser client, so that the first server can record the identifier.

[0128] Further, refer to the appendix Figure 7 The communication connection device shown can be implemented as all or part of the device through software, hardware, or a combination of both. The device 2 includes an address acquisition module 21 and a task sending module 22.

[0129] Address acquisition module 21 is used to acquire the second server address of the second server and generate an address migration task corresponding to the second server based on the second server address;

[0130] The task sending module 22 is used to send the address migration task to the browser client, so that the browser client can establish a connection between the browser client and the second server based on the second server address in the address migration task.

[0131] Optionally, the task sending module 22 is further configured to receive a successful connection message sent by the browser client, and record the successful connection message based on the identifier of the browser client in the successful connection message;

[0132] When each identifier in the target identifier set corresponds to a successful connection message, the first server is shut down; the target identifier set is the identifier set of browser clients connected to the first server.

[0133] It should be noted that the communication connection device provided in the above embodiments is only illustrated by the division of the above functional modules when executing the communication connection method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the communication connection device and the communication connection method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.

[0134] The sequence numbers of the embodiments described above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0135] This application embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the above-described functionality. Figures 2-5 The method described in the illustrated embodiment can be found in the following document for a detailed execution process. Figures 2-5 The specific details of the illustrated embodiments will not be elaborated here.

[0136] Please refer to Figure 8 This diagram illustrates the structure of an electronic device provided in an exemplary embodiment of this specification. The electronic device in this specification may include one or more components such as a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected via the bus 150.

[0137] Processor 110 may include one or more processing cores. Processor 110 connects to various parts of the electronic device using various interfaces and lines, and executes various functions of terminal 100 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 120, and by calling data stored in memory 120. Optionally, processor 110 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 110 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user page, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 110 and may be implemented separately using a communication chip.

[0138] The memory 120 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 120 may include non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the various method embodiments described above, etc. The operating system may be the Android system, including systems deeply developed based on the Android system, the iOS system developed by Apple Inc., including systems deeply developed based on the iOS system, or other systems.

[0139] The memory 120 can be divided into operating system space and user space. The operating system runs in the operating system space, while native and third-party applications run in user space. To ensure that different third-party applications can achieve good running performance, the operating system allocates corresponding system resources for each application. However, different application scenarios within the same third-party application have different requirements for system resources. For example, in local resource loading scenarios, third-party applications have high requirements for disk read speed; in animation rendering scenarios, third-party applications have high requirements for GPU performance. Since the operating system and third-party applications are independent of each other, the operating system often cannot promptly perceive the current application scenario of a third-party application, resulting in the operating system's inability to adapt system resources accordingly.

[0140] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to establish data communication between the third-party applications and the operating system. This would allow the operating system to obtain the current scenario information of the third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0141] The input device 130 is used to receive input instructions or data, and includes, but is not limited to, a keyboard, mouse, camera, microphone, or touch device. The output device 140 is used to output instructions or data, and includes, but is not limited to, a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 can be a touch display screen.

[0142] The touch display screen can be designed as a full-screen, curved screen, or irregularly shaped screen. It can also be designed as a combination of a full-screen and a curved screen, or a combination of an irregularly shaped screen and a curved screen; however, this application does not limit the specific design in this regard.

[0143] In addition, those skilled in the art will understand that the structure of the electronic device shown in the above figures does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the electronic device may also include radio frequency circuits, input units, sensors, audio circuits, WiFi modules, power supplies, Bluetooth modules, etc., which will not be described in detail here.

[0144] exist Figure 8 In the illustrated electronic device, the processor 110 can be used to call computer applications stored in the memory 120 and specifically perform the following operations:

[0145] In response to the browser client's startup action, obtain browser configuration data;

[0146] Parse the browser configuration data to confirm the server address of the browser client;

[0147] When the server address is the first server address, an address migration task is obtained from the first server based on the first server address, and the address migration task includes the second server address of the second server.

[0148] The browser client establishes a connection with the second server based on the second server address;

[0149] When the browser client successfully connects to the second server, the server address is changed from the first communication connection address to the second server address.

[0150] In one embodiment, before retrieving browser configuration data, the processor 110 also performs the following operations:

[0151] Obtain the local cached data of the browser client;

[0152] When an address migration task exists in the local cache data, the step of establishing a connection between the browser client and the second server based on the second server address is executed.

[0153] If the address migration task is not present in the local cache data, then the step of obtaining browser configuration data is executed.

[0154] In one embodiment, when the browser client successfully connects to the second server, the processor 110 also performs the following operations:

[0155] Send a connection request to the second server;

[0156] When the browser client receives the response data returned by the second server based on the connection request, it is confirmed that the connection between the browser client and the second server has been successful.

[0157] In one embodiment, when the processor 110 receives response data returned by the second server based on the connection request and confirms that the browser has successfully connected with the second server, it specifically performs the following operations:

[0158] When the response data returned by the second server based on the connection request is received, the interface verification data in the response data is obtained;

[0159] Based on the interface verification data, a consensus data request is sent to the second server;

[0160] Receive the first agreed-upon data returned by the second server based on the agreed-upon data request;

[0161] When the first agreed data matches the second agreed data indicated by the interface verification data, it is confirmed that the browser client has successfully connected to the second server.

[0162] In one embodiment, after the processor 110 establishes a connection between the browser client and the second server based on the second server address, it further performs the following operations:

[0163] When the browser client fails to connect to the second server, the address migration task is stored in the browser's local cache data.

[0164] In one embodiment, after the browser client successfully connects to the second server, the processor 110 further performs the following operations:

[0165] The browser client reports a successful connection message to the first server based on its identifier, so that the first server can record the identifier.

[0166] In one embodiment, processor 110 can be used to invoke a computer application stored in memory 120 and specifically perform the following operations:

[0167] Obtain the address of the second server and generate an address migration task corresponding to the second server based on the address of the second server;

[0168] The address migration task is sent to the browser client so that the browser client can establish a connection with the second server based on the second server address in the address migration task.

[0169] In one embodiment, the processor 110 may also perform the following operations:

[0170] Receive a successful connection message sent by the browser client, and record the successful connection message based on the identifier of the browser client in the successful connection message;

[0171] When each identifier in the target identifier set corresponds to a successful connection message, the first server is shut down; the target identifier set is the identifier set of browser clients connected to the first server.

[0172] In this embodiment, the browser client responds to the browser client's startup operation by obtaining browser configuration data, parsing the data to confirm the browser client's server address. When the server address is a first server address, an address migration task is obtained from the first server based on that address. This task includes the second server address of the second server. A connection is established between the browser client and the second server based on this second server address. When the connection is successful, the server address is changed from the first communication connection address to the second server address. Automatic server address switching via the browser client reduces the manual modification cost for users and avoids modification failures due to human error, thereby improving the success rate of server address switching.

[0173] Furthermore, in response to the browser client's startup operation, the system retrieves the browser client's local cache data. If an address migration task exists in the local cache data, the system executes the step of establishing a connection between the browser client and the second server based on the second server's address. If no address migration task exists in the local cache data, the system retrieves the browser configuration data. A connection request is sent to the second server. When a response is received from the second server based on the connection request, the system confirms a successful connection between the browser client and the second server. A connection success message is then reported to the first server based on the browser client's identifier, allowing the first server to record the identifier. If the connection between the browser client and the second server fails, the address migration task is stored in the browser's local cache data. By checking the browser client's local cache data for any incomplete address migration tasks, if any exist, the system executes the task directly to avoid redundant retrieval and resource waste. If no address migration task exists, the system retrieves the task from the first server, connects to the second server based on the second server address in the task, and confirms the successful connection by sending a connection request and receiving a response from the second server. This process quickly confirms the connection result. Furthermore, upon successful connection, a connection success message can be sent back to the first server based on the browser client's identifier. This allows the first server to promptly shut down the connection when all browser clients have migrated to the second server, reducing the cost of maintaining the first server and saving server hardware.

[0174] Furthermore, the first server receives successful connection messages sent by browser clients and records them according to the identifiers. At the same time, it confirms whether there are successful connection messages for each identifier in the target identifier set. When all browser clients have migrated to the second server, the first server can be shut down and the second server can be used instead. This eliminates the need to maintain multiple servers continuously and reduces server maintenance costs.

[0175] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0176] The above-disclosed embodiments are merely preferred embodiments of this specification and should not be construed as limiting the scope of this specification. Therefore, any equivalent variations made in accordance with the claims of this specification shall still fall within the scope of this specification.

Claims

1. A communication connection method, characterized by, The method comprises: obtaining a communication instruction of an Internet of Things firmware simulation platform and a cloud computing platform; parsing the communication instruction to obtain a virtual network device identifier and a device connection relationship, the virtual network device identifier being at least two; connecting the virtual network device corresponding to each virtual network device identifier to the Internet of Things firmware simulation platform and the cloud computing platform according to the device connection relationship, so that the Internet of Things firmware simulation platform and the cloud computing platform are connected based on the virtual network device.

2. The method of claim 1, wherein, Before the step of obtaining the communication instruction of the Internet of Things firmware simulation platform and the cloud computing platform, the method further comprises: creating a pair of virtual network cards connected to the cloud computing platform, the pair of virtual network cards comprising a first virtual network card and a second virtual network card connected to each other; allocating a first virtual device identifier of the first virtual network card and a second virtual device identifier of the second virtual network card.

3. The method of claim 2, wherein, The cloud computing platform comprises a virtual machine and a virtual switch; Before the step of creating the pair of virtual network cards connected to the cloud computing platform, the method further comprises: obtaining a first port identifier of a target port of the virtual machine; confirming a second port identifier of the virtual switch corresponding to the first port identifier, and connecting a switch port corresponding to the second port identifier to the target port; The step of creating the pair of virtual network cards connected to the cloud computing platform comprises: creating a pair of virtual network cards connected to the virtual switch; confirming a first connection relationship between the first virtual network card in the pair of virtual network cards and the virtual switch.

4. The method of claim 3, wherein, Before the step of obtaining the communication instruction of the Internet of Things firmware simulation platform and the cloud computing platform, the method further comprises: creating a third virtual network card and a virtual network bridge connected to the Internet of Things firmware simulation platform; allocating a third virtual device identifier of the third virtual network card and a fourth virtual device identifier of the virtual network bridge; confirming a second connection relationship between the third virtual network card and the virtual network bridge. confirming a third connection relationship between the virtual network bridge and the second virtual network card.

5. The method of claim 4, wherein, The device connection relationship comprises the first connection relationship, the second connection relationship and the third connection relationship; The virtual network device identifier comprises the first virtual device identifier, the second virtual device identifier, the third virtual device identifier and the fourth virtual device identifier; The step of connecting the virtual network device corresponding to each virtual network device identifier to the Internet of Things firmware simulation platform and the cloud computing platform according to the device connection relationship comprises: connecting the first virtual network card corresponding to the first virtual device identifier and the virtual switch according to the first connection relationship; obtaining a second port identifier of a switch port of the virtual switch, and obtaining a first port identifier of the virtual machine based on the second port identifier; obtaining a third port identifier corresponding to the first port identifier, and setting a port of the Internet of Things firmware simulation platform as a third port corresponding to the third port identifier; connecting the third virtual network card corresponding to the third virtual device identifier to one end of the virtual network bridge corresponding to the fourth virtual device identifier according to the second connection relationship; According to the third connection relationship, the second virtual network card corresponding to the second virtual device identifier is connected to the other end of the virtual bridge.

6. The method of claim 1, wherein, After connecting the virtual network device corresponding to each virtual network device identifier to the Internet of Things firmware simulation platform and the cloud computing platform according to the device connection relationship, the method further includes: obtaining a first Internet protocol address of the cloud computing platform; setting an Internet protocol address of the Internet of Things firmware simulation platform as a second Internet protocol address which is the same as a subnet mask of the first Internet protocol address.

7. The method of claim 1, wherein, The method further includes: controlling the Internet of Things firmware simulation platform to send a connection request to the cloud computing platform based on a connection instruction; when the return data generated by the cloud computing platform based on the connection request is obtained, confirming that the Internet of Things firmware simulation platform and the cloud computing platform have been connected.

8. A communication connection device, characterized in that The device includes: an instruction obtaining module configured to obtain a communication instruction of an Internet of Things firmware simulation platform and a cloud computing platform; an analysis module configured to analyze the communication instruction to obtain a virtual network device identifier and a device connection relationship, the virtual network device identifier being at least two; a connection module configured to connect a virtual network device corresponding to each virtual network device identifier to the Internet of Things firmware simulation platform and the cloud computing platform according to the device connection relationship, so that the Internet of Things firmware simulation platform and the cloud computing platform are connected based on the virtual network device.

9. An electronic device, comprising: including: a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded and executed by the processor to perform the steps of the method according to any one of claims 1 to 7.

10. A storage medium storing a computer program, characterized by The computer program is executed by the processor to perform the steps of the method according to any one of claims 1 to 7.