CN117640723A - Communication method, device, equipment and storage medium for different system equipment - Google Patents

Communication method, device, equipment and storage medium for different system equipment Download PDF

Info

Publication number
CN117640723A
CN117640723A CN202311704751.7A CN202311704751A CN117640723A CN 117640723 A CN117640723 A CN 117640723A CN 202311704751 A CN202311704751 A CN 202311704751A CN 117640723 A CN117640723 A CN 117640723A
Authority
CN
China
Prior art keywords
ncm
network adapter
equipment
communication
port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311704751.7A
Other languages
Chinese (zh)
Inventor
朱志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ruan Niu Technology Group Co ltd
Original Assignee
Shenzhen Ruan Niu Technology Group Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ruan Niu Technology Group Co ltd filed Critical Shenzhen Ruan Niu Technology Group Co ltd
Priority to CN202311704751.7A priority Critical patent/CN117640723A/en
Publication of CN117640723A publication Critical patent/CN117640723A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to the field of computers, and discloses a communication method, a device, equipment and a storage medium of different system equipment. The method comprises the following steps: the first equipment sends a control instruction to the second equipment, opens hidden NCM hardware of the second equipment and acquires configuration information of the NCM hardware; creating an NCM network adapter, and broadcasting traversal through the NCM network adapter to obtain a remote service IP address of the second equipment; pairing with the second equipment through a preset port and an unpaired service port of the second equipment to generate a private key certificate, and creating QUIC connection through the private key certificate; and creating a tun network adapter, and establishing two-way communication with the second equipment through the tun network adapter and QUIC connection so as to realize the communication function in the developer mode. In the embodiment of the invention, network hardware drive corresponding to the developer mode of the apple device can be provided for the Windows device, and two-way communication is established so as to realize that the apple device communicates with the Windows device in the developer mode.

Description

