Screen projection method and system based on Wifi direct connection

By adopting Wifi direct connection technology in the screen projection system, the server creates a Wifi access point and directly connects it to the client, solving the problems of data transmission stability and efficiency caused by relying on routers in the existing technology, and achieving more efficient and stable screen projection data transmission.

CN119893744APending Publication Date: 2025-04-25FUJIAN CENTM INFORMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411851767.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

Existing Wifi transmission-based screen projection methods rely on routers or access points, resulting in low data transmission stability and efficiency, and affect the connectivity and stability of data connections in the event of router failure or maintenance.

Method used

Using the screen projection method based on Wifi direct connection, the server responds to the Wifi direct connection command, configures it as a GO device, creates a Wifi access point, and broadcasts connection information to the client. The client establishes a screen projection connection with the server through the access point, and directly transmits data.

Benefits of technology

The transmission process of screen projection data is optimized, the stability and efficiency of data transmission is improved, the time consumed by GO negotiation is avoided, the screen projection connection efficiency is improved, and the server allows the server to connect multiple clients at the same time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119893744A_ABST
    Figure CN119893744A_ABST
Patent Text Reader

Abstract

The invention discloses a screen projection method and system based on Wifi direct connection, and the method comprises the steps: a server side responds to a Wifi direct connection instruction, configures the state of Wifi direct connection equipment of the server side as GO equipment, creates a Wifi access point of the GO equipment, and broadcasts the connection information of the Wifi access point to a client side; and if the client receives the connection information, creating a screen projection connection with the server through the Wifi access point according to the connection information, and sending screen projection data to the server through the screen projection connection so as to complete a screen projection task based on the server. According to the invention, the transmission process of the projection screen data can be optimized, and the stability and efficiency of data transmission are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of screen projection technology, and in particular to a screen projection method and system based on Wifi direct connection. Background Art

[0002] With the rapid development of mobile Internet technology, the demand for wireless data transmission between devices is increasing. Traditional Bluetooth transmission methods have defects such as short distance and slow speed, while Wifi transmission methods that rely on routers or access points are limited by network environment and device configuration.

[0003] At present, the method of implementing screen projection based on Wifi transmission is usually to connect the server and client to the same router or Wifi hotspot, and the server periodically sends a UDP (User Datagram Protocol) broadcast signal with server device information, and the client parses the server's UDP broadcast signal to obtain the server device information, and then the user manually selects a server to perform the screen projection task. Finally, the client establishes a Socket connection with the selected target server and transmits the projection data. This screen projection method needs to rely on a router or access point Wifi. When transmitting data, it needs to be sent to the router first, and then forwarded to the target device by the router, which adds an intermediate link for data transmission, and when the router fails or is maintained and upgraded, it will affect the connectivity and stability of the entire data connection. In addition, during the connection establishment process, the user needs to configure the parameters of the Wifi network, and because multiple devices share the same bandwidth resources, when multiple devices access the network at the same time, the bandwidth may be insufficient, resulting in a decrease in network speed and affecting data transmission efficiency. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a screen projection method and system based on Wifi direct connection, which can optimize the transmission process of screen projection data and improve the stability and efficiency of data transmission.

