A data transmission method, apparatus, device and medium

By customizing the peripheral communication protocol between game applications and peripheral devices, the problem of operating system limitations is solved, enabling direct data transmission, enriching gameplay and control capabilities, and improving the user experience.

CN117012017BActive Publication Date: 2026-01-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210466211.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2026-01-27
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

Data transmission between existing peripheral devices and game applications relies on the operating system, which prevents the functionality of newly added hardware from being utilized, thus limiting gameplay and user experience.

Method used

By customizing peripheral communication protocols between game applications and peripheral devices, direct data transmission is achieved using communication drivers, independent of the operating system, and supports a wide range of gameplay options.

Benefits of technology

It enables direct communication between peripheral devices and game applications, enriching game control capabilities and enhancing user engagement and gaming experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117012017B_ABST
    Figure CN117012017B_ABST
Patent Text Reader

Abstract

Embodiments of the application disclose a data transmission method, device and equipment and medium, wherein the method comprises: when target data needs to be transmitted between a game application in a target terminal and a peripheral device, obtaining a peripheral communication protocol; and transmitting the target data between the game application and the peripheral device by using the peripheral communication protocol and a communication driver. The embodiments of the application can realize direct communication between the peripheral device and the game application, support rich game play, and thus improve the game experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to the field of data transmission, and in particular to a data transmission method, a data transmission device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] A peripheral device directly operated by an object (or game player, player object, etc.) is a hardware device that is external to a target terminal and used to send data (such as game data) to control the game application running on the target terminal. Currently, data transmission between peripheral devices and game applications is forwarded through the target terminal's operating system (such as the Android operating system).

[0003] Practical experience has shown that existing methods of forwarding data via the operating system have significant limitations. For example, if new hardware is added to a peripheral device, and the operating system cannot recognize or support the data associated with that hardware, the operating system cannot correctly forward that data to the game application, preventing the new hardware from functioning. Therefore, relying on the operating system to forward data between peripheral devices and game applications limits gameplay, restricts the development of both peripheral devices and game applications, and ultimately degrades the user experience. Summary of the Invention

[0004] This application provides a data transmission method, apparatus, device, and medium that enables direct communication between peripheral devices and game applications, supports a variety of gameplay options, and thus enhances the gaming experience.

[0005] On one hand, embodiments of this application provide a data transmission method, the method comprising:

[0006] When the game application and peripheral device in the target terminal need to transmit target data, the peripheral communication protocol is obtained; the target terminal sends and receives data through its internal communication driver, and the peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver.

[0007] Using peripheral communication protocols and communication drivers, target data is transmitted between the game application and the peripheral device.

[0008] On the other hand, embodiments of this application provide a data transmission apparatus, the apparatus comprising:

[0009] The acquisition unit is used to acquire the peripheral communication protocol when the game application in the target terminal and the peripheral device need to transmit target data. The target terminal sends and receives data through its internal communication driver. The peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver.

[0010] The processing unit is used to transmit target data between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.

[0011] In one implementation, when the processing unit is used to transmit target data between the game application and the peripheral device using a peripheral communication protocol and a communication driver, it may specifically be used to:

[0012] The target data is encapsulated using a peripheral communication protocol to obtain encapsulated data;

[0013] The encapsulated data is sent to the communication driver so that the data receiver can obtain the encapsulated data from the communication driver;

[0014] In this context, if the encapsulated data is sent from the game application to the communication driver, the data receiver refers to the peripheral device; if the encapsulated data is sent from the peripheral device to the communication driver, the data receiver refers to the game application.

[0015] In one implementation, the peripheral communication protocol specifies information structures corresponding to one or more data types; the processing unit, when encapsulating target data using the peripheral communication protocol to obtain encapsulated data, can specifically be used for:

[0016] Determine the data type of the target data;

[0017] In the peripheral communication protocol, query the information structure corresponding to the data type of the target data, and use it as the target information structure;

[0018] The target data is written into the target information structure to obtain the encapsulated data.

[0019] In one embodiment, the device is integrated into a game application, and the communication driver includes interface declarations for one or more communication interfaces of the peripheral device; the processing unit can also be used for:

[0020] Scan the interface declarations of each communication interface of the peripheral device from the communication driver, and search for the specified protocol identifier in each interface declaration.

[0021] If the specified protocol identifier is found in at least one interface declaration, the communication protocol identified by the specified protocol identifier is determined to be the peripheral communication protocol.

[0022] In one implementation, the target data includes an information query request for querying device information of a peripheral device, wherein the device information includes at least the feature information supported by the peripheral device; the processing unit can also be used for:

[0023] After the peripheral device sends a feedback result in the communication driver, the feedback result is obtained from the communication driver. The feedback result is obtained by the peripheral device responding to the information query request and encapsulating the device information using the peripheral communication protocol.

[0024] The feedback results are decapsulated according to the peripheral communication protocol to obtain the device information of the peripheral device.

[0025] In one implementation, the characteristic information is used to indicate at least one device capability of the peripheral device; the processing unit can also be used for:

[0026] If an input command is received from a peripheral device, the reference device capability required by the peripheral device to generate the input command is determined.

[0027] Capability matching is performed on at least one device capability indicated by the characteristic information using the baseline device capability;

[0028] The validity of the input command is checked based on the capability matching result; if the reference device capability matches at least one device capability, the input command is determined to be a valid command.

[0029] In one implementation, the target data includes peripheral control instructions, and the processing unit can also be used for:

[0030] If it is detected that a peripheral device needs to be controlled to perform a target game feedback operation, then the feature information supported by the peripheral device is obtained. The feature information is used to indicate at least one device capability of the peripheral device.

[0031] Find the target device capability among at least one device capability indicated by the characteristic information, where the target device capability refers to: the device capability used to support peripheral devices in performing the target game feedback operation;

[0032] If the target device capability is found, peripheral control commands are generated to control the peripheral device to perform the target game feedback operation.

[0033] In one embodiment, the peripheral device includes one or more vibration devices, and the target game feedback operation includes a target vibration operation; the processing unit can also be used for:

[0034] If a vibrating object is detected in the game screen of the target game during the running of the game application, the operation of controlling the default vibration device in the peripheral device to vibrate will be determined as the target vibration operation.

[0035] Alternatively, based on the position of the vibrating object in the game screen and the position information of each vibration device in the peripheral device, a target vibration device is selected from the peripheral device, and the operation used to control the target vibration device to vibrate is determined as the target vibration operation.

[0036] In one implementation, the game application runs on the operating system of the target terminal, and when the peripheral device is in a customized communication mode, the operating system supports the peripheral device and the game application to transmit any data by using the peripheral communication protocol.

[0037] The target data includes a mode switching command, which is used to instruct the peripheral device to switch the communication mode to a customized communication mode so that the peripheral device can use the peripheral communication protocol to transmit data during the running of the target game in the game application.

[0038] The processing unit can also be used for:

[0039] The system detects whether the operating system supports mode switching commands and transmits them through peripheral communication protocols and communication drivers.

[0040] If supported, the step of obtaining the peripheral communication protocol will be triggered.

[0041] If not supported, a vibration sequence is generated, which is used to trigger the peripheral device to switch execution modes. The vibration sequence and target data are sent to the management module of the operating system so that the management module can forward the vibration sequence and target data to the peripheral device through the communication driver.

[0042] In one embodiment, the device is mounted on a peripheral device, and the processing unit can also be used for:

[0043] During the running of the target game in the game application, if a target operation is detected by the target game's operation object, an object input signal is generated as target data based on the target operation;

[0044] In this process, after obtaining the target data, the game application updates the game screen of the target game based on the target data.

[0045] In one embodiment, the device is mounted on a peripheral device, and the processing unit can also be used for:

[0046] During the operation of peripheral devices, the device power level is obtained;

[0047] If the device's battery level is lower than the battery threshold, a battery warning signal will be generated as the target data.

[0048] After acquiring the target data, the game application generates a battery warning message based on the target data and displays the battery warning message in the game application's interface.

[0049] In one implementation, the peripheral device includes a custom communication interface based on a peripheral communication protocol, the custom communication interface including a custom input endpoint and a custom output endpoint;

[0050] The peripheral device sends data to the communication driver through the customized input endpoint; and the peripheral device obtains data from the communication driver through the customized output endpoint.

[0051] In one implementation, the target data is transmitted while the peripheral device is in a custom communication mode;

[0052] The peripheral devices operate in a customized communication mode by receiving heartbeat commands from the game application through customized output endpoints.

[0053] In another aspect, embodiments of this application provide an electronic device, which includes:

[0054] A processor, adapted to execute computer programs;

[0055] A computer-readable storage medium storing a computer program, which is loaded by a processor and performs the following steps:

[0056] When the game application and peripheral device in the target terminal need to transmit target data, the peripheral communication protocol is obtained; the target terminal sends and receives data through its internal communication driver, and the peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver.

[0057] Using peripheral communication protocols and communication drivers, target data is transmitted between the game application and the peripheral device.

[0058] In another aspect, embodiments of this application provide a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed as follows:

[0059] When the game application and peripheral device in the target terminal need to transmit target data, the peripheral communication protocol is obtained; the target terminal sends and receives data through its internal communication driver, and the peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver.

[0060] Using peripheral communication protocols and communication drivers, target data is transmitted between the game application and the peripheral device.

[0061] In another aspect, embodiments of this application provide a computer program product, which includes computer instructions that are loaded by a processor and executed in the following steps:

[0062] When the game application and peripheral device in the target terminal need to transmit target data, the peripheral communication protocol is obtained; the target terminal sends and receives data through its internal communication driver, and the peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver.

[0063] Using peripheral communication protocols and communication drivers, target data is transmitted between the game application and the peripheral device.

[0064] In this embodiment, a customized peripheral communication protocol can be established between the game application and the peripheral device according to the data transmission specifications followed by the communication driver in the target terminal. Since this customized peripheral communication protocol is written based on the data transmission specifications followed by the communication driver, and these specifications are universally applicable across various terminals, this allows the customized peripheral communication protocol to support cross-terminal use, improving its applicability. Furthermore, using this customized peripheral communication protocol enables direct communication between the game application and the peripheral device, freeing the data transmitted between them from the limitations of the operating system in the target terminal. This allows for the transmission of richer data between the game application and the peripheral device, providing enhanced game control capabilities and ultimately increasing user engagement. Attached Figure Description

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

[0066] Figure 1a This invention provides a schematic diagram of the structure of a data transmission system according to an exemplary embodiment of the present application.

[0067] Figure 1b This illustration shows a schematic diagram of the data flow in a cloud gaming scenario provided by an exemplary embodiment of this application.

[0068] Figure 1c This invention provides a schematic diagram of the structure of a data transmission system according to an exemplary embodiment of the present application.

[0069] Figure 1dThis illustration shows a schematic diagram of a peripheral device and a target terminal establishing a connection according to an exemplary embodiment of this application;

[0070] Figure 1e This illustration shows a schematic diagram of an existing data transmission method provided by an exemplary embodiment of this application;

[0071] Figure 1f This illustration shows a schematic diagram of data transmission when the target game is a cloud game, according to an exemplary embodiment of this application.

[0072] Figure 1g This illustration shows a schematic diagram of data transmission when the target game is a local game, according to an exemplary embodiment of this application.

[0073] Figure 2a A schematic flowchart of a data transmission scheme provided by an exemplary embodiment of this application is shown;

[0074] Figure 2b This illustration shows a schematic diagram of the software structure of a peripheral device supporting a peripheral communication protocol, provided by an exemplary embodiment of this application.