Communication method, device, equipment and storage medium for different system equipment
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, a device, and a storage medium for communication between different system devices.
Background
Apples published iOS17 and iPadOS 17-plus-18 systems at 2023, a significant change in developer mode communication functionality under this system, using a new Remote protocol, which must be implemented by creating trusted tunnels, using specific NCM (Network Control Model ) network hardware, in order to communicate with devices in developer mode
Apples have implemented the relevant functions in the Xcode's development tools in their own MacOS systems and apple MacOS systems exclusively use schemes that support this protocol for specific hardware drivers, whereas apples do not develop corresponding hardware drivers and communications for Windows systems. Partial functions of Windows for the iOS17 cannot be realized, such as screen capturing, test simulation modification positioning, acquisition of a dynamic system debug log, viewing of a detailed process list, and starting of an application program.
Disclosure of Invention
The invention mainly aims to solve the technical problem of how to realize communication between the apple device and the Windows device in a developer mode.
The first aspect of the present invention provides a different system device communication method, including:
the method comprises the steps that a first device sends a control instruction to a second device to start NCM hardware hidden by the second device and obtain configuration information of the NCM hardware, wherein the first device adopts a Windows system, and the second device adopts an apple system;
the first device creates an NCM network adapter according to the configuration information, and obtains a remote service IP address of the second device through broadcasting traversal of the NCM network adapter;
the first device pairs with the second device according to the remote service IP address through a preset port and an unpaired service port of the second device, generates a private key certificate, and creates QUIC (Quick UDP Internet Connection, quick UDP network connection) connection through the private key certificate;
and the first equipment establishes a tun network adapter, and establishes two-way communication with the second equipment through the tun network adapter and the QUIC connection so as to realize a communication function in a developer mode.
Optionally, in a first implementation manner of the first aspect of the present invention, the NCM hardware includes a plurality of NCM control hardware and NCM data hardware;
the first device creates an NCM network adapter according to the configuration information, and the remote service IP address of the second device is obtained through broadcasting traversal through the NCM network adapter, wherein the method comprises the following steps:
the first device queries configuration information of NCM data hardware at a preset position according to the configuration information;
creating an NCM network adapter according to a plurality of corresponding interface information in the configuration information of the NCM data hardware;
and broadcasting and traversing to obtain the remote service IP address of the second equipment through the NCM network adapter.
Optionally, in a second implementation manner of the first aspect of the present invention, creating the NCM network adapter according to the corresponding plurality of interface information in the configuration information of the NCM data hardware includes:
acquiring corresponding function description information in the plurality of interface information according to the corresponding plurality of interface information in the configuration information of the NCM data hardware;
acquiring input and output pipeline handles under an NCM control hardware interface;
and creating an NCM network adapter according to the function description information and the input and output pipeline handles.
Optionally, in a third implementation manner of the first aspect of the present invention, the broadcasting, through the NCM network adapter, the remote service IP address of the second device includes:
disabling an ipv4 protocol of the NCM network adapter;
broadcasting traversal to obtain a remote service list of the second device;
and acquiring an ipv6 address corresponding to a preset remote service according to the remote service list, and taking the ipv6 address as a remote service IP address of the second device.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the pairing, by the first device, with the second device according to the remote service IP address through a preset port and an unpaired service port of the second device, to generate a private key certificate, and creating a quit connection through the private key certificate includes:
the first device is connected with the second device through a preset port according to the remote service IP address to obtain a port number corresponding to unpaired service in the second device;
pairing with the second equipment through the remote service IP address and the port number corresponding to the unpaired service to generate a private key certificate;
and creating a QUIC connection through the private key certificate.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the first device creates a tun network adapter, and establishes bidirectional communication with the second device through the tun network adapter and the qic connection, so as to implement a communication function in a developer mode, where the communication function includes:
the first device sends a port creation instruction to the second device, wherein the port creation instruction is used for controlling the second device to create a monitoring port and acquiring the created monitoring port returned by the second device;
connecting to the listening port through the QUIC connection;
and creating a tun network adapter, and establishing two-way communication with the second equipment through the tun network adapter and a connected monitoring port so as to realize a communication function in a developer mode.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the creating a tun network adapter, and establishing bidirectional communication with the second device through the tun network adapter and a connected listening port, so as to implement a communication function in a developer mode includes:
randomly generating a global unique identifier through a tun driver in the first device, and creating a tun network adapter according to the global unique identifier;
establishing a QUIC encryption tunnel through the tun network adapter and a connected monitoring port;
and establishing two-way communication between the first device and the second device through the QUIC encryption tunnel so as to realize a communication function in a developer mode.
A second aspect of the present invention provides a different system device communication device comprising: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line; the at least one processor invokes the instructions in the memory to cause the different system device communication device to perform the different system device communication method described above.
A third aspect of the present invention provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the different system device communication methods described above.
In the embodiment of the invention, a first device sends a control instruction to a second device to start NCM hardware hidden by the second device and obtain configuration information of the NCM hardware, wherein the first device adopts a Windows system, and the second device adopts an apple system; the first device creates an NCM network adapter according to the configuration information, and obtains a remote service IP address of the second device through broadcasting traversal of the NCM network adapter; the first device pairs with the second device according to the remote service IP address through a preset port and an unpaired service port of the second device, generates a private key certificate, and creates QUIC connection through the private key certificate; and the first equipment establishes a tun network adapter, and establishes two-way communication with the second equipment through the tun network adapter and the QUIC connection so as to realize a communication function in a developer mode. In the invention, hidden NCM hardware of a second device is started through a first device, an NCM network adapter is created, and a remote service IP address of the second device is obtained through broadcasting traversal through the NCM network adapter; pairing with the second equipment through the remote service IP address to generate a private key certificate, and creating QUIC connection; then a tun network adapter is established, and two-way communication is established with the second device through the tun network adapter and QUIC connection, so that network hardware drive corresponding to the developer mode of the apple device can be provided for the Windows device, and two-way communication is established, so that the apple device can communicate with the Windows device in the developer mode.
Drawings
FIG. 1 is a schematic diagram of one embodiment of a communication method of different system devices in an embodiment of the present invention;
FIG. 2 is a schematic diagram of one embodiment of a communication apparatus of a different system device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of one embodiment of a communication device for a different system device in an embodiment of the invention.
Detailed Description
The embodiment of the invention provides a communication method, a device, equipment and a storage medium of different system equipment.
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the present disclosure has been illustrated in the drawings in some form, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and examples of the present disclosure are for illustrative purposes only and are not intended to limit the scope of the present disclosure.
In describing embodiments of the present disclosure, the term "comprising" and its like should be taken to be open-ended, i.e., including, but not limited to. The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first," "second," and the like, may refer to different or the same object. Other explicit and implicit definitions are also possible below.
For ease of understanding, a specific flow of an embodiment of the present invention is described below with reference to fig. 1, where one embodiment of a communication method of a different system device in an embodiment of the present invention includes:
s100, the first device sends a control instruction to the second device to start the hidden NCM hardware of the second device and acquire configuration information of the NCM hardware.
In this embodiment, the hardware ID of the USB (Universal Serial Bus ) device is traversed, the USB hardware device with the vendor ID number 1452 and the first two hexadecimal characters of the product ID number 12 is found by judging and matching, the device is an apple iPhone or iPad device, the USB device is opened, the first device obtains the handle of the corresponding USB device and sends the corresponding USB control command to the second device, where the USB control command is sent, and there are three schemes, respectively, through winUSB, libusb-win32, libusbK, where winUSB is a microsoft self-contained drive, and no installation is needed, and if libusb-win32 and libusbK are used, it is needed to be generated into an advanced filtering drive and additionally installed on the original apple official drive device without unloading the original official drive, so as to avoid affecting the device connection and identification.
Devices connected to the USB port all have a set of "configurations" from which configuration description information can be retrieved through a library of APIs (Application Programming Interface, application programming interfaces) corresponding to WinUSB, libusb, libusbK. These descriptors include:
device Descriptors description of the apparatus
Configuration Descriptors configuration description
Interface Descriptors interface description
Endpoint Descriptors endpoint description
String Descriptors, character string description.
At this time, the configuration information is queried, and 4 relevant configuration information is obtained.
To communicate using developer functionality, the hidden Apple NCM hardware must be enabled, the hidden hardware configuration opened by sending specific control requests to the device, the open commands being as follows, 4 USB control instructions in the following order:
usb_control_msg(devHandle,0xC0,0x45,0x0,0x0,(char*)response,4,0);
usb_control_msg(devHandle,0xC0,0x52,0x0,0x3,(char*)response,1,0);
usb_control_msg(devHandle,0x80,0x08,0x0,0x0,(char*)response,1,0);
usb_control_msg(devHandle,0xC0,0x45,0x0,0x0,(char*)response,4,0);
1. using the previously opened USB device handle, USB communication is performed, where a request type of 0xc0,0xc0 indicates that this is a request sent to the device, the request code is 0x45, the requested value defaults to 0, and the index parameter of the request is 0.
2. Using the previously opened USB device handle, USB communication is performed, with a request type of 0xc0,0xc0 indicating that this is a request to send a request to the device, the request code is 0x52, the requested value defaults to 0, and the index parameter of the request is 3.
3. Using the previously opened USB device handle, USB communication is performed with a request type of 0x80,0x80 indicating that data is requested to be read from the USB device. The request code defaults to 0 for a value of 0x08 request and the index parameter of the request is 0.
4. Using the previously opened USB device handle, USB communication is performed with request types of 0xc0,0xc0 indicating that data is requested to be read from the USB device. The request code defaults to 0 for a value of 0x45 request and the index parameter of the request is 0.
And S200, the first equipment creates an NCM network adapter according to the configuration information, and obtains the remote service IP address of the second equipment through broadcasting traversal through the NCM network adapter.
In this embodiment, after the hidden NCM hardware is turned on, additional hardware appears in the Windows device manager, two sets of NCM Control interface (NCM Control) and NCM Data interface (NCM Data) hardware, respectively. The Apple's NCM CDC (Communication Device Class ) Network driver, which does not provide a corresponding driver on microsoft's Windows system, needs to create a specific NCM CDC driver, which is different from the conventional standard NCM CDC driver, where the conventional NCM CDC, NCM Control and NCM Data exist in the same hardware ID. Whereas Apple's NCM hardware device slices NCM Control and NCM Data into two pieces of hardware. An NCM driver is written using microsoft new WDF (Windows Driver Frameworks, windows driver framework) NetAdapter network driver framework, an NCM network adapter is created, and a remote service IP (Internet Protocol ) address of the second device is broadcast traversal through the NCM network adapter.
And S300, the first equipment performs pairing with the second equipment through a preset port and an unpaired service port of the second equipment according to the remote service IP address, generates a private key certificate, and establishes QUIC connection through the private key certificate.
In this embodiment, using the obtained remote service IP address, the first device performs socket connection through the 58783 port, and obtains information of the XPC service after receiving data and performing HTTP/2 serialization analysis, where the information type is handshake information, the version is 3, and the attribute includes detailed information of the apple device, which relates to a version number, a device name, a device model, a country region, a serial number, a device unique value, and the like. The service information content includes a log service name and port number, an untrusted pairing service name and port number, and a gpu (graphics processing unit, graphics processor) tool service name and port number. The first equipment is connected with the untrusted pairing service port through the preset port, so that the first equipment and the second equipment are subjected to handshake pairing to generate a private key certificate; a QUIC configuration is created locally specifying a certificate generated by a previous private key using the RemotePairingTunnel protocol, with the authentication mode set to unverified. The XPC service is an inter-process communication service in the MAC OS, and is a bundle under the Contents/XPCServices directory of the main application bundle.
Defining QUIC receiving event type data functions for processing different QUIC event type message data, respectively: connection termination type, stream data reception type, and data packet type. And when the handshake pairing between the first equipment and the second equipment is successful, the response stream data receiving type is returned, wherein the data content comprises configuration information for subsequently establishing a tun network tunnel, and the specific content comprises a client IPv6 address, a client maximum transmission unit mtu, a server IPv6 address and a port for discovering service by remote service of the server. If the data of the data message type is received, judging whether the tun network adapter is initialized, and if the initialization is completed, taking out the valid message data part from the event data and writing the valid message data part into a tun tunnel.
S400, the first device creates a tun network adapter, and establishes two-way communication with the second device through the tun network adapter and QUIC connection so as to realize the communication function in the developer mode.
In this embodiment, a tun network adapter is created, which can be used for simultaneous compatibility of multiple devices, obtains an adapter handle, and sets an IP address and a maximum transmission unit of the network adapter, where the two values are the obtained client IPv6 address and the client maximum transmission unit mtu. Communication with the second device in developer mode can be achieved through the created tun network adapter and the QUIC connection.
In an alternative embodiment of the first aspect of the present invention, the NCM hardware includes a plurality of NCM control hardware and NCM data hardware; the first device creating an NCM network adapter according to the configuration information, and broadcasting the remote service IP address of the second device through the NCM network adapter includes:
the first device queries configuration information of NCM data hardware at a preset position according to the configuration information; creating an NCM network adapter according to a plurality of corresponding interface information in the configuration information of the NCM data hardware; the broadcast traversal obtains the remote service IP address of the second device through the NCM network adapter.
In this embodiment, after the USB control instruction is executed successfully, it will cause the apple device to disconnect from the host and reconnect after a few seconds. At this time, 4 newly added hardware devices, two NCM Data and NCM Control, respectively, appear in the Windows hardware device manager. At this time, the configuration information is queried through the USB API library, and at this time, 5 configurations are included. The newly-appearing description configuration is PTP+ Apple Mobile Device +NCM, and simultaneously comprises 6 description interfaces. The interface name of the interface number 2 is 'NCM Control', and the interface description comprises iMACAddress address information and the maximum segment size; the interface name at interface number 3 is "NCM Data". The step of opening the hidden hardware is now complete. The newly added hardware IDs are USB\VID_05ac & PID_12XX & MI_02, USB\VID_05ac & PID_12XX & MI_03, USB\VID_05ac & PID_12XX & MI_04, USB\VID_05ac & PID_12XX & MI_05, respectively, wherein XX is the hardware PID (Product ID of hardware) of different devices.
Obtaining a USB target device handle by using the WDF device handle, wherein the USB target device is NCM Data target device with MI of 05 in newly-appearing hardware ID, and the hardware ID is USB\VID_05ac & PID_12XX & MI_05; inquiring equipment description information through the USB equipment handle, acquiring configuration description number, traversing and inquiring a plurality of configuration description information, and acquiring the interface number in each configuration description information. Wherein, there are a plurality of interfaces under one configuration, which can be regarded as a set of endpoints with similar functions, and the 5 th configuration contains 6 interfaces, including: PTP, apple USB Multiplexor, NCM Control, NCM Data, create an NCM network adapter through the 5 th configuration corresponding plurality of interface information, broadcast traversal to get the remote service IP address of the second device.
In an optional implementation manner of the first aspect of the present invention, creating the NCM network adapter according to the corresponding plurality of interface information in the configuration information of the NCM data hardware includes:
acquiring corresponding function description information in the plurality of interface information according to the corresponding plurality of interface information in the configuration information of NCM data hardware; acquiring input and output pipeline handles under an NCM control hardware interface; and creating the NCM network adapter according to the function description information and the input and output pipeline handles.
In this embodiment, querying the 5 th interface NCM Control may obtain 4 pieces of function description information, including: CDC Ethernet Networking, CDC Network Control Model, CDC Union, CDC Header, and CDC Ethernet Networking functional description contains information such as address value of device MAC network card, ethernet statistics, maximum segment (packet) size, number of multicast MAC address filters, number of power filters, etc. for creating parameters of the generated network adapter later. 2 functional endpoint description information can be obtained by querying the 6 th interface NCM Data: and the pipeline handles created by the IN endpoint and the OUT endpoint are used for reading/writing or receiving/transmitting of the subsequent creation network adapter binding network transmission.
Setting the configuration with the configuration description number of 5 as an active configuration, transmitting a target device synchronous transmission control transmission function by using an API function of a kernel WDF USB, and transmitting a data packet to the target USB device to complete the designated configuration number of 5 as the active configuration. The method comprises the following steps: the kernel WDF USB API is used for constructing a request data packet, a control setup packet is initialized, a request direction parameter is set to be BmRequestHostTodevice, the request direction parameter is set to be BmRequestTodevice, a receiver is BmRequestTodevice, the request type is 0x9, the request value is 0x5, and the index value is 5. The interface information of the current active configuration is acquired, and the number of configured pipes under the interface is 2 through the WDF driving framework API, wdfUsbInterfaceGetNumConfiguredPipes. And simultaneously using WdfUsbInterfaceGetConfiguredPipe API to search the successfully configured pipeline under the interface through the USB interface object UsbInterface, and returning two handles corresponding to the two pipelines. Whether a pipe is an end point IN the IN direction or an end point IN the OUT direction is checked by the wdfusbtargetpipeisilnendpoint and wdfusbtargetpipeout endpoint functions for determining the data transmission direction of the pipe.
The network adapter is created based on the two input and output pipe handles under the NCM Data hardware interface and the network configuration information under the function description of the acquired hardware NCM Control hardware interface. The netadapter cx framework is used to create a network card adapter, obtain the adapter object, and configure the Mac address obtained from NCM Control by opening the configuration data interface of the network adapter. Initializing a network read and write queue creating a network adapter, and binding the two previously acquired pipe handles, wherein the read queue will acquire data from the open IN endpoint object and the write queue will send data from the previous OUT endpoint object. Thereby maintaining proper operation of the opened network adapter.
In an optional implementation manner of the first aspect of the present invention, broadcasting the traversal to obtain the remote service IP address of the second device via the NCM network adapter includes:
disabling the ipv4 protocol of the NCM network adapter; broadcasting and traversing to obtain a remote service list of the second equipment; and acquiring an ipv6 address corresponding to the preset remote service according to the remote service list, and taking the ipv6 address as a remote service IP address of the second device.
In this embodiment, because the network established by Apple developer service all uses the ipv6 protocol version, and the network adapter created in Windows is default to support both ipv6 and ipv4 protocol versions, when performing cross-adapter network segment search or multicasting between local different networks, the ipv4 protocol may affect subsequent broadcast searches for Apple NCM remoted. In order to increase the speed of searching for services and avoid getting stuck on the IPv4 protocol, it is necessary to close the Apple NCM network card driver's Internet protocol version 4 (TCP/IPv 4) of the corresponding adapter before searching.
Specifically, first traversing all network adapters on Windows, finding a newly created NCM network adapter by an adapter name, calling a command line, setting the value of ms_tcpip-Enabled to False, and disabling Internet protocol version 4 (TCP/IPv 4) of the NCM adapter. The mDNS response procedure was performed using the mdnsr response, apple's open source DNS (Domain Name System ) service discovery library. The mdnsr monitors multicast traffic on port 5353 (mDNS port) to keep track of the services advertised on the local network. The mdnsr response performs DNS resolution on non-local queries and uses the mDNS resolution specific ". Local" field to discover the broadcast of Bonjour services. After the NCM network adapter is established, using the broadcast and discovery function traversal, an IP 6 address corresponding to the remote service of NCM._remote_tcp.local is found from the apple device, _tcp.lcoal, _remote_tcp.local, NCM._remote_tcp.local, and the list information is queried, where the IP 6 address is the IP address of the remote service of the Apples device.
In an optional implementation manner of the first aspect of the present invention, the pairing, by the first device, with the second device according to the remote service IP address through the preset port and the unpaired service port of the second device, to generate a private key certificate, and creating the quitc connection through the private key certificate includes:
the first device is connected with the second device through a preset port according to the remote service IP address to obtain a port number corresponding to unpaired service in the second device; pairing with the second equipment through the remote service IP address and the port number corresponding to the unpaired service to generate a private key certificate; the QUIC connection is created by means of a private key certificate.
In this embodiment, the first device uses the acquired remote device IP address and the port number corresponding to the untrustworthy pairing service name obtained by the above inquiry to perform socket connection. And HTTP/2. The data may be communicated to the second device via the NCM network adapter. And calling to send a verification request, if the returned handshake information contains an attemptpairverity field as True, indicating that no effective pairing exists, and requiring pairing operation, and if no effective pairing record exists, calling a pairing method to pair with equipment, wherein the main flow comprises the following steps:
1. the user is requested to confirm the pairing.
2. And initializing protocol parameters and generating a session key.
3. Mutually authenticating session keys.
4. And sending the created information such as the local PC public key to the equipment for storage.
5. The master encryption key of the client/server is derived using the session key.
6. A remote unlocking key is created.
7. And generating storage pairing information, and storing information such as a private key generated by the local machine in a designated PEM file.
In an alternative implementation manner of the first aspect of the present invention, the first device creates a tun network adapter, and establishes two-way communication with the second device through the tun network adapter and the QUIC connection, so as to implement a communication function in the developer mode, including:
the first equipment sends a port creation instruction to the second equipment, and the port creation instruction is used for controlling the second equipment to create a monitoring port and acquiring the created monitoring port returned by the second equipment; through QUIC connection, connect to monitor port; and creating a tun network adapter, and establishing two-way communication with the second equipment through the tun network adapter and a connected monitoring port so as to realize a communication function in a developer mode.
In this embodiment, a request is constructed at the first device to notify the remote service to establish a snoop, a protocol quic is specified, a certificate is generated by the private key, the request is encrypted and sent to the second device, and a response is received and decrypted. And finally returning the second equipment to the first equipment after the second equipment successfully creates the monitoring port, decrypting the data to obtain the monitoring port of the remote equipment, and automatically closing the remote monitoring port of the equipment within a few minutes if the remote monitoring port of the equipment is not connected with calculation or the data is transmitted. And establishing QUIC connection, asynchronously establishing the QUIC connection by using a QUIC library, connecting a host IP address to an acquired remote device IP address, and monitoring a port by a remote port to a received remote device. And establishing bidirectional communication with the second device through the QUIC connection, the listening port and the tun network adapter.
In an optional implementation manner of the first aspect of the present invention, creating a tun network adapter, and establishing bidirectional communication with the second device through the tun network adapter and the connected listening port, so as to implement a communication function in a developer mode includes:
randomly generating a global unique identifier through a tun driver in the first device, and creating a tun network adapter according to the global unique identifier; establishing a QUIC encryption tunnel through a tun network adapter and a connected monitoring port; through the QUIC encryption tunnel, the first device establishes two-way communication with the second device to implement the communication function in the developer mode.
In this embodiment, wintun is a small TUN driver in Windows that provides a simple network adapter for user space programs to read and write data packets.
The API dynamic library using the winTun uses a randomly produced global unique identifier (GUID value) to create a tun network adapter, which can be used for simultaneous compatibility of multiple devices, obtains an adapter handle, and uses the adapter handle to create a session of the winTun to obtain a session handle.
And establishing a communication flow, starting a tunnel reading thread from the client to the server, continuously reading data of the tun equipment by the reading thread, and forwarding and sending the data to the server through QUIC connection. The data message is read from the tun network adapter, and is sent to the network card of the apple device through the network adapter driven by the NCM through the remote port connected by the QUIC, the whole network uses the ipv6 protocol standard, and the protocol layer of the system automatically processes. When the client receives a data message type event on the QUIC connection, the data is rewritten in the tun device, namely, apple network card data is forwarded to a reading event of the QUIC connection through the NCM driving network adapter and then written into the tun network adapter through tun, so that bidirectional communication docking is completed.
Referring to fig. 2, a second aspect of the present invention provides a different system device communication apparatus comprising:
the hidden hardware opening module 100 is configured to send a control instruction to a second device by using a first device, so as to open NCM hardware hidden by the second device, and obtain configuration information of the NCM hardware, where the first device uses a Windows system, and the second device uses an apple system;
the remote service address obtaining module 200 is configured to create an NCM network adapter according to the configuration information by the first device, and obtain a remote service IP address of the second device through broadcast traversal by the NCM network adapter;
the service port pairing module 300 is configured to pair, according to the remote service IP address, the first device with the second device through a preset port and an unpaired service port of the second device, generate a private key certificate, and create a quit connection through the private key certificate;
the communication establishing module 400 is configured to establish a tun network adapter by the first device, and establish two-way communication with the second device through the tun network adapter and the QUIC connection, so as to implement a communication function in a developer mode.
In an optional embodiment of the second aspect of the present invention, the remote service address obtaining module 200 is further configured to query, by the first device, configuration information of NCM data hardware at a preset location according to the configuration information; creating an NCM network adapter according to a plurality of corresponding interface information in the configuration information of the NCM data hardware; the broadcast traversal obtains the remote service IP address of the second device through the NCM network adapter.
In an optional embodiment of the second aspect of the present invention, the remote service address obtaining module 200 is further configured to obtain corresponding function description information in the plurality of interface information according to the corresponding plurality of interface information in the configuration information of the NCM data hardware; acquiring input and output pipeline handles under an NCM control hardware interface; and creating the NCM network adapter according to the function description information and the input and output pipeline handles.
In an alternative embodiment of the second aspect of the present invention, the remote service address obtaining module 200 is further configured to disable an ipv4 protocol of the NCM network adapter; broadcasting and traversing to obtain a remote service list of the second equipment; and acquiring an ipv6 address corresponding to the preset remote service according to the remote service list, and taking the ipv6 address as a remote service IP address of the second device.
In an optional implementation manner of the second aspect of the present invention, the service port pairing module 300 is further configured to connect, by a preset port, the first device with the second device according to the remote service IP address, to obtain a port number corresponding to an unpaired service in the second device; pairing with the second equipment through the remote service IP address and the port number corresponding to the unpaired service to generate a private key certificate; the QUIC connection is created by means of a private key certificate.
In an optional implementation manner of the second aspect of the present invention, the communication establishing module 400 is further configured to send, to the second device, a port creation instruction, where the port creation instruction is used to control the second device to create a listening port, and obtain a created listening port returned by the second device; through QUIC connection, connect to monitor port; and creating a tun network adapter, and establishing two-way communication with the second equipment through the tun network adapter and a connected monitoring port so as to realize a communication function in a developer mode.
In an alternative embodiment of the second aspect of the present invention, the communication setup module 400 is further configured to randomly generate a globally unique identifier by a tun driver in the first device, and create a tun network adapter according to the globally unique identifier; establishing a QUIC encryption tunnel through a tun network adapter and a connected monitoring port; through the QUIC encryption tunnel, the first device establishes two-way communication with the second device to implement the communication function in the developer mode.
Fig. 3 is a schematic structural diagram of a different system device communication device according to an embodiment of the present invention, where the different system device communication device 500 may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (e.g., one or more processors) and a memory 520, one or more storage media 530 (e.g., one or more mass storage devices) storing application programs 533 or data 532. Wherein memory 520 and storage medium 530 may be transitory or persistent storage. The program stored on the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations in a different system device communication device 500. Still further, the processor 510 may be arranged to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on different system device communication devices 500.
The system device based communication device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input/output interfaces 560, and/or one or more operating systems 531, such as Windows Server, mac OS X, unix, linux, free BSD, and the like. It will be appreciated by those skilled in the art that the different system device communication device architecture shown in fig. 3 is not limiting on different system device-based communication devices and may include more or fewer components than shown, or may combine certain components, or may be arranged differently.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, and which may also be a volatile computer readable storage medium, the computer readable storage medium having stored therein instructions which, when executed on a computer, cause the computer to perform the steps of the different system device communication method.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Moreover, although operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (10)