[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is: A screen projection method based on Wifi direct connection, comprising: In response to the Wifi Direct instruction, the server configures the Wifi Direct device state of the server as a GO device, creates a Wifi access point of the GO device, and broadcasts connection information of the Wifi access point to the client; If the client receives the connection information, it will create a screen projection connection with the server through the Wifi access point according to the connection information, and send the screen projection data to the server through the screen projection connection to complete the screen projection task based on the server.

[0006] In order to solve the above technical problems, another technical solution adopted by the present invention is: A screen projection system based on Wifi direct connection includes a server and a client, the server includes a first memory, a first processor, and a first computer program stored in the first memory and running on the first processor, the client includes a second memory, a second processor, and a second computer program stored in the second memory and running on the second processor, when the first processor executes the first computer program, it implements the various steps of the server in the above-mentioned screen projection method based on Wifi direct connection, and when the second processor executes the second computer program, it implements the various steps of the client in the above-mentioned screen projection method based on Wifi direct connection.

[0007] The beneficial effects of the present invention are as follows: the server creates a Wifi access point, so that the server allows other clients to connect to the current server, and there is no need for the server and the client to communicate through a router or an additional access point, which optimizes the transmission process of the projection data and improves the stability and efficiency of data transmission. In addition, when the server and the client are in the process of realizing Wifi direct connection, the server and the client do not determine the GO device through GO negotiation, but specify the server as the GO device of Wifi direct connection, which avoids the time consumed by the server and the client in GO negotiation, improves the efficiency of the projection connection, and the server directly creates a Wifi access point as a GO device state, so that the server can connect to multiple clients at the same time to complete the projection task. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 A flowchart of a screen projection method based on Wifi direct connection provided by an embodiment of the present invention; Figure 2 A flowchart of a Wifi Direct initialization method provided by an embodiment of the present invention; Figure 3 A flow chart of a Wi-Fi direct connection method provided by an embodiment of the present invention; Figure 4 A schematic diagram of address allocation for a P2P group provided in an embodiment of the present invention; Figure 5 An architecture diagram of a screen projection system based on Wifi direct connection provided by an embodiment of the present invention; Description of labels: 100. A screen projection system based on Wifi direct connection; 101. Server; 102. Client; 1011. First memory; 1012. First processor; 1021. Second memory; 1022. Second processor. DETAILED DESCRIPTION

[0009] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0010] An embodiment of the present invention provides a screen projection method based on Wifi direct connection, comprising: The server, in response to the Wifi Direct instruction, configures the Wifi Direct device state of the server as a GO device, creates a Wifi access point of the GO device, and broadcasts connection information of the Wifi access point to the client; If the client receives the connection information, it will create a screen projection connection with the server through the Wifi access point according to the connection information, and send the screen projection data to the server through the screen projection connection to complete the screen projection task based on the server.

[0011] From the above description, it can be seen that the beneficial effects of the present invention are: the server creates a Wifi access point, so that the server allows other clients to connect to the current server, and there is no need for the server and the client to communicate through a router or an additional access point, which optimizes the transmission process of the screen projection data and improves the stability and efficiency of data transmission. In addition, in the process of realizing Wifi direct connection between the server and the client, the server and the client do not determine the GO device through GO negotiation, but specify the server as the GO device of Wifi direct connection, avoiding the time consumed by the server and the client in GO negotiation, improving the efficiency of screen projection connection, and the server directly creates a Wifi access point as a GO device state, so that the server can connect to multiple clients at the same time to complete the screen projection task.

[0012] Further, the server creates a Wifi access point for the GO device including: The server creates a point-to-point connection group based on the GO device state, and configures a Wifi access point based on the point-to-point connection group.

[0013] From the above description, we can know that in Wifi Direct, a GO device refers to a device that plays a role similar to an AP (access point) in a peer-to-peer connection (P2P) group. The GO device allows other devices to connect to it, thus forming a P2P network. Create a peer-to-peer connection group and configure a Wifi access point in the server, so that the server can connect to multiple clients at the same time to complete the screen projection task.

[0014] Furthermore, the client creates a screen projection connection with the server through the Wifi access point according to the connection information, including: The client sends a connection request to the server according to the connection information; The server negotiates transmission parameters with the client in response to the connection request, and receives the first identity key of the client based on the successfully negotiated target transmission parameters; The server verifies the identity information of the client according to the first identity key, and if the verification is successful, adds the client to the point-to-point connection group and sends a connection response message to the client; If the client receives the connection response information, it creates a socket connection with the server according to the connection information to realize the screen projection connection between the server and the client.

[0015] As can be seen from the above description, the server and the client negotiate transmission parameters to ensure the correctness of data transmission. The server receives the first identity key based on the successfully negotiated target transmission parameters to ensure the security of data transmission. The server verifies the identity information of the client according to the first identity key to ensure the legitimacy and security of the data connection. Thus, the data security between the server and the client is guaranteed.