[0075] Figure 3 This illustration shows a schematic diagram of downlink and uplink transmission between a peripheral device and a game application according to an exemplary embodiment of this application;

[0076] Figure 4 A flowchart illustrating a data transmission method provided in an exemplary embodiment of this application is shown.

[0077] Figure 5a This illustration shows a schematic diagram of a game application querying device information of a peripheral device according to an exemplary embodiment of this application;

[0078] Figure 5b This illustration shows a schematic diagram of a game application querying device information of a peripheral device according to an exemplary embodiment of this application;

[0079] Figure 6a This illustration shows a schematic diagram of a game application controlling a peripheral device to perform game feedback, provided by an exemplary embodiment of this application.

[0080] Figure 6b This illustration shows a schematic diagram of a peripheral device performing vibration operation according to an exemplary embodiment of this application;

[0081] Figure 6c This illustration shows a schematic diagram of a peripheral device performing vibration operation according to an exemplary embodiment of this application;

[0082] Figure 7aThis illustration shows a schematic diagram of a direct transmission mode switching command between a game application and a peripheral device, provided in an exemplary embodiment of this application.

[0083] Figure 7b This illustration shows a schematic diagram of a mode switching command forwarded via the operating system, provided in an exemplary embodiment of this application.

[0084] Figure 8 This illustration shows a schematic diagram of a peripheral device sending an object input signal of an operation object input to a game application, according to an exemplary embodiment of this application.

[0085] Figure 9 This illustration shows a schematic diagram of a peripheral device actively initiating a power warning signal, provided in an exemplary embodiment of this application.

[0086] Figure 10 This illustration shows a schematic diagram of the structure of a data transmission apparatus provided in an exemplary embodiment of this application;

[0087] Figure 11 A schematic diagram of the structure of an electronic device provided in an exemplary embodiment of this application is shown. Detailed Implementation

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

[0089] This application embodiment relates to a data transmission system, which includes at least peripheral devices and a target terminal; the data transmission system can be found in [reference needed]. Figure 1a The number of peripheral devices and target terminals in this application embodiment is not limited; for example, in a game scenario where multiple people participate in the target game, one target terminal can be connected to two or more peripheral devices to control the game application running on the target terminal through multiple peripheral devices; as another example, one peripheral device can also be connected to two or more target terminals to achieve split-screen display of the game screen using multiple target terminals. The various electronic devices involved in this data transmission system are described below, wherein:

[0090] (1) The target terminal can refer to any terminal running a game application; the game application may include a client (or web application or mini-program, etc.) providing the target game. The target terminal has certain data processing and screen display capabilities. Optionally, the target terminal may include two or more terminal devices. For example, the target terminal may include a data processing device with data processing capabilities and a display device with screen display capabilities. In this implementation, the data processing device and the display device need to run the game application together, and the data processing device and the display device can be connected via wired or wireless connection so that the data generated by the data processing device (such as the game screen) can be transmitted to the display device for display. For example, the data processing device is a host with data processing capabilities, and the display device is a monitor with screen display capabilities. Optionally, the target terminal can also be an all-in-one machine, in which case the target terminal has both data processing and screen display capabilities; in this implementation, the target terminal not only supports data processing of game data related to the game application, but also supports displaying the game screen through the display screen. Target terminals may include, but are not limited to: smartphones (such as Android phones, iOS phones, etc.), tablets, portable personal computers, mobile internet devices (MIDs), smart TVs, in-vehicle devices, head-mounted devices, etc.

[0091] The target games provided by the game applications running on the target terminal can be classified according to different conditions. Based on the different running conditions, target games can be divided into local games and online games. Local games refer to games that run locally on the target terminal and do not require a network connection; online games refer to games that rely on a network to load their data before running. Alternatively, based on the different running modes, target games can be divided into client games, web games, and cloud gaming. Client games, also known as PC games, are games that run on a personal computer (PC). Web games, also known as browser games, are games that run on a game webpage provided by a browser. Cloud gaming, also known as gaming on demand, refers to games that run on a cloud server (or cloud server). Specifically, in the cloud gaming mode, the game application can send data (such as input commands or signals) from peripheral devices to the cloud server. The cloud gaming server is responsible for rendering the game screen based on the data, compressing the rendered game screen, and transmitting it over the network to the target terminal used by the user. At this time, the target terminal only performs the operation of displaying the game screen, such as... Figure 1bAs shown. This operating mode of cloud gaming means that the target terminal held by the player does not need to have powerful graphics computing and data processing capabilities. It only needs to have basic streaming media playback capabilities (such as the ability to display game screens), human-computer interaction capabilities (the ability to obtain input operations from the object being operated), and data transmission capabilities (such as the ability to send instructions to the cloud server). This application embodiment does not limit the specific type of target game running on the target terminal, but this is only a description of the case.

[0092] When the target game is one of the aforementioned online games, such as cloud gaming, client-based games requiring multiplayer collaboration, or web-based games, the data processing system provided in this application embodiment further includes at least one server, such as... Figure 1c As shown in the diagram. In this implementation, the server can refer to the backend server corresponding to the game application running on the target terminal, used to interact with the target terminal running the game application and provide computing and application service support for the game application. The server can include, but is not limited to, devices with complex computing capabilities such as data processing servers, web servers, and application servers; or, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. As described above, the target game can include cloud gaming. Therefore, in the case of cloud gaming, the aforementioned server can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0093] (2) Peripheral devices, also known as input devices, external devices, game control devices, or game operation devices, refer to hardware devices that are external to the target terminal and directly operated by the user to control the game application running on the target terminal. Peripheral devices may include, but are not limited to, handheld game controllers (or simply game controllers), wearable game consoles, mice, or keyboards; for ease of explanation, a handheld game controller will be used as an example in the following description. It should be noted that although peripheral devices and the target terminal are independent hardware devices, a communication connection can be established between them. In this way, the user can operate the peripheral device to control the target game provided by the game application running on the target terminal.

[0094] In practical applications, peripheral devices can be configured with receivers. By connecting this receiver to the physical interface (or hardware interface) provided by the target terminal, a communication connection can be established between the peripheral device and the target terminal through this physical interface. An exemplary diagram illustrating the establishment of a communication connection between a peripheral device and a target terminal via a receiver and a physical interface can be found here. Figure 1d ,like Figure 1d As shown, the target terminal 101 includes at least one physical interface 1011. A receiver 102 configured for a peripheral device can be inserted into the physical interface 1011 provided by the target terminal 101 to establish a communication connection between the peripheral device and the target terminal. It should also be noted that... Figure 1d The receiver 102 shown is wirelessly connected to the peripheral device 103. In this case, wireless communication modules can be deployed in both the peripheral device 103 and the receiver 102 to facilitate data transmission between them via wireless communication modules (such as Bluetooth, Wi-Fi, or RF signal modules). For example, the peripheral device 103 can send its own information (such as device model or manufacturer information) to the receiver 102 through the wireless communication module. Alternatively, the receiver 102 and the peripheral device 103 can also be wired. In this case, the receiver 102 can be configured with a data transmission line, which can establish a connection between the peripheral device and the game application. Regardless of whether the connection between the peripheral device and the receiver is wired or wireless, the peripheral device can send data to the receiver so that the target terminal can scan the peripheral device's device information from the receiver, thereby enabling data transmission between the peripheral device and the target terminal.

[0095] The physical interface provided by the target terminal may include a USB (Universal Serial Bus) interface. In this case, a peripheral device plugged into this USB interface can be referred to as a USB device. A USB interface refers to an interface in the target terminal that conforms to the USB standard or specification. The USB standard is an external bus standard (or serial bus standard), and also a technical specification for an input / output interface (or communication interface), used to standardize the connection and communication between the target terminal (such as a personal computer) and peripheral devices (such as game controllers). Furthermore, if a USB interface is deployed in the target terminal, and you want the plugged-in peripheral device (or USB device) to work properly, then a USB driver (or simply USB driver) needs to be installed inside the target terminal. This allows the target terminal to recognize the plugged-in peripheral device and send / receive data, such as retrieving data sent by the USB device, to achieve the desired effect of the USB device.

[0096] Therefore, when a communication driver (such as the aforementioned USB driver) is installed on the target terminal, the target terminal can send and receive data through its internal communication driver. Sending and receiving data refers to receiving and sending data. For example, after a peripheral device sends data to a receiver, the USB driver can scan the receiver for the target data (such as any data) sent by the peripheral device. Specifically, it scans for the encapsulated data obtained by the peripheral device after encapsulating the target data. Then, it performs corresponding feedback processing based on the target data obtained by decapsulating the encapsulated data. For example, if the target data includes a target signal for adjusting the volume, the volume of the target terminal or game application can be increased accordingly based on this target signal. The aforementioned encapsulated data is specifically obtained by encapsulating the target data according to a communication protocol. The communication protocol is written according to the HID (Human Interface Device) specification followed by the USB driver. When the USB driver scans any packaged data, it can check the data format of that packaged data using the HID specification. Only if the data format of any packaged data conforms to the HID specification is the packaged data cached, thus filtering out data that does not conform to the HID specification. The HID specification is a human interface specification (or standard), which can be simply understood as a computer language that defines the data format during data transmission. The HID specification in the USB driver is unified and universal, meaning that the HID specification followed by USB drivers deployed on different terminals is the same. This allows communication protocols written according to the HID specification to be supported by most devices, thereby improving the applicability of the communication protocol to a certain extent.

[0097] In summary, in the data transmission system provided in this application embodiment, the user can use a peripheral device to control the target game running on the target terminal. For ease of description, this method of controlling the target game using a peripheral device can be referred to as a large-screen game in this application embodiment. That is, a large-screen game can refer to a gameplay method in which a separate target terminal is used to display the game screen or game scene of the target game, and a peripheral device attached to the target terminal is used to control the target game displayed on the target terminal. Therefore, in the large-screen game scenario, the target terminal used to display the game screen of the target game and the peripheral device used to control the target game are separate. Compared to using the same device to control the target game, this method of controlling the target game using a peripheral device avoids obstructing the game screen when the user controls the game on the display screen, helping the user to better participate in the target game and providing a more immersive gaming experience.

[0098] To enrich the user's control over peripheral devices and game applications in large-screen games and improve user stickiness, this application proposes a data transmission scheme based on the aforementioned data transmission system. This data transmission scheme supports the customization of a peripheral communication protocol (or proprietary protocol, customized communication protocol, HID protocol) between the game application and peripheral devices. Specifically, it is a peripheral communication protocol customized according to business needs, following the data transmission specifications (such as the aforementioned HID specification) followed by the communication driver (such as the aforementioned USB driver) within the target terminal. Then, the peripheral devices and the game application communicate directly according to this peripheral communication protocol and through the communication driver in the target terminal.

[0099] Practice has shown that the data transmission scheme provided in this application has significant advantages when transmitting data between peripheral devices and game applications. The advantages of this application's scheme are illustrated below by comparing it with existing mainstream data transmission processes between peripheral devices and game applications:

[0100] Currently, mainstream peripheral devices and game applications communicate indirectly according to a default communication protocol. This default protocol is written by the developers of the target terminal's operating system according to business requirements. This means that when data is transmitted between the peripheral device and the game application using this default protocol, the peripheral device relies on the target terminal's operating system management module (or input management module) to forward data (such as the encapsulated data generated by the peripheral device mentioned above) to the game application. Figure 1eAs shown, the operating system in the target terminal receives data sent by peripheral devices through a communication driver running on the target terminal. Then, the operating system forwards the data obtained from the communication driver to the game application, allowing the game application to process the feedback based on the data forwarded from the operating system. In other words, data transmission between peripheral devices and the game application must be forwarded by the operating system. This results in many game inputs not supported by the operating system being unable to be forwarded, significantly limiting the game control capabilities of both peripheral devices and the game application. For example, this limitation can be manifested in the following two exemplary points: 1. If the peripheral device manufacturer adds customized hardware structures to the existing peripheral devices, such as a six-axis gyroscope sensor or a pressure sensor, and the operating system's default customized protocol does not support data related to this added hardware structure, then after the operating system obtains this data, the management device in the operating system does not support forwarding this data to the game application, rendering the functionality of the added hardware structure unusable, thus limiting the development of peripheral devices. 2. When a game application wants to generate vibration feedback or similar effects on peripheral devices, if the operating system's management module does not support transmitting the vibration data sent by the game application, the peripheral device cannot receive the vibration data, thus failing to achieve the vibration effect, resulting in poor game performance and reducing the user's gaming experience.

[0101] However, in this embodiment, the peripheral device and the game application can communicate directly according to a peripheral communication protocol. This peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver, making the data transmission between the peripheral device and the game application independent of the operating system and not limited by the operating system, thereby eliminating the operating system limitations described above. For example, the data transmission process between the peripheral device and the game application in a cloud gaming scenario can be found in [reference needed]. Figure 1f As shown, for example, the data transmission process between peripheral devices and game applications in a PC game scenario can be found in [reference needed]. Figure 1g As shown; Figure 1f or Figure 1g As shown, after the communication driver in the target terminal obtains the data sent by the peripheral device, the game application can directly scan the data sent by the peripheral device from the communication driver without being restricted by the operating system in the target terminal.

[0102] As can be seen from the above description, the data transmission scheme provided in this application has the following main advantages: 1. When the peripheral device includes a new hardware structure, peripheral manufacturers and game application developers can expand the peripheral communication protocol, specifically by adding relevant protocols for the new hardware structure to the peripheral communication protocol. This allows the expanded peripheral communication protocol to realize the relevant functions of the newly added hardware structure in the peripheral device, thereby enriching gameplay and enhancing game control capabilities. 2. Without changing the original hardware structure of the peripheral device, the peripheral communication protocol can fully reflect the input characteristics or feedback characteristics (such as vibration characteristics) of the peripheral device in the target game, allowing the original functions of the peripheral device to be fully utilized. 3. Since the peripheral communication protocol is customized according to the HID specification in the communication driver, and the HID specification in the communication driver is unified across all terminals, the peripheral communication protocol provided in this application can be unified across terminals. Whether it is a cloud gaming application developer or a peripheral manufacturer producing peripheral devices, they can develop only once based on this peripheral communication protocol to enable the developed game application or peripheral device to be used across terminals. For example, peripheral devices using this peripheral communication protocol can be connected to a smart computer to enable direct communication with game applications running on the smart computer according to the peripheral communication protocol; another example is that peripheral devices using this peripheral communication protocol can also be connected to a television to enable live communication with game applications running on the television according to the peripheral communication protocol.

[0103] Furthermore, to enable developers of different games to integrate the peripheral communication protocol provided in this application embodiment when developing games (such as local games), and considering the high adoption rate of the peripheral communication protocol, this application embodiment also supports encapsulating the ability to use the peripheral communication protocol into a Software Development Kit (SDK). This allows developers to integrate the peripheral communication protocol into a cross-terminal SDK when developing a reference game (such as any game). In this way, the reference game with the SDK integrated can interact with the corresponding peripheral device through the peripheral communication protocol, without being limited by the operating system. Here, an SDK refers to a collection of development tools used to build application software for specific software packages, software frameworks, hardware platforms, operating systems, etc. This collection includes relevant documentation, examples, and tools to assist in the development of a certain type of software, such as the peripheral communication protocol to assist in the development of any game software. An SDK includes an Application Programming Interface (API), which refers to predefined functions used for data communication. APIs are used to connect different components of the system. For example, in this embodiment, the SDK includes a protocol interface. After the reference game developed by the developer is launched, it can access a set of routines (such as peripheral communication protocols) in the game application that includes the target game through the protocol interface provided by the game application that includes the target game, without needing to access the source code or understand the details of the internal working mechanism. In this way, after the game application that includes the reference game integrates the software development kit corresponding to the protocol interface of the game application that includes the target game, when the software development kit in the game application that includes the reference game is triggered, the protocol interface of the game application that includes the target game is called, so that the game application that includes the reference game can call the peripheral communication protocol through the protocol interface to perform data transmission.

[0104] Based on the above description of the data transmission scheme involved in the embodiments of this application, the following is in conjunction with... Figure 2a A brief introduction to the general principles of the data transmission scheme is provided. (See also...) Figure 2a As shown, the process of data transmission between peripheral devices and game applications according to the peripheral communication protocol may involve the following stages:

[0105] (1) Initial Stage: When the target device needs to control a game application running on the target terminal using a peripheral device, the receiver configured on the peripheral device can be inserted into the physical interface provided by the target terminal. At this time, the peripheral device can send the interface declarations of one or more of its communication interfaces to the receiver. In this way, the communication driver in the target terminal can scan the interface declarations of each communication interface of the peripheral device from the receiver. The communication driver can periodically scan the receiver to obtain data (such as interface declarations). The interface declaration of the communication interface can be simply understood as a declaration of a set of methods supported by the communication interface. For example, if a protocol identifier is added to the interface declaration of the communication interface, then the interface declaration can be used to determine that the communication interface supports data transmission according to the communication protocol corresponding to the protocol identifier.

[0106] Furthermore, after the target device opens and launches the game application through the target terminal, the game application can scan the interface declarations of one or more communication interfaces of the peripheral device from the communication driver in the target terminal. If the game application scans a specified protocol identifier from the communication driver, it determines the communication protocol identified by the specified protocol identifier as the peripheral communication protocol. That is, the game application confirms that the peripheral device with which it has established a connection is a peripheral device that supports the peripheral communication protocol.

[0107] Among them, the software input communication module of peripheral devices that support peripheral communication protocols must comply with... Figure 2b The structure shown is implemented as follows; Figure 2bAs shown, the peripheral device includes a customized communication interface based on a peripheral communication protocol. Specifically, the software input communication module includes this customized communication interface; that is, the software input communication module of the peripheral device includes a customized communication interface that supports data transmission according to the peripheral communication protocol. Furthermore, this customized communication interface includes at least a customized input endpoint and a customized output endpoint. An endpoint can be understood as a data buffer used to temporarily store data; the input or output of the endpoint is determined by the data flow direction when the game application sends and receives data. For example, the data flow direction of the customized input endpoint is the same as the data flow direction when the game application receives data. In this case, data flows from the peripheral device to the game application. That is, the peripheral device can send data to the customized input endpoint in the customized interface for buffering, and then the communication driver can retrieve the buffered data from the customized input endpoint. The game application then scans the retrieved buffered data from the communication driver to realize the data flow from the peripheral device to the game application. For example, the data flow direction of the customized output endpoint is the data flow direction when the game application sends data. In this case, the data flows from the game application to the peripheral device. That is, the game application can send data to the driver application, and then the driver application sends the data to the customized output endpoint in the customized interface for caching. Then the peripheral device retrieves the cached data from the customized output endpoint to realize the data flow from the game application to the peripheral device.

[0108] Furthermore, to ensure compatibility with existing data transmission methods, this embodiment supports the coexistence of peripheral communication protocols and existing default communication protocols in software. That is, while including a customized peripheral communication protocol, the peripheral device must retain its existing default communication protocol. Therefore, the software input communication module of the peripheral device includes not only a customized communication interface but also a default communication interface based on the original default communication protocol. In other words, while including customized input and output endpoints, the peripheral device must retain its existing default input and output endpoints to preserve the original peripheral data transmission method. This ensures that even when the game application supporting the peripheral communication protocol is not running, the peripheral device can still interact with the operating system according to the original default communication protocol. And when the game application supporting the peripheral communication protocol is running, the peripheral communication protocol can be activated to transmit data based on the customized input and output endpoints, while the original input and output endpoints are paused.

[0109] (2) Game Application Initialization Stage. Before the user controls the target game provided by the game application through the peripheral device, this embodiment of the application also needs to perform initialization processing on the game application. This initialization processing may include: the process of the game application obtaining device information of the peripheral device. Specifically, after the game application determines that the peripheral device is a device that supports the peripheral communication protocol, the game application can query the device information of the peripheral device so that it can subsequently perform validity checks on input and output commands based on the device information. Specifically, the game application can generate an information query request according to the peripheral communication protocol and use the information query request as the target data; then, it can encapsulate the target data according to the peripheral communication protocol; and send the encapsulated data obtained by the encapsulation processing to the customized input interface through the communication driver. In this way, the peripheral device can respond to the information query request, encapsulate the device information using the peripheral communication protocol, and report the encapsulated feedback result to the game application through the communication driver so that the game application can obtain the device information of the peripheral device.

[0110] The device information for peripheral devices may include, but is not limited to, characteristic information, capability information, and detailed information. Characteristic information indicates at least one capability of the peripheral device. For example, if the peripheral device includes a gyroscope, then the peripheral device has the capability to upload gyroscope data. Capability information indicates the device information required for each capability of the peripheral device. For example, if the peripheral device has the capability to upload gyroscope data, then the peripheral device includes a gyroscope capable of generating gyroscope data, and the capability information includes the device information for that gyroscope. Detailed information indicates detailed device information for the peripheral device, such as the device manufacturer or model. After obtaining the detailed information of the peripheral device, the game application can better control the quality and performance of the game product based on this detailed information, thereby improving the gaming experience for the users.

[0111] (3) Peripheral Device Initialization Stage. Before the user controls the target game provided by the game application through the peripheral device, this embodiment of the application also needs to perform initialization processing on the peripheral device. This initialization processing may include: switching the working mode (or communication mode) of the peripheral device to a customized communication mode; at this time, the peripheral device suspends the use of the default communication protocol for data transmission and starts the customized peripheral communication mode for data transmission. When the peripheral device is in the customized communication mode, the operating system in the target terminal supports the peripheral device and the game application to transmit any data through the peripheral communication protocol. In this way, during the subsequent process of the user controlling the target game provided by the game application according to the peripheral device, the peripheral device can send the target data generated according to the user's target operation to the game application according to the peripheral communication protocol, providing richer game control capabilities. Specifically, after the game application determines that the peripheral device is a hardware device that supports the peripheral communication protocol, it can send a mode switching command to the peripheral device. This mode switching command is used to instruct the peripheral device to switch its working mode to the customized communication mode; then the peripheral device can switch from the current communication mode to the customized communication mode in response to the mode switching command. The current communication mode refers to the communication mode that the peripheral device is in when it receives a mode switching command. In cases where the peripheral device includes both a default communication mode and a custom communication mode, the current communication mode here may refer to the default communication mode. When the peripheral device is in the default communication mode, it uses the default communication protocol to interact with the game application. A description of the default communication protocol can be found above and will not be repeated here.

[0112] (4) Game Control Stage. After completing steps (1)-(3) above, the game application can determine that the peripheral device is a hardware device that supports the peripheral communication protocol, and the game application can obtain the device information of the peripheral device; in addition, the peripheral device has switched its working mode to the customized communication mode. From this point on, the user can use the peripheral device's general input capabilities (such as the capabilities contained in the original communication protocol, such as the ability to operate the remote control in the peripheral device), as well as the special input capabilities contained in the peripheral communication protocol (such as the ability of the peripheral device to vibrate), to control the target game provided by the game application. In other words, when the game application finds the peripheral device's device information and the peripheral device is in the customized communication mode, the user can operate the peripheral device to control the target game provided by the game application; for the device, the peripheral device and the game application can transmit data according to the peripheral communication protocol, such as the peripheral device sending data or battery warning information generated according to the user's target operation to the game application, and the game application can make the peripheral device perform corresponding game feedback operations (such as vibration operation).

[0113] (5) End Phase. When the user ends the operation of the target game, such as when the user closes the game application on the target terminal, the game application can send a mode switch back instruction to the peripheral device. This mode switch instruction is used to instruct the peripheral device to switch back from the customized communication mode to the original communication mode. In this way, the peripheral device stops using the peripheral communication protocol for data transmission and starts the original default communication mode for data transmission.

[0114] The above steps (1)-(5) provide a relatively complete technical flow of the data transmission scheme provided by the embodiments of this application; however, in actual application scenarios, the implementation methods included in some steps may also change. For example, in the peripheral device initialization stage shown in step (3), the game application is also supported to send a heartbeat command to the peripheral device to ensure that the peripheral device continues to maintain the customized communication mode after switching to the customized communication mode. In addition, it should be noted that when the embodiments of this application are applied to specific products or technologies, such as when the game application obtains the game data of the operation object, it needs to obtain the permission or consent of the operation object; and the collection, use and processing of related data need to comply with the relevant laws, regulations and standards of the relevant countries and regions, such as the game equipment provided by the game application need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0115] For ease of understanding, the embodiments of this application support summarizing the relatively complete data transmission process described above into uplink transmission (or simply uplink) and downlink transmission (or simply downlink), such as... Figure 3 As shown. In the data transmission process, uplink and downlink are determined by the data flow direction of the game application during data transmission; for example, the data transmission process from the game application to the peripheral device can be called downlink transmission, and the instructions sent by the game application to the peripheral device in this case are called downlink transmission instructions; similarly, the data transmission process from the peripheral device to the game application can be called uplink transmission, and the instructions sent by the peripheral device to the game application in this case are called uplink transmission instructions. The functions carried by the peripheral device in downlink transmission and the functions carried by the peripheral device in uplink transmission are briefly summarized below; where:

[0116] I. Downlink transmission.

[0117] 1. Hardware and software control and information retrieval.

[0118] In one implementation, the software and hardware control of the peripheral device by the game application may include: controlling the switching of the communication mode of the peripheral device, and controlling the peripheral device to perform game feedback (such as vibration control).

[0119] Optionally, the game application can control the communication mode of peripheral devices to switch between the original communication mode (such as the aforementioned default communication mode) and a customized communication mode. For example, when the game application finds a specified protocol identifier in the interface declaration of the peripheral device, it determines that the peripheral device is a hardware device that supports the peripheral communication protocol. The game application can then send a downlink transmission command to the peripheral device, which includes a mode switching command to control the peripheral device's communication mode to switch to the customized communication mode, specifically from the default communication mode. As another example, when the game application detects that the user has ended the game experience, such as when the game application detects that the user has performed a game close operation, the game application can send a downlink transmission command to the peripheral device, which includes a mode revert command to control the peripheral device's operating mode to switch back from the customized communication mode to the original communication mode, specifically from the customized communication mode back to the default communication mode.

[0120] Optionally, the game application can control peripheral devices to perform game feedback. For example, when the game application detects a vibrating object in the target game's screen that requires vibration, it can send a downlink transmission command to the peripheral device. This downlink transmission command includes a peripheral control command, specifically a vibration command, so that the peripheral device responds to the vibration command and performs a vibration operation. ① The game screen provided by the target game can be used to describe the game scene provided by the target game. This game scene may include a competition scene, a team scene, or a settlement scene, etc.; a competition scene can refer to a scene where the user controls a game character and actually participates in a competition in the target game; a team scene can refer to a scene where the user waits in the game lobby to enter a game room (such as a competition scene), in which the user can edit the attributes of the game character, such as updating the character's clothing or equipment; a settlement scene can refer to a scene used to display game results (such as points) after the game ends. ② The vibrating object in the game screen can refer to any virtual object displayed on the game screen that needs to vibrate, according to the needs of the game scene. This virtual object can be a game character or a virtual object (such as a boat, tree, or car). For example, if the game scene includes a scenario where an operator controls a game character to drive a vehicle, then when driving the vehicle on an uneven road, the vehicle and the game character need to vibrate. In this case, the vehicle and the game character can be considered as the vibrating objects in the game scene. This application embodiment does not limit the game scene provided by the target game or the vibrating objects within the game scene.

[0121] In other implementations, the information query initiated by the game application may include, but is not limited to, querying device information of the peripheral device and querying the device's battery level. The content of the peripheral device's device information can be found in the aforementioned descriptions, and will not be repeated here. After determining that the peripheral device is a hardware device supporting the peripheral communication protocol, the game application can send an information query request to the customized output endpoint, so that the peripheral device can respond to the information query request and return device information. The specific implementation process of the game application obtaining the peripheral device's device information can be found in the aforementioned descriptions. Figure 2a The specific implementation process described herein will not be elaborated upon here. During the execution of the target game within the game application, the application can periodically (e.g., at preset time intervals) generate a battery level query request. This request prompts the peripheral device to respond and send its battery level (e.g., the device's battery level at the time the query request is received) back to the game application. Upon receiving the peripheral device's battery level information, the game application updates and displays the device's battery level on its terminal screen. The preset time interval can be customized by the game developers based on business needs. When the preset time interval is short, it can, to a certain extent, achieve real-time display of the peripheral device's battery level on the game application's terminal screen, allowing users to intuitively and promptly understand the peripheral device's battery status.

[0122] It should be noted that, in order for peripheral devices to respond accordingly to downlink transmission commands sent by game applications, peripheral device manufacturers need to implement the following software logic when customizing the communication interface based on the peripheral communication protocol: The peripheral device receives encapsulated data from the custom endpoint (such as the custom output endpoint) in the custom communication interface, and performs decapsulation processing (or parsing processing, or simply parsing) on ​​the encapsulated data according to the peripheral communication protocol to obtain the downlink transmission command initiated by the game application, such as the aforementioned mode switching command or battery query command; then, it performs feedback processing based on the parsing result (i.e., the corresponding command obtained from the parsing). Depending on the downlink transmission command received by the peripheral device, the feedback processing performed by the peripheral device varies. For example, if the peripheral device parses the encapsulation data to obtain a mode switching command, the feedback processing includes switching the communication mode to a custom communication mode in response to the mode switching command. Similarly, if the peripheral device parses the encapsulation data to obtain a peripheral control command, the feedback processing includes performing vibration operation in response to the peripheral control command. Furthermore, if the peripheral device parses the encapsulation data to obtain an information query request, the feedback processing includes returning device information to the game application in response to the information query request; and so on.

[0123] 2. Keep peripheral devices in custom communication mode.

[0124] As described above, peripheral devices include both a default communication protocol and a customized peripheral communication protocol. When the peripheral device is in the customized communication mode, it transmits data with the game application according to the peripheral communication protocol. When the peripheral device is in the default communication mode, it transmits data with the game application according to the default communication protocol and forwards the data through the operating system. Therefore, to ensure that the peripheral device can still transmit data with the operating system according to the original communication protocol when the game application exits (e.g., is closed or running in the background), thus preserving the original functionality of the peripheral device, this application embodiment supports using a heartbeat mechanism to adjust the communication mode of the peripheral device.

[0125] Specifically, if the peripheral device receives a heartbeat command from the game application, it maintains operation in a customized communication mode. The heartbeat command is obtained by the game application encapsulating a heartbeat packet according to a customized communication protocol. The heartbeat packet can be a default string used to notify the receiver that the device is currently in a valid state, enabling the receiver to maintain a valid connection. In this embodiment, the heartbeat packet is used to keep the peripheral device in a customized operating mode. When the peripheral device is in customized communication mode, the peripheral device and the game application can transmit target data (such as the aforementioned peripheral control commands) according to the peripheral communication protocol; that is, the target data is transmitted while the peripheral device is in customized communication mode. Therefore, in order for peripheral devices to maintain a customized communication mode through a heartbeat mechanism, peripheral device manufacturers need to implement the following software logic when customizing the customized communication interface based on the peripheral communication protocol: the peripheral device receives a heartbeat command from the customized endpoint (such as the customized output endpoint) in the customized communication interface, parses the heartbeat command according to the peripheral communication protocol, obtains the heartbeat packet, and maintains the customized communication mode; if the peripheral device does not receive a heartbeat command from the customized endpoint (such as the customized output endpoint) in the customized communication interface, it switches back from the customized communication mode to the original communication mode so that the peripheral device can still transmit data with the operating system.

[0126] Therefore, it can be seen that the peripheral device maintains its operation in a customized communication mode by receiving heartbeat commands from the game application through a customized output endpoint. For example, if the game application sends a heartbeat packet to the peripheral device every preset period (e.g., 10 seconds), and the peripheral device receives the heartbeat packet within the preset period, it determines that the game application wants the peripheral device to continue data transmission in the customized communication mode, and the peripheral device continues to maintain the customized communication mode. If the peripheral device does not receive the heartbeat command within the preset period, it determines that the game application wants the peripheral device to switch back to the original communication mode for data transmission, and the peripheral device switches back from the customized communication mode to the original communication mode.

[0127] II. Uplink transmission.

[0128] 1. Notify and provide feedback on target data.

[0129] Corresponding to the downlink transmission command (or query and control command, such as the mode switching command mentioned above) initiated by the game application described above, after receiving the downlink transmission command, the peripheral device can respond to the downlink transmission command by reporting the corresponding target data as an uplink transmission command (or notification and feedback command) to the game application.

[0130] The uplink transmission command carries the following exemplary functions: Optionally, when the game application needs to query the device information of a peripheral device, the peripheral device can generate an uplink transmission command based on the device information, encapsulate the uplink transmission command according to the peripheral communication protocol to obtain encapsulated data, and then send the encapsulated data to the game application so that the game application can decapsulate the encapsulated data to obtain the device information of the peripheral device. Optionally, when the game application needs to query the battery information of a peripheral device, the peripheral device can generate an uplink transmission command based on the current battery level to inform the game application of the current battery level; wherein, the current battery level of the peripheral device refers to the battery level detected by the peripheral device when it receives the downlink transmission command (such as the battery query command) sent by the game application. In order for peripheral devices to be able to send the data queried to the game application as described above, peripheral device manufacturers need to implement the following software logic when customizing the communication interface based on the peripheral communication protocol: The peripheral device receives the encapsulated data sent by the game application from the custom endpoint (such as the custom output endpoint), and decapsulates the encapsulated data to obtain the downlink transmission command (such as the information query request); then, the peripheral device encapsulates the corresponding data (such as device information) according to the peripheral communication protocol based on the downlink transmission command, and sends the encapsulated data back to the custom endpoint (such as the custom input endpoint) so that the game application can obtain the data returned by the peripheral device from the custom endpoint.

[0131] Optionally, when a peripheral device detects that its battery level is below a threshold, it indicates that the peripheral device has low remaining power. At this time, the peripheral device can actively initiate an uplink transmission command. This uplink transmission command indicates that the peripheral device's remaining power level is below the threshold. The uplink transmission command is then encapsulated and sent to the game application. In response to the decapsulated uplink transmission command, the game application displays a battery warning message on its application interface. The game application interface can be any service interface provided by the game application, and the battery warning message displayed on the application interface is used to remind the peripheral device that its battery level is low, so that the peripheral device can be recharged in time. Similar to the aforementioned description, in order for peripheral devices to proactively notify game applications when their battery is low, peripheral device manufacturers need to implement the following software logic when customizing the communication interface based on the peripheral communication protocol for the peripheral devices: When the peripheral device detects that its battery level is less than the battery threshold and determines that the trigger condition for proactively notifying the game application has been met, it encapsulates the device battery level according to the peripheral communication protocol and sends the encapsulated data back to the custom endpoint (such as a custom input endpoint) so that the game application can obtain the device battery level returned by the peripheral device from the custom endpoint.

[0132] 2. Transmit the target data generated based on the target operation input by the operation object.

[0133] As described above, the peripheral device includes both a default communication protocol and a customized peripheral communication protocol. When the peripheral device is in the default communication mode, upon detecting a target operation input by the target game's user, it generates a target input signal as target data based on the target operation. This target data is then encapsulated according to the peripheral communication protocol in the customized communication mode, and the encapsulated data is sent to the default communication interface, allowing the game application to retrieve the encapsulated data from the default communication interface according to the default protocol. Conversely, when the peripheral device is in the customized communication mode, upon detecting a target operation input by the target game's user, it generates a target input signal as target data based on the target operation. This target data is then encapsulated according to the peripheral communication protocol in the customized communication mode, and the encapsulated data is sent to the customized communication interface, allowing the game application to retrieve the encapsulated data from the customized communication interface according to the customized protocol. This enables the peripheral device provided in this embodiment to be compatible with target operations under both old and new communication modes. For the user, there is no need to learn new operating habits, thereby improving the user's gaming experience.

[0134] To achieve the transmission of target data generated from the target operation input by the operation object to the game application as described above, the peripheral device manufacturer implements the following software logic when customizing the customized communication interface based on the peripheral communication protocol for the peripheral device: After detecting that the operation object is performing the target operation, the peripheral device can convert the analog signal input by the operation object into the corresponding digital signal (i.e., the aforementioned object input signal) according to the analog-to-digital conversion structure of the peripheral device; then, the object input signal is encapsulated according to the peripheral communication protocol, and the encapsulated data is sent to the customized communication interface so that the game application can obtain the encapsulated data from the customized communication interface according to the customized communication protocol.

[0135] Based on the above description of the overall process of the data transmission scheme, this application proposes a more detailed data transmission method. This data transmission method can be executed by a peripheral device in the aforementioned data transmission system or a game application in the target terminal. For ease of explanation, the following description uses an electronic device executing the data transmission method as an example. Unless otherwise specified, the electronic device can refer to either a peripheral device or a target terminal running a game application. When the electronic device is a target terminal running a game application, the operations performed by the described electronic device are specifically performed by the game application running in the target terminal. The data transmission method provided by this application embodiment will be described in detail below with reference to the accompanying drawings.

[0136] Figure 4 The diagram illustrates a data transmission method provided in an exemplary embodiment of this application; the data transmission method may include steps S401-S402:

[0137] S401: When the game application in the target terminal and the peripheral device need to transmit target data, obtain the peripheral communication protocol.

[0138] In practical implementation, when the controlled object needs to control a target game provided by a game application on the target terminal using a peripheral device, the controlled object can establish a communication connection between the peripheral device and the target terminal. Specifically, the receiver of the peripheral device can be plugged into a physical interface provided by the target terminal to establish a communication connection between the peripheral device and the target terminal. Furthermore, the peripheral device can send the interface declarations of one or more of its communication interfaces to the receiver. In this way, the communication driver deployed on the target terminal can obtain the interface declarations of each communication interface of the peripheral device from the receiver, thus including the interface declarations of one or more communication interfaces of the peripheral device in the communication driver.

[0139] Then, the game application can scan the interface declarations of each communication interface of the peripheral device from the communication driver in the target terminal, and look for a specified protocol identifier in each scanned interface declaration. This specified protocol identifier is the identifier of the customized peripheral communication protocol, which can be used to uniquely identify the peripheral communication protocol. If the game application finds the specified protocol identifier, then the game application confirms that the peripheral device is a hardware device that supports the peripheral communication protocol, and determines the communication protocol identified by the specified protocol identifier as the peripheral communication protocol. Furthermore, it can read the specific protocol content of the peripheral communication protocol identified by the specified protocol identifier to determine the peripheral communication protocol.

[0140] The S402 uses a peripheral communication protocol and a communication driver to transmit target data between the game application and the peripheral device.

[0141] After confirming that the peripheral device supports the peripheral communication protocol for data transmission, the game application and the peripheral device can transmit target data according to the peripheral communication protocol and through the communication driver. The target data can be either the data the game application wants to send to the peripheral device, or the data the peripheral device wants to send to the game application. Specifically, when an electronic device needs to transmit target data, it can obtain the peripheral communication protocol, such as from the peripheral device's interface declaration, or from the hardware structure if the peripheral communication protocol is written into the electronic device's hardware structure in code form. The electronic device uses this peripheral communication protocol to encapsulate the target data to be transmitted, obtaining encapsulated data. Then, the electronic device sends the encapsulated data to the communication driver deployed in the target terminal, so that the data receiver can obtain the encapsulated data from the communication driver. Optionally, if the electronic device needing to send target data is a game application, then the data receiver can be a peripheral device. In this implementation, the encapsulated data is encapsulated by the game application according to the peripheral communication protocol and sent to the communication driver. Optionally, if the electronic device that needs to send target data is a peripheral device, then the data receiver may refer to a game application. In this implementation, the encapsulated data is encapsulated and processed by the peripheral device according to the peripheral communication protocol and sent to the communication driver.

[0142] The implementation method for encapsulating the target data to be transmitted varies depending on the data type, specifically in the information structure used. The information structure corresponding to any data type is defined by the peripheral communication protocol, and this application embodiment does not limit the specific style of the information structure corresponding to each data type. In specific implementation, after determining the target data to be transmitted, the electronic device can further determine the data type of the target data, then query the peripheral communication protocol for the information structure corresponding to the data type of the target data as the target information structure; finally, the target data is written into the target information structure to obtain the encapsulated data. It should be noted that whether the peripheral device encapsulates the target data or the game application encapsulates the target data, the encapsulation process is the same as described above.

[0143] It is understandable that the target data that an electronic device needs to transmit will vary depending on the device itself. The following describes how different electronic devices transmit the corresponding target data during the process of controlling a target game using peripheral devices; among them:

[0144] I. Electronic devices include target terminals running game applications. In this case, during the entire process of using peripheral devices to control the target game provided by the game application, the target data that the game application needs to transmit may include, but is not limited to: information query requests, peripheral control commands, and mode switching commands. The data transmission process of the three exemplary target data given above is described in detail below.

[0145] 1) The target data includes an information query request, which is used to query device information of a peripheral device; the specific implementation process of the game application sending the information query request to the peripheral device to query its device information and receiving the feedback result from the peripheral device can be found in [link to relevant documentation]. Figure 5a and Figure 5b ,like Figure 5a and Figure 5b As shown:

[0146] In step s51, after the game application determines that the peripheral device is a hardware device that supports the peripheral communication protocol by scanning the peripheral device's interface declaration, the game application can generate an information query request and encapsulate the information query request according to the peripheral communication protocol to obtain encapsulated data. Then, the encapsulated data is sent to the communication driver so that the peripheral device can obtain the encapsulated data through the communication driver and decapsulate the encapsulated data according to the peripheral communication protocol to obtain the information query request. The peripheral device can obtain the encapsulated data through the communication driver in the following ways: the communication driver actively sends the encapsulated data to a custom output endpoint in the custom communication interface included in the peripheral device, and then the peripheral device obtains the encapsulated data from the custom output endpoint.

[0147] In step s52, after obtaining the encapsulated data, the peripheral device uses the peripheral communication protocol to decapsulate (i.e., parse) the encapsulated data to obtain an information query request. Then, in response to the information query request, the peripheral device retrieves device information and uses the peripheral communication protocol to encapsulate the device information to obtain encapsulated data. At this time, the encapsulated data includes the feedback result obtained from the encapsulation process. The specific implementation process of the peripheral device encapsulating device information according to the peripheral communication protocol is similar to the encapsulation process described above and can be briefly summarized as follows: based on the data type of the device information, the information structure corresponding to that data type is obtained from the peripheral communication protocol as the information query structure. Then, the device information is filled into or written into the information query structure to generate a feedback result, thereby achieving the encapsulation of the device information.

[0148] For example, when encapsulating device information, the exemplary device information shown in Table 1 can be filled into the information query structure to generate encapsulated data.

[0149] Table 1

[0150] Manufacturers Feature information Equipment Model Equipment Name … XXX 0xXXX XXX XXX …

[0151] As shown in Table 1, the information entered into the information query structure can include detailed information about the peripheral device (such as manufacturer, device model, and device name) and its feature information. The feature information of the peripheral device can be used to indicate at least one capability of the peripheral device. This feature information can be entered into the information query structure bit by bit; for example, if the peripheral device supports a target feature, the binary bit occupied by the target feature can be filled with 1 to indicate that the peripheral device supports the capability corresponding to that target feature. Examples of features that peripheral devices may support are shown in Table 2.

[0152] Table 2

[0153]

[0154] As shown in Table 2, hexadecimal can be used to represent the characteristic information of peripheral devices; of course, this application embodiment does not limit which specific number system is used to represent the characteristics of peripheral devices, which is stated here. By filling the characteristic information supported by the peripheral device into the information structure bit by bit, the game application can infer whether the peripheral device supports a certain characteristic based on the bits after obtaining the characteristic information; for example, assuming that the dual joystick capability of the peripheral device is represented by the first bit of binary, if the device information received by the game application includes hexadecimal 0x1, converting 0x1 to binary 0001, then it is determined that the first bit of the binary number is the number 1, indicating that the peripheral device supports the dual joystick capability.

[0155] In step s53, the peripheral device can send the feedback result back to the custom input endpoint in the custom communication interface, allowing the game application to obtain the feedback result from the custom input endpoint through the communication driver. The game application then decapsulates the feedback result according to the peripheral communication protocol to obtain the device information of the peripheral device. Specifically, the process of the game application obtaining the feedback result from the custom input endpoint through the driver can include: the communication driver periodically scanning the custom input endpoint; upon detecting a feedback result sent by the peripheral device from the custom input endpoint, the game application can obtain that feedback result; subsequently, the game application can also periodically scan the communication driver so that if a feedback result sent by the peripheral device is present in the communication driver, the game application can obtain the feedback result sent by the peripheral device from the communication driver.

[0156] In the above process, it should be noted that, in addition to obtaining feedback results from the customized input endpoint through periodic scanning, the communication driver also supports the customized input endpoint actively sending the received feedback results to the communication driver, or, after obtaining feedback results, the customized input endpoint sending a feedback instruction to the communication driver, so that the communication driver scans for feedback results from the customized input endpoint upon receiving the feedback instruction. Similarly, in addition to obtaining feedback results through a successful customized scan of the communication driver, the game application can also obtain feedback results in the manner described above, such as the communication driver actively sending feedback results to the game application, or the communication driver sending a feedback instruction to the game application to instruct the game application to actively obtain feedback results. This application embodiment does not limit the specific implementation method of data transmission between the customized interface and the communication driver, or between the communication driver and the game application.

[0157] Furthermore, upon obtaining device information from the peripheral device, the game application can perform validity checks on the commands based on this information. A valid command means that the game application can recognize or parse the command and process it accordingly; an invalid command means that the game application cannot recognize the command, and upon receiving it, the application will not provide feedback or notify the peripheral device that the command is unrecognizable. Specifically, the process of the game application validating the input command based on the peripheral device's device information can include: if the game application receives an input command from the peripheral device, it determines the baseline device capabilities required by the peripheral device to generate the input command. For example, if the input command is a dual-joystick left movement command, then the baseline device capabilities required by the peripheral device to generate the command include dual-joystick capabilities. Then, the baseline device capabilities are used to perform capability matching against at least one device capability indicated by the feature information. Capability matching means checking whether the baseline device capability exists among the at least one device capability indicated by the feature information. Finally, the validity of the input command is checked based on the capability matching result; if the reference device capability matches at least one device capability, that is, the reference device capability belongs to one of the device capabilities in the characteristic information, then the input command is determined to be a valid command.

[0158] 2) The target data includes peripheral control commands, which are used to control peripheral devices to perform target game feedback operations. An exemplary implementation of the game application sending peripheral control commands to the peripheral device to cause the peripheral device to perform the target game feedback operation can be found in [reference needed]. Figure 6a :

[0159] s61, if a game application detects that it needs to control a peripheral device to perform a target game feedback operation, it can obtain the feature information supported by the peripheral device; wherein, the game application can obtain the feature information supported by the peripheral device in the following ways: obtaining the feature information supported by the peripheral device from the historical cache in the storage space, or, as described above. Figure 5a The implementation shown obtains the feature information supported by the peripheral device from the peripheral device side.

[0160] s62, the game application searches for a target device capability among at least one device capability indicated by the peripheral device's characteristic information. This target device capability refers to the device capability used to instruct the peripheral device to perform a target game feedback operation. Specifically, after determining the target game feedback operation that needs to be controlled by the peripheral device, the game application can determine the target device capability required for the peripheral device to perform the target game feedback operation; then, it performs capability matching among the at least one device capability indicated by the characteristic information. If a target device capability is matched from the at least one device capability, it is determined that the peripheral device has the device capability to perform the target game feedback operation.

[0161] s63. After the game application finds the target device capability from at least one device capability indicated by the peripheral device's characteristic information, it can generate a peripheral control command to control the peripheral device to perform the target game feedback operation based on the target device capability. The generated peripheral control command is a valid output command, meaning it can be recognized and responded to by the peripheral device. For example, if the peripheral device's characteristic information indicates that the peripheral device has vibration capability, then the peripheral control command that the peripheral device can generate can be called a vibration command. This vibration command can include vibration data used to control the peripheral device to perform vibration operations, as shown in Table 3.

[0162] Table 3

[0163] vibration amplitude Vibration cycle number Vibration time Vibration direction … XXX XXX XXX XXX …

[0164] Then, the game application can fill the vibration data into the vibration information structure according to the peripheral communication protocol to realize the encapsulation processing of vibration commands, and send the encapsulated data to the peripheral device so that the peripheral device can obtain the vibration command based on the encapsulated data and perform vibration operation according to the vibration data contained in the vibration command.

[0165] In s64, the game application encapsulates the peripheral control command according to the peripheral communication protocol to generate encapsulated data; and sends the encapsulated data to the communication driver so that the communication driver sends the encapsulated data to the customized output endpoint of the peripheral device. In this way, the peripheral device can receive the peripheral control command sent by the game application and respond to the peripheral control command to execute the corresponding target game feedback operation.

[0166] Taking a game feedback operation that includes vibration as an example, in this case, the peripheral control command generated by the game application is used to control the peripheral device to perform the vibration operation. Specifically, the peripheral device includes one or more vibration devices, which may include vibration motors (or simply motors). Each motor is configured with corresponding parameters, which may include, but are not limited to, vibration direction, vibration frequency, or vibration mode, for controlling the motor's vibration. In one implementation, if the game application detects a vibrating object (i.e., a game character that needs vibration) in the game screen during the game application's execution of the target game, then the operation used to control the default vibration device in the peripheral device to vibrate can be determined as the target vibration operation; wherein, the default vibration device may include any one of the one or more vibration devices provided by the peripheral device. Figure 6bAs shown, assuming the game scene depicted in the game screen includes a car driving up a hillside, it can be determined that the object requiring vibration in the game screen includes the car. The game application can then generate peripheral control commands based on the parameters of the default vibration device. These peripheral control commands can be called vibration commands, and are sent to the peripheral device so that the peripheral device responds to the vibration command and controls the default vibration device to vibrate, simulating the vibration effect produced by a vibrating object in a real environment. Furthermore, if the default vibration device 601 in the peripheral device is located at the center of the peripheral device, when the peripheral device controls the default vibration device to perform a vibration operation, both hands of the user can feel the vibration.

[0167] In other implementations, during the game application's execution, a target vibration device can be selected from the peripheral devices based on the location of the vibrating object and the location information of various vibration devices within the peripheral device. The operation used to control the mechanical vibration of this target device is then defined as the target vibration operation. In other words, based on the specific location (e.g., coordinates) of the vibrating object on the game screen, a vibration device with a similar location on the game screen can be selected as the target vibration device. This allows the peripheral device to control the target vibration device to perform a vibration operation, simulating the vibration of a vibrating object in a real environment and creating a more realistic gaming experience. For example... Figure 6c As shown, assuming the game scene depicted in the game screen includes a car driving up a hillside, it can be determined that the vibration object in the game screen that needs to vibrate includes the car. Then, the position of the vibration object "car" in the game screen is detected. For example, in the coordinate axis with the upper left corner of the game screen as the origin, the car's coordinate position is (20,5). Therefore, it is determined that the car is located in the upper right corner of the game screen, and the vibration device 602 deployed on the right hand controller in the peripheral device is determined as the target vibration device. The peripheral control command is generated according to the parameters of the target vibration device, and the vibration command is sent to the peripheral device so that the peripheral device responds to the vibration command to control the target vibration device to vibrate. At this time, the right hand of the operator can feel a more obvious vibration effect than the left hand, so as to improve the more realistic game experience for the operator.

[0168] It should be noted that the above only provides an example of the data transmission process when the peripheral control command is a vibration command. During the running of the target game, the game application can also generate other peripheral control commands based on the specific game scene and the characteristics of the peripheral device. For example, if the peripheral device's characteristics include audio feedback capability, then when the game application detects an operation in the game scene that controls the peripheral device to perform sound effect output, it generates an audio feedback command so that the peripheral device responds to the audio feedback command and outputs sound effects, creating a more realistic gaming experience for the target.

[0169] 3) The target data includes a mode switching command, which instructs the peripheral device to switch its communication mode to a customized communication mode. This allows the peripheral device to transmit data using the peripheral communication protocol while the game application is running the target game. Specifically, since the game application runs on the target terminal's operating system, its operation may be limited by the operating system. Therefore, when the game application needs to send a mode switching command to the peripheral device, it must first check whether the operating system supports the mode switching command and transmit it through the peripheral communication protocol and communication driver. Then, based on the detection result, it is determined whether the game application should directly transmit the mode switching command to the peripheral device through the communication driver.

[0170] Specifically: if the detection result indicates that the operating system supports it, then it is determined that the game application can transmit mode switching commands between communication drivers. A diagram illustrating this direct transmission of mode switching commands can be found here. Figure 7a Specifically, this includes: the game application can obtain the peripheral communication protocol and directly transmit the mode switching command to the peripheral device according to the peripheral communication protocol and communication driver; then, after receiving the mode switching command, the peripheral device can respond to the mode switching command and switch the communication mode to the customized communication mode; when the peripheral device is in the customized communication mode, the operating system supports the peripheral device and the game application to transmit any data by using the peripheral communication protocol, such as the peripheral device can directly transmit the target operation and / or power information of the operation object to the game application according to the peripheral communication protocol and communication driver.

[0171] Conversely, if the detection result indicates that the operating system does not support it, then it is determined that the game application cannot transmit mode switching commands between communication drivers. In this case, the mode switching commands can be forwarded to the peripheral device via the operating system. For details on how the operating system forwards mode switching commands, please refer to [link to relevant documentation]. Figure 7b Specifically, this includes: the game application can generate a vibration sequence, which may include a default string (such as the string "123"), to trigger the peripheral device to perform a mode switch; then, the game application sends the generated vibration sequence and target data (such as a mode switch command) to the operating system's management module, so that the management module forwards the vibration sequence and target data to the peripheral device through the communication driver; in this way, when the peripheral device receives the vibration sequence, it can determine that a mode switch is needed, and further switch the communication mode to a customized communication mode according to the mode switch command.

[0172] II. Electronic devices include peripheral devices. In this case, during the entire process of using peripheral devices to control the target game provided by the game application, the target data that the peripheral devices need to transmit may include, but is not limited to: object input signals and battery warning signals. The data transmission process of the two exemplary target data given above is described in detail below.

[0173] 1) Target data includes object input signals. In specific implementation, when the peripheral device is in custom communication mode, if the peripheral device detects a target operation input by the target game object during the game application's execution, the peripheral device can generate an object input signal based on the target operation. This object input signal can then be used as target data. The object input signal is then filled into the input information structure according to the peripheral communication protocol to achieve encapsulation processing of the object input signal. Then, the encapsulated data is transmitted to the game application through the communication driver. After receiving the encapsulated data, the game application decapsulates it to obtain the target data and updates the game screen based on the target data. For example... Figure 8 As shown, during the operation of the target game using a peripheral device, if the peripheral device detects an upward swipe operation input by the operating object to the game object 801, it indicates that the peripheral device wants the game object 801 to perform a jump action following the upward swipe operation. The peripheral device can then generate an object input signal based on the upward swipe operation and transmit the object input signal as target data directly to the game application through the communication driver. After obtaining the target data, the game application can determine the game screen when the game object performs the jump action based on the target data, and update the game screen before the jump action is performed using the game screen when the game object performs the jump action.

[0174] 2) The target data includes a battery warning signal. In the specific implementation, during the operation of the target game using a peripheral device, the peripheral device can obtain its own battery level, such as through a custom battery level acquisition mechanism. If the peripheral device detects that its battery level is lower than a threshold, it indicates that the peripheral device's battery is low, and the peripheral device can generate a battery warning signal, which serves as the target data. Then, the battery warning signal is encapsulated using a peripheral communication protocol. Specifically, the peripheral device's device information is added to the battery information structure to obtain encapsulated data. This encapsulated data is then sent back to the custom input interface. The game application can then scan the encapsulated data from this custom input interface through the communication driver and obtain the battery warning signal after parsing and processing the encapsulated data. Furthermore, after acquiring the target data (i.e., the battery warning signal), the game application can generate a battery warning message based on the target data and display it on the application interface. This battery warning message serves to remind peripheral devices that they need charging, allowing users to promptly understand the remaining battery level of their peripheral devices and avoid game interruptions due to power outages, thereby improving the user's gaming experience and increasing user engagement. An exemplary implementation method for a peripheral device to proactively issue a battery warning can be found in [reference needed]. Figure 9 The game screen displays a battery warning message: 901.

[0175] It should be noted that the above description only illustrates several exemplary data transmission processes for target data of electronic devices, namely game applications and peripheral devices, and does not limit the embodiments of this application.

[0176] In summary, this application embodiment can customize a peripheral communication protocol between the game application and the peripheral device according to the data transmission specifications followed by the communication driver deployed in the target terminal. Since this customized peripheral communication protocol is written based on the data transmission specifications followed by the communication driver, and these specifications are uniform and universal across various terminals, this allows the customized peripheral communication protocol to support cross-terminal use, improving its applicability. Furthermore, using this customized peripheral communication protocol enables direct communication between the game application and the peripheral device, freeing the data transmitted between them from the limitations of the operating system in the target terminal. This allows for the transmission of richer data between the game application and the peripheral device, enabling richer game control capabilities on the peripheral device, increasing the game's fun, and ultimately enhancing user engagement.

[0177] Based on the description of the above data transmission method embodiments, this application also discloses a data transmission device, which can be a computer program (including program code) running in an electronic device. The data transmission device can execute... Figure 4 The method shown. Please refer to [link / reference]. Figure 10 The data transmission device can operate the following units:

[0178] The acquisition unit 1001 is used to acquire the peripheral communication protocol when the game application in the target terminal and the peripheral device need to transmit target data; the target terminal sends and receives data through its internal communication driver, and the peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specification of the communication driver.

[0179] The processing unit 1002 is used to transmit target data between the game application and the peripheral device using a peripheral communication protocol and a communication driver.

[0180] In one embodiment, the processing unit 1002, when transmitting target data between a game application and a peripheral device using a peripheral communication protocol and a communication driver, may specifically be used for:

[0181] The target data is encapsulated using a peripheral communication protocol to obtain encapsulated data;

[0182] The encapsulated data is sent to the communication driver so that the data receiver can obtain the encapsulated data from the communication driver;

[0183] In this context, if the encapsulated data is sent from the game application to the communication driver, the data receiver refers to the peripheral device; if the encapsulated data is sent from the peripheral device to the communication driver, the data receiver refers to the game application.

[0184] In one implementation, the peripheral communication protocol specifies the information structure corresponding to one or more data types; when the processing unit 1002 encapsulates the target data using the peripheral communication protocol to obtain encapsulated data, it can specifically be used for:

[0185] Determine the data type of the target data;

[0186] In the peripheral communication protocol, query the information structure corresponding to the data type of the target data, and use it as the target information structure;

[0187] The target data is written into the target information structure to obtain the encapsulated data.

[0188] In one embodiment, the device is integrated into a game application, and the communication driver includes interface declarations for one or more communication interfaces of the peripheral device; the processing unit 1002 can also be used for:

[0189] Scan the interface declarations of each communication interface of the peripheral device from the communication driver, and search for the specified protocol identifier in each interface declaration.

[0190] If the specified protocol identifier is found in at least one interface declaration, the communication protocol identified by the specified protocol identifier is determined to be the peripheral communication protocol.

[0191] In one implementation, the target data includes an information query request for querying device information of a peripheral device, wherein the device information includes at least the feature information supported by the peripheral device; the processing unit 1002 can also be used for:

[0192] After the peripheral device sends a feedback result in the communication driver, the feedback result is obtained from the communication driver. The feedback result is obtained by the peripheral device responding to the information query request and encapsulating the device information using the peripheral communication protocol.

[0193] The feedback results are decapsulated according to the peripheral communication protocol to obtain the device information of the peripheral device.

[0194] In one embodiment, the characteristic information is used to indicate at least one device capability of the peripheral device; the processing unit 1002 can also be used for:

[0195] If an input command is received from a peripheral device, the reference device capability required by the peripheral device to generate the input command is determined.

[0196] Capability matching is performed on at least one device capability indicated by the characteristic information using the baseline device capability;

[0197] The validity of the input command is checked based on the capability matching result; if the reference device capability matches at least one device capability, the input command is determined to be a valid command.

[0198] In one embodiment, the target data includes peripheral control instructions, and the processing unit 1002 can also be used for:

[0199] If it is detected that a peripheral device needs to be controlled to perform a target game feedback operation, then the feature information supported by the peripheral device is obtained. The feature information is used to indicate at least one device capability of the peripheral device.

[0200] Find the target device capability among at least one device capability indicated by the characteristic information, where the target device capability refers to: the device capability used to support peripheral devices in performing the target game feedback operation;

[0201] If the target device capability is found, peripheral control commands are generated to control the peripheral device to perform the target game feedback operation.

[0202] In one embodiment, the peripheral device includes one or more vibration devices, and the target game feedback operation includes a target vibration operation; the processing unit 1002 can also be used for:

[0203] If a vibrating object is detected in the game screen of the target game during the running of the game application, the operation of controlling the default vibration device in the peripheral device to vibrate will be determined as the target vibration operation.

[0204] Alternatively, based on the position of the vibrating object in the game screen and the position information of each vibration device in the peripheral device, a target vibration device is selected from the peripheral device, and the operation used to control the target vibration device to vibrate is determined as the target vibration operation.

[0205] In one implementation, the game application runs on the operating system of the target terminal, and when the peripheral device is in a customized communication mode, the operating system supports the peripheral device and the game application to transmit any data by using the peripheral communication protocol.

[0206] The target data includes a mode switching command, which is used to instruct the peripheral device to switch the communication mode to a customized communication mode so that the peripheral device can use the peripheral communication protocol to transmit data during the running of the target game in the game application.

[0207] Processing unit 1002 can also be used for:

[0208] The system detects whether the operating system supports mode switching commands and transmits them through peripheral communication protocols and communication drivers.

[0209] If supported, the step of obtaining the peripheral communication protocol will be triggered.

[0210] If not supported, a vibration sequence is generated, which is used to trigger the peripheral device to switch execution modes. The vibration sequence and target data are sent to the management module of the operating system so that the management module can forward the vibration sequence and target data to the peripheral device through the communication driver.

[0211] In one embodiment, the device is mounted on a peripheral device, and the processing unit 1002 can also be used for:

[0212] During the running of the target game in the game application, if a target operation is detected by the target game's operation object, an object input signal is generated as target data based on the target operation;

[0213] In this process, after obtaining the target data, the game application updates the game screen of the target game based on the target data.

[0214] In one embodiment, the device is mounted on a peripheral device, and the processing unit 1002 can also be used for:

[0215] During the operation of peripheral devices, the device power level is obtained;

[0216] If the device's battery level is lower than the battery threshold, a battery warning signal will be generated as the target data.

[0217] After acquiring the target data, the game application generates a battery warning message based on the target data and displays the battery warning message in the game application's interface.

[0218] In one implementation, the peripheral device includes a custom communication interface based on a peripheral communication protocol, the custom communication interface including a custom input endpoint and a custom output endpoint;

[0219] The peripheral device sends data to the communication driver through the customized input endpoint; and the peripheral device obtains data from the communication driver through the customized output endpoint.

[0220] In one implementation, the target data is transmitted while the peripheral device is in a custom communication mode;

[0221] The peripheral devices operate in a customized communication mode by receiving heartbeat commands from the game application through customized output endpoints.

[0222] According to another embodiment of this application, Figure 10 The data transmission device shown can be constructed by combining each unit individually or entirely into one or more other units, or one or more of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the data processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0223] According to another embodiment of this application, the following can be achieved by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), a device capable of performing operations such as... Figure 4 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 10The data transmission device shown herein, and the data transmission method for implementing the embodiments of this application, are described. The computer program may be recorded on, for example, a computer-readable recording medium, loaded onto the aforementioned computing device via the computer-readable recording medium, and run therein.

[0224] In this embodiment, a customized peripheral communication protocol can be established between the game application and the peripheral device according to the data transmission specifications followed by the communication driver in the target terminal. Since this customized peripheral communication protocol is written based on the data transmission specifications followed by the communication driver, and these specifications are universally applicable across various terminals, this allows the customized peripheral communication protocol to support cross-terminal use, improving its applicability. Furthermore, using this customized peripheral communication protocol enables direct communication between the game application and the peripheral device, freeing the data transmitted between them from the limitations of the operating system in the target terminal. This allows for the transmission of richer data between the game application and the peripheral device, providing enhanced game control capabilities and ultimately increasing user engagement.

[0225] Figure 11 This application shows a schematic diagram of the structure of an electronic device provided in an exemplary embodiment; please refer to [link to relevant documentation]. Figure 11 The electronic device includes at least a processor 1101, a communication interface 1102, and a computer-readable storage medium 1103. The processor 1101, communication interface 1102, and computer-readable storage medium 1103 are connected via a bus or other means. The communication interface 1102 is used to receive and send data. The computer-readable storage medium 1103 can be stored in the memory of the electronic device and is used to store computer programs, including program instructions. The processor 1101 is used to execute the program instructions stored in the computer-readable storage medium 1103. The processor 1101 (or CPU (Central Processing Unit)) is the computing and control core of the electronic device, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve corresponding method flows or corresponding functions.

[0226] This application embodiment also provides a computer-readable storage medium (Memory), which is a memory device in an electronic device used to store programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the electronic device and extended storage media supported by the electronic device. The computer-readable storage medium provides storage space that stores the processing system of the electronic device. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by the processor 1101, which may be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM memory or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer-readable storage medium located remotely from the aforementioned processor.

[0227] In one embodiment, the computer-readable storage medium stores one or more instructions; the processor 1101 loads and executes one or more instructions stored in the computer-readable storage medium to implement the corresponding steps in the above-described data transmission method embodiment; the one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and executed as follows:

[0228] When the game application and peripheral device in the target terminal need to transmit target data, the peripheral communication protocol is obtained; the target terminal sends and receives data through its internal communication driver, and the peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver.

[0229] Using peripheral communication protocols and communication drivers, target data is transmitted between the game application and the peripheral device.

[0230] In one implementation, when one or more instructions in a computer-readable storage medium are loaded by processor 1101 and executed to transmit target data between a game application and a peripheral device using a peripheral communication protocol and a communication driver, the following steps are specifically performed:

[0231] The target data is encapsulated using a peripheral communication protocol to obtain encapsulated data;

[0232] The encapsulated data is sent to the communication driver so that the data receiver can obtain the encapsulated data from the communication driver;

[0233] In this context, if the encapsulated data is sent from the game application to the communication driver, the data receiver refers to the peripheral device; if the encapsulated data is sent from the peripheral device to the communication driver, the data receiver refers to the game application.

[0234] In one implementation, the peripheral communication protocol specifies an information structure corresponding to one or more data types; one or more instructions in the computer-readable storage medium are loaded and executed by the processor 1101. When encapsulating target data using the peripheral communication protocol to obtain encapsulated data, the following steps are specifically performed:

[0235] Determine the data type of the target data;

[0236] In the peripheral communication protocol, query the information structure corresponding to the data type of the target data, and use it as the target information structure;

[0237] The target data is written into the target information structure to obtain the encapsulated data.

[0238] In one embodiment, the device is mounted on a game application, and the communication driver includes interface declarations of one or more communication interfaces of the peripheral device; one or more instructions in a computer-readable storage medium are loaded by processor 1101 and further perform the following steps:

[0239] Scan the interface declarations of each communication interface of the peripheral device from the communication driver, and search for the specified protocol identifier in each interface declaration.

[0240] If the specified protocol identifier is found in at least one interface declaration, the communication protocol identified by the specified protocol identifier is determined to be the peripheral communication protocol.

[0241] In one implementation, the target data includes an information query request for querying device information of a peripheral device, the device information including at least the feature information supported by the peripheral device; one or more instructions in a computer-readable storage medium are loaded by the processor 1101 and further execute the following steps:

[0242] After the peripheral device sends a feedback result in the communication driver, the feedback result is obtained from the communication driver. The feedback result is obtained by the peripheral device responding to the information query request and encapsulating the device information using the peripheral communication protocol.

[0243] The feedback results are decapsulated according to the peripheral communication protocol to obtain the device information of the peripheral device.

[0244] In one implementation, characteristic information is used to indicate at least one device capability of the peripheral device; one or more instructions in a computer-readable storage medium are loaded by processor 1101 and further executed as follows:

[0245] If an input command is received from a peripheral device, the reference device capability required by the peripheral device to generate the input command is determined.

[0246] Capability matching is performed on at least one device capability indicated by the characteristic information using the baseline device capability;

[0247] The validity of the input command is checked based on the capability matching result; if the reference device capability matches at least one device capability, the input command is determined to be a valid command.

[0248] In one implementation, the target data includes peripheral control instructions, one or more of which are loaded by processor 1101 from a computer-readable storage medium and further executed with the following steps:

[0249] If it is detected that a peripheral device needs to be controlled to perform a target game feedback operation, then the feature information supported by the peripheral device is obtained. The feature information is used to indicate at least one device capability of the peripheral device.

[0250] Find the target device capability among at least one device capability indicated by the characteristic information, where the target device capability refers to: the device capability used to support peripheral devices in performing the target game feedback operation;

[0251] If the target device capability is found, peripheral control commands are generated to control the peripheral device to perform the target game feedback operation.

[0252] In one embodiment, the peripheral device includes one or more vibration devices, and the target game feedback operation includes a target vibration operation; one or more instructions in a computer-readable storage medium are loaded by processor 1101 and further perform the following steps:

[0253] If a vibrating object is detected in the game screen of the target game during the running of the game application, the operation of controlling the default vibration device in the peripheral device to vibrate will be determined as the target vibration operation.

[0254] Alternatively, based on the position of the vibrating object in the game screen and the position information of each vibration device in the peripheral device, a target vibration device is selected from the peripheral device, and the operation used to control the target vibration device to vibrate is determined as the target vibration operation.

[0255] In one implementation, the game application runs on the operating system of the target terminal, and when the peripheral device is in a customized communication mode, the operating system supports the peripheral device and the game application to transmit any data by using the peripheral communication protocol.

[0256] The target data includes a mode switching command, which is used to instruct the peripheral device to switch the communication mode to a customized communication mode so that the peripheral device can use the peripheral communication protocol to transmit data during the running of the target game in the game application.

[0257] One or more instructions in a computer-readable storage medium are loaded by processor 1101 and the following steps are also executed:

[0258] The system detects whether the operating system supports mode switching commands and transmits them through peripheral communication protocols and communication drivers.

[0259] If supported, the step of obtaining the peripheral communication protocol will be triggered.

[0260] If not supported, a vibration sequence is generated, which is used to trigger the peripheral device to switch execution modes. The vibration sequence and target data are sent to the management module of the operating system so that the management module can forward the vibration sequence and target data to the peripheral device through the communication driver.

[0261] In one embodiment, the device is mounted on a peripheral device, and one or more instructions in a computer-readable storage medium are loaded by processor 1101 and further executed as follows:

[0262] During the running of the target game in the game application, if a target operation is detected by the target game's operation object, an object input signal is generated as target data based on the target operation;

[0263] In this process, after obtaining the target data, the game application updates the game screen of the target game based on the target data.

[0264] In one embodiment, the device is mounted on a peripheral device, and one or more instructions in a computer-readable storage medium are loaded by processor 1101 and further executed as follows:

[0265] During the operation of peripheral devices, the device power level is obtained;

[0266] If the device's battery level is lower than the battery threshold, a battery warning signal will be generated as the target data.

[0267] After acquiring the target data, the game application generates a battery warning message based on the target data and displays the battery warning message in the game application's interface.

[0268] In one implementation, the peripheral device includes a custom communication interface based on a peripheral communication protocol, the custom communication interface including a custom input endpoint and a custom output endpoint;

[0269] The peripheral device sends data to the communication driver through the customized input endpoint; and the peripheral device obtains data from the communication driver through the customized output endpoint.

[0270] In one implementation, the target data is transmitted while the peripheral device is in a custom communication mode;

[0271] The peripheral devices operate in a customized communication mode by receiving heartbeat commands from the game application through customized output endpoints.

[0272] Based on the same inventive concept, the principle and beneficial effects of the electronic device provided in the embodiments of this application in solving the problem are similar to the principle and beneficial effects of the data transmission method in the embodiments of this application in solving the problem. For the sake of brevity, the principle and beneficial effects of the method implementation can be referred to.

[0273] This application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the aforementioned data transmission method.

[0274] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0275] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0276] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this invention should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data transmission method, characterized in that, include: When the game application in the target terminal and the peripheral device need to transmit target data, obtain the peripheral communication protocol; The target terminal sends and receives data through an internal communication driver, and the peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver. The target data is transmitted between the game application and the peripheral device using the peripheral communication protocol and the communication driver. The peripheral device includes multiple vibration devices. When the method is executed by the game application, the target data includes peripheral control instructions. During the operation of the target game, after detecting a vibrating object in the game screen, the game application selects a vibration device close to the location of the vibrating object as the target vibration device based on the position of the vibrating object in the game screen and the position information of each vibration device in the peripheral device. It then generates peripheral control instructions based on the parameters of the target vibration device. The vibrating object is a virtual object in the game screen that needs to vibrate, and the peripheral control instructions instruct the peripheral device to control the target vibration device to vibrate.

2. The method as described in claim 1, characterized in that, The process of transmitting the target data between the game application and the peripheral device using the peripheral communication protocol and through the communication driver includes: The target data is encapsulated using the peripheral communication protocol to obtain encapsulated data. The encapsulated data is sent to the communication driver so that the data receiver can obtain the encapsulated data from the communication driver; Wherein, if the encapsulated data is sent from the game application to the communication driver, the data receiver refers to the peripheral device; if the encapsulated data is sent from the peripheral device to the communication driver, the data receiver refers to the game application.

3. The method as described in claim 2, characterized in that, The peripheral communication protocol specifies information structures corresponding to one or more data types; the encapsulation of the target data using the peripheral communication protocol to obtain encapsulated data includes: Determine the data type of the target data; The information structure corresponding to the data type of the target data is queried in the peripheral communication protocol and used as the target information structure. The target data is written into the target information structure to obtain encapsulated data.

4. The method according to any one of claims 1-3, characterized in that, The method is executed by the game application, and the communication driver includes interface declarations for one or more communication interfaces of the peripheral device; the method further includes: Scan the interface declarations of each communication interface of the peripheral device from the communication driver, and search for the specified protocol identifier in each obtained interface declaration; If the specified protocol identifier is found in at least one of the interface declarations, the communication protocol identified by the specified protocol identifier is determined to be the peripheral communication protocol.

5. The method as described in claim 4, characterized in that, The target data includes an information query request for querying device information of the peripheral device, wherein the device information includes at least the feature information supported by the peripheral device; the method further includes: After the feedback result sent by the peripheral device exists in the communication driver, the feedback result is obtained from the communication driver; the feedback result is obtained by the peripheral device responding to the information query request and encapsulating the device information using the peripheral communication protocol. The feedback result is decapsulated according to the peripheral communication protocol to obtain the device information of the peripheral device.

6. The method as described in claim 5, characterized in that, The characteristic information is used to indicate at least one device capability of the peripheral device; the method further includes: If an input command is received from the peripheral device, the reference device capability required by the peripheral device to generate the input command is determined. The capability of at least one device indicated by the characteristic information is matched using the benchmark device capability. The input instruction is validated based on the capability matching result; wherein, if the reference device capability matches the capability of at least one device, the input instruction is determined to be a valid instruction.

7. The method as described in claim 4, characterized in that, The method further includes: If it is detected that the peripheral device needs to perform a target game feedback operation, then the feature information supported by the peripheral device is obtained, and the feature information is used to indicate at least one device capability of the peripheral device; The target device capability is found among at least one device capability indicated by the characteristic information, wherein the target device capability refers to: the device capability for supporting the peripheral device to perform the target game feedback operation; If the target device capability is found, peripheral control instructions are generated to control the peripheral device to perform the target game feedback operation.

8. The method as described in claim 4, characterized in that, The game application runs on the operating system of the target terminal, and the peripheral device is in a customized communication mode. The operating system supports the peripheral device and the game application in transmitting any data by using the peripheral communication protocol. The target data includes a mode switching command, which is used to instruct the peripheral device to switch the communication mode to the customized communication mode, so that the peripheral device can use the peripheral communication protocol to transmit data during the running of the target game in the game application. The method further includes: The system detects whether the operating system supports the mode switching command and transmits the data through the peripheral communication protocol and the communication driver. If supported, the step of obtaining the peripheral communication protocol will be triggered. If not supported, a vibration sequence is generated, which is used to trigger the peripheral device to switch execution modes; the vibration sequence and the target data are sent to the management module of the operating system, so that the management module forwards the vibration sequence and the target data to the peripheral device through the communication driver.

9. The method according to any one of claims 1-3, characterized in that, The method is executed by the peripheral device, and the method further includes: During the running of the target game in the game application, if a target operation input by the target game's operation object is detected, an object input signal is generated as target data based on the target operation. After acquiring the target data, the game application updates the game screen of the target game based on the target data.

10. The method according to any one of claims 1-3, characterized in that, The method is executed by the peripheral device, and the method further includes: During the operation of the peripheral device, the device power level of the peripheral device is acquired; If the device's battery level is less than the battery threshold, a battery warning signal is generated as the target data. After acquiring the target data, the game application generates a battery warning message based on the target data and displays the battery warning message in the application interface of the game application.

11. The method according to any one of claims 1-3, characterized in that, The peripheral device includes a customized communication interface based on the peripheral communication protocol, and the customized communication interface includes a customized input endpoint and a customized output endpoint; The peripheral device sends data to the communication driver through the custom input endpoint; and the peripheral device obtains data from the communication driver through the custom output endpoint.

12. The method as described in claim 11, characterized in that, The target data is transmitted when the peripheral device is in a customized communication mode; The peripheral device operates in the customized communication mode when it receives the heartbeat command sent by the game application through the customized output endpoint.

13. A data transmission device, characterized in that, include: The acquisition unit is used to acquire the peripheral communication protocol when the game application in the target terminal and the peripheral device need to transmit target data. The target terminal sends and receives data through an internal communication driver, and the peripheral communication protocol is customized between the game application and the peripheral device according to the data transmission specifications of the communication driver. The processing unit is configured to transmit the target data between the game application and the peripheral device using the peripheral communication protocol and through the communication driver. The peripheral device includes multiple vibration devices. When the device is applied to the game application, the target data includes peripheral control instructions. The processing unit is further configured to: during the running of the target game in the game application, after detecting a vibration object in the game screen of the target game, select a vibration device from the peripheral device that is close to the position of the vibration object as the target vibration device based on the position of the vibration object in the game screen and the position information of each vibration device in the peripheral device, and generate peripheral control instructions based on the parameters of the target vibration device; wherein, the vibration object is a virtual object in the game screen that needs to vibrate, and the peripheral control instructions are used to instruct the peripheral device to control the target vibration device to vibrate.

14. An electronic device, characterized in that, include: A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the data transmission method as described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed by the data transmission method as described in any one of claims 1-12.

16. A computer program product, characterized in that, The computer program product includes computer instructions that are loaded by a processor and executed as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Gamepad and game control method and device based on BLE connection

    CN106075902A