1. A method of communication for different system devices, the method comprising:
the method comprises the steps that a first device sends a control instruction to a second device to start NCM hardware hidden by the second device and obtain configuration information of the NCM hardware, wherein the first device adopts a Windows system, and the second device adopts an apple system;
the first device creates an NCM network adapter according to the configuration information, and obtains a remote service IP address of the second device through broadcasting traversal of the NCM network adapter;
the first device pairs with the second device according to the remote service IP address through a preset port and an unpaired service port of the second device, generates a private key certificate, and creates QUIC connection through the private key certificate;
and the first equipment establishes a tun network adapter, and establishes two-way communication with the second equipment through the tun network adapter and the QUIC connection so as to realize a communication function in a developer mode.
2. The different system device communication method of claim 1, wherein the NCM hardware includes a plurality of NCM control hardware and NCM data hardware;
the first device creates an NCM network adapter according to the configuration information, and the remote service IP address of the second device is obtained through broadcasting traversal through the NCM network adapter, wherein the method comprises the following steps:
the first device queries configuration information of NCM data hardware at a preset position according to the configuration information;
creating an NCM network adapter according to a plurality of corresponding interface information in the configuration information of the NCM data hardware;
and broadcasting and traversing to obtain the remote service IP address of the second equipment through the NCM network adapter.
3. The method of communicating with different system devices according to claim 2, wherein creating an NCM network adapter based on a corresponding plurality of interface information in the configuration information of the NCM data hardware comprises:
acquiring corresponding function description information in the plurality of interface information according to the corresponding plurality of interface information in the configuration information of the NCM data hardware;
acquiring input and output pipeline handles under an NCM control hardware interface;
and creating an NCM network adapter according to the function description information and the input and output pipeline handles.
4. The method of claim 2, wherein broadcasting through the NCM network adapter the remote service IP address of the second device comprises:
disabling an ipv4 protocol of the NCM network adapter;
broadcasting traversal to obtain a remote service list of the second device;
and acquiring an ipv6 address corresponding to a preset remote service according to the remote service list, and taking the ipv6 address as a remote service IP address of the second device.
5. The method of communicating between different system devices according to claim 1, wherein the first device, according to the remote service IP address, pairing with the second device through a preset port and an unpaired service port of the second device, generating a private key certificate, and creating a quit connection through the private key certificate includes:
the first device is connected with the second device through a preset port according to the remote service IP address to obtain a port number corresponding to unpaired service in the second device;
pairing with the second equipment through the remote service IP address and the port number corresponding to the unpaired service to generate a private key certificate;
and creating a QUIC connection through the private key certificate.
6. The method of communication between different system devices according to claim 1, wherein said first device creates a tun network adapter and establishes two-way communication with said second device through said tun network adapter and said QUIC connection to implement a communication function in a developer mode comprising:
the first device sends a port creation instruction to the second device, wherein the port creation instruction is used for controlling the second device to create a monitoring port and acquiring the created monitoring port returned by the second device;
connecting to the listening port through the QUIC connection;
and creating a tun network adapter, and establishing two-way communication with the second equipment through the tun network adapter and a connected monitoring port so as to realize a communication function in a developer mode.
7. The method of communication between different system devices according to claim 6, wherein creating a tun network adapter and establishing bidirectional communication with the second device through the tun network adapter and a connected listening port to implement a communication function in a developer mode includes:
randomly generating a global unique identifier through a tun driver in the first device, and creating a tun network adapter according to the global unique identifier;
establishing a QUIC encryption tunnel through the tun network adapter and a connected monitoring port;
and establishing two-way communication between the first device and the second device through the QUIC encryption tunnel so as to realize a communication function in a developer mode.
8. A different system device communication apparatus, the different system device communication apparatus comprising:
the hidden hardware starting module is used for sending a control instruction to second equipment by first equipment so as to start hidden NCM hardware of the second equipment and obtain configuration information of the NCM hardware, wherein the first equipment adopts a Windows system, and the second equipment adopts an apple system;
the remote service address acquisition module is used for creating an NCM network adapter according to the configuration information by the first equipment and obtaining the remote service IP address of the second equipment through broadcasting traversal by the NCM network adapter;
the service port pairing module is used for the first equipment to pair with the second equipment through a preset port and an unpaired service port of the second equipment according to the remote service IP address, generate a private key certificate and establish QUIC connection through the private key certificate;
and the communication establishing module is used for establishing a tun network adapter by the first equipment, and establishing two-way communication with the second equipment through the tun network adapter and the QUIC connection so as to realize a communication function in a developer mode.
9. A different system device communication device, the different system device communication device comprising: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line;
the at least one processor invoking the instructions in the memory to cause the different system device communication device to perform the different system device communication method of any of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the different system device communication method according to any of claims 1-7.
CN202311704751.7A 2023-12-12 2023-12-12 Communication method, device, equipment and storage medium for different system equipment Pending CN117640723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311704751.7A CN117640723A (en) 2023-12-12 2023-12-12 Communication method, device, equipment and storage medium for different system equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311704751.7A CN117640723A (en) 2023-12-12 2023-12-12 Communication method, device, equipment and storage medium for different system equipment