[0016] Furthermore, the server and the client negotiate transmission parameters including: The server sends a service parameter list configured with a first weight to the client, where the service parameter list is a transmission parameter supported by the server; The client compares the service parameter list with a client parameter list configured with a second weight to determine candidate transmission parameters that exist in both the client parameter list and the service parameter list, the client parameter list being transmission parameters supported by the client; The client marks the candidate transmission parameter having the largest sum of the first weight and the second weight as a target transmission parameter, and sends the target transmission parameter to the server; The first weight and the second weight are determined according to data transmission performance of the server and the client.

[0017] From the above description, it can be seen that the data transmission performance between the server and the client is different due to different hardware and environmental conditions. Therefore, by negotiating and determining the transmission parameters supported by both parties, packet loss and errors can be avoided during data transmission, and the reliability of data transmission can be improved. The sum of the first weight and the second weight is the largest, which means that the data transmission performance between the client and the server under the transmission parameters is optimal, thereby reducing unnecessary resource waste and achieving efficient data transmission.

[0018] Furthermore, before the server adds the client to the point-to-point connection group, the server further includes: The server sends the second identity key of the server to the client; The client verifies the identity information of the server according to the second identity key, and if the verification succeeds, sends a verification success message to the server; If the server receives the verification success information, it adds the client to the point-to-point connection group.

[0019] From the above description, it can be seen that the client and the server exchange identity keys for two-way identity authentication to ensure the legitimacy and security of the data connection.

[0020] Further, the server adding the client to the point-to-point connection group includes: The client detects whether it is the first time to connect to the server according to the identity information of the server; If yes, the client sends an address allocation request to the server to obtain a free address in the server corresponding to the point-to-point connection group, and sends an address configuration request to the server based on the free address; Otherwise, the client sends an address configuration request to the server based on the historical address previously allocated by the server; The address configuration request is used to instruct the server to allocate the idle address or the historical address to the client.

[0021] From the above description, it can be seen that if the client and the server are connected for the first time, the server needs to allocate an idle address to the client; if the client and the server are not connected for the first time, the server can allocate a historical address to the client, thereby improving the connection efficiency between the client and the server, while improving the utilization rate of address resources and avoiding waste of resources.

[0022] Furthermore, it also includes: If the server receives the address configuration request, it detects whether the idle address or the historical address exists in the address pool corresponding to the point-to-point connection group; If yes, the server allocates the free address or the historical address to the client; Otherwise, the server sends a rejection configuration message to the client, and the client responds to the rejection configuration message and returns to execute the step of detecting whether it is the first connection with the server according to the identity information of the server.

[0023] From the above description, it can be seen that after receiving the address configuration request from the client, the server will detect whether the free address or historical address exists in the address pool to determine whether it has the ability to allocate to the free address or historical address. If so, the server will allocate the address to the client. If not, the server will search for a new address for allocation. In this way, the automatic connection between the server and the client is realized, simplifying the screen projection connection process.

[0024] Further, after the server configures the Wifi Direct device state of the server as a GO device, it also includes: The server configures the connection mode of the GO device to be a key connection mode.

[0025] As can be seen from the above description, the key connection mode is a way to quickly connect devices without manually entering a password, which effectively simplifies the connection configuration process.

[0026] Further, the server verifies the identity information of the client according to the first identity key including: The server decrypts the encrypted identity information of the client according to the first identity key. If the decryption is successful, the identity information of the client is verified. If the decryption fails, the identity information of the client is not verified.

[0027] From the above description, it can be seen that the identity information of the client and the server is encrypted for transmission, which ensures the security of data transmission and realizes the security verification of identity information.

[0028] Another embodiment of the present invention provides a screen projection system based on Wifi direct connection, including a server and a client, the server including a first memory, a first processor, and a first computer program stored in the first memory and running on the first processor, the client including a second memory, a second processor, and a second computer program stored in the second memory and running on the second processor, when the first processor executes the first computer program, it implements the various steps of the server in the above-mentioned screen projection method based on Wifi direct connection, and when the second processor executes the second computer program, it implements the various steps of the client in the above-mentioned screen projection method based on Wifi direct connection.

[0029] From the above description, it can be seen that the beneficial effects of the present invention are: the server creates a Wifi access point, so that the server allows other clients to connect to the current server, and there is no need for the server and the client to communicate through a router or an additional access point, which optimizes the transmission process of the screen projection data and improves the stability and efficiency of data transmission. In addition, in the process of realizing Wifi direct connection between the server and the client, the server and the client do not determine the GO device through GO negotiation, but specify the server as the GO device of Wifi direct connection, avoiding the time consumed by the server and the client in GO negotiation, improving the efficiency of screen projection connection, and the server directly creates a Wifi access point as a GO device state, so that the server can connect to multiple clients at the same time to complete the screen projection task.

[0030] The above-mentioned screen projection method and system based on Wifi direct connection of the present invention can be applied to data transmission between two devices, and the following is described through specific implementation methods: Please refer to Figures 1 to 4 , Embodiment 1 of the present invention is: A screen projection method based on Wifi direct connection, comprising: S1. In response to a Wifi Direct instruction, the server configures the Wifi Direct device state of the server as a GO device, creates a Wifi access point of the GO device, and broadcasts connection information of the Wifi access point to the client.

[0031] In some embodiments, before configuring the Wifi Direct device state of the server as a GO device, the server needs to implement Wifi Direct initialization in response to the Wifi Direct instruction. Among them, Wifi Direct initialization is specifically as follows: 1. The server obtains the Wifi Direct service handle of the server system, and registers the application to the Wifi Direct service handle through the initialize method to obtain the direct channel instance required for subsequent Wifi Direct operations. The initialize method is used to initialize the state of the class or execute some code that only needs to be executed once when the program starts. 2. The server creates an IntentFilter to monitor the state changes of Wifi Direct, and registers a BroadcastReceiver through registerReceiver to receive these states, including whether Wifi is available, etc. IntentFilter is a filter in the Android system that specifies which types of Intent a component (such as Activity, Service or BroadcastReceiver) is willing to receive. RegisterReceiver is a method in the Android system that is used to dynamically register BroadcastReceiver to receive broadcast messages. BroadcastReceiver is a component in the Android system that is used to receive system-wide broadcast messages. 3. The server determines whether the Wifi status is available through the message received by BroadcastReceiver, thereby determining whether the Wifi function of the current device is turned on. If the status is not available, that is, the Wifi function is not turned on, the setWifiEnabled function of the Wifi Direct Service Manager automatically turns on Wifi or prompts the user to turn on Wifi manually.

[0032] Specifically, in step S1, the server creates a Wifi access point for the GO device including: S11. The server creates a point-to-point connection group based on the GO device status, and configures a Wifi access point based on the point-to-point connection group.

[0033] In some embodiments, the server creates a P2P group with the current device status as a GO device. When configuring a Wifi access point, the server needs to configure the access point's SSID (broadcast identifier) ​​and other information. The access point can accept connections from other WiFi direct devices and manage device members in the peer-to-peer connection group. Management operations include processing join requests, data exchange, etc.

[0034] Specifically, after the server configures the Wifi Direct device state of the server as a GO device, the method further includes: S101, the server configures the connection mode of the GO device to a key connection mode. When configuring the connection mode of the GO device, the device name of the GO device of the server during the Wifi direct connection process is synchronously configured so that the client can find the designated server for connection.

[0035] In some embodiments, the connection information of the Wifi access point broadcast by the server is the device name of the server.

[0036] S2. If the client receives the connection information, it creates a screen projection connection with the server through the Wifi access point according to the connection information, and sends the screen projection data to the server through the screen projection connection to complete the screen projection task based on the server.

[0037] In some embodiments, before the client receives the connection information, the client further includes: the client responds to the Wifi direct connection instruction to implement Wifi direct initialization. The specific method of Wifi direct initialization is the same as the above-mentioned server to implement Wifi direct initialization, which will not be repeated here. After the client completes the Wifi direct initialization, the client will search for other WiFi direct devices by using the discoverPeers method managed by the WiFi direct service.

[0038] In some embodiments, the client receives the server connection information specifically as follows: when the client finds a new WiFi direct connection device, the client returns a node list change event (WIFI_P2P_PEERS_CHANGED_ACTION) through BroadcastReceiver. When the client receives the node list change event, it obtains a list of all found WiFi direct connection devices through requestPeers. The WiFi direct connection device list includes the WiFi direct connection name (i.e., the server device name), address, status and other connection information.

[0039] In some embodiments, after the user selects the target server that needs to perform the screen projection task based on the Wi-Fi direct connection device list provided by the client, the client creates a screen projection connection with the target server based on the method described in step S2.

[0040] Specifically, in step S2, the client establishes a screen projection connection with the server through the Wifi access point according to the connection information, including: S21. The client sends a connection request to the server according to the connection information.

[0041] In some embodiments, when the client establishes a screen projection connection with the server through the connect method, the client sends a PDR connection request, that is, a point-to-point discovery request, to the server.

[0042] S22. The server negotiates transmission parameters with the client in response to the connection request, and receives the first identity key of the client based on the successfully negotiated target transmission parameters.

[0043] S23. The server verifies the identity information of the client according to the first identity key. If the verification is successful, the server adds the client to the point-to-point connection group and sends a connection response message to the client.

[0044] Specifically, in step S23, the server verifies the identity information of the client according to the first identity key, including: the server decrypts the encrypted identity information of the client according to the first identity key, if the decryption is successful, the identity information of the client is verified, if the decryption fails, the identity information of the client is verified failed.

[0045] Specifically, in step S23, before the server adds the client to the point-to-point connection group, the process further includes: S2301. The server sends the second identity key of the server to the client.

[0046] S2302. The client verifies the identity information of the server according to the second identity key. If the verification is successful, the client sends a verification success message to the server.

[0047] S2303: If the server receives the verification success information, it adds the client to the point-to-point connection group.

[0048] S24. If the client receives the connection response information, it creates a socket connection with the server according to the connection information to realize the screen projection connection between the server and the client.

[0049] In some embodiments, when the client receives the connection response information returned by the server, the client returns the Wifi Direct connection success event (WIFI_P2P_CONNECTION_CHANGED_ACTION) through BroadcastReceiver. When the client receives the Wifi Direct connection success event, it will create a socket connection according to the IP address of the server. After the socket connection is successfully created, the client sends the screen projection data to the server through the connection to complete the screen projection task.

[0050] Please refer to Figure 4 , Embodiment 2 of the present invention is: A screen projection method based on Wifi direct connection, which differs from the first embodiment in that the specific implementation method of step S22 and step S23 is limited.

[0051] In some embodiments, the transmission parameters that need to be negotiated between the server and the client in step S22 include data transmission rate, data encryption method, and authentication protocol.

[0052] In step S22, the server and the client negotiate transmission parameters including: S221. The server sends a service parameter list configured with a first weight to the client, where the service parameter list is a transmission parameter supported by the server.

[0053] S222. The client compares the service parameter list with a client parameter list configured with a second weight to determine candidate transmission parameters that exist in both the client parameter list and the service parameter list, where the client parameter list is the transmission parameters supported by the client.

[0054] S223: The client marks the candidate transmission parameter having the largest sum of the first weight and the second weight as a target transmission parameter, and sends the target transmission parameter to the server.

[0055] The first weight and the second weight are determined according to the data transmission performance of the server and the client. Each type of transmission parameter is configured with a corresponding weight. For example, the weight value of the data transmission rate is determined according to the hardware capabilities of the device and the current network environment; and the weight value of the data encryption method is determined according to the compatibility and security of the encryption technology.

[0056] In step S23, the server adds the client to the point-to-point connection group including: S231. The client detects whether it is the first connection with the server based on the identity information of the server.

[0057] S232: If yes, the client sends an address allocation request to the server to obtain an idle address in the server corresponding to the point-to-point connection group, and sends an address configuration request to the server based on the idle address.

[0058] In some embodiments, the address allocation request includes information such as the client's Mac address and host name. The client sends an address allocation request to the server to obtain a free address corresponding to the point-to-point connection group in the server. Specifically, the client sends an address allocation request to the server. If the server receives the address allocation request, it selects an unallocated IP address (i.e., a free address) that matches the client from the IP address pool corresponding to the point-to-point connection group, and sends an address response message to the client. The address response information includes the first IP address of the server, the second IP address assigned to the client by the server, the validity period of the second IP address, the subnet mask of the second IP address, the gateway, and the DNS server and other network configuration information. The address response information may also include other information options, such as a server identifier and a message type.

[0059] S233: Otherwise, the client sends an address configuration request to the server based on the historical address previously allocated by the server.

[0060] The address configuration request is used to instruct the server to allocate the idle address or the historical address to the client.

[0061] In some embodiments, the address configuration request includes the client's Mac address, the IP address requested to be configured (a free address or a historical address), and a server identifier.

[0062] Specifically, the method further includes: S234: If the server receives the address configuration request, it detects whether the idle address or the historical address exists in the address pool corresponding to the point-to-point connection group.

[0063] S235: If yes, the server allocates the free address or the historical address to the client.

[0064] In some embodiments, the server sends a configuration response message to the client to confirm that the idle address or historical address is allocated to the client. After the server completes the allocation, the P2P group data, IP address pool and IP address validity period in the server are synchronously updated.

[0065] S236. Otherwise, the server sends a configuration rejection message to the client, and the client responds to the configuration rejection message and returns to execute step S231.

[0066] Please refer to Figure 5 , Embodiment 3 of the present invention is: A screen projection system 100 based on Wifi direct connection includes a server 101 and a client 102, wherein the server 101 includes a first memory 1011, a first processor 1012, and a first computer program stored in the first memory 1011 and running on the first processor 1012, and the client 102 includes a second memory 1021, a second processor 1022, and a second computer program stored in the second memory 1021 and running on the second processor 1022, when the first processor 1012 executes the first computer program, the server steps in the screen projection method based on Wifi direct connection in the above-mentioned embodiments 1 and 2 are implemented, and when the second processor 1022 executes the second computer program, the client steps in the screen projection method based on Wifi direct connection in the above-mentioned embodiments 1 and 2 are implemented.

[0067] In summary, the present invention provides a screen projection method and system based on Wifi Direct. When the server and the client initialize Wifi Direct, they do not determine the Wifi Direct GO device through GO negotiation, but specify the server as a GO device and create a corresponding Wifi access point, so that the server allows other clients to connect to the current server. There is no need for the server and the client to communicate through a router or an additional access point, which optimizes the transmission process of the projection data, improves the stability of data transmission, and avoids the time consumed by the server and the client in GO negotiation, thereby improving the efficiency of the projection connection. At the same time, since the server is designated as a GO device, the server can connect to multiple clients at the same time, thereby having the ability to collect data and maintain connections for multiple devices at the same time, thereby improving system compatibility. In addition, in the process of realizing Wifi Direct between the server and the client, the client creates a projection connection after performing parameter negotiation, key exchange, and identity authentication with the server through a PDR request, thereby improving the security of data transmission and effectively preventing data leakage and tampering.

[0068] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A screen projection method based on Wifi direct connection, characterized in that: include: The server, in response to the Wifi Direct instruction, configures the Wifi Direct device state of the server as a GO device, creates a Wifi access point of the GO device, and broadcasts connection information of the Wifi access point to the client; If the client receives the connection information, it will create a screen projection connection with the server through the Wifi access point according to the connection information, and send the screen projection data to the server through the screen projection connection to complete the screen projection task based on the server.

2. According to the screen projection method based on Wifi direct connection according to claim 1, it is characterized in that: The server creates the Wifi access point of the GO device including: The server creates a point-to-point connection group based on the GO device state, and configures a Wifi access point based on the point-to-point connection group.

3. According to the screen projection method based on Wifi direct connection according to claim 2, it is characterized in that: The client creates a screen projection connection with the server through the Wifi access point according to the connection information, including: The client sends a connection request to the server according to the connection information; The server negotiates transmission parameters with the client in response to the connection request, and receives the first identity key of the client based on the successfully negotiated target transmission parameters; The server verifies the identity information of the client according to the first identity key, and if the verification is successful, adds the client to the point-to-point connection group and sends a connection response message to the client; If the client receives the connection response information, it creates a socket connection with the server according to the connection information to realize the screen projection connection between the server and the client.

4. According to the screen projection method based on Wifi direct connection according to claim 3, it is characterized in that: The server and the client negotiate transmission parameters including: The server sends a service parameter list configured with a first weight to the client, where the service parameter list is a transmission parameter supported by the server; The client compares the service parameter list with a client parameter list configured with a second weight to determine candidate transmission parameters that exist in both the client parameter list and the service parameter list, the client parameter list being transmission parameters supported by the client; The client marks the candidate transmission parameter having the largest sum of the first weight and the second weight as a target transmission parameter, and sends the target transmission parameter to the server; The first weight and the second weight are determined according to data transmission performance of the server and the client.

5. According to the screen projection method based on Wifi direct connection according to claim 3, it is characterized in that: Before the server adds the client to the point-to-point connection group, the server further includes: The server sends the second identity key of the server to the client; The client verifies the identity information of the server according to the second identity key, and if the verification succeeds, sends a verification success message to the server; If the server receives the verification success information, it adds the client to the point-to-point connection group.

6. According to the screen projection method based on Wifi direct connection according to claim 5, it is characterized in that: The server adds the client to the point-to-point connection group including: The client detects whether it is the first time to connect to the server according to the identity information of the server; If yes, the client sends an address allocation request to the server to obtain a free address in the server corresponding to the point-to-point connection group, and sends an address configuration request to the server based on the free address; Otherwise, the client sends an address configuration request to the server based on the historical address previously allocated by the server; The address configuration request is used to instruct the server to allocate the idle address or the historical address to the client.

7. According to claim 6, a screen projection method based on Wifi direct connection is characterized in that: Also includes: If the server receives the address configuration request, it detects whether the idle address or the historical address exists in the address pool corresponding to the point-to-point connection group; If yes, the server allocates the free address or the historical address to the client; Otherwise, the server sends a rejection configuration message to the client, and the client responds to the rejection configuration message and returns to execute the step of detecting whether it is the first connection with the server according to the identity information of the server.

8. The screen projection method based on Wifi direct connection according to claim 1, characterized in that: After the server configures the Wi-Fi direct device state of the server as a GO device, the method further includes: The server configures the connection mode of the GO device to be a key connection mode.

9. According to the screen projection method based on Wifi direct connection according to claim 3, it is characterized in that: The server verifies the identity information of the client according to the first identity key, including: The server decrypts the encrypted identity information of the client according to the first identity key. If the decryption is successful, the identity information of the client is verified. If the decryption fails, the identity information of the client is not verified.

10. A screen projection system based on Wifi direct connection, characterized in that: It includes a server and a client, the server includes a first memory, a first processor, and a first computer program stored in the first memory and running on the first processor, the client includes a second memory, a second processor, and a second computer program stored in the second memory and running on the second processor, and is characterized in that when the first processor executes the first computer program, it implements the various steps of the server in a screen projection method based on Wifi direct connection as claimed in any one of claims 1-9, and when the second processor executes the second computer program, it implements the various steps of the client in a screen projection method based on Wifi direct connection as claimed in any one of claims 1-9.