Publications (1)

Publication Number Publication Date
CN117640723A true CN117640723A (en) 2024-03-01

Family

ID=90033906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311704751.7A Pending CN117640723A (en) 2023-12-12 2023-12-12 Communication method, device, equipment and storage medium for different system equipment

Country Status (1)

Country Link
CN (1) CN117640723A (en)

Similar Documents

Publication Publication Date Title
US10681131B2 (en) Source network address translation detection and dynamic tunnel creation
KR100699701B1 (en) Home-network autoconfiguration
US20190116095A1 (en) Method and apparatus for managing field device based on cloud server
US6687817B1 (en) Configuration of a network device via the network
JP4705990B2 (en) A system for establishing a reliable distributed peer-to-peer network
US9231904B2 (en) Deploying and managing networked devices
US8024469B1 (en) System and method for connecting network sockets between applications
US7840688B2 (en) Information processing device, server client system, method, and computer program
TWI638568B (en) Transmission method of screen transmission software, screen transmission method, wireless screen transmission device, and data transmission system
US20040210630A1 (en) Systems and methods for discovering, acquiring and maintaining nodes in a logical network
JP2010534884A (en) Data stream control for network devices
US8386614B2 (en) Network connection manager
CN103973785B (en) A kind of log read system and method based on P2P
CN104683865A (en) ARC (Audio Return Channel) setting method and equipment
US20190386880A1 (en) IoT TOPOLOGY ANALYZER DEFINING AN IoT TOPOLOGY AND ASSOCIATED METHODS
CN112445700A (en) Test method and device
CN112929411A (en) Distributed file transmission method, server and private cloud equipment
CN111352602A (en) Control method, device and equipment of LED screen and storage medium
TWI735633B (en) Data transmission method, equipment, device and system
US20040068575A1 (en) Method and apparatus for achieving a high transfer rate with TCP protocols by using parallel transfers
CN117640723A (en) Communication method, device, equipment and storage medium for different system equipment
CN114006955B (en) Data processing method, device, equipment and readable storage medium
US8521911B2 (en) Apparatus, system and method for executing discovery in network
CN112019358A (en) Network configuration method, device, equipment and system
US7580990B1 (en) Method and system for footprint minimized, HTML/HTTP-based systems for Java-based embedded device management applications

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination