WO2023207941A1 - Data transmission method and apparatus, and electronic device, storage medium and program product - Google Patents

Data transmission method and apparatus, and electronic device, storage medium and program product Download PDF

Info

Publication number
WO2023207941A1
WO2023207941A1 PCT/CN2023/090483 CN2023090483W WO2023207941A1 WO 2023207941 A1 WO2023207941 A1 WO 2023207941A1 CN 2023090483 W CN2023090483 W CN 2023090483W WO 2023207941 A1 WO2023207941 A1 WO 2023207941A1
Authority
WO
WIPO (PCT)
Prior art keywords
peripheral device
peripheral
data
game
communication
Prior art date
Application number
PCT/CN2023/090483
Other languages
French (fr)
Chinese (zh)
Inventor
唐玺
魏雪
李�瑞
潘博渊
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2023207941A1 publication Critical patent/WO2023207941A1/en

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/23Input arrangements for video game devices for interfacing with the game device, e.g. specific interfaces between game controller and console
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W80/00Wireless network protocols or protocol adaptations to wireless operation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Definitions

  • the present 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, a computer-readable storage medium and a program product.
  • a peripheral device directly operated by an operating object is a peripheral device installed on a terminal and used to send data (such as game data) to control game applications running in the terminal.
  • data such as game data
  • hardware equipment Currently, data transmission between peripheral devices and game applications is forwarded through the terminal's operating system (such as Android and other operating systems).
  • the related method of forwarding data through the operating system has limitations. For example, if a new hardware structure is added to the peripheral device, and the data related to the hardware structure cannot be recognized or supported by the operating system, the operating system cannot correctly forward the data to the game application, resulting in the new hardware structure in the peripheral device. The functionality of the hardware structure cannot be utilized. It can be seen that relying on the operating system to forward data between peripheral devices and game applications will cause data transmission failures, which will also limit the gameplay of the game, limit the development of peripheral devices and game applications, and reduce the user experience of the operating objects. gaming experience.
  • Embodiments of the present application provide a data transmission method, device, electronic device, storage medium and program product, which can realize direct communication between peripheral devices and game applications, so that the data transmitted between game applications and peripheral devices is no longer required.
  • Limited by the operating system in the terminal that is, the data does not need to be forwarded by the management module of the operating system), which allows richer data to be sent between game applications and peripheral devices, and improves the efficiency and convenience of data transmission. sex.
  • embodiments of the present application provide a data transmission method, which includes:
  • the peripheral communication protocol When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver.
  • the peripheral communication protocol is in accordance with the data transmission specification of the communication driver and is for all The communication between the game application and the peripheral device is customized;
  • Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  • a data transmission device which includes:
  • the acquisition unit is used to obtain the peripheral communication protocol when interactive data needs to be transmitted between the game application in the terminal and the peripheral device; the terminal sends and receives data through the internal communication driver, and the peripheral communication protocol is based on the data of the communication driver. Transmission specification, customized for communication between the game application and the peripheral device;
  • a processing unit used to transmit interactive data between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  • an electronic device which includes:
  • a processor adapted to execute a computer program
  • a computer-readable storage medium stores a computer program.
  • the computer program is loaded by the processor and executes the following steps:
  • the peripheral communication protocol When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver.
  • the peripheral communication protocol is in accordance with the data transmission specification of the communication driver and is for all The communication between the game application and the peripheral device is customized;
  • Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  • embodiments of the present application provide a computer-readable storage medium that stores a computer program.
  • the computer program is suitable for being loaded by a processor and executing the following steps:
  • the peripheral communication protocol When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal uses the internal communication The communication driver sends and receives data, and the peripheral communication protocol is customized for the communication between the game application and the peripheral device according to the data transmission specification of the communication driver;
  • Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  • inventions of the present application provide a computer program product.
  • the computer program product includes computer instructions.
  • the computer instructions are loaded by a processor and execute the following steps:
  • the peripheral communication protocol When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver.
  • the peripheral communication protocol is in accordance with the data transmission specification of the communication driver and is for all The communication between the game application and the peripheral device is customized;
  • Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  • Figure 1a shows a schematic structural diagram of a data transmission system provided by an exemplary embodiment of the present application
  • Figure 1b shows a schematic data flow diagram of a cloud game provided by an exemplary embodiment of the present application
  • Figure 1c shows a schematic structural diagram of a data transmission system provided by an exemplary embodiment of the present application
  • Figure 1d shows a schematic diagram of establishing a connection between a peripheral device and a terminal provided by an exemplary embodiment of the present application
  • Figure 1e shows a schematic diagram of an existing data transmission provided by an exemplary embodiment of the present application
  • Figure 1f shows a schematic diagram of data transmission when a game provided by an exemplary embodiment of the present application is a cloud game
  • Figure 1g shows a schematic diagram of data transmission when a game provided by an exemplary embodiment of the present application is a local game
  • Figure 2a shows a schematic flow chart of a data transmission solution provided by an exemplary embodiment of the present application
  • Figure 2b shows a schematic software structure diagram of a peripheral device supporting a peripheral communication protocol provided by an exemplary embodiment of the present application
  • Figure 3 shows a schematic diagram of downlink transmission and uplink transmission between a peripheral device and a game application provided by an exemplary embodiment of the present application
  • Figure 4 shows a schematic flowchart of a data transmission method provided by an exemplary embodiment of the present application
  • Figure 5a shows a schematic diagram of a game application querying device information of a peripheral device according to an exemplary embodiment of the present application
  • Figure 5b shows a schematic diagram of a game application querying device information of a peripheral device according to an exemplary embodiment of the present application
  • Figure 6a shows a schematic diagram of a game application controlling a peripheral device to perform game feedback provided by an exemplary embodiment of the present application
  • Figure 6b shows a schematic diagram of a peripheral device performing a vibration operation provided by an exemplary embodiment of the present application
  • Figure 6c shows a schematic diagram of a peripheral device performing a vibration operation provided by an exemplary embodiment of the present application
  • Figure 7a shows a schematic diagram of a mode switching command directly transmitted between a game application and a peripheral device provided by an exemplary embodiment of the present application
  • Figure 7b shows a schematic diagram of forwarding a mode switching command via an operating system provided by an exemplary embodiment of the present application
  • Figure 8 shows a schematic diagram of a peripheral device sending an input signal input by an operating object to a game application provided by an exemplary embodiment of the present application
  • Figure 9 shows a schematic diagram of a peripheral device actively initiating a power warning signal provided by an exemplary embodiment of the present application.
  • Figure 10 shows a schematic structural diagram of a data transmission device provided by an exemplary embodiment of the present application.
  • Figure 11 shows a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application.
  • a data transmission system which at least includes peripheral equipment and a terminal; the data transmission system can be seen in Figure 1a.
  • the embodiments of the present application do not limit the number of peripheral devices and terminals; for example, in a game scenario in which multiple people participate in the game, one terminal can be connected to two or more peripheral devices to achieve the goal of using multiple peripheral devices.
  • the various electronic devices involved in the data transmission system are described below, among which:
  • the terminal may refer to: any terminal running a game application; the game application may include: a client (or web application or applet, etc.) that provides games.
  • the terminal has certain data processing capabilities and screen display capabilities.
  • the terminal may include two or more devices.
  • the terminal may include a data processing device with a data processing function and a display device with a screen display function; in this implementation, a data processing device and a display device are required.
  • Game applications are run together, and the data processing device and the display device can be connected through wired or wireless connections, so that data generated by the data processing device (such as game screens) can be transmitted to the display device for display.
  • the data processing device is a host with data processing capabilities
  • the display device is a monitor with image display capabilities.
  • the terminal can also be an all-in-one machine, in which case the terminal has both data processing capabilities and screen display capabilities; in this implementation, the terminal not only supports data processing of game data related to game applications, but also supports game processing through the display screen.
  • the screen is displayed.
  • terminals may include but are not limited to: smartphones (such as Android phones, iOS phones, etc.), tablet computers, portable personal computers, Mobile Internet Devices (MID), smart TVs, vehicle-mounted devices, head-mounted devices, etc.
  • games provided by game applications running in the terminal can be classified according to different conditions. According to different operating conditions of the game, games can be divided into local games and online games; the so-called local games refer to games that run locally on the terminal and do not require a network; the so-called online games refer to games that rely on the network to load game data in order to run. game. Or, according to the different running modes of the game, games can be divided into: client games, web games and cloud gaming (Cloud gaming), etc.; client games can be referred to as end games, which refer to games played on a personal computer (PC). running game. Web games can be called web games or web games. They are games that are run on the game web page provided by the browser.
  • Cloud gaming also known as gaming on demand, refers to games running in cloud servers (or cloud servers).
  • game applications can send data (such as input instructions or signals) sent by peripheral devices to the cloud server, and the cloud game server is responsible for rendering the game screen based on the data and rendering the rendered game. After the screen is compressed, it is transmitted to the terminal used by the operation object through the network. At this time, the terminal only performs the operation of displaying the game screen, as shown in Figure 1b.
  • This operating mode of cloud games means that the terminal held by the player does not need to have powerful graphics computing and data processing capabilities, but only needs to have basic streaming media playback capabilities (such as the ability to display game screens), human-computer interaction capabilities (obtaining The ability to input operations on the operating object), and data transmission capabilities (such as the ability to send instructions to the cloud server) are sufficient.
  • the embodiments of the present application do not limit the specific types of games running in the terminal, which are specifically explained here.
  • the data processing system provided by the embodiment of the present application further includes at least one server, as shown in Figure 1c.
  • the server may refer to a background server corresponding to the game application running in the terminal, which is used to interact with the terminal running the game application to provide computing and application service support for the game application.
  • Servers may include, but are not limited to: data processing servers, Web servers, application servers, and other devices with complex computing capabilities; alternatively, servers may be independent physical servers, or server clusters or distributed servers composed of multiple physical servers. system.
  • games can include cloud games.
  • the above-mentioned server can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud Cloud servers for basic cloud computing services such as communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
  • cloud services such as communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
  • Peripheral devices can be called input devices, external devices, game control devices or game control devices, etc., which refer to hardware that is external to the terminal and directly operated by the operating object to control the game application running in the terminal. equipment.
  • Peripheral devices may include, but are not limited to: handheld gamepads (or gamepads for short), wearable game consoles, mice or keyboards; for ease of explanation, the following description will take a handheld gamepad as an example of a peripheral device.
  • the peripheral device and the terminal are independent hardware devices, a communication connection can be established between the peripheral device and the terminal, so that the operating object can control the game application running in the terminal by operating the peripheral device. Controls of the games provided.
  • the peripheral device can be configured with a receiver, and the receiver is connected to the physical interface (or hardware interface) provided by the terminal to establish communication between the peripheral device and the terminal through the physical interface. connect.
  • FIG 1d An exemplary schematic diagram of establishing a communication connection between a peripheral device and a terminal through a receiver and a physical interface can be seen in Figure 1d.
  • the terminal 101 includes at least one physical interface 1011, and a receiver configured by the peripheral device 102 can be inserted into the physical interface 1011 provided by the terminal 101 to establish a communication connection between the peripheral device and the terminal.
  • the receiver 102 and the peripheral device 103 shown in Figure 1d are connected wirelessly.
  • wireless communication modules can be deployed in the peripheral device 103 and the receiver 102 to facilitate wireless communication.
  • the wireless communication module (such as Bluetooth module, wifi module or radio frequency signal module, etc.) performs data transmission between the peripheral device 103 and the receiver 102.
  • the peripheral device 103 can transmit its own information (such as device model or device model) through the wireless communication module. manufacturer and other information) is sent to the receiver 102.
  • the receiver 102 and the peripheral device 103 can also be connected by wire.
  • the receiver 102 can be configured with a data transmission line, through which the peripheral device and the game application can be established. connect.
  • the peripheral device can send data to the receiver so that the terminal can scan the device information of the peripheral device from the receiver, and then the peripheral device can Implement data transmission between devices and terminals.
  • the physical interface provided by the terminal may include a USB (Universal Serial Bus, Universal Serial Bus) interface.
  • the peripheral device inserted into the USB interface may be called a USB device.
  • the USB interface refers to the interface set up in the terminal that complies with the USB standard or specification; the USB standard is an external bus standard (or called a serial bus standard) and a technical specification for an input and output interface (or called a communication interface). Used to standardize the connection and communication between terminals (such as personal computers) and peripheral devices (such as game controllers).
  • a USB interface is deployed in the terminal, if you want the peripheral device (or USB device) inserted into the USB interface to work normally, you need to install a USB driver (or USB driver for short) inside the terminal. , so that the peripheral device plugged into the USB interface can be identified in the terminal through the USB driver, and data can be sent and received through the USB driver, such as obtaining the data sent by the USB device, to achieve the desired effect of the USB device.
  • the terminal can send and receive data through the internal communication driver.
  • the so-called sending and receiving data refers to receiving data and sending data.
  • the USB driver can scan the interactive data (such as any data) sent by the peripheral device from the receiver. Specifically, it scans the peripheral device and encapsulates the interactive data. encapsulated data, and then perform corresponding feedback processing based on the interactive data obtained by decapsulating the encapsulated data. If the interactive data includes a target signal for adjusting the sound volume, then the terminal or terminal can be increased accordingly based on the target signal. Game application volume.
  • the above-mentioned encapsulation data is specifically obtained by encapsulating the interactive data according to the communication protocol.
  • the communication protocol is written in accordance with the HID (Human interface device, human-computer interaction interface) specification that the USB driver follows.
  • HID Human interface device, human-computer interaction interface
  • the USB driver scans any encapsulated data, it can use the HID specification it follows to scan any encapsulated data.
  • the data format of the packaged data is detected. Only when the data format of any packaged data is detected to meet the HID specification, the packaged data is determined to be cached, so as to filter the scanned data that does not meet the HID specification. .
  • the HID specification is a human-computer interaction specification (or standard).
  • the human-computer interaction specification 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, that is to say, there is no difference in the HID specification followed by the USB driver deployed on different terminals; this allows the communication protocol written in accordance with the HID specification to be used by most devices. supported, thereby improving the applicability of the communication protocol to a certain extent.
  • the operating object can use the peripheral device to control the game running in the terminal.
  • the operating object can use the peripheral device to control the game.
  • the gameplay is called a large-screen game; that is, a large-screen game refers to a game that uses a separate terminal to display the game screen or game scene, and uses peripheral devices external to the terminal to control the game displayed on the terminal. Gameplay. It can be seen that in a large-screen game scenario, the terminal used to display the game screen and the peripheral device used to control the game are separated.
  • This kind of gameplay that uses peripheral devices to control the game can avoid the occlusion of the game screen when the operating object controls the display screen, help the operating object better participate in the game, and provide the operating object with a more immersive gaming experience.
  • embodiments of this application propose a data transmission scheme based on the data transmission system described above; the data transmission scheme supports Customize a set of peripheral communication protocols (also known as private protocols, customized communication protocols, HID protocols) between game applications and peripheral devices, specifically in accordance with the communication driver inside the terminal (such as the USB driver mentioned above) Following the data transmission specification (such as the HID specification mentioned above), a set of peripheral communication protocols customized according to business needs between the game application and the peripheral device; then, the peripheral device and the game application follow the peripheral communication protocol communication protocol and communicate directly through the communication driver in the terminal.
  • peripheral communication protocols also known as private protocols, customized communication protocols, HID protocols
  • the data transmission scheme provided by the embodiment of the present application has obvious advantages when transmitting data between peripheral devices and game applications.
  • the data transmission scheme provided by the embodiment of the present application is compared with the existing mainstream peripheral devices. Taking the data transmission process between the device and the game application as an example, the advantages of the embodiments of the present application are explained:
  • the default communication protocol is The developer of the operating system in the terminal writes it according to business needs, which makes the peripheral device rely on the management module (or input) of the operating system in the terminal when the peripheral device and the game application transmit data according to the default communication protocol.
  • Management module to forward data (such as the encapsulated data generated by the aforementioned peripheral devices) to the game application.
  • the management module is configured to send the received data to the game application and the receiver in the peripheral device after receiving the data from the sender in the game application and the peripheral device.
  • the operating system in the terminal receives the data sent by the peripheral device through the communication driver running in the terminal.
  • the operating system forwards the data obtained from the communication driver to the game application to facilitate the game.
  • the application performs feedback processing based on data forwarded from the operating system.
  • data transmission between peripheral devices and game applications must be forwarded by the operating system.
  • many game inputs that are not supported by the operating system cannot be forwarded by the operating system, making the game control of peripheral devices and game applications difficult.
  • the ability has high limitations. For example, these limitations can be reflected in the following two exemplary points: 1.
  • the management module in the operating system used to forward the communication data does not apply. Supporting the forwarding of this data to game applications results in the functionality of the new hardware structure being unusable, thus limiting the development of peripheral devices. 2.
  • peripheral communication protocol is customized for the communication between the game application and the peripheral device according to the data transmission specification of the communication driver, so that the data transmission between the peripheral device and the game application is independent of the operating system , is not restricted by the operating system, and can eliminate the operating system restrictions described above.
  • the data transmission process between peripheral devices and game applications in the cloud gaming scenario can be seen in Figure 1f.
  • Another example is the data transmission process between peripheral devices and game applications in the client game scenario.
  • 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 terminal.
  • the data transmission solution provided by the embodiment of the present application has the following main advantages: 1.
  • peripheral manufacturers and game application developers can expand the peripheral communication protocol , specifically, the relevant protocols about the new hardware structure are added to the peripheral communication protocol, so that according to the expanded peripheral communication protocol, the related functions of the new hardware structure in the peripheral device can be realized, thereby enriching the game play. Prompt game control ability.
  • the input characteristics or feedback characteristics (such as vibration characteristics) of the peripheral device can be fully reflected in the game through the peripheral communication protocol, so that the original hardware structure of the peripheral device can be fully reflected in the game. Functions are fully utilized. 3.
  • peripheral communication protocol is customized according to the HID specification in the communication driver, and the HID specification in the communication driver is unified on each terminal, this allows the peripheral communication protocol provided by the embodiment of this application to With cross-terminal unification, both developers of cloud game applications and peripheral manufacturers producing peripheral devices can develop only once based on this peripheral communication protocol, and the developed game applications or peripheral devices can be used across terminals.
  • a peripheral device using the peripheral communication protocol can be connected to a computer to achieve direct communication with a game application running on the computer according to the peripheral communication protocol; for another example, a peripheral device using the peripheral communication protocol It can also be connected to the TV to implement live communication with the game application running on the TV according to the peripheral communication protocol.
  • this application also supports packaging the ability to use peripheral communication protocols into a software development kit (SDK) for developers to access the peripheral communication protocol when developing reference games (such as any game) cross-terminal SDK; in this way, the reference game connected to the SDK can interact with the corresponding peripheral devices through the peripheral communication protocol without being restricted by the operating system.
  • SDK refers to a collection of development tools for building application software for a specific software package, software framework, hardware platform, operating system, etc.
  • the SDK includes an application programming interface (Application Programming Interface, API).
  • API Application Programming Interface
  • the so-called API refers to some predefined functions for data communication. APIs are used to connect different components of the system.
  • the SDK includes a protocol interface. After the reference game developed by the developer is started, it can access a set of routines in the game application (such as peripheral communication protocol) through the protocol interface provided by the game application containing the game, and There is no need to access the source code or understand the details of the inner workings.
  • the game application containing the reference game integrates the software development kit corresponding to the protocol interface of the game application containing the game, when the game containing the reference game
  • the protocol interface of the game application containing the game is called, so that the game application containing the reference game can call the peripheral communication protocol for data transmission through the protocol interface.
  • the process of direct data transmission between a peripheral device and a game application in accordance with the peripheral communication protocol may involve the following stages:
  • the receiver configured by the peripheral device can be inserted into the physical interface provided by the terminal.
  • the peripheral device can The interface declaration of one or more communication interfaces is sent to the receiver, so that the communication driver in the terminal can scan the interface declaration of each communication interface of the peripheral device from the receiver; where the communication driver can be a timer The receiver is scanned for data (such as interface declarations).
  • the interface declaration of the communication interface can be simply understood as the 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 the The communication protocol corresponding to the protocol identifier performs data transmission.
  • the game application can scan the interface statement of one or more communication interfaces of the peripheral device from the communication driver in the terminal. If the game application obtains the interface statement from the communication driver, If the specified protocol identifier is scanned, the communication protocol identified by the specified protocol identifier is determined to be the peripheral communication protocol, that is, the game application confirms that the peripheral device connected to it is a peripheral device that supports the peripheral communication protocol.
  • the software input communication module of the peripheral device that supports the peripheral communication protocol needs to be implemented according to the structure shown in Figure 2b; as shown in Figure 2b, the peripheral device includes a customized communication interface customized based on the peripheral communication protocol.
  • the software input communication module includes a customized communication interface customized based on the peripheral communication protocol, such as a customized HID USB interface (UsbInterface); that is to say, the software input communication module of the peripheral device includes a customized communication interface, and the customized The communication interface supports data transmission according to the peripheral communication protocol.
  • the customized communication interface at least includes a customized input endpoint and a customized output endpoint.
  • the endpoint can be understood as a data buffer that can be used to temporarily save data; the input or output of the endpoint is determined from the data flow direction when the game application sends and receives data.
  • the data flow direction of the custom input endpoint is the data flow direction when the game application receives data; in this case, the data flows from the peripheral device to the game application, that is: the peripheral device can send data to the custom input endpoint in the custom interface.
  • the communication driver can then obtain the cached data from the custom input endpoint, and the game application scans the cached data from the communication driver to realize data flow from the peripheral device to the game application.
  • 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
  • the program sends the data to the customized output endpoint in the customized interface for caching, and then the peripheral device obtains the cached data from the customized output endpoint to realize the data flow from the game application process to the peripheral device.
  • the embodiment of the present application supports the coexistence of the peripheral communication protocol and the original default communication protocol in the software, that is, the peripheral device includes a customized peripheral communication protocol.
  • the original default communication protocol still needs to be retained; therefore, in addition to the customized communication interface, the software input communication module of the peripheral device also includes a default communication interface based on the original default communication protocol, such as the mode USB interface .
  • the peripheral device includes customized input endpoints and customized output endpoints, it still needs to retain the original default input and output endpoints to retain the original peripheral data transmission method, so that in game applications that support peripheral communication protocols In the scenario where it is not running, it can ensure that the peripheral device can still interact with the operating system according to the originally designed default communication protocol, and in the scenario where the game application that supports the peripheral communication protocol is running, the peripheral communication protocol can be started based on customization Input endpoints and customized output endpoints perform data transmission, and the original input and output endpoints are paused.
  • Game application initialization phase Before the operating object controls the game provided by the game application by controlling the peripheral device, the embodiment of the present application also needs to initialize the game application.
  • the initialization process here may include: the game application obtains the device information of the peripheral device. process. 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 detect the validity of the input and output instructions based on the device information.
  • the game application can generate an information query request according to the peripheral communication protocol, and use the information query request as interactive data; then, encapsulate the interactive data according to the peripheral communication protocol; and process the encapsulation through the communication driver to obtain
  • the encapsulated data is sent to the customized input interface, so that the peripheral device can respond to the information query request, use the peripheral communication protocol to encapsulate the device information, and report the encapsulated feedback results to the game application through the communication driver, so as to facilitate Game applications can obtain external Device information of the device.
  • the device information of the peripheral device may include but is not limited to: characteristic information, capability information and detailed information.
  • the characteristic information is used to indicate at least one device capability of the peripheral device. If the peripheral device includes a gyroscope, then the peripheral device has the device capability of uploading gyroscope data. Capability information is used to indicate that the peripheral device has the information of the device required for each device capability. If the peripheral device has the device capability of uploading gyroscope data, then the peripheral device includes a gyroscope that can generate gyroscope data. This The time capability information includes device information of the gyroscope. Detailed information is used to indicate the device details of the peripheral device, such as the device manufacturer or device model of the peripheral device, etc. After the game application obtains the detailed information of the peripheral device, it can better evaluate the quality of the game product based on the detailed information. and quality control, thereby improving the gaming experience of the operating objects.
  • the initialization process may include: changing the working mode of the peripheral device (also known as Communication mode) switches to the customized communication mode, where the customized communication mode refers to the mode that uses other communication protocols of the peripheral device; 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.
  • the working mode of the peripheral device also known as Communication mode
  • the customized communication mode refers to the mode that uses other communication protocols of the peripheral device
  • the peripheral device suspends the use of the default communication protocol for data transmission, and starts the customized peripheral communication mode for data transmission.
  • the operating system in the terminal supports the peripheral device and the game application to transmit any data by using the peripheral communication protocol, so that in the subsequent process of the operating object controlling the game provided by the game application based on the peripheral device , the peripheral device can send interactive data generated based on the target operation of the operation object to the game application according to the peripheral communication protocol, providing richer game control capabilities.
  • the target operation refers to any operation input by the operation object.
  • the game application determines that the peripheral device is a hardware device that supports the peripheral communication protocol, the game application can send a mode switching command to the peripheral device.
  • the mode switching command is used to instruct the working mode of the peripheral device to switch to a 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 in which the peripheral device is in when it receives the mode switching command; in the case where the peripheral device includes a default communication mode and a customized communication mode, the current communication mode here may refer to the default communication mode.
  • the peripheral device uses the default communication protocol to interact with the game application; the relevant description of the default communication protocol can be found in the foregoing description and will not be described again here.
  • 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; and, the peripheral device has Switch the working mode to the customized communication mode. From then on, the operating object can use the general input capabilities of the peripheral device (such as the capabilities included in the original communication protocol, such as the ability to operate the remote control stick in the peripheral device), as well as the special input included in the peripheral communication protocol. capabilities (such as the ability of peripheral devices to vibrate) to control games provided by game applications.
  • the general input capabilities of the peripheral device such as the capabilities included in the original communication protocol, such as the ability to operate the remote control stick in the peripheral device
  • capabilities such as the ability of peripheral devices to vibrate
  • the operation object can perform the operation of operating the peripheral device to control the game provided by the game application;
  • data transmission between the peripheral device and the game application can be carried out according to the peripheral communication protocol.
  • the peripheral device sends data or power warning information generated according to the target operation of the operating object to the game application according to the peripheral communication protocol.
  • a game application can enable peripheral devices to perform corresponding game feedback operations (such as vibration operations).
  • the game application can send a mode switching command to the peripheral device.
  • the mode switching command is used to instruct the peripheral device to switch back to the original communication mode from the customized communication mode. communication mode, so that the peripheral device stops using the peripheral communication protocol for data transmission and starts the original default communication mode for data transmission.
  • steps (1)-(5) provide a relatively complete technical process of the data transmission solution provided by the embodiment of the present application; however, in actual application scenarios, the implementation methods included in some steps may also change.
  • 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.
  • the embodiments of the present application are applied to specific products or technologies, such as when a 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 relevant data require Comply with relevant laws, regulations and standards of relevant countries and regions.
  • game equipment provided by game applications needs to comply with relevant laws, regulations and standards of relevant countries and regions.
  • the embodiment of the present application supports summarizing the relatively complete data transmission process described above into uplink transmission (or simply referred to as uplink) and downlink transmission (or simply referred to as downlink), as shown in Figure 3 .
  • the uplink and downlink in the data transmission process 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. At this time, it can be The instructions sent by the game application to the peripheral device are called downlink transmission instructions; for another example, the data flows from the peripheral device The data transmission process to the game application can be called uplink transmission. At this time, the instructions that can be sent from the peripheral device to the game application are called uplink transmission instructions.
  • the following is a brief overview of the functions carried by peripheral devices in downlink transmission and the functions carried by peripheral devices in uplink transmission; among them:
  • the software and hardware control of the peripheral device by the game application may include: controlling the communication mode switching of the peripheral device, and controlling the peripheral device to perform game feedback (such as vibration control).
  • the game application can control the communication mode of the peripheral device to switch between the original communication mode (such as the default communication mode mentioned above) and the customized communication mode.
  • the game application finds the specified protocol identifier in the interface declaration of the peripheral device and determines that the peripheral device is a hardware device that supports the peripheral communication protocol, then the game application can send a downlink transmission command to the peripheral device.
  • the downlink The transmission command includes a mode switching command to control the communication mode of the peripheral device to switch to a customized communication mode, specifically switching from the default communication mode to the customized communication mode.
  • the game application when the game application detects that the operating object ends the game experience, such as when the game application detects that the operating object performs the game closing operation, the game application can send a downlink transmission instruction to the peripheral device.
  • the downlink transmission instruction includes mode switching back. command to control the working mode of the peripheral device to switch from the customized communication mode back to the original communication mode. Specifically, it can switch from the customized communication mode back to the default communication mode.
  • the game application can control peripheral devices to perform game feedback.
  • the game application can send a downlink transmission instruction to the peripheral device.
  • the downlink transmission instruction includes a peripheral control instruction, specifically a vibration instruction, to Cause the peripheral device to perform a vibration operation in response to the vibration instruction.
  • the game screen provided by the game can be used to describe the game scenes provided by the game.
  • the game scenes can include competition scenes, team formation scenes or settlement scenes, etc.; competition scenes can refer to: the operating object controls the game character in the game and actually participates in it.
  • the game scene; the team scene may refer to the scene where the operating object is waiting to enter the game room (such as a competition scene) in the game lobby.
  • the operating object is supported to edit the attributes of the game character, such as updating the clothing of the game character.
  • the settlement scene may refer to: the scene used to display the game results (such as points) after the game is over.
  • the vibration object in the game screen can refer to: any virtual object that needs to vibrate displayed in the game screen according to the requirements of the game scene.
  • the virtual object can be a game character or a virtual object (such as a boat, tree or car, etc.);
  • the game scene includes a scene where the operating object controls the game character to drive a vehicle.
  • the vehicle and the game character need to vibrate.
  • the vehicle and the game character can be used as part of the game scene.
  • the vibration object to be vibrated The embodiments of the present application do not limit the game scenes provided by the game and the vibration objects in the game scenes.
  • the information inquiry initiated by the game application may include but is not limited to: information inquiry about the device information of the peripheral device, and information inquiry about the device power of the peripheral device.
  • information inquiry about the device information of the peripheral device For the content included in the device information of the peripheral device, please refer to the relevant description of the content shown above, and will not be described again here.
  • the game application determines that the peripheral device is a hardware device that supports the peripheral communication protocol, it 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; wherein, the game application obtains the external device information.
  • the specific implementation process of the device information of the device please refer to the related description of the specific implementation process shown in Figure 2a, and will not be described again here.
  • the game application can generate a power query request at regular intervals (such as every preset time period), so that the peripheral device responds to the power query request and transmits the device power (such as the peripheral device receiving the power query request).
  • the device power at the time of request) is returned to the game application, so that the game application updates and displays the power of the peripheral device on the terminal screen each time it obtains the device power of the peripheral device.
  • the preset time period can be customized by the game developer according to business needs; when the preset time period is very short, the device power of the peripheral device can be displayed in real time on the terminal screen of the game application to a certain extent. It is helpful for the operating object to intuitively and timely understand the power status of the peripheral device.
  • the manufacturer of the peripheral device needs to customize the peripheral communication protocol for the peripheral device.
  • the peripheral device receives encapsulated data from the customized endpoint (such as a customized output endpoint) in the customized communication interface, and decapsulates the encapsulated data (or parses it) according to the peripheral communication protocol. Processing, referred to as parsing), to obtain the downlink transmission instructions initiated by the game application, such as the aforementioned mode switching command or power query command; then, feedback processing is performed based on the parsing results (that is, the corresponding instructions obtained by parsing).
  • the feedback processing performed by the peripheral device is different; for example, if the peripheral device parses the encapsulated data and obtains a mode switching instruction, the feedback processing performed by the peripheral device includes: responding to the The mode switching command switches the communication mode to the customized communication mode; for another example, the peripheral device parses the encapsulated data to obtain the peripheral control command, Then the feedback processing performed by the peripheral device includes: responding to the peripheral control instruction to perform a vibration operation; for another example, the peripheral device parses the package data to obtain an information query request, then the feedback processing performed by the peripheral device includes: responding to the information query Requests that device information be returned to the game app; etc.
  • the peripheral device includes the original default communication protocol and the customized peripheral communication protocol; when the peripheral device is in the customized communication mode, the peripheral device communicates with the game application according to the peripheral communication protocol. Transmission, when the peripheral device is in the original default communication mode, the peripheral device follows the default communication protocol and forwards it through the operating system to achieve data transmission with the game application. Therefore, in order to ensure that when the game application exits (such as closing or running in the background), the peripheral device can still transmit data with the operating system according to the original communication protocol to retain the original functions of the peripheral device, the embodiment of this application supports the use of Heartbeat mechanism to adjust the communication mode of peripheral devices.
  • the peripheral device if the peripheral device receives the heartbeat command sent by the game application, the peripheral device maintains working in the customized communication mode.
  • the heartbeat command is obtained by the game application encapsulating the heartbeat packet according to the customized communication protocol; the heartbeat packet refers to a default string, which is used to notify the recipient that it is currently in a valid state, so that the recipient can be effectively connected to itself.
  • the heartbeat packet is used to keep the peripheral device in a customized working mode.
  • the peripheral device and the game application can communicate according to the peripheral communication protocol.
  • the manufacturer of the peripheral device needs to implement the following software logic when customizing the customized communication interface based on the peripheral communication protocol for the peripheral device:
  • the peripheral device starts from The heartbeat command is received from the customized endpoint (such as the customized output endpoint) in the customized communication interface, and the heartbeat command is parsed according to the peripheral communication protocol to obtain the heartbeat packet and maintain the customized communication mode; if the peripheral device does not receive the heartbeat command from the customized communication interface If a heartbeat command is received from a customized endpoint (such as a customized output endpoint), the customized communication mode will be switched back to the original communication mode so that the peripheral device can still transmit data with the operating system.
  • a customized endpoint such as a customized output endpoint
  • the peripheral device maintains working in the customized communication mode after obtaining the heartbeat command sent by the game application through the customized output endpoint.
  • the game application sends a heartbeat packet to the peripheral device every preset period (such as 10 seconds). Then when the peripheral device receives the heartbeat packet within the preset period, it is determined that the game application wants the peripheral device to still be in the customized communication mode.
  • 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 is determined that the game application wants the peripheral device to switch back to the original communication mode for data transmission, then the peripheral device The device switches from the customized communication mode back to the original communication mode.
  • the peripheral device can respond to the downlink transmission command.
  • the corresponding interactive data is reported to the game application as an uplink transmission command (or notification and feedback command).
  • the exemplary functions carried by the uplink transmission instructions are as follows:
  • the peripheral device can generate an uplink transmission instruction based on the device information, and perform the processing according to the peripheral communication protocol.
  • the uplink transmission instruction is encapsulated to obtain encapsulated data, and then the encapsulated data is sent to the game application, so that the game application decapsulates the encapsulated data and obtains the device information of the peripheral device.
  • the peripheral device can generate an uplink transmission instruction based on the current device power to inform the game application of the current device power; where, the current device of the peripheral device
  • the power refers to the power detected by the peripheral device when it receives the downlink transmission command (such as the power query command) sent by the game application.
  • the manufacturer of the peripheral device needs to implement the following software logic when customizing a customized communication interface based on the peripheral communication protocol for the peripheral device:
  • the peripheral device starts from The customized endpoint (such as a customized output endpoint) receives the encapsulated data sent by the game application, and decapsulates the encapsulated data to obtain the downstream transmission instructions (such as information query requests); then, the peripheral device performs the downstream transmission instructions according to the peripheral communication protocol.
  • the corresponding data (such as device information) is encapsulated, and the encapsulated data is returned to the customized endpoint (such as a customized input endpoint), so that the game application can obtain the data returned by the peripheral device from the customized endpoint.
  • the peripheral device when the peripheral device detects that the device power is less than the power threshold, it means that the remaining power of the peripheral device is low.
  • the peripheral device can actively initiate an uplink transmission instruction.
  • the uplink transmission instruction indicates that the remaining power of the peripheral device is less than power threshold, and encapsulates the uplink transmission command and sends it to the game application; so that the game application responds to the uplink transmission command obtained by the decapsulation process.
  • the battery warning information is displayed in the application interface of the game application.
  • the application interface of the game application can be any service interface provided by the game application, and the battery warning information displayed in the application interface is used to prompt that the battery of the peripheral device of the operating object is low. Replenish power for peripheral devices in a timely manner.
  • the manufacturer of the peripheral device needs to implement the following software when customizing a customized communication interface based on the peripheral communication protocol for the peripheral device.
  • Logic When the peripheral device detects that the device power is less than the power threshold and determines that the trigger condition for actively notifying the game application is met, it will encapsulate the device power according to the peripheral communication protocol, and transmit the encapsulated encapsulated data back to the customized endpoint. (such as a customized input endpoint), so that the game application can obtain the device power returned by the peripheral device from the customized endpoint.
  • the peripheral device includes the original default communication protocol and the customized peripheral communication protocol; then when the peripheral device is in the default communication mode, the peripheral device detects the target operation input by the game's operating object.
  • the input signal is generated as interactive data according to the target operation; the interactive data is encapsulated according to the peripheral communication protocol in the customized communication mode, and the encapsulated data is sent to the original default communication interface so that the game application can follow the
  • the original default communication protocol obtains encapsulated data from the default communication interface.
  • the peripheral device when the peripheral device is in the customized communication mode, when the peripheral device detects the target operation input by the game's operating object, it can generate an input signal as interactive data according to the target operation; and according to the peripheral communication protocol in the customized communication mode The interactive data is encapsulated, 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.
  • This enables the peripheral device provided by the embodiment of the present application to be compatible with target operations in both old and new communication modes. For the operating object, there is no need to learn new operating habits, thereby improving the gaming experience of the operating object.
  • the peripheral manufacturer of the peripheral device implements the following software when customizing a customized communication interface based on the peripheral communication protocol for the peripheral device.
  • Logic After the peripheral device detects that the operating object performs the target operation, it can convert the analog signal input by the operating object into the corresponding digital signal (i.e. the aforementioned input signal) according to the analog-to-digital conversion structure of the peripheral device; then , encapsulate the input signal according to the peripheral communication protocol, and send the encapsulated data 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.
  • embodiments of the present application propose a more detailed data transmission method.
  • This data transmission method can be used by the peripheral device in the aforementioned data transmission system or the game application in the terminal. Execution; for ease of explanation, the subsequent description will take the data transmission method performed by an electronic device as an example, and unless otherwise specified, the electronic device may refer to any of a peripheral device or a terminal running a game application; when the electronic device When a terminal is used to run a game application, the described operations performed by the electronic device are specifically performed by the game application running in the terminal.
  • the data transmission method provided by the embodiment of the present application will be introduced in detail below with reference to the accompanying drawings.
  • Figure 4 shows a schematic diagram of a data transmission method provided by an exemplary embodiment of the present application; the data transmission method may include steps S401-S402:
  • the terminal sends and receives data through an internal communication driver, and the peripheral communication protocol is customized for communication between the game application and the peripheral device according to the data transmission specification of the communication driver.
  • the peripheral communication protocol supports data transmission between game applications and peripheral devices without the need for forwarding by the management module of the operating system.
  • the data transmission specification is used to represent the protocol specification of the communication interface followed by the communication driver (such as USB driver, Bluetooth driver, etc.), such as the HID (Human interface device, human-computer interaction interface) specification.
  • a communication connection can be established between the peripheral device and the terminal.
  • the receiver of the peripheral device can be inserted into the terminal.
  • the peripheral device can send the interface declaration of one or more communication interfaces it contains to the receiver, so that the communication driver deployed in the terminal can obtain the information of each communication interface of the peripheral device from the receiver.
  • Interface declaration so that the communication driver includes the interface declaration of one or more communication interfaces of the peripheral device.
  • the game application can scan the interface declarations of each communication interface of the peripheral device from the communication driver in the terminal, and find the specified protocol identifier in each scanned interface declaration, which is the customized peripheral communication protocol.
  • the identifier 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 supports peripheral communication If the hardware device trusts the protocol, the communication protocol identified by the designated protocol identifier is determined as the peripheral communication protocol, and the specific protocol content of the peripheral communication protocol identified by the designated protocol identifier can be further read to determine the peripheral communication protocol.
  • the manufacturer of the peripheral device can add a customized hardware structure, such as a six-axis gyroscope sensor or a pressure sensor, to the original peripheral device.
  • a customized hardware structure such as a six-axis gyroscope sensor or a pressure sensor
  • the management module in the operating system does not support forwarding the data. Forwarding to the game application and forwarding data related to the operation of the new hardware structure by the game application to the peripheral device is not supported, resulting in the function of the new hardware structure not being used.
  • the interactive data to be transmitted in step S401 is the interactive data related to the newly added hardware structure in the peripheral device.
  • Step S401 may be performed to obtain the peripheral communication protocol when the management module (or default communication protocol) of the operating system in the terminal does not support forwarding the data related to the newly added hardware structure and needs to forward the data related to the new hardware structure. operate.
  • the peripheral communication protocol can be used to transmit interactive data that the management module of the operating system does not support forwarding.
  • the interactive data is data related to the hardware structure that is not supported by the management module of the operating system in the terminal when the peripheral device is configured with a new hardware structure, so The hardware structure is used to perform interactive operations related to the game application.
  • the forwarding is: after the management module receives the data of the sender in the game application and the peripheral device, it forwards the data to the game application and the peripheral device.
  • the receiver sends the received data.
  • S402 use the peripheral communication protocol and the communication driver to transmit interactive data between the game application and the peripheral device.
  • one of the game application and the peripheral device is the sender, and the other is the receiver.
  • the sender uses the peripheral communication protocol to encapsulate the interactive data, it sends the encapsulated data (that is, the encapsulated interactive data) to the communication driver, so that the receiver can obtain the encapsulated data from the communication driver.
  • the sender sends the encapsulated data to the communications driver, and the communications driver sends the encapsulated data to the receiver.
  • S402 uses a peripheral communication protocol to package the interactive data, and then the communication program transmits the encapsulated interactive data between the game application and the peripheral device.
  • the game application and the peripheral device can realize the transmission of interactive data according to the peripheral communication protocol and through the communication driver.
  • the interactive data may refer to the data that the game application wants to send to the peripheral device, or the interactive data may refer to the data that the peripheral device wants to send to the game application.
  • the electronic device can obtain the peripheral communication protocol, such as from the interface declaration of the peripheral device, or write the peripheral communication protocol into the hardware of the electronic device in the form of code.
  • the electronic device When in the structure, it can be read from the hardware structure; the electronic device uses the peripheral communication protocol to encapsulate the interactive data to be transmitted, and obtains the encapsulated data; then, the electronic device sends the encapsulated data obtained by the encapsulation process to the communication device deployed in the terminal. driver so that the data receiver can obtain the encapsulated data from the communication driver.
  • the data receiver can refer to the peripheral device.
  • the encapsulated data is encapsulated and processed by the game application according to the peripheral communication protocol and sent to in the communication driver.
  • the data receiver can refer to the game application.
  • the encapsulated data is encapsulated and processed by the peripheral device according to the peripheral communication protocol and sent. to the communication driver.
  • the implementation methods of encapsulating the interactive data to be transmitted are also different, which is specifically reflected in the different information structures used to encapsulate the interactive data to be transmitted.
  • the information structure corresponding to any data type is defined by the peripheral communication protocol.
  • the embodiment of the present application does not limit the specific style of the information structure corresponding to each data type.
  • the electronic device can further determine the data type of the interactive data to be transmitted, and then query the information structure corresponding to the data type of the interactive data in the peripheral communication protocol, as Target information structure; then write the interactive data into the target information structure to obtain encapsulated data.
  • the peripheral device encapsulates the interactive data or the game application encapsulates the interactive data
  • the implementation process of the encapsulation process is related to the content described in the above implementation method.
  • a peripheral communication protocol can be customized between the game application and the peripheral device according to the data transmission specification followed by the communication driver in the terminal, because the customized peripheral communication protocol is based on the communication driver
  • the data transmission specifications followed by the communication driver are unified and universal among various terminals.
  • using this customized peripheral communication protocol can realize direct communication between game applications and peripheral devices, so that the data transmitted between game applications and peripheral devices is no longer affected by operations in the terminal. System limitations (that is, data does not need to be forwarded by the management module of the operating system), thus enabling richer data to be sent between game applications and peripheral devices, and improving the efficiency and convenience of data transmission.
  • embodiments of the present application can realize the transmission of interactive data about the new hardware structure between the peripheral device and the game application through a peripheral communication protocol.
  • Electronic equipment includes terminals running game applications.
  • the interactive data that the game application needs to transmit may include but is not limited to: information query requests, peripheral control instructions, and mode switching instructions.
  • the data transmission processes of the three exemplary interactive data given above are described in detail below.
  • the interactive data includes an information query request, which is used to query the device information of the peripheral device; wherein the game application sends an information query request to the peripheral device for querying the device information of the peripheral device, and receives the information query request from the peripheral device.
  • the specific implementation process of the feedback results of the device feedback can be seen in Figure 5a and Figure 5b, as shown in Figure 5a and Figure 5b:
  • the game application After the game application determines that the peripheral device is a hardware device that supports the peripheral communication protocol by scanning the interface statement of the peripheral device, the game application can generate an information query request and encapsulate the information query request according to the peripheral communication protocol. , obtain the encapsulated data; then, send the encapsulated data to the communication driver, so that after the peripheral device obtains the encapsulated data through the communication driver, it can decapsulate the encapsulated data according to the peripheral communication protocol and obtain the information query request. .
  • the way in which the peripheral device obtains the encapsulated data through the communication driver may include: the communication driver actively sends the encapsulated data to a customized output endpoint in the customized communication interface included in the peripheral device, and then, the peripheral device obtains the encapsulated data from the customized output endpoint. Get the encapsulated data.
  • the peripheral device uses the peripheral communication protocol to decapsulate (ie parse) the encapsulated data and obtain the information query request; then, the peripheral device pulls the device in response to the information query request information, and uses a peripheral communication protocol to encapsulate the device information to obtain encapsulated data.
  • the encapsulated data includes the feedback results obtained by the encapsulation process.
  • the specific implementation process of the peripheral device encapsulating the device information according to the peripheral communication protocol.
  • the implementation process of the encapsulation process described above is similar and can be briefly summarized as: according to the data type of the device information, from the peripheral communication protocol Obtain the information structure corresponding to the data type as the information query structure, and then fill in or write the device information into the information query structure to generate feedback results to realize the encapsulation of the device information.
  • the exemplary device information shown in Table 1 can be filled in the information query structure to generate encapsulated data.
  • the information filled in the information query structure may include detailed information of the peripheral device (such as manufacturer, device model, and device name) and characteristic information.
  • the characteristic information of the peripheral device can be used to indicate at least one device capability of the peripheral device, and the characteristic information of the peripheral device can be filled in the information query structure bit by bit; for example, if the peripheral device supports the target characteristic, the target can be The binary bit occupied by the characteristic is filled with 1 to indicate that the peripheral device supports the device capability corresponding to the target characteristic.
  • the characteristic information may include device capabilities related to new hardware structures in the peripheral device. Newly added hardware structures include vibration devices, rotor motors, or three-axis gyroscopes. Feature information that exemplary peripheral devices may support can be found in Table 2.
  • hexadecimal can be used to represent the characteristic information of the peripheral device; of course, the embodiment of the present application does not limit which hexadecimal system is used to express the characteristics of the peripheral device, which is explained here.
  • the game application can infer whether the peripheral device supports a certain feature based on the bits after obtaining the feature information; for example, assuming the dual joystick capability of the peripheral device is represented by the first digit of binary, then if the device information received by the game application includes hexadecimal 0x1, and the 0x1 is converted into binary 0001, then it is determined that the first digit of the binary is the number 1, which means Peripheral devices support dual joystick device capabilities.
  • the peripheral device can transmit the feedback result back to the customized input endpoint in the customized communication interface, so that the game application can obtain the feedback result from the customized input endpoint through the communication driver; and interpret the feedback result according to the peripheral communication protocol.
  • the specific implementation process of the game application obtaining the feedback result from the customized input endpoint through the driver may include: the communication driver may scan the customized input endpoint regularly, and when the feedback result sent by the peripheral device is scanned from the customized input endpoint, the communication driver may Realize the acquisition of the feedback result; then, the game application can also periodically scan the communication driver, so that after there is a feedback result sent by the peripheral device in the communication driver, the game application can obtain the peripheral device from the communication driver Send feedback results.
  • embodiments of the present application also support the customized input endpoint to proactively send the received feedback results to the communication driver.
  • the embodiment of the present application also supports the customized input endpoint to send a feedback instruction to the communication driver after obtaining the feedback result, so that the communication driver scans the feedback result from the customized input endpoint after receiving the feedback instruction.
  • the game application can also obtain the feedback results in the manner described above. For example, the communication driver actively sends the feedback results to the game application, or the communication driver sends the feedback results to the game application. Feedback instructions to instruct the game application to actively obtain feedback results.
  • the embodiments of this application do not limit the specific implementation of data transmission between the customized interface and the communication driver, and between the communication driver and the game application.
  • the game application can check the validity of the instruction according to the device information. Among them, if the instruction is valid, it can be understood that the instruction can be recognized or parsed by the game application, and the corresponding processing will be carried out according to the recognition result; if the instruction is invalid, it can be understood that the instruction cannot be recognized by the game application. After receiving the invalid instruction, the game application , without giving feedback or notifying the peripheral device that the command cannot be recognized.
  • the implementation process of the game application checking the validity of the instruction based on the device information of the peripheral device may include: if the game application receives the input instruction sent by the peripheral device, determining the use required by the peripheral device to generate the input instruction. The first device capability.
  • the input instruction is used to represent an instruction generated by a peripheral device. If the input instruction is an instruction to move a double joystick to the left, then it is determined that the first device capability required by the peripheral device to generate the instruction includes the dual joystick capability. Then, the first device capability is used to perform capability hit matching on at least one device capability indicated by the characteristic information to obtain a capability hit matching result.
  • capability hit matching refers to querying in at least one device capability indicated by the characteristic information. Whether first device capabilities exist.
  • the validity of the input instruction is tested according to the capability hit result; wherein, if the first device capability hits (exists in) at least one device capability, that is, the first device capability belongs to one of the device capabilities in the characteristic information, then the The input command was determined to be a valid command.
  • the interactive data includes peripheral control instructions, which are used to control peripheral devices to perform game feedback operations.
  • the game feedback operation is used to represent an operation that the game application instructs the peripheral device to perform to provide feedback to the user, such as a vibration operation.
  • the exemplary implementation process of the game application sending peripheral control instructions to the peripheral device so that the peripheral device performs game feedback operations can be seen in Figure 6a:
  • the game application if it detects that it needs to control the peripheral device to perform a game feedback operation, it can obtain the characteristic information supported by the peripheral device; wherein, the method for the game application to obtain the characteristic information supported by the peripheral device may include: obtaining from the storage space Historically cached feature information supported by the peripheral device, or, according to the aforementioned implementation shown in Figure 5a, obtain feature information supported by the peripheral device from the peripheral device side.
  • the game application searches for the target device capability in at least one device capability indicated by the characteristic information of the peripheral device.
  • the target device capability refers to the device capability used to instruct the peripheral device to perform a game feedback operation.
  • the game application determines that it needs to control the peripherals After the device performs the game feedback operation, the target device capabilities required by the peripheral device to perform the game feedback operation can be determined; then, capability hit matching is performed among at least one device capability indicated by the characteristic information. If the capability matches the target device capability, it is determined that the peripheral device has the device capability to perform game feedback operations.
  • the game application after the game application finds the target device capability from at least one device capability indicated by the characteristic information of the peripheral device, it can generate a peripheral control instruction for controlling the peripheral device to perform a game feedback operation based on the target device capability.
  • the peripheral control command generated at this time is a valid output command, that is, the command can be recognized and responded to by the peripheral device.
  • the peripheral control instructions that the peripheral device can generate can be called vibration instructions.
  • the vibration instructions can include instructions for controlling the peripheral device to perform vibration operations. Vibration data, as shown in Table 3:
  • the game application can fill the vibration data into the vibration information structure according to the peripheral communication protocol, so as to realize the encapsulation processing of the vibration instructions, and send the encapsulated data to the peripheral device, so that the peripheral device obtains the information based on the encapsulated data.
  • Vibration instructions can perform vibration operations based on the vibration data contained in the vibration instructions.
  • the game application encapsulates the peripheral control instructions 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 customization of the peripheral device Output endpoint, so that the peripheral device can receive the peripheral control instructions sent by the game application and perform corresponding game feedback operations in response to the peripheral control instructions.
  • the peripheral control instructions generated by the game application are used to control the peripheral device to perform vibration operations.
  • the peripheral equipment includes one or more vibration devices.
  • the vibration device may include a vibration motor (or simply referred to as a motor). Each motor is configured with corresponding parameters.
  • the parameters may include but are not limited to: vibration direction, Vibration frequency, or vibration pattern, used to control the vibration of a motor.
  • the game application when the game application is running the game, if the game application detects that there is a vibration object in the game screen, that is, there is a game character that needs to vibrate, then it can be used to control the default vibration in the peripheral device.
  • the device performs a vibration operation, which is determined as the first vibration operation; wherein the default vibration device may include any one of one or more vibration devices provided by the peripheral device.
  • the peripheral control command can be called a vibration command, and the vibration command is sent to the peripheral device, so that the peripheral device responds to the vibration command and controls the default vibration device to vibrate to simulate the real environment.
  • the vibration effect produced by the vibration of the vibrating object 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 operating subject can feel the vibration.
  • the target vibration device when the game application is running the game, can be selected from the peripheral device based on the position of the vibration object and the position information of each vibration device in the peripheral device, and will be used to control the target
  • the operation of mechanical energy vibration of the vibration device is determined as the first vibration operation. That is to say, according to the specific position (such as coordinates) of the vibration object in the game screen, a vibration device that is close to the position of the vibration device in the game screen can be determined from the peripheral device as the target vibration device, and the peripheral device can The target vibration device is controlled to perform a vibration operation to achieve a vibration effect that simulates the vibration of a vibrating object in a real environment, creating a more realistic gaming experience.
  • the vibration device 602 on the right handle is the target vibration device; and generates peripheral control instructions according to the parameters of the target vibration device, and sends the vibration instructions to the peripheral equipment, so that the peripheral equipment responds to the vibration instructions to control the target vibration.
  • the device vibrates. At this time, the right hand of the operating subject can feel a more obvious vibration effect than the left hand, so as to provide the operating subject with a more realistic gaming experience.
  • the above is only an exemplary data transmission process when the peripheral control instruction is a vibration instruction; during the process of the game application running the game, the game application can also use the specific game scene and the characteristic information of the peripheral device to Generate other peripheral control instructions; if the characteristic information of the peripheral device includes audio feedback capability, then when the game application detects that there is an operation to control the peripheral device to perform sound effect output in the game scene, it generates an audio feedback instruction so that the peripheral device Sound effects are output in response to the audio feedback command to create a more realistic gaming experience for the operating object.
  • the interactive data includes a mode switching command, which is used to command the peripheral device to switch the communication mode to a customized communication mode, so that the peripheral device uses the peripheral communication protocol for data transmission while the game application is running the game. .
  • the operation of the game application may be restricted by the operating system. Therefore, when the game application has the need to send a mode switching command to a peripheral device, it needs to be detected first. Whether the operating system supports transmitting the mode switching command through the peripheral communication protocol and the communication driver to obtain the corresponding detection result; and then, based on the detection result, determine whether the game application directly transmits the mode switching command to the communication driver through the communication driver. Peripheral devices.
  • 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, the peripheral After receiving the mode switching command, the 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 communicate using the peripheral device
  • the protocol transmits any data.
  • a peripheral device can directly transmit data such as the target operation and/or power information of the operating object to the game application according to the peripheral communication protocol and communication driver.
  • the mode switching command can be forwarded to the peripheral device via the operating system.
  • the game application can generate a vibration sequence, and the vibration sequence can include a default string (such as the string "123") for triggering
  • the peripheral device executes the mode switching command; then, the game application sends the generated vibration sequence and interaction data (such as the mode switching command) to the management module of the operating system, so that the management module forwards the vibration sequence and interaction data through the communication driver To the peripheral device; in this way, when the peripheral device receives the vibration sequence, it can determine that mode switching is required, and further switch the communication mode to the customized communication mode according to the mode switching command.
  • the game application sends the mode switching command to the management module of the operating system, so that the management module forwards the mode switching command to the peripheral device through the communication driver; in this way, the peripheral device changes the communication mode according to the mode switching command. Switch to customized communication mode.
  • Electronic equipment includes peripheral equipment.
  • the interactive data that the peripheral device needs to transmit may include but is not limited to: input signals and power warning signals.
  • the data transmission process of the two exemplary interactive data given above will be described in detail below.
  • Interaction data includes input signals.
  • the peripheral device when the peripheral device is in the customized communication mode, if the peripheral device detects the target operation input by the operating object of the game while the game application is running the game, the peripheral device can generate an input signal according to the target operation.
  • the input signal can be used as interactive data; and the input signal is filled into the input information structure according to the peripheral communication protocol to realize the encapsulation processing of the input signal; then, the encapsulated encapsulated data is transmitted to the game through the communication driver
  • the application enables the game application to decapsulate the encapsulated data to obtain interactive data after obtaining the encapsulated data, and update the game screen of the game based on the interactive data.
  • the peripheral device when the operating object uses the peripheral device to operate the game, if the peripheral device detects the upward sliding operation input by the operating object on the game object 801, it means that the peripheral device wants the game object 801 to follow the upward sliding operation. Perform a jumping action, the peripheral device can generate an input signal based on the upward sliding operation, and transmit the input signal as interactive data directly to the game application through the communication driver; then, after the game application obtains the interactive data, it can The data determines the game screen when the game object performs the jumping action, and uses the game screen when the game object performs the jumping action to update and display the game screen before the jumping action is performed.
  • Interactive data includes power warning signals.
  • the peripheral device when the operating object uses the peripheral device to control the game, that is, during the operation of the peripheral device, the peripheral device can obtain its own device power, such as customizing the device power; if the peripheral device detects the device power is less than the power threshold, it means that the power of the peripheral device is low at this time, and the peripheral device can generate a power warning signal. At this time, the power warning signal is used as interactive data; then, the peripheral communication protocol is used to encapsulate the power warning signal.
  • the device information of the peripheral device is added to the power information structure to obtain the encapsulated data after encapsulation; then, the encapsulated data is returned to the customized input interface, so that the game application can use the communication driver to obtain the encapsulated data from the customized input interface.
  • the package data is scanned, and the power warning signal is obtained after parsing and processing the package data.
  • the game application obtains the interactive data (i.e., the power warning signal), it can generate the power warning information based on the interactive data, and display the power warning information in the application interface of the game application.
  • the power warning information is used to prompt external users.
  • Power warning information 901 is displayed on the game screen.
  • the embodiments of this application can customize a peripheral communication protocol between the game application and the peripheral device according to the data transmission specification followed by the communication driver deployed in the terminal, because the customized peripheral communication protocol is It is written based on the data transmission specifications followed by the communication driver, and the data transmission specifications followed by the communication driver are unified and universal among various terminals. This enables the customized peripheral communication protocol to support cross-terminal use and improve peripherals. Applicability of communication protocols.
  • peripheral communication protocol can realize direct communication between game applications and peripheral devices, so that the data transmitted between game applications and peripheral devices is no longer restricted by the operating system in the terminal, so that game applications Richer data can be sent to and from peripheral devices to achieve richer game control capabilities in peripheral devices, which can increase the fun of the game and thereby enhance user stickiness.
  • inventions of the present application also disclose a data transmission device.
  • the data transmission device may be a computer program (including program code) running in an electronic device.
  • the data transmission device can perform the method shown in Figure 4. Referring to Figure 10, the data transmission device can run the following units:
  • the acquisition unit 1001 is used to obtain the peripheral communication protocol when interactive data needs to be transmitted between the game application in the terminal and the peripheral device; the terminal sends and receives data through the internal communication driver, and the peripheral communication protocol is in accordance with the communication driver Data transmission specifications, customized for communication between the game application and the peripheral device;
  • the processing unit 1002 is used to transmit interactive data between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  • the processing unit 1002 when used to transmit interactive data between a game application and a peripheral device using a peripheral communication protocol and through a communication driver, it may be specifically used to:
  • the data receiver refers to the peripheral device; if the encapsulated data is sent by the peripheral device to the communication driver, the data receiver refers to the game application.
  • the peripheral communication protocol stipulates the information structure corresponding to one or more data types; when the processing unit 1002 uses the peripheral communication protocol to encapsulate the interactive data and obtains the encapsulated data, it can specifically Used for:
  • the device is installed in a game application, and the communication driver includes interface declarations for one or more communication interfaces of peripheral devices; the processing unit 1002 can also be used to:
  • the communication protocol identified by the specified protocol identifier is determined as the peripheral communication protocol.
  • the interaction data includes an information query request for querying device information of a peripheral device, and the device information at least includes feature information supported by the peripheral device; the processing unit 1002 may also be used to:
  • 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 using the peripheral communication protocol to encapsulate the device information. of;
  • the feedback result is decapsulated according to the peripheral communication protocol to obtain the device information of the peripheral device.
  • the characteristic information is used to indicate at least one device capability of the peripheral device; the processing unit 1002 may also be used to:
  • the first device capability is used to perform capability hit matching on at least one device capability indicated by the characteristic information to obtain a capability hit matching result.
  • the capability hit matching refers to querying in at least one device capability indicated by the characteristic information. Whether the first device capability exists;
  • the validity of the input instruction is tested according to the capability hit matching result; wherein, if the first device capability belongs to the at least one device If the input command is one of the equipment capabilities, the input command is determined to be a valid command.
  • the interaction data includes peripheral control instructions, and the processing unit 1002 can also be used to:
  • the characteristic information supported by the peripheral device is obtained, and the characteristic information is used to indicate at least one device capability of the peripheral device;
  • the target device capability refers to: the device capability used to support peripheral devices to perform game feedback operations;
  • a peripheral control instruction for controlling the peripheral device to perform a game feedback operation is generated.
  • the peripheral device includes one or more vibration devices, and the game feedback operation includes a first vibration operation; the processing unit 1002 may also be used to:
  • the operation used to control the default vibration device in the peripheral device to vibrate is determined as the first vibration operation
  • the controller According to the position of the vibration object in the game screen and the position information of each vibration device in the peripheral device, select the target vibration device from the peripheral device, and determine the operation used to control the target vibration device to vibrate. First vibration operation.
  • the game application runs on the operating system of the terminal, and 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;
  • the interactive data includes a mode switching command, which is used to command the peripheral device to switch the communication mode to a customized communication mode, so that the peripheral device uses the peripheral communication protocol for data transmission during the game application running the game;
  • the processing unit 1002 may also be used to:
  • a vibration sequence is generated, which is used to trigger the peripheral device to perform mode switching; the vibration sequence and interaction data are sent to the management module of the operating system, so that the management module transmits the vibration sequence and interaction data through the communication driver forwarded to peripheral devices.
  • the device is mounted on a peripheral device, and the processing unit 1002 can also be used to:
  • the game application After the game application obtains the interaction data, it updates the game screen of the game according to the interaction data.
  • the device is mounted on a peripheral device, and the processing unit 1002 can also be used to:
  • a power warning signal is generated as interactive data
  • the game application After the game application obtains the interaction data, it generates power warning information based on the interaction data, and displays the power warning information in the application interface of the game application.
  • the peripheral device includes a customized communication interface customized 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 customized input endpoint; and the peripheral device obtains data from the communication driver through the customized output endpoint.
  • the interactive data is transmitted while the peripheral device is in a customized communication mode
  • the peripheral device maintains working in the customized communication mode after obtaining the heartbeat command sent by the game application through the customized output endpoint.
  • each unit in the data transmission device shown in Figure 10 can be separately or entirely combined into one or several other units to form, or some of the units (some) can be further disassembled. It is divided into multiple units with smaller functions, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application.
  • the above units are divided based on logical functions.
  • the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit.
  • the data processing device may also include other units. In practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by multiple units in cooperation.
  • the system can be configured by including a central processing unit (CPU), a random access storage medium (RAM),
  • a computer program (including program code) capable of executing the steps involved in the corresponding method as shown in Figure 4 is run on a general-purpose computing device such as a computer with processing elements and storage elements such as a read-only storage medium (ROM) to construct such as
  • the data transmission device shown in Figure 10 is used to implement the data transmission method according to the embodiment of the present application.
  • the computer program may be recorded on, for example, a computer-readable recording medium, loaded into the above-mentioned computing device through the computer-readable recording medium, and run therein.
  • a peripheral communication protocol can be customized between the game application and the peripheral device according to the data transmission specification followed by the communication driver in the terminal, because the customized peripheral communication protocol is based on the communication driver
  • the data transmission specifications followed by the communication driver are unified and universal among various terminals.
  • using this customized peripheral communication protocol can realize direct communication between game applications and peripheral devices, so that the data transmitted between game applications and peripheral devices is no longer restricted by the operating system in the terminal, so that game applications Richer data can be sent to and from peripheral devices, providing rich game control capabilities, thereby increasing user stickiness.
  • Figure 11 shows a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application; please refer to Figure 11.
  • the electronic device at least includes a processor 1101, a communication interface 1102 and a computer-readable storage medium 1103.
  • the electronic device includes a processor 1101, a communication interface 1102, and a computer-readable storage medium 1103.
  • the processor 1101, the communication interface 1102 and the computer-readable storage medium 1103 can be connected through a bus or other means.
  • the communication interface 1102 is used to receive and send data.
  • the computer-readable storage medium 1103 may be stored in the memory of the electronic device.
  • the computer-readable storage medium 1103 is used to store a computer program.
  • the computer program includes 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 core and control core of the electronic device. It is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve Corresponding method flow or corresponding function.
  • Embodiments of the present application also provide a computer-readable storage medium (Memory).
  • the computer-readable storage medium is a memory device in an electronic device and is used to store programs and data. It can be understood that the computer-readable storage medium here may include a built-in storage medium in the electronic device, and of course may also include an extended storage medium supported by the electronic device.
  • the computer-readable storage medium provides storage space that stores the processing system of the electronic device. Furthermore, one or more instructions suitable for being loaded and executed by the processor 1101 are also stored in the storage space. These instructions may be one or more computer programs (including program codes).
  • the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory; optionally, it can also be at least one located remotely The computer-readable storage medium of the aforementioned processor.
  • one or more instructions are stored in the computer-readable storage medium; the processor 1101 loads and executes one or more instructions stored in the computer-readable storage medium to implement the above data transmission method embodiment.
  • the corresponding steps in; one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and execute the following steps:
  • the peripheral communication protocol When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver.
  • the peripheral communication protocol is in accordance with the data transmission specification of the communication driver.
  • Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  • one or more instructions in a computer-readable storage medium are loaded by the processor 1101 and executed using a peripheral communication protocol and through a communication driver to transmit interactive data between the game application and the peripheral device. , specifically perform the following steps:
  • the data receiver refers to the peripheral device; if the encapsulated data is sent by the peripheral device to the communication driver, the data receiver refers to the game application.
  • the peripheral communication protocol specifies the information structure corresponding to one or more data types; one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and executed using the external device. Assume that the communication protocol encapsulates the interactive data. When the encapsulated data is obtained, the following steps are performed:
  • the device is installed in 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 the computer-readable storage medium are generated by the processor 1101 Load and also perform the following steps:
  • the communication protocol identified by the specified protocol identifier is determined as the peripheral communication protocol.
  • the interaction data includes an information query request for querying device information of the peripheral device, and the device information at least includes characteristic information supported by the peripheral device;
  • one or more instructions in the computer-readable storage medium are composed of Processor 1101 loads and also performs the following steps:
  • 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 using the peripheral communication protocol to encapsulate the device information. of;
  • the feedback result is decapsulated according to the peripheral communication protocol to obtain the device information of the peripheral device.
  • the characteristic information is used to indicate at least one device capability of the peripheral device; one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
  • the validity of the input instruction is tested according to the capability hit matching result; if the first device capability hits at least one device capability, the input instruction is determined to be a valid instruction.
  • the interactive data includes peripheral control instructions, and one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
  • the characteristic information supported by the peripheral device is obtained, and the characteristic information is used to indicate at least one device capability of the peripheral device;
  • the target device capability refers to: the device capability used to support peripheral devices to perform game feedback operations;
  • a peripheral control instruction for controlling the peripheral device to perform a game feedback operation is generated.
  • one or more vibration devices are included in the peripheral device, and the game feedback operation includes a first vibration operation; one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and the following steps are also performed: :
  • the operation used to control the default vibration device in the peripheral device to vibrate is determined as the first vibration operation
  • the controller According to the position of the vibration object in the game screen and the position information of each vibration device in the peripheral device, select the target vibration device from the peripheral device, and determine the operation used to control the target vibration device to vibrate. First vibration operation.
  • the game application runs on the operating system of the terminal, and 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;
  • the interactive data includes a mode switching command, which is used to command the peripheral device to switch the communication mode to a customized communication mode, so that the peripheral device uses the peripheral communication protocol for data transmission during the game application running the game;
  • One or more instructions in the computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
  • a vibration sequence is generated, which is used to trigger the peripheral device to execute a mode switching command; the vibration sequence and interaction data are sent to the management module of the operating system, so that the management module transmits the vibration sequence and interaction through the communication driver. The data is forwarded to the peripheral device.
  • the device is mounted on a peripheral device, and one or more instructions in a computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
  • the game application After the game application obtains the interaction data, it updates the game screen of the game according to the interaction data.
  • the device is mounted on a peripheral device, and one or more instructions in a computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
  • a power warning signal is generated as interactive data
  • the game application After the game application obtains the interaction data, it generates power warning information based on the interaction data, and displays the power warning information in the application interface of the game application.
  • the peripheral device includes a customized communication interface customized 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 customized input endpoint; and the peripheral device obtains data from the communication driver through the customized output endpoint.
  • the interactive data is transmitted while the peripheral device is in a customized communication mode
  • the peripheral device maintains working in the customized communication mode after obtaining the heartbeat command sent by the game application through the customized output endpoint.
  • Embodiments of the present application also provide a computer program product or computer program.
  • the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the above data transmission method.
  • a computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • Computer instructions may be stored in or transmitted over a computer-readable storage medium.
  • Computer instructions may be transmitted from one website, computer, server, or data center to another website by wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. , computer, server or data center for transmission.
  • Computer-readable storage media can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or other integrated media that contains one or more available media. Available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), etc.

Abstract

Provided are a data transmission method and apparatus, and an electronic device, a storage medium and a program product. The method comprises: when interaction data needs to be transmitted between a game application in a terminal and a peripheral device, acquiring a peripheral communication protocol; and transmitting the interaction data between the game application and the peripheral device by using the peripheral communication protocol and by means of a communication driving program. A direct communication between a peripheral device and a game application can be realized, such that data transmitted between the game application and the peripheral device is not limited by an operating system in a terminal anymore, that is, the data does not need to be forwarded by a management module of the operating system, such that richer data can be sent between the game application and the peripheral device, and the efficiency and convenience of data transmission are improved.

Description

数据传输方法、装置、电子设备、存储介质及程序产品Data transmission methods, devices, electronic equipment, storage media and program products
本申请要求于2022年4月29日提交中国专利局、申请号为202210466211.9、申请名称为“一种数据传输方法、装置、设备及介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application submitted to the China Patent Office on April 29, 2022, with the application number 202210466211.9 and the application title "A data transmission method, device, equipment and medium". The entire content of the application is approved This reference is incorporated into this application.
技术领域Technical field
本申请涉及计算机技术领域,具体涉及数据传输领域,尤其涉及一种数据传输方法、一种数据传输装置、一种电子设备、一种计算机可读存储介质及一种程序产品。The present 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, a computer-readable storage medium and a program product.
背景技术Background technique
由操作对象(或称为游戏玩家、玩家对象等)直接操作的外设设备,是一种外设于终端,且用来发送数据(如游戏数据),以实现操控终端中运行的游戏应用的硬件设备。目前,外设设备与游戏应用之间的数据传输,是经由终端的操作系统(如安卓等操作系统)转发的。A peripheral device directly operated by an operating object (also called a game player, player object, etc.) is a peripheral device installed on a terminal and used to send data (such as game data) to control game applications running in the terminal. hardware equipment. Currently, data transmission between peripheral devices and game applications is forwarded through the terminal's operating system (such as Android and other operating systems).
经实践发现,相关的经由操作系统转发数据的方式,具有局限性。例如,如果在外设设备中新增硬件结构,且该硬件结构相关的数据不能被操作系统所识别或支持,那么操作系统就不能将该数据正确转发至游戏应用,导致外设设备中新增的硬件结构的功能不能被发挥出来。由此可见,依赖于操作系统在外设设备和游戏应用之间转发数据,会出现数据传输失败的情况,也会限制游戏的玩法,导外设设备和游戏应用的发展受限,降低操作对象的游戏体验。It has been found in practice that the related method of forwarding data through the operating system has limitations. For example, if a new hardware structure is added to the peripheral device, and the data related to the hardware structure cannot be recognized or supported by the operating system, the operating system cannot correctly forward the data to the game application, resulting in the new hardware structure in the peripheral device. The functionality of the hardware structure cannot be utilized. It can be seen that relying on the operating system to forward data between peripheral devices and game applications will cause data transmission failures, which will also limit the gameplay of the game, limit the development of peripheral devices and game applications, and reduce the user experience of the operating objects. gaming experience.
发明内容Contents of the invention
本申请实施例提供一种数据传输方法、装置、电子设备、存储介质及程序产品,能够实现外设设备和游戏应用之间的直接通信,使得游戏应用和外设设备之间传输的数据不再受到终端中的操作系统的限制(即数据不需要由操作系统的管理模块进行转发),从而可以在游戏应用和外设设备之间发送更为丰富的数据,并提高了数据传输的效率和方便性。Embodiments of the present application provide a data transmission method, device, electronic device, storage medium and program product, which can realize direct communication between peripheral devices and game applications, so that the data transmitted between game applications and peripheral devices is no longer required. Limited by the operating system in the terminal (that is, the data does not need to be forwarded by the management module of the operating system), which allows richer data to be sent between game applications and peripheral devices, and improves the efficiency and convenience of data transmission. sex.
一方面,本申请实施例提供一种数据传输方法,该方法包括:On the one hand, embodiments of the present application provide a data transmission method, which includes:
当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;终端通过内部的通信驱动程序收发数据,外设通信协议是按照通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的;When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver. The peripheral communication protocol is in accordance with the data transmission specification of the communication driver and is for all The communication between the game application and the peripheral device is customized;
使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据。Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
另一方面,本申请实施例提供一种数据传输装置,该装置包括:On the other hand, embodiments of the present application provide a data transmission device, which includes:
获取单元,用于当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;终端通过内部的通信驱动程序收发数据,外设通信协议是按照通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的;The acquisition unit is used to obtain the peripheral communication protocol when interactive data needs to be transmitted between the game application in the terminal and the peripheral device; the terminal sends and receives data through the internal communication driver, and the peripheral communication protocol is based on the data of the communication driver. Transmission specification, customized for communication between the game application and the peripheral device;
处理单元,用于使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据。A processing unit used to transmit interactive data between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
再一方面,本申请实施例提供一种电子设备,该电子设备包括:On the other hand, an embodiment of the present application provides an electronic device, which includes:
处理器,适于执行计算机程序;A processor adapted to execute a computer program;
计算机可读存储介质,计算机可读存储介质中存储有计算机程序,计算机程序被处理器加载并执行如下步骤:A computer-readable storage medium stores a computer program. The computer program is loaded by the processor and executes the following steps:
当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;终端通过内部的通信驱动程序收发数据,外设通信协议是按照通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的;When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver. The peripheral communication protocol is in accordance with the data transmission specification of the communication driver and is for all The communication between the game application and the peripheral device is customized;
使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据。Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
再一方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序适于由处理器加载并执行如下步骤:On the other hand, embodiments of the present application provide a computer-readable storage medium that stores a computer program. The computer program is suitable for being loaded by a processor and executing the following steps:
当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;终端通过内部的通 信驱动程序收发数据,外设通信协议是按照通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的;When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal uses the internal communication The communication driver sends and receives data, and the peripheral communication protocol is customized for the communication between the game application and the peripheral device according to the data transmission specification of the communication driver;
使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据。Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
再一方面,本申请实施例提供一种计算机程序产品,该计算机程序产品包括计算机指令,计算机指令被处理器加载并执行如下步骤:On the other hand, embodiments of the present application provide a computer program product. The computer program product includes computer instructions. The computer instructions are loaded by a processor and execute the following steps:
当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;终端通过内部的通信驱动程序收发数据,外设通信协议是按照通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的;When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver. The peripheral communication protocol is in accordance with the data transmission specification of the communication driver and is for all The communication between the game application and the peripheral device is customized;
使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据。Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1a示出了本申请一个示例性实施例提供的一种数据传输系统的结构示意图;Figure 1a shows a schematic structural diagram of a data transmission system provided by an exemplary embodiment of the present application;
图1b示出了本申请一个示例性实施例提供的一种云游戏的数据流向示意图;Figure 1b shows a schematic data flow diagram of a cloud game provided by an exemplary embodiment of the present application;
图1c示出了本申请一个示例性实施例提供的一种数据传输系统的结构示意图;Figure 1c shows a schematic structural diagram of a data transmission system provided by an exemplary embodiment of the present application;
图1d示出了本申请一个示例性实施例提供的一种外设设备和终端建立连接的示意图;Figure 1d shows a schematic diagram of establishing a connection between a peripheral device and a terminal provided by an exemplary embodiment of the present application;
图1e示出了本申请一个示例性实施例提供的一种现有的数据传输的示意图;Figure 1e shows a schematic diagram of an existing data transmission provided by an exemplary embodiment of the present application;
图1f示出了本申请一个示例性实施例提供的一种游戏为云游戏时的数据传输的示意图;Figure 1f shows a schematic diagram of data transmission when a game provided by an exemplary embodiment of the present application is a cloud game;
图1g示出了本申请一个示例性实施例提供的一种游戏为本地游戏时的数据传输的示意图;Figure 1g shows a schematic diagram of data transmission when a game provided by an exemplary embodiment of the present application is a local game;
图2a示出了本申请一个示例性实施例提供的一种数据传输方案的流程示意图;Figure 2a shows a schematic flow chart of a data transmission solution provided by an exemplary embodiment of the present application;
图2b示出了本申请一个示例性实施例提供的一种支持外设通信协议的外设设备的软件结构示意图;Figure 2b shows a schematic software structure diagram of a peripheral device supporting a peripheral communication protocol provided by an exemplary embodiment of the present application;
图3示出了本申请一个示例性实施例提供的一种外设设备和游戏应用之间的下行传输和上行传输的示意图;Figure 3 shows a schematic diagram of downlink transmission and uplink transmission between a peripheral device and a game application provided by an exemplary embodiment of the present application;
图4示出了本申请一个示例性实施例提供的一种数据传输方法的流程示意图;Figure 4 shows a schematic flowchart of a data transmission method provided by an exemplary embodiment of the present application;
图5a示出了本申请一个示例性实施例提供的一种游戏应用查询外设设备的设备信息的示意图;Figure 5a shows a schematic diagram of a game application querying device information of a peripheral device according to an exemplary embodiment of the present application;
图5b示出了本申请一个示例性实施例提供的一种游戏应用查询外设设备的设备信息的示意图;Figure 5b shows a schematic diagram of a game application querying device information of a peripheral device according to an exemplary embodiment of the present application;
图6a示出了本申请一个示例性实施例提供的一种游戏应用控制外设设备执行游戏反馈的示意图;Figure 6a shows a schematic diagram of a game application controlling a peripheral device to perform game feedback provided by an exemplary embodiment of the present application;
图6b示出了本申请一个示例性实施例提供的一种外设设备执行振动操作的示意图;Figure 6b shows a schematic diagram of a peripheral device performing a vibration operation provided by an exemplary embodiment of the present application;
图6c示出了本申请一个示例性实施例提供的一种外设设备执行振动操作的示意图;Figure 6c shows a schematic diagram of a peripheral device performing a vibration operation provided by an exemplary embodiment of the present application;
图7a示出了本申请一个示例性实施例提供的一种游戏应用和外设设备之间直接传输模式切换命令的示意图;Figure 7a shows a schematic diagram of a mode switching command directly transmitted between a game application and a peripheral device provided by an exemplary embodiment of the present application;
图7b示出了本申请一个示例性实施例提供的一种经由操作系统转发模式切换命令的示意图;Figure 7b shows a schematic diagram of forwarding a mode switching command via an operating system provided by an exemplary embodiment of the present application;
图8示出了本申请一个示例性实施例提供的一种外设设备将操作对象输入的输入信号发送至游戏应用的示意图;Figure 8 shows a schematic diagram of a peripheral device sending an input signal input by an operating object to a game application provided by an exemplary embodiment of the present application;
图9示出了本申请一个示例性实施例提供的一种外设设备主动发起电量预警信号的示意图;Figure 9 shows a schematic diagram of a peripheral device actively initiating a power warning signal provided by an exemplary embodiment of the present application;
图10示出了本申请一个示例性实施例提供的一种数据传输装置的结构示意图;Figure 10 shows a schematic structural diagram of a data transmission device provided by an exemplary embodiment of the present application;
图11示出了本申请一个示例性实施例提供的一种电子设备的结构示意图。Figure 11 shows a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present invention.
在本申请实施例中,涉及一种数据传输系统,该数据传输系统至少包括外设设备与终端;该数据传输系统可参见图1a。本申请实施例对外设设备和终端的数量不作限定;例如,在多人共同参与游戏的游戏场景中,一个终端可以与两个或两个以上的外设设备进行连接,以实现通过多个外设设备操控 终端中运行的游戏应用;再如,一个外设设备也可以与两个或两个以上的终端进行连接,以实现采用多终端对游戏画面的分屏显示。下面对该数据传输系统所涉及的各种电子设备进行说明,其中:In the embodiment of the present application, it relates to a data transmission system, which at least includes peripheral equipment and a terminal; the data transmission system can be seen in Figure 1a. The embodiments of the present application do not limit the number of peripheral devices and terminals; for example, in a game scenario in which multiple people participate in the game, one terminal can be connected to two or more peripheral devices to achieve the goal of using multiple peripheral devices. Device control Game applications running in terminals; for another example, a peripheral device can also be connected to two or more terminals to achieve split-screen display of game images using multiple terminals. The various electronic devices involved in the data transmission system are described below, among which:
(1)终端可以是指:运行有游戏应用的任一终端;游戏应用可包括:提供游戏的客户端(或web应用或小程序等)。终端具有一定的数据处理能力和画面显示能力。可选的,终端可以包括两个或两个以上的设备,例如,终端可以包括具有数据处理功能的数据处理设备和具有画面显示功能的显示设备;此实现方式下,需要数据处理设备和显示设备共同运行游戏应用,且数据处理设备和显示设备之间可以通过有线或无线连接,以使数据处理设备产生的数据(如游戏画面)能够传输至显示设备进行显示。例如,数据处理设备为具有数据处理能力的主机,显示设备为具有画面显示能力的显示器。可选的,终端还可以是一体机,此时终端同时具有数据处理能力和画面显示能力;此实现方式下,终端不仅支持对游戏应用相关的游戏数据进行数据处理,而且支持通过显示屏幕对游戏画面进行显示。如终端可包括但不限于:智能手机(如Android手机、iOS手机等)、平板电脑、便携式个人计算机、移动互联网设备(Mobile Internet Devices,简称MID)、智能电视、车载设备、头戴设备等。(1) The terminal may refer to: any terminal running a game application; the game application may include: a client (or web application or applet, etc.) that provides games. The terminal has certain data processing capabilities and screen display capabilities. Optionally, the terminal may include two or more devices. For example, the terminal may include a data processing device with a data processing function and a display device with a screen display function; in this implementation, a data processing device and a display device are required. Game applications are run together, and the data processing device and the display device can be connected through wired or wireless connections, so that data generated by the data processing device (such as game screens) 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 image display capabilities. Optionally, the terminal can also be an all-in-one machine, in which case the terminal has both data processing capabilities and screen display capabilities; in this implementation, the terminal not only supports data processing of game data related to game applications, but also supports game processing through the display screen. The screen is displayed. For example, terminals may include but are not limited to: smartphones (such as Android phones, iOS phones, etc.), tablet computers, portable personal computers, Mobile Internet Devices (MID), smart TVs, vehicle-mounted devices, head-mounted devices, etc.
其中,可按照不同条件,对终端中运行的游戏应用所提供的游戏进行分类。按照游戏的运行条件不同,游戏可以分为本地游戏和网络游戏;所谓本地游戏可是指:在终端本地运行且无需网络的游戏;所谓网络游戏可是指:依赖于网络来加载游戏的数据才能运行的游戏。或者,按照游戏的运行模式不同,游戏可分为:客户端游戏、网页游戏以及云游戏(Cloud gaming)等;客户端游戏可简称为端游,是指在个人计算机(Personal Computer,PC)端运行的游戏。网页游戏可称为web游戏或页游,是在浏览器提供的游戏网页运行的游戏。云游戏又可称为游戏点播(gaming on demand),是指在云服务器(或称为云端服务器)中运行的游戏。具体地,在云游戏的运行模式下,游戏应用可将外设设备发送的数据(如输入指令或信号)发送至云服务器,由云游戏服务器根据数据负责渲染游戏画面,并将渲染完毕的游戏画面压缩后,通过网络传送给操作对象所使用的终端,此时终端仅做显示游戏画面的操作,如图1b所示。云游戏的这种运行模式,使得玩家游戏持有的终端无需拥有强大的图形运算与数据处理能力,仅需拥有基本的流媒体播放能力(如显示游戏画面的能力)、人机交互能力(获取操作对象的输入操作的能力),以及数据传输能力(如发送指令给云服务器的能力)即可。本申请实施例对终端中运行的游戏的具体类型不作限定,特在此说明。Among them, games provided by game applications running in the terminal can be classified according to different conditions. According to different operating conditions of the game, games can be divided into local games and online games; the so-called local games refer to games that run locally on the terminal and do not require a network; the so-called online games refer to games that rely on the network to load game data in order to run. game. Or, according to the different running modes of the game, games can be divided into: client games, web games and cloud gaming (Cloud gaming), etc.; client games can be referred to as end games, which refer to games played on a personal computer (PC). running game. Web games can be called web games or web games. They are games that are run on the game web page provided by the browser. Cloud gaming, also known as gaming on demand, refers to games running in cloud servers (or cloud servers). Specifically, in the running mode of cloud games, game applications can send data (such as input instructions or signals) sent by peripheral devices to the cloud server, and the cloud game server is responsible for rendering the game screen based on the data and rendering the rendered game. After the screen is compressed, it is transmitted to the terminal used by the operation object through the network. At this time, the terminal only performs the operation of displaying the game screen, as shown in Figure 1b. This operating mode of cloud games means that the terminal held by the player does not need to have powerful graphics computing and data processing capabilities, but only needs to have basic streaming media playback capabilities (such as the ability to display game screens), human-computer interaction capabilities (obtaining The ability to input operations on the operating object), and data transmission capabilities (such as the ability to send instructions to the cloud server) are sufficient. The embodiments of the present application do not limit the specific types of games running in the terminal, which are specifically explained here.
在游戏为前述提及的网络游戏时,如云游戏、需多人协同操控的端游或网页游戏等,本申请实施例提供的数据处理系统还包括至少一个服务器,如图1c所示。此实现方式下,服务器可是指:终端中运行的游戏应用对应的后台服务器,用于与运行该游戏应用的终端进行交互,以为该游戏应用提供计算和应用服务支持。服务器可以包括但不限于:数据处理服务器、Web服务器、应用服务器等等具有复杂计算能力的设备;或者,服务器可以是独立的物理服务器,也可以是由多个物理服务器构成的服务器集群或者分布式系统。正如前述所描述的,游戏可以包括云游戏,那么在游戏为云游戏的情况下,上述提及的服务器还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。When the game is the aforementioned online game, such as a cloud game, a client game or a web game that requires collaborative control by multiple people, the data processing system provided by the embodiment of the present application further includes at least one server, as shown in Figure 1c. In this implementation, the server may refer to a background server corresponding to the game application running in the terminal, which is used to interact with the terminal running the game application to provide computing and application service support for the game application. Servers may include, but are not limited to: data processing servers, Web servers, application servers, and other devices with complex computing capabilities; alternatively, servers may be independent physical servers, or server clusters or distributed servers composed of multiple physical servers. system. As described above, games can include cloud games. If the game is a cloud game, the above-mentioned server can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud Cloud servers for basic cloud computing services such as communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
(2)外设设备可称为输入设备、外部设备、游戏操纵设备或游戏操控设备等,是指:外设于终端的且由操作对象直接操作,以实现操控终端中运行的游戏应用的硬件设备。外设设备可包括但不限于:手持游戏手柄(或简称为游戏手柄)、佩戴式游戏机、鼠标或键盘;为便于阐述,后续以外设设备为手持游戏手柄为例进行介绍。需说明的是,外设设备和终端虽是相互独立的硬件设备,但外设设备和终端之间可以建立通信连接,这样操作对象可通过操作外设设备,以实现对终端中运行的游戏应用所提供的游戏的操控。(2) Peripheral devices can be called input devices, external devices, game control devices or game control devices, etc., which refer to hardware that is external to the terminal and directly operated by the operating object to control the game application running in the terminal. equipment. Peripheral devices may include, but are not limited to: handheld gamepads (or gamepads for short), wearable game consoles, mice or keyboards; for ease of explanation, the following description will take a handheld gamepad as an example of a peripheral device. It should be noted that although the peripheral device and the terminal are independent hardware devices, a communication connection can be established between the peripheral device and the terminal, so that the operating object can control the game application running in the terminal by operating the peripheral device. Controls of the games provided.
在实际应用中,外设设备可配置有接收器,通过将该接收器与终端提供的物理接口(或称为硬件接口)进行连接,以实现通过该物理接口在外设设备和终端之间建立通信连接。一种示例性的通过接收器和物理接口在外设设备和终端之间建立通信连接的示意图可参见图1d,如图1d所示,终端101包括至少一个物理接口1011,外设设备配置的接收器102可以插入终端101提供的物理接口1011中,以实现在外设设备和终端之间建立通信连接。还需说明的是,图1d所示的接收器102与外设设备103之间是无线连接的,这种情况下,外设设备103和接收器102中可部署无线通信模块,以便于通过无 线通信模块(如蓝牙模块、wifi模块或射频信号模块等)在外设设备103和接收器102之间进行数据传输,如外设设备103通过无线通信模块可将自身的信息(如设备型号或设备厂商等信息)发送至接收器102。当然,接收器102和外设设备103之间还可以是有线连接的,在此情况下,接收器102可配置有一条数据传输线,通过该数据传输线可实现将外设设备和游戏应用之间建立连接。无论外设设备和接收器之间是有限连接还是无线连接,外设设备均可以将数据发送至接收器中,以便于终端可从该接收器中扫描到外设设备的设备信息,进而在外设设备和终端之间实现数据传输。In practical applications, the peripheral device can be configured with a receiver, and the receiver is connected to the physical interface (or hardware interface) provided by the terminal to establish communication between the peripheral device and the terminal through the physical interface. connect. An exemplary schematic diagram of establishing a communication connection between a peripheral device and a terminal through a receiver and a physical interface can be seen in Figure 1d. As shown in Figure 1d, the terminal 101 includes at least one physical interface 1011, and a receiver configured by the peripheral device 102 can be inserted into the physical interface 1011 provided by the terminal 101 to establish a communication connection between the peripheral device and the terminal. It should also be noted that the receiver 102 and the peripheral device 103 shown in Figure 1d are connected wirelessly. In this case, wireless communication modules can be deployed in the peripheral device 103 and the receiver 102 to facilitate wireless communication. The wireless communication module (such as Bluetooth module, wifi module or radio frequency signal module, etc.) performs data transmission between the peripheral device 103 and the receiver 102. For example, the peripheral device 103 can transmit its own information (such as device model or device model) through the wireless communication module. manufacturer and other information) is sent to the receiver 102. Of course, the receiver 102 and the peripheral device 103 can also be connected by wire. In this case, the receiver 102 can be configured with a data transmission line, through which the peripheral device and the game application can be established. connect. Regardless of whether there is a limited connection or a wireless connection between the peripheral device and the receiver, the peripheral device can send data to the receiver so that the terminal can scan the device information of the peripheral device from the receiver, and then the peripheral device can Implement data transmission between devices and terminals.
其中,终端提供的物理接口可包括USB(Universal Serial Bus,通用串行总线)接口,此时可将插入该USB接口的外设设备称为USB设备。USB接口是指终端中设置的符合USB标准或规范的接口;USB标准是一种外部总线标准(或称为串口总线标准),也是一种输入输出接口(或称为通信接口)的技术规范,用于规范终端(如个人电脑)与外设设备(如游戏手柄)的连接和通讯。进一步的,在终端中部署有USB接口的情况下,如果想要插入USB接口的外设设备(或USB设备)能够正常工作,那么还需在终端内部安装USB驱动程序(或简称为USB驱动),这样才可以通过USB驱动在终端中识别出插入USB接口的外设设备,并通过USB驱动实现收发数据,如获取USB设备发送的数据,以实现USB设备想要达到的效果。Among them, the physical interface provided by the terminal may include a USB (Universal Serial Bus, Universal Serial Bus) interface. In this case, the peripheral device inserted into the USB interface may be called a USB device. The USB interface refers to the interface set up in the terminal that complies with the USB standard or specification; the USB standard is an external bus standard (or called a serial bus standard) and a technical specification for an input and output interface (or called a communication interface). Used to standardize the connection and communication between terminals (such as personal computers) and peripheral devices (such as game controllers). Furthermore, when a USB interface is deployed in the terminal, if you want the peripheral device (or USB device) inserted into the USB interface to work normally, you need to install a USB driver (or USB driver for short) inside the terminal. , so that the peripheral device plugged into the USB interface can be identified in the terminal through the USB driver, and data can be sent and received through the USB driver, such as obtaining the data sent by the USB device, to achieve the desired effect of the USB device.
由此可见,在终端中安装了通信驱动程序(如前述提及的USB驱动)的情况下,终端可以通过内部的通信驱动程序实现收发数据,所谓收发数据是指接收数据和发送数据。例如,在外设设备将数据发送到接收器后续,USB驱动可从该接收器中扫描外设设备发送的交互数据(如任一数据),具体是扫描到外设设备对交互数据进行封装处理得到的封装数据,然后根据对封装数据解封装处理得到的交互数据执行相应的反馈处理,如该交互数据包括用于调整声音音量变大的目标信号,那么可根据该目标信号相应的调大终端或游戏应用的音量。其中,上述提及的封装数据具体是按照通信协议对交互数据进行封装得到。通信协议可是按照USB驱动所遵循的HID(Human interface device,人机交互接口)规范编写得到的,这样在USB驱动扫描到任一封装数据时,可通过其所遵循的HID规范,对该任一封装数据的数据格式进行检测,只有在检测到该任一封装数据的数据格式满足HID规范的情况下,才确定缓存该任一封装数据,以实现对扫描到的不符合HID规范的数据进行过滤。其中,HID规范是一种人机交互规范(或标准),该人机交互规范可以简单理解为一种计算机语言,定义了数据传输时的数据格式等。USB驱动中的HID规范是统一通用的,也就是说,即使在不同终端上部署的USB驱动所遵循的HID规范也不存在差异;这使得遵循该HID规范编写的通信协议能够被大多数的设备所支持,进而在一定程度提升通信协议的适用性。It can be seen that when a communication driver (such as the aforementioned USB driver) is installed in the terminal, the terminal can send and receive data through the internal communication driver. The so-called sending and receiving data refers to receiving data and sending data. For example, after the peripheral device sends data to the receiver, the USB driver can scan the interactive data (such as any data) sent by the peripheral device from the receiver. Specifically, it scans the peripheral device and encapsulates the interactive data. encapsulated data, and then perform corresponding feedback processing based on the interactive data obtained by decapsulating the encapsulated data. If the interactive data includes a target signal for adjusting the sound volume, then the terminal or terminal can be increased accordingly based on the target signal. Game application volume. Among them, the above-mentioned encapsulation data is specifically obtained by encapsulating the interactive data according to the communication protocol. The communication protocol is written in accordance with the HID (Human interface device, human-computer interaction interface) specification that the USB driver follows. In this way, when the USB driver scans any encapsulated data, it can use the HID specification it follows to scan any encapsulated data. The data format of the packaged data is detected. Only when the data format of any packaged data is detected to meet the HID specification, the packaged data is determined to be cached, so as to filter the scanned data that does not meet the HID specification. . Among them, the HID specification is a human-computer interaction specification (or standard). The human-computer interaction specification 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, that is to say, there is no difference in the HID specification followed by the USB driver deployed on different terminals; this allows the communication protocol written in accordance with the HID specification to be used by most devices. supported, thereby improving the applicability of the communication protocol to a certain extent.
综上所述,本申请实施例提供的数据传输系统中,操作对象可使用外设设备操控终端中运行的游戏,为便于描述,本申请实施例中可将这种采用外设设备操控游戏的游戏玩法称为大屏游戏;即大屏游戏可是指:采用单独的终端来显示游戏的游戏画面或游戏场景,以及采用外设于该终端的外设设备来操控终端中显示的游戏的一种游戏玩法。由此可见,在大屏游戏场景中,用于显示游戏的游戏画面的终端与用于操控游戏的外设设备是分离的,相比于终端与外设设备为同一设备来操控游戏而言,这种采用外设设备操控游戏的游戏玩法,能够避免操作对象在显示屏幕上操控时对游戏画面产生的遮挡,帮助操作对象更好地参与游戏,提供给操作对象更为沉浸的游戏体验。To sum up, in the data transmission system provided by the embodiment of the present application, the operating object can use the peripheral device to control the game running in the terminal. For the convenience of description, in the embodiment of the present application, the operating object can use the peripheral device to control the game. The gameplay is called a large-screen game; that is, a large-screen game refers to a game that uses a separate terminal to display the game screen or game scene, and uses peripheral devices external to the terminal to control the game displayed on the terminal. Gameplay. It can be seen that in a large-screen game scenario, the terminal used to display the game screen and the peripheral device used to control the game are separated. Compared with the terminal and the peripheral device being the same device to control the game, This kind of gameplay that uses peripheral devices to control the game can avoid the occlusion of the game screen when the operating object controls the display screen, help the operating object better participate in the game, and provide the operating object with a more immersive gaming experience.
为了丰富操作对象对大屏游戏中的外设设备和游戏应用的游戏操控能力,提高用户黏性,本申请实施例基于前述描述的数据传输系统,提出一种数据传输方案;该数据传输方案支持在游戏应用和外设设备之间定制一套外设通信协议(或称为私有协议、定制通信协议、HID协议),具体是按照终端内部的通信驱动程序(如前述提及的USB驱动)所遵循的数据传输规范(如前述提及的HID规范),在游戏应用和外设设备之间按照业务需求定制的一套外设通信协议;然后,外设设备和游戏应用之间按照该外设通信协议,并通过终端中的通信驱动程序进行直接通信。In order to enrich the game control capabilities of operating objects for peripheral devices and game applications in large-screen games and improve user stickiness, embodiments of this application propose a data transmission scheme based on the data transmission system described above; the data transmission scheme supports Customize a set of peripheral communication protocols (also known as private protocols, customized communication protocols, HID protocols) between game applications and peripheral devices, specifically in accordance with the communication driver inside the terminal (such as the USB driver mentioned above) Following the data transmission specification (such as the HID specification mentioned above), a set of peripheral communication protocols customized according to business needs between the game application and the peripheral device; then, the peripheral device and the game application follow the peripheral communication protocol communication protocol and communicate directly through the communication driver in the terminal.
经实践发现,采用本申请实施例提供的数据传输方案,在外设设备和游戏应用之间进行数据传输时,具有明显优势;下面以本申请实施例提供的数据传输方案,与现有主流的外设设备和游戏应用之间的数据传输过程进行对比为例,对本申请实施例的优势进行说明:It has been found through practice that the data transmission scheme provided by the embodiment of the present application has obvious advantages when transmitting data between peripheral devices and game applications. The data transmission scheme provided by the embodiment of the present application is compared with the existing mainstream peripheral devices. Taking the data transmission process between the device and the game application as an example, the advantages of the embodiments of the present application are explained:
现有主流的外设设备和游戏应用之间,是按照默认通信协议进行间接通信的。该默认通信协议是 终端中的操作系统的开发者按照业务需求编写的,这使得在外设设备和游戏应用按照该默认通信协议进行数据传输时,外设设备依赖于终端中的操作系统的管理模块(或称为输入管理模块)来转发数据(如前述提及的外设设备产生的封装数据)至游戏应用。这里,管理模块用于在接收到游戏应用和所述外设设备中的发送方的数据后,向游戏应用和所述外设设备中的接收方发送接收到的数据。如图1e所示,终端中的操作系统通过终端中运行的通信驱动程序接收外设设备发送的数据,然后,操作系统再将从通信驱动程序中获取到的数据转发给游戏应用,以便于游戏应用根据从操作系统转发的数据进行反馈处理。换而言之,外设设备和游戏应用之间的数据传输必须经由操作系统的转发,导致许多操作系统所不支持的游戏输入不能被操作系统进行转发,使得外设设备和游戏应用的游戏操控能力具有较高局限性,例如该局限性可体现为如下示例性的两点:1、若外设设备的厂商在原有的外设设备中新增定制的硬件结构,如六轴陀螺仪传感器或压力传感器等,且操作系统的默认通信协议不支持该新增的硬件结构相关的数据,那么在操作系统获取到该数据后,操作系统中的用于将通信数据转发值应用的管理模块并不支持将该数据转发至游戏应用,导致该新增的硬件结构的功能不能被使用,进而限制外设设备的发展。2、在游戏应用想要在外设设备上产生振动反馈等类似的效果时,若操作系统的管理模块不支持传递游戏应用发送的振动数据,则外设设备无法接收到该振动数据,进而无法实现振动效果,导致游戏效果较差,降低操作对象的游戏体验。Existing mainstream peripheral devices and game applications communicate indirectly according to the default communication protocol. The default communication protocol is The developer of the operating system in the terminal writes it according to business needs, which makes the peripheral device rely on the management module (or input) of the operating system in the terminal when the peripheral device and the game application transmit data according to the default communication protocol. Management module) to forward data (such as the encapsulated data generated by the aforementioned peripheral devices) to the game application. Here, the management module is configured to send the received data to the game application and the receiver in the peripheral device after receiving the data from the sender in the game application and the peripheral device. As shown in Figure 1e, the operating system in the terminal receives the data sent by the peripheral device through the communication driver running in the terminal. Then, the operating system forwards the data obtained from the communication driver to the game application to facilitate the game. The application performs feedback processing based on data forwarded from the operating system. In other words, data transmission between peripheral devices and game applications must be forwarded by the operating system. As a result, many game inputs that are not supported by the operating system cannot be forwarded by the operating system, making the game control of peripheral devices and game applications difficult. The ability has high limitations. For example, these limitations can be reflected in the following two exemplary points: 1. If the manufacturer of the peripheral device adds a customized hardware structure to the original peripheral device, such as a six-axis gyroscope sensor or Pressure sensors, etc., and the default communication protocol of the operating system does not support the newly added hardware structure-related data, then after the operating system obtains the data, the management module in the operating system used to forward the communication data does not apply. Supporting the forwarding of this data to game applications results in the functionality of the new hardware structure being unusable, thus limiting the development of peripheral devices. 2. When a game application wants to produce vibration feedback and other similar effects on a peripheral device, if the management module of the operating system does not support the transmission of vibration data sent by the game application, the peripheral device will not be able to receive the vibration data, making it impossible to achieve Vibration effects lead to poor game effects and reduce the gaming experience of operating objects.
然而,本申请实施例中的外设设备和游戏应用之间,可以按照外设通信协议进行直接通信。该外设通信协议是按照通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的,使得外设设备和游戏应用之间的数据传输是独立于操作系统的,不受操作系统的限制,进而可以消除上述描述的操作系统的限制。例如,云游戏场景下外设设备和游戏应用之间的数据传输流程可参见图1f所示,再如,端游(即客户端游戏)场景下外设设备和游戏应用之间的数据传输流程可参见图1g所示;如图1f或图1g所示的,终端中的通信驱动程序获取到外设设备发送的数据后,游戏应用可从该通信驱动程序中直接扫描外设设备发送的数据,而不会受到终端中的操作系统的限制。However, direct communication can be carried out between the peripheral device and the game application in the embodiment of the present application according to the peripheral communication protocol. The peripheral communication protocol is customized for the communication between the game application and the peripheral device according to the data transmission specification of the communication driver, so that the data transmission between the peripheral device and the game application is independent of the operating system , is not restricted by the operating system, and can eliminate the operating system restrictions described above. For example, the data transmission process between peripheral devices and game applications in the cloud gaming scenario can be seen in Figure 1f. Another example is the data transmission process between peripheral devices and game applications in the client game scenario. As shown in Figure 1g; as shown in Figure 1f or Figure 1g, after the communication driver in the 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 terminal.
由上述描述可见,本申请实施例提供的数据传输方案,具有如下主要优势:1、在外设设备包括新的硬件结构的情况下,外设厂商和游戏应用的开发者可以通过扩充外设通信协议,具体是在外设通信协议中新增关于新的硬件结构的相关协议,以实现按照扩充后的外设通信协议,能够实现外设设备中新增的硬件结构的相关功能,进而丰富游戏玩法,提示游戏操控能力。2、在外设设备原本的硬件结构不发生改动的情况下,能够通过外设通信协议将外设设备的输入特性或反馈特性(如振动特征)在游戏中充分体现出来,使得外设设备的原有功能被充分发挥。3、由于外设通信协议是遵循通信驱动程序中的HID规范所定制的,而通信驱动程序中的HID规范在各个终端上均是统一的,这使得本申请实施例提供的外设通信协议可以跨终端统一,无论是云游戏应用的开发者,还是生产外设设备的外设厂商,都可以依据此外设通信协议只进行一次开发,就能使开发的游戏应用或外设设备跨终端使用。例如,采用该外设通信协议的外设设备可以与电脑进行连接,以实现按照该外设通信协议与电脑中运行的游戏应用进行直接通信;再如,采用该外设通信协议的外设设备还可以与电视进行连接,以实现按照该外设通信协议与电视中运行的游戏应用进行直播通信。It can be seen from the above description that the data transmission solution provided by the embodiment of the present 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, the relevant protocols about the new hardware structure are added to the peripheral communication protocol, so that according to the expanded peripheral communication protocol, the related functions of the new hardware structure in the peripheral device can be realized, thereby enriching the game play. Prompt game control ability. 2. Without changing the original hardware structure of the peripheral device, the input characteristics or feedback characteristics (such as vibration characteristics) of the peripheral device can be fully reflected in the game through the peripheral communication protocol, so that the original hardware structure of the peripheral device can be fully reflected in the game. Functions are 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 on each terminal, this allows the peripheral communication protocol provided by the embodiment of this application to With cross-terminal unification, both developers of cloud game applications and peripheral manufacturers producing peripheral devices can develop only once based on this peripheral communication protocol, and the developed game applications or peripheral devices can be used across terminals. For example, a peripheral device using the peripheral communication protocol can be connected to a computer to achieve direct communication with a game application running on the computer according to the peripheral communication protocol; for another example, a peripheral device using the peripheral communication protocol It can also be connected to the TV to implement live communication with the game application running on the TV according to the peripheral communication protocol.
进一步的,为了不同游戏的开发者在开发游戏(如本地游戏)时,能够在该游戏中接入本申请实施例提供的外设通信协议,提示外设通信协议具有较高的推广率,本申请实施例还支持将具有使用外设通信协议的能力封装成软件开发工具包(Software Development Kit,SDK)以供开发者在开发参考游戏(如任一游戏)时,接入该外设通信协议的跨终端SDK;这样接入了SDK的参考游戏可以通过外设通信协议来和对应的外设设备进行交互,而不必受操作系统的限制。其中,所谓SDK是指为特定的软件包、软件框架、硬件平台、操作系统等建立应用软件时的开发工具的集合,该集合中包含辅助开发某一类软件的相关文档、范例和工具,如包含辅助开发该任一游戏软件时的外设通信协议;SDK中包含应用程序接口(Application Programming Interface,API),所谓API是指一些预先定义的用于进行数据通信的函数。API被用于衔接系统中不同的组成部分。例如,本申请实施例中SDK包含协议接口,开发者开发的参考游戏在启动后可通过包含游戏的游戏应用提供的协议接口访问游戏应用中的一组例程(如外设通信协议),而又无需访问源码,或理解内部工作机制的细节。这样包含该参考游戏的游戏应用中集成了包含游戏的游戏应用的协议接口对应的软件开发工具包后,当包含该参考游戏的游 戏应用中的软件开发工具包被触发时,包含游戏的游戏应用的协议接口被调用,使得包含该参考游戏的游戏应用可以通过协议接口调用外设通信协议进行数据传输。Further, in order for developers of different games to be able to access the peripheral communication protocol provided by the embodiments of the present application in the game when developing games (such as local games), it is suggested that the peripheral communication protocol has a higher promotion rate, this application The application embodiment also supports packaging the ability to use peripheral communication protocols into a software development kit (SDK) for developers to access the peripheral communication protocol when developing reference games (such as any game) cross-terminal SDK; in this way, the reference game connected to the SDK can interact with the corresponding peripheral devices through the peripheral communication protocol without being restricted by the operating system. Among them, the so-called SDK refers to a collection of development tools for building application software for a specific software package, software framework, hardware platform, operating system, etc. This collection includes relevant documents, examples and tools to assist in the development of a certain type of software, such as Contains peripheral communication protocols to assist in the development of any game software; the SDK includes an application programming interface (Application Programming Interface, API). The so-called API refers to some predefined functions for data communication. APIs are used to connect different components of the system. For example, in the embodiment of the present application, the SDK includes a protocol interface. After the reference game developed by the developer is started, it can access a set of routines in the game application (such as peripheral communication protocol) through the protocol interface provided by the game application containing the game, and There is no need to access the source code or understand the details of the inner workings. In this way, after the game application containing the reference game integrates the software development kit corresponding to the protocol interface of the game application containing the game, when the game containing the reference game When the software development kit in the game application is triggered, the protocol interface of the game application containing the game is called, so that the game application containing the reference game can call the peripheral communication protocol for data transmission through the protocol interface.
基于上述对本申请实施例涉及的数据传输方案的相关描述,下面结合图2a对数据传输方案的大致原理进行介绍。参见图2a所示,外设设备和游戏应用之间按照外设通信协议直接进行数据传输的过程中,可涉及如下阶段:Based on the above description of the data transmission scheme involved in the embodiment of the present application, the general principle of the data transmission scheme will be introduced below with reference to Figure 2a. As shown in Figure 2a, the process of direct data transmission between a peripheral device and a game application in accordance with the peripheral communication protocol may involve the following stages:
(1)开始阶段:在操作对象具有使用外设设备操控终端中运行的游戏应用的需求时,可以将外设设备配置的接收器插入到终端提供的物理接口,此时外设设备可以将自己的一个或多个通信接口的接口声明发送至接收器,这样终端中的通信驱动程序可以从该接收器中,扫描到外设设备的各个通信接口的接口声明;其中,通信驱动程序可以是定时对该接收器进行扫描,以获取数据(如接口声明)。其中,通信接口的接口声明可简单理解为对通信接口所支持的一组方法的声明;例如,在通信接口的接口声明中添加了协议标识,那么通过该接口声明可确定该通信接口支持按照该协议标识对应的通信协议进行数据传输。(1) Starting stage: When the operating object needs to use a peripheral device to control the game application running in the terminal, the receiver configured by the peripheral device can be inserted into the physical interface provided by the terminal. At this time, the peripheral device can The interface declaration of one or more communication interfaces is sent to the receiver, so that the communication driver in the terminal can scan the interface declaration of each communication interface of the peripheral device from the receiver; where the communication driver can be a timer The receiver is scanned for data (such as interface declarations). Among them, the interface declaration of the communication interface can be simply understood as the 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 the The communication protocol corresponding to the protocol identifier performs data transmission.
进一步的,在操作对象通过终端打开并启动游戏应用后,游戏应用可以从终端中的通信驱动程序中,扫描外设设备的一个或多个通信接口的接口声明,如果游戏应用从通信驱动程序中扫描到指定协议标识,则将该指定协议标识所标识的通信协议确定为外设通信协议,即游戏应用确认与之建立连接的外设设备是支持外设通信协议的外设设备。Further, after the operation object opens and starts the game application through the terminal, the game application can scan the interface statement of one or more communication interfaces of the peripheral device from the communication driver in the terminal. If the game application obtains the interface statement from the communication driver, If the specified protocol identifier is scanned, the communication protocol identified by the specified protocol identifier is determined to be the peripheral communication protocol, that is, the game application confirms that the peripheral device connected to it is a peripheral device that supports the peripheral communication protocol.
其中,支持外设通信协议的外设设备的软件输入通信模块,需按照图2b所示的结构实现;如图2b所示,外设设备包括基于外设通信协议所定制的定制通信接口,具体是软件输入通信模块包括基于外设通信协议所定制的定制通信接口,例如为定制HID USB接口(UsbInterface);也就是说,外设设备的软件输入通信模块中包括了定制通信接口,且该定制通信接口支持按照外设通信协议进行数据传输。进一步的,该定制通信接口中至少包括定制输入端点和定制输出端点。其中,端点可以理解为一个数据缓冲区,可用于临时保存数据;端点的输入或输出是从游戏应用进行数据收发时的数据流向来确定的。例如:定制输入端点的数据流向是游戏应用接收数据时的数据流向;在此情况下,数据从外设设备流向游戏应用,即:外设设备可将数据发送至定制接口中的定制输入端点进行缓存,然后通信驱动程序可以从定制输入端点中获取缓存的数据,再由游戏应用从该通信驱动程序中扫描获取的缓存的数据,以实现数据从外设设备流向游戏应用。再如:定制输出端点的数据流向是游戏应用发送数据时的数据流向;在此情况下,数据从游戏应用流向外设设备,即:游戏应用可将数据发送至驱动应用程序,再由驱动应用程序将数据发送定制接口中的定制输出端点进行缓存,然后由外设设备从该定制输出端点中获取缓存的数据,以实现数据从游戏应用流程外设设备。Among them, the software input communication module of the peripheral device that supports the peripheral communication protocol needs to be implemented according to the structure shown in Figure 2b; as shown in Figure 2b, the peripheral device includes a customized communication interface customized based on the peripheral communication protocol. Specifically The software input communication module includes a customized communication interface customized based on the peripheral communication protocol, such as a customized HID USB interface (UsbInterface); that is to say, the software input communication module of the peripheral device includes a customized communication interface, and the customized The communication interface supports data transmission according to the peripheral communication protocol. Further, the customized communication interface at least includes a customized input endpoint and a customized output endpoint. Among them, the endpoint can be understood as a data buffer that can be used to temporarily save data; the input or output of the endpoint is determined from the data flow direction when the game application sends and receives data. For example: the data flow direction of the custom input endpoint is the data flow direction when the game application receives data; in this case, the data flows from the peripheral device to the game application, that is: the peripheral device can send data to the custom input endpoint in the custom interface. Caching, the communication driver can then obtain the cached data from the custom input endpoint, and the game application scans the cached data from the communication driver to realize data flow from the peripheral device to the game application. Another 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 The program sends the data to the customized output endpoint in the customized interface for caching, and then the peripheral device obtains the cached data from the customized output endpoint to realize the data flow from the game application process to the peripheral device.
另外,为使外设设备能够兼容原有的数据传输方式,本申请实施例支持在软件上外设通信协议与原有的默认通信协议并存,即:外设设备在包含定制的外设通信协议的同时,仍需保留原有的默认通信协议;因此,在外设设备的软件输入通信模块中除包括定制的定制通信接口外,还包括基于原本的默认通信协议的默认通信接口,例如模式USB接口。换句话说,外设设备在包括定制输入端点和定制输出端点的同时,仍需保留原本的默认输入输出端点,以保留原有的外设数据传输方式,这样在支持外设通信协议的游戏应用未运行的场景下,能够确保外设设备仍然能够按照原有设计的默认通信协议与操作系统进行交互,并在支持外设通信协议的游戏应用运行的场景下,能够启动外设通信协议基于定制输入端点和定制输出端点进行数据传输,并暂停原有的输入输出端点。In addition, in order to make the peripheral device compatible with the original data transmission method, the embodiment of the present application supports the coexistence of the peripheral communication protocol and the original default communication protocol in the software, that is, the peripheral device includes a customized peripheral communication protocol. At the same time, the original default communication protocol still needs to be retained; therefore, in addition to the customized communication interface, the software input communication module of the peripheral device also includes a default communication interface based on the original default communication protocol, such as the mode USB interface . In other words, while the peripheral device includes customized input endpoints and customized output endpoints, it still needs to retain the original default input and output endpoints to retain the original peripheral data transmission method, so that in game applications that support peripheral communication protocols In the scenario where it is not running, it can ensure that the peripheral device can still interact with the operating system according to the originally designed default communication protocol, and in the scenario where the game application that supports the peripheral communication protocol is running, the peripheral communication protocol can be started based on customization Input endpoints and customized output endpoints perform data transmission, and the original input and output endpoints are paused.
(2)游戏应用初始化阶段。在操作对象通过操控外设设备对游戏应用提供的游戏进行操控之前,本申请实施例还需对游戏应用进行初始化处理,此处的初始化处理可包括:游戏应用获取外设设备的设备信息的处理过程。具体而言,在游戏应用确定外设设备是支持外设通信协议的设备之后,游戏应用可以对外设设备的设备信息进行查询,以便于后续能够根据设备信息进行输入输出指令的有效性检测。具体地,游戏应用可以按照外设通信协议生成信息查询请求,并将该信息查询请求作为交互数据;然后,按照外设通信协议对该交互数据进行封装处理;并通过通信驱动程序将封装处理得到的封装数据发送至定制输入接口,这样外设设备可响应信息查询请求,采用外设通信协议对设备信息进行封装处理,并将封装处理后的反馈结果通过通信驱动程序上报给游戏应用,以便于游戏应用能够获取到外 设设备的设备信息。(2) Game application initialization phase. Before the operating object controls the game provided by the game application by controlling the peripheral device, the embodiment of the present application also needs to initialize the game application. The initialization process here may include: the game application obtains the device information of the peripheral device. process. 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 detect the validity of the input and output instructions 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 interactive data; then, encapsulate the interactive data according to the peripheral communication protocol; and process the encapsulation through the communication driver to obtain The encapsulated data is sent to the customized input interface, so that the peripheral device can respond to the information query request, use the peripheral communication protocol to encapsulate the device information, and report the encapsulated feedback results to the game application through the communication driver, so as to facilitate Game applications can obtain external Device information of the device.
其中,外设设备的设备信息可包括但不限于:特性信息、能力信息以及详情信息。特性信息用于指示外设设备的至少一个设备能力,如外设设备中包括陀螺仪,那么外设设备具有上传陀螺仪数据的设备能力。能力信息用于指示外设设备具有每种设备能力所需的装置的信息,如外设设备具有上传陀螺仪数据的设备能力,那么该外设设备中包括能够产生陀螺仪数据的陀螺仪,此时能力信息包括该陀螺仪的装置信息。详情信息用于指示外设设备的设备详细信息,如外设设备的设备厂商或设备型号等等,游戏应用获取外设设备的详情信息后,可根据该详情信息更好地对游戏产品的质量和品质进行控制,进而提升操作对象的游戏体验。Among them, the device information of the peripheral device may include but is not limited to: characteristic information, capability information and detailed information. The characteristic information is used to indicate at least one device capability of the peripheral device. If the peripheral device includes a gyroscope, then the peripheral device has the device capability of uploading gyroscope data. Capability information is used to indicate that the peripheral device has the information of the device required for each device capability. If the peripheral device has the device capability of uploading gyroscope data, then the peripheral device includes a gyroscope that can generate gyroscope data. This The time capability information includes device information of the gyroscope. Detailed information is used to indicate the device details of the peripheral device, such as the device manufacturer or device model of the peripheral device, etc. After the game application obtains the detailed information of the peripheral device, it can better evaluate the quality of the game product based on the detailed information. and quality control, thereby improving the gaming experience of the operating objects.
(3)外设设备初始化阶段。在操作对象通过操控外设设备对游戏应用提供的游戏进行操控之前,本申请实施例还需对外设设备进行初始化处理,此处的初始化处理可包括:将外设设备的工作模式(或称为通信模式)切换至定制通信模式,其中定制通信模式是指使用外设他通信协议的模式;此时外设设备暂停使用默认通信协议进行数据传输,启动定制的外设通信模式进行数据传输。在外设设备处于定制通信模式时,终端中的操作系统支持外设设备和游戏应用通过使用外设通信协议传输任一数据,这样在后续操作对象根据外设设备操控游戏应用提供的游戏的过程中,外设设备能够按照外设通信协议向游戏应用发送根据操作对象的目标操作所产生的交互数据,提供更为丰富的游戏操控能力。目标操作是指操作对象输入的任意操作。具体地,游戏应用在确定外设设备是支持外设通信协议的硬件设备后,可向外设设备发送模式切换命令,该模式切换命令用于指示外设设备的工作模式切换至定制通信模式;那么外设设备响应于在模式切换命令可从当前通信模式切换至定制通信模式。当前通信模式是指外设设备在接收到模式切换命令时所处的通信模式;在外设设备包括默认通信模式和定制通信模式的情况下,此处的当前通信模式可是指默认通信模式。外设设备处于默认通信模式时,外设设备使用默认通信协议与游戏应用之间进行数据交互;其中,默认通信协议的相关描述可参见前述描述,在此不作赘述。(3) Peripheral device initialization stage. Before the operating object controls the game provided by the game application by controlling the peripheral device, the embodiment of the present application also needs to perform an initialization process on the peripheral device. The initialization process here may include: changing the working mode of the peripheral device (also known as Communication mode) switches to the customized communication mode, where the customized communication mode refers to the mode that uses other communication protocols of the peripheral device; 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 terminal supports the peripheral device and the game application to transmit any data by using the peripheral communication protocol, so that in the subsequent process of the operating object controlling the game provided by the game application based on the peripheral device , the peripheral device can send interactive data generated based on the target operation of the operation object to the game application according to the peripheral communication protocol, providing richer game control capabilities. The target operation refers to any operation input by the operation object. Specifically, after the game application determines that the peripheral device is a hardware device that supports the peripheral communication protocol, the game application can send a mode switching command to the peripheral device. The mode switching command is used to instruct the working mode of the peripheral device to switch to a 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 in which the peripheral device is in when it receives the mode switching command; in the case where the peripheral device includes a default communication mode and a customized communication mode, the current communication mode here may refer to the default communication mode. When the peripheral device is in the default communication mode, the peripheral device uses the default communication protocol to interact with the game application; the relevant description of the default communication protocol can be found in the foregoing description and will not be described again here.
(4)游戏操控阶段。在执行完上述的步骤(1)-(3)之后,游戏应用能够确定外设设备是支持外设通信协议的硬件设备,且游戏应用能够获取外设设备的设备信息;并且,外设设备已将工作模式切换定制通信模式。自此,操作对象可以使用外设设备的通用输入能力(如原有的通信协议所包含的能力,如操作外设设备中的遥控杆的能力),以及,外设通信协议中包含的特殊输入能力(如外设设备进行振动的能力),来实现对游戏应用提供的游戏的操控。换而言之,在游戏应用查询到外设设备的设备信息,且外设设备处于定制通信模式下,对于操作对象而言,可以执行操作外设设备以实现操控游戏应用提供的游戏的操作;对于设备而言,外设设备和游戏应用之间可以按照外设通信协议进行数据传输,如外设设备按照外设通信协议向游戏应用发送根据操作对象的目标操作所产生的数据或电量预警信息等等,再如游戏应用能够使外设设备执行相应的游戏反馈操作(如振动操作)。(4) Game control stage. After completing the above steps (1)-(3), 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; and, the peripheral device has Switch the working mode to the customized communication mode. From then on, the operating object can use the general input capabilities of the peripheral device (such as the capabilities included in the original communication protocol, such as the ability to operate the remote control stick in the peripheral device), as well as the special input included in the peripheral communication protocol. capabilities (such as the ability of peripheral devices to vibrate) to control games provided by game applications. In other words, after the game application queries the device information of the peripheral device, and the peripheral device is in the customized communication mode, the operation object can perform the operation of operating the peripheral device to control the game provided by the game application; For devices, data transmission between the peripheral device and the game application can be carried out according to the peripheral communication protocol. For example, the peripheral device sends data or power warning information generated according to the target operation of the operating object to the game application according to the peripheral communication protocol. Wait, another example is that a game application can enable peripheral devices to perform corresponding game feedback operations (such as vibration operations).
(5)结束阶段。在操作对象结束操控游戏时,如操作对象在终端中关闭游戏应用时,游戏应用可向外设设备发送模式切回指令,该模式切换指令用于指示外设设备从定制通信模式切换回原有的通信模式,这样外设设备暂停使用外设通信协议进行数据传输,启动原有的默认通信模式进行数据传输。(5) Ending stage. When the operating object ends controlling the game, such as when the operating object closes the game application in the terminal, the game application can send a mode switching command to the peripheral device. The mode switching command is used to instruct the peripheral device to switch back to the original communication mode from the customized communication mode. communication mode, so that the peripheral device stops using the peripheral communication protocol for data transmission and starts the original default communication mode for data transmission.
上述步骤(1)-(5)给出了本申请实施例提供的数据传输方案的较为完整的技术流程;但在实际应用场景中,部分步骤所包含的实现方式还可以发生变化。例如,在步骤(3)所示的外设设备初始化阶段,还支持游戏应用向外设设备发送心跳指令,以确保外设设备在切换至定制通信模式后,继续保持该定制通信模式。另外,需说明的是,本申请实施例运用到具体产品或技术中时,如游戏应用获取操作对象的游戏数据时,需要获得操作对象的许可或者同意;且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准,如游戏应用提供的游戏装备需要遵循相关国家和地区的相关法律法规和标准。The above steps (1)-(5) provide a relatively complete technical process of the data transmission solution provided by the embodiment of the present application; however, in actual application scenarios, the implementation methods included in some steps may also change. For example, in the peripheral device initialization phase 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 the present application are applied to specific products or technologies, such as when a 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 relevant data require Comply with relevant laws, regulations and standards of relevant countries and regions. For example, game equipment provided by game applications needs to comply with relevant laws, regulations and standards of relevant countries and regions.
为便于理解,本申请实施例支持将上述描述的较为完整的数据传输过程,归结为上行传输(或简称为上行)和下行传输(或简称为下行),如图3所示。其中,数据传输过程中的上行和下行,是以游戏应用在数据传输时的数据流向来确定的;例如,数据从游戏应用流向外设设备的数据传输过程可称为下行传输,此时可将游戏应用发送至外设设备的指令称为下行传输指令;再如,数据从外设设备流 向游戏应用的数据传输过程可称为上行传输,此时可将外设设备发送至游戏应用的指令称为上行传输指令。下面对下行传输中外设设备所承载的功能,以及上行传输中外设设备所承载的功能,分别进行简单概述;其中:For ease of understanding, the embodiment of the present application supports summarizing the relatively complete data transmission process described above into uplink transmission (or simply referred to as uplink) and downlink transmission (or simply referred to as downlink), as shown in Figure 3 . Among them, the uplink and downlink in the data transmission process 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. At this time, it can be The instructions sent by the game application to the peripheral device are called downlink transmission instructions; for another example, the data flows from the peripheral device The data transmission process to the game application can be called uplink transmission. At this time, the instructions that can be sent from the peripheral device to the game application are called uplink transmission instructions. The following is a brief overview of the functions carried by peripheral devices in downlink transmission and the functions carried by peripheral devices in uplink transmission; among them:
一、下行传输。1. Downlink transmission.
1、软硬件控制与信息查询。1. Software and hardware control and information query.
一种实现方式中,游戏应用对外设设备的软硬件控制可包括:控制外设设备的通信模式切换,以及控制外设设备执行游戏反馈(如振动控制)。In one implementation, the software and hardware control of the peripheral device by the game application may include: controlling the communication mode switching of the peripheral device, and controlling the peripheral device to perform game feedback (such as vibration control).
可选的,游戏应用可以控制外设设备的通信模式在原有通信模式(如前述提及的默认通信模式)和定制通信模式之间互切。例如:游戏应用在外设设备的接口声明中查找到指定协议标识时,确定该外设设备是支持外设通信协议的硬件设备,那么游戏应用可以向外设设备发送下行传输指令,此时该下行传输指令包括模式切换命令,以实现控制外设设备的通信模式切换至定制通信模式,具体可是从默认通信模式切换至定制通信模式。再如,游戏应用在检测到操作对象结束游戏体验时,如游戏应用检测到操作对象执行游戏关闭操作时,游戏应用可以向外设设备发送下行传输指令,此时该下行传输指令包括模式切回命令,以实现控制外设设备的工作模式从定制通信模式切换回原有的通信模式,具体可是从定制通信模式切换回默认通信模式。Optionally, the game application can control the communication mode of the peripheral device to switch between the original communication mode (such as the default communication mode mentioned above) and the customized communication mode. For example: when the game application finds the specified protocol identifier in the interface declaration of the peripheral device and determines that the peripheral device is a hardware device that supports the peripheral communication protocol, then the game application can send a downlink transmission command to the peripheral device. At this time, the downlink The transmission command includes a mode switching command to control the communication mode of the peripheral device to switch to a customized communication mode, specifically switching from the default communication mode to the customized communication mode. For another example, when the game application detects that the operating object ends the game experience, such as when the game application detects that the operating object performs the game closing operation, the game application can send a downlink transmission instruction to the peripheral device. At this time, the downlink transmission instruction includes mode switching back. command to control the working mode of the peripheral device to switch from the customized communication mode back to the original communication mode. Specifically, it can switch from the customized communication mode back to the default communication mode.
可选的,游戏应用可以控制外设设备执行游戏反馈。例如,游戏应用在检测到游戏的游戏画面中存在需要振动的振动对象时,游戏应用可以向外设设备发送下行传输指令,此时该下行传输指令包括外设控制指令,具体包括振动指令,以使外设设备响应于该振动指令执行振动操作。其中,①游戏提供的游戏画面可用于描述游戏提供的游戏场景,如该游戏场景可包括竞赛场景、组队场景或结算场景等;竞赛场景可是指:操作对象操控游戏角色在游戏中,实际参与比赛的场景;组队场景可是指:操作对象在游戏大厅等待进入游戏房间(如竞赛场景)的场景,在该组队场景下支持操作对象对游戏角色的属性进行编辑,如更新游戏角色的服饰或装备等;结算场景可是指:在游戏结束后用于展现游戏成绩(如积分)的场景。②游戏画面中的振动对象可是指:根据游戏场景需求,在游戏画面中显示的任一需振动的虚拟对象,该虚拟对象可以是游戏角色也可是虚拟物体(如船、树或车等);例如,游戏场景包括:操作对象操控游戏角色驾驶车辆的场景,那么当驾驶该车辆行驶在不平滑的路上时,该车辆和游戏角色需振动,则此时可将车辆和游戏角色作为游戏场景中需振动的振动对象。本申请实施例对游戏提供的游戏场景和游戏场景中的振动对象不作限定。Optionally, the game application can control peripheral devices to perform game feedback. For example, when a game application detects that there is a vibration object that needs to vibrate in the game screen, the game application can send a downlink transmission instruction to the peripheral device. At this time, the downlink transmission instruction includes a peripheral control instruction, specifically a vibration instruction, to Cause the peripheral device to perform a vibration operation in response to the vibration instruction. Among them, ① The game screen provided by the game can be used to describe the game scenes provided by the game. For example, the game scenes can include competition scenes, team formation scenes or settlement scenes, etc.; competition scenes can refer to: the operating object controls the game character in the game and actually participates in it. The game scene; the team scene may refer to the scene where the operating object is waiting to enter the game room (such as a competition scene) in the game lobby. In this team scene, the operating object is supported to edit the attributes of the game character, such as updating the clothing of the game character. Or equipment, etc.; the settlement scene may refer to: the scene used to display the game results (such as points) after the game is over. ② The vibration object in the game screen can refer to: any virtual object that needs to vibrate displayed in the game screen according to the requirements of the game scene. The virtual object can be a game character or a virtual object (such as a boat, tree or car, etc.); For example, the game scene includes a scene where the operating object controls the game character to drive a vehicle. When driving the vehicle on an uneven road, the vehicle and the game character need to vibrate. At this time, the vehicle and the game character can be used as part of the game scene. The vibration object to be vibrated. The embodiments of the present application do not limit the game scenes provided by the game and the vibration objects in the game scenes.
其他实现方式中,游戏应用发起的信息查询可包括但不限限于:对外设设备的设备信息的信息,以及,对外设设备的设备电量的信息查询。其中,外设设备的设备信息所包含的内容可参见前述所示内容的相关描述,在此不作赘述。其中,游戏应用在确定外设设备是支持外设通信协议的硬件设备后,可向定制输出端点发送信息查询请求,以便于外设设备响应该信息查询请求返回设备信息;其中,游戏应用获取外设设备的设备信息的具体实施过程,可参见前述图2a所示的具体实施过程的相关描述,在此不作赘述。在游戏应用运行游戏的过程中,游戏应用可以定时(如每隔预设时间段)生成电量查询请求,以使外设设备响应该电量查询请求,将设备电量(如外设设备接收到电量查询请求时的设备电量)回传给游戏应用,这样游戏应用在每次获取到外设设备的设备电量后,在终端屏幕中更新显示外设设备的电量。其中,预设时间段可以是由游戏开发人员根据业务需求自定义的;当预设时间段很短时,在一定程度上能够实现在游戏应用的终端屏幕中实时显示外设设备的设备电量,有利于操作对象直观且及时的了解外设设备中的电量情况。In other implementations, the information inquiry initiated by the game application may include but is not limited to: information inquiry about the device information of the peripheral device, and information inquiry about the device power of the peripheral device. For the content included in the device information of the peripheral device, please refer to the relevant description of the content shown above, and will not be described again here. Among them, after the game application determines that the peripheral device is a hardware device that supports the peripheral communication protocol, it 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; wherein, the game application obtains the external device information. For the specific implementation process of the device information of the device, please refer to the related description of the specific implementation process shown in Figure 2a, and will not be described again here. While the game application is running the game, the game application can generate a power query request at regular intervals (such as every preset time period), so that the peripheral device responds to the power query request and transmits the device power (such as the peripheral device receiving the power query request). The device power at the time of request) is returned to the game application, so that the game application updates and displays the power of the peripheral device on the terminal screen each time it obtains the device power of the peripheral device. Among them, the preset time period can be customized by the game developer according to business needs; when the preset time period is very short, the device power of the peripheral device can be displayed in real time on the terminal screen of the game application to a certain extent. It is helpful for the operating object to intuitively and timely understand the power status of the peripheral device.
需说明的是,为了在游戏应用发送下行传输指令时,外设设备能够针对游戏应用发送的指令作出相应的反馈,需要外设设备的生产厂商在为外设设备定制基于外设通信协议的定制通信接口时,实现如下软件逻辑:外设设备从定制通信接口中的定制端点(如定制输出端点)中接收封装数据,并按照外设通信协议对该封装数据进行解封装处理(或称为解析处理,简称为解析),得到游戏应用发起的下行传输指令,如前述提及的模式切换命令或电量查询指令;然后,根据解析结果(即解析得到的相应的指令)进行反馈处理。根据外设设备接收到的下行传输指令的不同,外设设备执行的反馈处理并不相同;例如,外设设备对封装数据解析得到模式切换指令,则外设设备进行的反馈处理包括:响应该模式切换指令将通信模式切换至定制通信模式;再如,外设设备对封装数据解析得到外设控制指令, 则外设设备进行的反馈处理包括:响应该外设控制指令进行振动操作;又如,外设设备对封装数据进行解析得到信息查询请求,则外设设备进行的反馈处理包括:响应该信息查询请求将设备信息返回至游戏应用;等等。It should be noted that in order for the peripheral device to respond accordingly to the instructions sent by the game application when the game application sends downlink transmission instructions, the manufacturer of the peripheral device needs to customize the peripheral communication protocol for the peripheral device. When communicating with the interface, the following software logic is implemented: the peripheral device receives encapsulated data from the customized endpoint (such as a customized output endpoint) in the customized communication interface, and decapsulates the encapsulated data (or parses it) according to the peripheral communication protocol. Processing, referred to as parsing), to obtain the downlink transmission instructions initiated by the game application, such as the aforementioned mode switching command or power query command; then, feedback processing is performed based on the parsing results (that is, the corresponding instructions obtained by parsing). Depending on the downlink transmission instructions received by the peripheral device, the feedback processing performed by the peripheral device is different; for example, if the peripheral device parses the encapsulated data and obtains a mode switching instruction, the feedback processing performed by the peripheral device includes: responding to the The mode switching command switches the communication mode to the customized communication mode; for another example, the peripheral device parses the encapsulated data to obtain the peripheral control command, Then the feedback processing performed by the peripheral device includes: responding to the peripheral control instruction to perform a vibration operation; for another example, the peripheral device parses the package data to obtain an information query request, then the feedback processing performed by the peripheral device includes: responding to the information query Requests that device information be returned to the game app; etc.
2、维持外设设备处于定制通信模式。2. Maintain peripheral devices in customized communication mode.
正如前述所描述的,外设设备中包括原有的默认通信协议和定制的外设通信协议;当外设设备处于定制通信模式时,外设设备按照外设通信协议与游戏应用之间进行数据传输,当外设设备处于原有的默认通信模式时,外设设备按照默认通信协议并通过操作系统转发,以实现与游戏应用之间的数据传输。因此,为确保游戏应用退出(如关闭或后台运行)时,外设设备仍然能够按照原有的通信协议与操作系统进行数据传输,以保留外设设备原有的功能,本申请实施例支持采用心跳机制来调整外设设备所处的通信模式。As described above, the peripheral device includes the original default communication protocol and the customized peripheral communication protocol; when the peripheral device is in the customized communication mode, the peripheral device communicates with the game application according to the peripheral communication protocol. Transmission, when the peripheral device is in the original default communication mode, the peripheral device follows the default communication protocol and forwards it through the operating system to achieve data transmission with the game application. Therefore, in order to ensure that when the game application exits (such as closing or running in the background), the peripheral device can still transmit data with the operating system according to the original communication protocol to retain the original functions of the peripheral device, the embodiment of this application supports the use of Heartbeat mechanism to adjust the communication mode of peripheral devices.
具体地,若外设设备接收到游戏应用发送的心跳指令,则外设设备维持在定制通信模式下工作。其中,心跳指令是游戏应用按照定制通信协议对心跳包进行封装处理得到的;心跳包可是指一个默认的字符串,用来通知接收方当前自己处于有效状态,使得接收方能够与自己处于有效连接。在本申请实施例中,该心跳包是用来让外设设备维持在定制工作模式下的,当外设设备维持在定制通信模式下,外设设备和游戏应用之间可以按照外设通信协议进行交互数据(如前述提及的外设控制指令)的传输,即交互数据是在外设设备处于定制通信模式下传输的。因此,为了外设设备能够实现通过心跳机制来维持定制通信模式,需要外设设备的生产厂商在为外设设备定制基于外设通信协议的定制通信接口时,实现如下软件逻辑:外设设备从定制通信接口中的定制端点(如定制输出端点)中接收心跳指令,并按照外设通信协议对该心跳指令进行解析,得到心跳包并维持定制通信模式;若外设设备未从定制通信接口中的定制端点(如定制输出端点)中接收心跳指令,则从定制通信模式切换回原有的通信模式,以便于外设设备仍然能够与操作系统之间进行数据传输。Specifically, if the peripheral device receives the heartbeat command sent by the game application, the peripheral device maintains working in the customized communication mode. Among them, the heartbeat command is obtained by the game application encapsulating the heartbeat packet according to the customized communication protocol; the heartbeat packet refers to a default string, which is used to notify the recipient that it is currently in a valid state, so that the recipient can be effectively connected to itself. . In this embodiment of the present application, the heartbeat packet is used to keep the peripheral device in a customized working mode. When the peripheral device is maintained in a customized communication mode, the peripheral device and the game application can communicate according to the peripheral communication protocol. Transmit interactive data (such as the aforementioned peripheral control instructions), that is, the interactive data is transmitted when the peripheral device is in a customized communication mode. Therefore, in order for the peripheral device to maintain the customized communication mode through the heartbeat mechanism, the manufacturer of the peripheral device needs to implement the following software logic when customizing the customized communication interface based on the peripheral communication protocol for the peripheral device: The peripheral device starts from The heartbeat command is received from the customized endpoint (such as the customized output endpoint) in the customized communication interface, and the heartbeat command is parsed according to the peripheral communication protocol to obtain the heartbeat packet and maintain the customized communication mode; if the peripheral device does not receive the heartbeat command from the customized communication interface If a heartbeat command is received from a customized endpoint (such as a customized output endpoint), the customized communication mode will be switched back to the original communication mode so that the peripheral device can still transmit data with the operating system.
由此可知,外设设备是在通过定制输出端点,获取到游戏应用发送的心跳指令的情况下,维持在定制通信模式下工作的。例如,游戏应用每隔预设周期(如10秒)向外设设备发送心跳包,那么外设设备预设周期内接收到该心跳包时,确定游戏应用希望外设设备仍处于定制通信模式下进行数据传输,则外设设备继续维持定制通信模式;若外设设备在预设周期内未接收到心跳指令,确定游戏应用希望外设设备切换回原有的通信模式进行数据传输,则外设设备从定制通信模式切换回原有的通信模式。It can be seen that the peripheral device maintains working in the customized communication mode after obtaining the heartbeat command sent by the game application through the customized output endpoint. For example, the game application sends a heartbeat packet to the peripheral device every preset period (such as 10 seconds). Then when the peripheral device receives the heartbeat packet within the preset period, it is determined that the game application wants the peripheral device to still be in the customized communication mode. For data transmission, 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 is determined that the game application wants the peripheral device to switch back to the original communication mode for data transmission, then the peripheral device The device switches from the customized communication mode back to the original communication mode.
二、上行传输。2. Uplink transmission.
1、通知与反馈交互数据。1. Notification and feedback interaction data.
与前述描述的游戏应用发起的下行传输指令(或称为查询与控制指令,如前述提及的模式切换命令)对应的,外设设备在接收到下行传输指令后,可响应于下行传输指令将相应的交互数据作为上行传输指令(或称为通知与反馈指令)上报给游戏应用。Corresponding to the downlink transmission command (also known as the 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. The corresponding interactive data is reported to the game application as an uplink transmission command (or notification and feedback command).
其中,上行传输指令承载的示例性功能如下:可选的,在游戏应用具有查询外设设备的设备信息的需求时,外设设备可基于设备信息生成上行传输指令,并按照外设通信协议对该上行传输指令进行封装处理,得到封装数据,再将封装数据发送至游戏应用,以使游戏应用对封装数据进行解封装处理后得到外设设备的设备信息。可选的,在游戏应用具有查询外设设备的电量信息的需求时,外设设备可基于当前设备电量生成上行传输指令,以实现将当前设备电量告知游戏应用;其中,外设设备的当前设备电量是指外设设备在接收到游戏应用发送的下行传输指令(如电量查询指令)时检测到的电量。为了外设设备能够实现上述描述的向游戏应用反馈查询的数据,需要外设设备的生产厂商在为外设设备定制基于外设通信协议的定制通信接口时,实现如下软件逻辑:外设设备从定制端点(如定制输出端点)接收游戏应用发送的封装数据,并对封装数据进行解封装处理得到下行传输指令(如信息查询请求);然后,外设设备根据下行传输指令按照外设通信协议对相应数据(如设备信息)进行封装处理,并将封装处理后的封装数据回传至定制端点(如定制输入端点),以便于游戏应用能够从该定制端点获取到外设设备返回的数据。Among them, the exemplary functions carried by the uplink transmission instructions are as follows: Optionally, when the game application has the need to query the device information of the peripheral device, the peripheral device can generate an uplink transmission instruction based on the device information, and perform the processing according to the peripheral communication protocol. The uplink transmission instruction is encapsulated to obtain encapsulated data, and then the encapsulated data is sent to the game application, so that the game application decapsulates the encapsulated data and obtains the device information of the peripheral device. Optionally, when the game application has the need to query the power information of the peripheral device, the peripheral device can generate an uplink transmission instruction based on the current device power to inform the game application of the current device power; where, the current device of the peripheral device The power refers to the power detected by the peripheral device when it receives the downlink transmission command (such as the power query command) sent by the game application. In order for the peripheral device to realize the above-described feedback query data to the game application, the manufacturer of the peripheral device needs to implement the following software logic when customizing a customized communication interface based on the peripheral communication protocol for the peripheral device: The peripheral device starts from The customized endpoint (such as a customized output endpoint) receives the encapsulated data sent by the game application, and decapsulates the encapsulated data to obtain the downstream transmission instructions (such as information query requests); then, the peripheral device performs the downstream transmission instructions according to the peripheral communication protocol. The corresponding data (such as device information) is encapsulated, and the encapsulated data is returned to the customized endpoint (such as a customized input endpoint), so that the game application can obtain the data returned by the peripheral device from the customized endpoint.
可选的,在外设设备检测到设备电量小于电量阈值时,表示外设设备的剩余电量较低,此时外设设备可主动发起上行传输指令,该上行传输指令指示外设设备的剩余电量小于电量阈值,并将上行传输指令封装处理后发送至游戏应用;以使游戏应用响应于解封装处理得到的上行传输指令,在游戏应 用的应用界面中显示电量预警信息,其中,游戏应用的应用界面可以是游戏应用提供的任一服务界面,且应用界面中显示的电量预警信息用于提示操作对象外设设备的电量较低,及时为外设设备补充电量。与前述描述类似的,为了外设设备在电量较低的情况下能够主动通知游戏应用,需要外设设备的生产厂商在为外设设备定制基于外设通信协议的定制通信接口时,实现如下软件逻辑:外设设备在检测到设备电量小于电量阈值,确定达到主动通知游戏应用的触发条件,则按照外设通信协议对设备电量进行封装处理,并将封装处理后的封装数据回传至定制端点(如定制输入端点),以便于游戏应用能够从该定制端点获取到外设设备返回的设备电量。Optionally, when the peripheral device detects that the device power is less than the power threshold, it means that the remaining power of the peripheral device is low. At this time, the peripheral device can actively initiate an uplink transmission instruction. The uplink transmission instruction indicates that the remaining power of the peripheral device is less than power threshold, and encapsulates the uplink transmission command and sends it to the game application; so that the game application responds to the uplink transmission command obtained by the decapsulation process. The battery warning information is displayed in the application interface of the game application. The application interface of the game application can be any service interface provided by the game application, and the battery warning information displayed in the application interface is used to prompt that the battery of the peripheral device of the operating object is low. Replenish power for peripheral devices in a timely manner. Similar to the above description, in order for the peripheral device to actively notify the game application when the battery is low, the manufacturer of the peripheral device needs to implement the following software when customizing a customized communication interface based on the peripheral communication protocol for the peripheral device. Logic: When the peripheral device detects that the device power is less than the power threshold and determines that the trigger condition for actively notifying the game application is met, it will encapsulate the device power according to the peripheral communication protocol, and transmit the encapsulated encapsulated data back to the customized endpoint. (such as a customized input endpoint), so that the game application can obtain the device power returned by the peripheral device from the customized endpoint.
2、传输根据操作对象输入的目标操作所生成的交互数据。2. Transmit interactive data generated according to the target operation input by the operation object.
如前述所描述的,外设设备中包括原有的默认通信协议和定制的外设通信协议;那么当外设设备处于默认通信模式下,外设设备在检测到游戏的操作对象输入的目标操作时,根据目标操作生成输入信号作为交互数据;并按照定制通信模式下的外设通信协议对该交互数据进行封装处理,且将封装数据发送至原有的默认通信接口,以使游戏应用能够按照原有的默认通信协议从默认通信接口中获取封装数据。反之,当外设设备处于定制通信模式下,外设设备在检测到游戏的操作对象输入的目标操作时,可根据目标操作生成输入信号作为交互数据;并按照定制通信模式下的外设通信协议对该交互数据进行封装处理,且将封装数据发送至定制通信接口,以使游戏应用能够按照定制通信协议从定制通信接口中获取该封装数据。这使得本申请实施例提供的外设设备能够兼容新旧两种通信模式下的目标操作,对于操作对象而言,其无需额外学习新的操作习惯,进而提升操作对象的游戏体验。As described above, the peripheral device includes the original default communication protocol and the customized peripheral communication protocol; then when the peripheral device is in the default communication mode, the peripheral device detects the target operation input by the game's operating object. When, the input signal is generated as interactive data according to the target operation; the interactive data is encapsulated according to the peripheral communication protocol in the customized communication mode, and the encapsulated data is sent to the original default communication interface so that the game application can follow the The original default communication protocol obtains encapsulated data from the default communication interface. On the contrary, when the peripheral device is in the customized communication mode, when the peripheral device detects the target operation input by the game's operating object, it can generate an input signal as interactive data according to the target operation; and according to the peripheral communication protocol in the customized communication mode The interactive data is encapsulated, 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. This enables the peripheral device provided by the embodiment of the present application to be compatible with target operations in both old and new communication modes. For the operating object, there is no need to learn new operating habits, thereby improving the gaming experience of the operating object.
为实现上述描述的将根据操作对象输入的目标操作所生成的交互数据传输给游戏应用,外设设备的外设厂商在为外设设备定制基于外设通信协议的定制通信接口时,实现如下软件逻辑:外设设备在检测到操作对象执行目标操作后,可按照外设设备的模数转换结构将操作对象输入的模拟信号,转化为对应的数字信号(即前述提及的输入信号);然后,按照外设通信协议对该输入信号进行封装处理,并将封装数据发送至定制通信接口,以使游戏应用能够按照定制通信协议从定制通信接口中获取该封装数据。In order to realize the above-described transmission of interactive data generated according to the target operation input by the operation object to the game application, the peripheral manufacturer of the peripheral device implements the following software when customizing a customized communication interface based on the peripheral communication protocol for the peripheral device. Logic: After the peripheral device detects that the operating object performs the target operation, it can convert the analog signal input by the operating object into the corresponding digital signal (i.e. the aforementioned input signal) according to the analog-to-digital conversion structure of the peripheral device; then , encapsulate the input signal according to the peripheral communication protocol, and send the encapsulated data 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.
基于上述对数据传输方案的整体流程的相关描述,本申请实施例提出更为详细的数据传输方法,该数据传输方法可以由前述提及的数据传输系统中的外设设备或终端中的游戏应用执行;为便于阐述,后续以电子设备执行数据传输方法为例进行说明,且在无特别说明时,该电子设备可以是指外设设备或运行游戏应用的终端中的任一种;当电子设备为运行游戏应用的终端时,描述的电子设备执行的操作,具体是由终端中运行的游戏应用执行的。下面结合附图对本申请实施例提供的数据传输方法进行详细介绍。Based on the above description of the overall process of the data transmission solution, embodiments of the present application propose a more detailed data transmission method. This data transmission method can be used by the peripheral device in the aforementioned data transmission system or the game application in the terminal. Execution; for ease of explanation, the subsequent description will take the data transmission method performed by an electronic device as an example, and unless otherwise specified, the electronic device may refer to any of a peripheral device or a terminal running a game application; when the electronic device When a terminal is used to run a game application, the described operations performed by the electronic device are specifically performed by the game application running in the terminal. The data transmission method provided by the embodiment of the present application will be introduced in detail below with reference to the accompanying drawings.
图4示出了本申请一个示例性实施例提供的一种数据传输方法的示意图;该数据传输方法可包括步骤S401-S402:Figure 4 shows a schematic diagram of a data transmission method provided by an exemplary embodiment of the present application; the data transmission method may include steps S401-S402:
S401,当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议。这里,交互数据用于表示游戏应用和外设设备之间需传输的任意数据。所述终端通过内部的通信驱动程序收发数据,所述外设通信协议是按照所述通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的。外设通信协议支持游戏应用和外设设备之间的数据传输不需要由操作系统的管理模块进行转发。数据传输规范用于表示通信驱动程序(例如为USB驱动、蓝牙驱动等)所遵循的通信接口的协议规范,例如为HID(Human interface device,人机交互接口)规范。S401. When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, obtain the peripheral communication protocol. Here, interaction data is used to represent any data that needs to be transmitted between the game application and the peripheral device. The terminal sends and receives data through an internal communication driver, and the peripheral communication protocol is customized for communication between the game application and the peripheral device according to the data transmission specification of the communication driver. The peripheral communication protocol supports data transmission between game applications and peripheral devices without the need for forwarding by the management module of the operating system. The data transmission specification is used to represent the protocol specification of the communication interface followed by the communication driver (such as USB driver, Bluetooth driver, etc.), such as the HID (Human interface device, human-computer interaction interface) specification.
具体实现中,在操控对象有使用外设设备,操控终端中的游戏应用提供的游戏的需求时,可以在外设设备和终端之间建立通信连接,具体可是将外设设备的接收器插到终端提供的物理接口中,以实现在外设设备和终端之间建立通信连接。进一步的,外设设备可以将自身所包含的一个或多个通信接口的接口声明发送至接收器,这样终端中部署的通信驱动程序可从该接收器中获取到外设设备的各个通信接口的接口声明,使得通信驱动程序中包括外设设备的一个或多个通信接口的接口声明。In specific implementation, when the control object needs to use a peripheral device and control the game provided by the game application in the terminal, a communication connection can be established between the peripheral device and the terminal. Specifically, the receiver of the peripheral device can be inserted into the terminal. Provides physical interfaces to establish communication connections between peripheral devices and terminals. Further, the peripheral device can send the interface declaration of one or more communication interfaces it contains to the receiver, so that the communication driver deployed in the terminal can obtain the information of each communication interface of the peripheral device from the receiver. Interface declaration, so that the communication driver includes the interface declaration of one or more communication interfaces of the peripheral device.
然后,游戏应用可从终端中的通信驱动程序中扫描外设设备的各个通信接口的接口声明,并在扫描到的各个接口声明中查找指定协议标识,该指定协议标识为定制的外设通信协议的标识,可用于唯一标识该外设通信协议;若游戏应用查找到指定协议标识,那么游戏应用确认外设设备是支持外设通 信协议的硬件设备,则将指定协议标识所标识的通信协议确定为外设通信协议,且可以进一步读取该指定协议标识所标识的外设通信协议的具体协议内容,以实现确定外设通信协议。Then, the game application can scan the interface declarations of each communication interface of the peripheral device from the communication driver in the terminal, and find the specified protocol identifier in each scanned interface declaration, which is the customized peripheral communication protocol. The identifier 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 supports peripheral communication If the hardware device trusts the protocol, the communication protocol identified by the designated protocol identifier is determined as the peripheral communication protocol, and the specific protocol content of the peripheral communication protocol identified by the designated protocol identifier can be further read to determine the peripheral communication protocol.
在一个实施例中,在外设设备的厂商可以在原有的外设设备中新增定制的硬件结构,如六轴陀螺仪传感器或压力传感器等。在这种场景中,若终端中操作系统的默认通信协议不支持转发该新增的硬件结构相关的数据,那么在操作系统获取到该数据后,操作系统中的管理模块并不支持将该数据转发至游戏应用以及不支持将游戏应用与新增硬件结构的操作相关的数据转发至外设设备,导致该新增的硬件结构的功能不能被使用。步骤S401中需传输的交互数据为外设设备中新增的硬件结构相关的交互数据。步骤S401可以在终端中操作系统的管理模块(或者默认通信协议)不支持转发该新增的硬件结构相关的数据,需要转发该新增的硬件结构相关的数据时,执行获取外设通信协议的操作。外设通信协议可以用于传输操作系统的管理模块不支持转发的交互数据。In one embodiment, the manufacturer of the peripheral device can add a customized hardware structure, such as a six-axis gyroscope sensor or a pressure sensor, to the original peripheral device. In this scenario, if the default communication protocol of the operating system in the terminal does not support forwarding the data related to the new hardware structure, then after the operating system obtains the data, the management module in the operating system does not support forwarding the data. Forwarding to the game application and forwarding data related to the operation of the new hardware structure by the game application to the peripheral device is not supported, resulting in the function of the new hardware structure not being used. The interactive data to be transmitted in step S401 is the interactive data related to the newly added hardware structure in the peripheral device. Step S401 may be performed to obtain the peripheral communication protocol when the management module (or default communication protocol) of the operating system in the terminal does not support forwarding the data related to the newly added hardware structure and needs to forward the data related to the new hardware structure. operate. The peripheral communication protocol can be used to transmit interactive data that the management module of the operating system does not support forwarding.
在一个实施例中,所述交互数据为在所述外设设备配置有新增的硬件结构的情况下,所述终端中操作系统的管理模块不支持转发的所述硬件结构相关的数据,所述硬件结构用于执行与游戏应用有关的交互操作,所述转发为:由管理模块接收到游戏应用和所述外设设备中的发送方的数据后,向游戏应用和所述外设设备中的接收方发送接收到的数据。In one embodiment, the interactive data is data related to the hardware structure that is not supported by the management module of the operating system in the terminal when the peripheral device is configured with a new hardware structure, so The hardware structure is used to perform interactive operations related to the game application. The forwarding is: after the management module receives the data of the sender in the game application and the peripheral device, it forwards the data to the game application and the peripheral device. The receiver sends the received data.
S402,使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据。S402, use the peripheral communication protocol and the communication driver to transmit interactive data between the game application and the peripheral device.
在一个实施例中,游戏应用和所述外设设备中一个为发送方,另一个为接收方。发送方利用外设通信协议对交互数据封装处理后,将得到的封装数据(即经过封装的交互数据)发送到通信驱动程序中,以使接收方能够从该通信驱动程序中获取到封装数据。换言之,发送方将封装数据发送到通信驱动程序,然后通信驱动程序将封装数据发送到接收方。In one embodiment, one of the game application and the peripheral device is the sender, and the other is the receiver. After the sender uses the peripheral communication protocol to encapsulate the interactive data, it sends the encapsulated data (that is, the encapsulated interactive data) to the communication driver, so that the receiver can obtain the encapsulated data from the communication driver. In other words, the sender sends the encapsulated data to the communications driver, and the communications driver sends the encapsulated data to the receiver.
在一个实施例中,S402使用外设通信协议对交互数据进行分装,然后由通信程序在游戏应用和外设设备之间传输经封装的所述交互数据。In one embodiment, S402 uses a peripheral communication protocol to package the interactive data, and then the communication program transmits the encapsulated interactive data between the game application and the peripheral device.
在一个实施例中,游戏应用在确认外设设备支持外设通信协议进行数据传输后,游戏应用和外设设置之间可以按照外设通信协议并通过通信驱动程序,实现对交互数据的传输。其中,交互数据可是指游戏应用欲发送给外设设备的数据,或者,交互数据可是指外设设备欲发送给游戏应用的数据。具体地,在电子设备具有传输交互数据的需求时,电子设备可获取外设通信协议,如从外设设备的接口声明中获取,或者,在外设通信协议以代码形式写入到电子设备的硬件结构中时可从硬件结构中读取;电子设备采用该外设通信协议对待传输的交互数据进行封装处理,得到封装数据;然后,电子设备将封装处理得到的封装数据发送到终端中部署的通信驱动程序中,以使数据接收方能够从该通信驱动程序中获取到封装数据。可选的,如果具有发送交互数据的需求的电子设备为游戏应用,那么数据接收方可是指外设设备,此实现方式下,封装数据是由游戏应用按照外设通信协议封装处理,并发送到通信驱动程序中的。可选的,如果具有发送交互数据的需求的电子设备为外设设备,那么数据接收方可是指游戏应用,此实现方式下,封装数据是由外设设备按照外设通信协议封装处理,并发送至通信驱动程序中的。In one embodiment, after the game application confirms that the peripheral device supports the peripheral communication protocol for data transmission, the game application and the peripheral device can realize the transmission of interactive data according to the peripheral communication protocol and through the communication driver. The interactive data may refer to the data that the game application wants to send to the peripheral device, or the interactive data may refer to the data that the peripheral device wants to send to the game application. Specifically, when the electronic device has a need to transmit interactive data, the electronic device can obtain the peripheral communication protocol, such as from the interface declaration of the peripheral device, or write the peripheral communication protocol into the hardware of the electronic device in the form of code. When in the structure, it can be read from the hardware structure; the electronic device uses the peripheral communication protocol to encapsulate the interactive data to be transmitted, and obtains the encapsulated data; then, the electronic device sends the encapsulated data obtained by the encapsulation process to the communication device deployed in the terminal. driver so that the data receiver can obtain the encapsulated data from the communication driver. Optionally, if the electronic device that needs to send interactive data is a game application, then the data receiver can refer to the peripheral device. In this implementation, the encapsulated data is encapsulated and processed by the game application according to the peripheral communication protocol and sent to in the communication driver. Optionally, if the electronic device that needs to send interactive data is a peripheral device, then the data receiver can refer to the 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.
其中,根据待传输的交互数据的数据类型不同,对待传输的交互数据进行封装处理的实现方式也不相同,具体体现为对待传输的交互数据进行封装处理时所采用的信息结构不同。其中,任一数据类型对应的信息结构是由外设通信协议所定义的,本申请实施例对每种数据类型对应的信息结构的具体样式不作限定。在具体实现中,电子设备在确定待传输的交互数据后,可进一步确定该待传输的交互数据的数据类型,然后,在外设通信协议中查询该交互数据的数据类型所对应的信息结构,作为目标信息结构;再将交互数据写入目标信息结构中,得到封装处理后的封装数据。需注意的是,无论是外设设备对交互数据进行封装处理,还是游戏应用对交互数据进行封装处理,封装处理的实现过程均为上述实现方式所描述的相关内容。Among them, depending on the data type of the interactive data to be transmitted, the implementation methods of encapsulating the interactive data to be transmitted are also different, which is specifically reflected in the different information structures used to encapsulate the interactive data to be transmitted. The information structure corresponding to any data type is defined by the peripheral communication protocol. The embodiment of the present application does not limit the specific style of the information structure corresponding to each data type. In a specific implementation, after determining the interactive data to be transmitted, the electronic device can further determine the data type of the interactive data to be transmitted, and then query the information structure corresponding to the data type of the interactive data in the peripheral communication protocol, as Target information structure; then write the interactive data into the target information structure to obtain encapsulated data. It should be noted that whether the peripheral device encapsulates the interactive data or the game application encapsulates the interactive data, the implementation process of the encapsulation process is related to the content described in the above implementation method.
本申请实施例中,可按照终端中的通信驱动程序所遵循的数据传输规范,在游戏应用和外设设备之间定制一个外设通信协议,由于该定制的外设通信协议是基于通信驱动程序所遵循的数据传输规范编写的,而通信驱动程序所遵循的数据传输规范在各种终端中是统一通用的,这使得该定制的外设通信协议支持跨终端使用,提高外设通信协议的适用性。并且,使用该定制的外设通信协议能够实现游戏应用和外设设备之间的直接通信,使得游戏应用和外设设备之间传输的数据不再受到终端中的操作 系统的限制(即数据不需要由操作系统的管理模块进行转发),从而可以在游戏应用和外设设备之间发送更为丰富的数据,并提高了数据传输的效率和方便性。特别是,在外设设备配置有新增的硬件结构的场景中,本申请实施例可以通过外设通信协议实现外设设备与游戏应用之间传输关于新增的硬件结构的交互数据。In the embodiment of this application, a peripheral communication protocol can be customized between the game application and the peripheral device according to the data transmission specification followed by the communication driver in the terminal, because the customized peripheral communication protocol is based on the communication driver The data transmission specifications followed by the communication driver are unified and universal among various terminals. This enables the customized peripheral communication protocol to support cross-terminal use and improves the applicability of the peripheral communication protocol. sex. Moreover, using this customized peripheral communication protocol can realize direct communication between game applications and peripheral devices, so that the data transmitted between game applications and peripheral devices is no longer affected by operations in the terminal. System limitations (that is, data does not need to be forwarded by the management module of the operating system), thus enabling richer data to be sent between game applications and peripheral devices, and improving the efficiency and convenience of data transmission. In particular, in a scenario where a peripheral device is configured with a new hardware structure, embodiments of the present application can realize the transmission of interactive data about the new hardware structure between the peripheral device and the game application through a peripheral communication protocol.
可以理解的是,根据电子设备的不同,电子设备所需传输的交互数据并不相同。下面对操作对象使用外设设备操控游戏的过程中,不同电子设备对相应需传输的交互数据的传输实现方式进行介绍;其中:It is understandable that, depending on the electronic device, the interactive data that the electronic device needs to transmit is different. The following is an introduction to how different electronic devices implement the transmission of corresponding interactive data that needs to be transmitted when the operating object uses peripheral devices to control the game; among them:
一、电子设备包括运行游戏应用的终端。此情况下,在使用外设设备操控游戏应用提供的游戏的整个过程中,游戏应用需传输的交互数据可以包括但不限于:信息查询请求、外设控制指令及模式切换指令。下面对上述给出的三种示例性的交互数据的数据传输过程进行详细阐述。1. Electronic equipment includes terminals running game applications. In this case, during the entire process of using the peripheral device to control the game provided by the game application, the interactive data that the game application needs to transmit may include but is not limited to: information query requests, peripheral control instructions, and mode switching instructions. The data transmission processes of the three exemplary interactive data given above are described in detail below.
1)交互数据包括信息查询请求,该信息查询请求用于查询外设设备的设备信息;其中,游戏应用向外设设备发送用于查询外设设备的设备信息的信息查询请求,并接收外设设备反馈的反馈结果的具体实施过程可参见图5a和图5b,如图5a和图5b所示:1) The interactive data includes an information query request, which is used to query the device information of the peripheral device; wherein the game application sends an information query request to the peripheral device for querying the device information of the peripheral device, and receives the information query request from the peripheral device. The specific implementation process of the feedback results of the device feedback can be seen in Figure 5a and Figure 5b, as shown in Figure 5a and Figure 5b:
s51,游戏应用在通过扫描外设设备的接口声明,确定外设设备是支持外设通信协议的硬件设备后,游戏应用可以产生信息查询请求,并按照外设通信协议对该信息查询请求进行封装,得到封装数据;然后,将该封装数据发送至通信驱动程序中,以便于外设设备通过通信驱动程序获取封装数据后,按照外设通信协议对该封装数据进行解封装处理,得到信息查询请求。其中,外设设备通过通信驱动程序获取封装数据的方式可包括:通信驱动程序主动将封装数据发送至外设设备包括的定制通信接口中的定制输出端点,然后,外设设备从该定制输出端点中获取封装数据。s51. After the game application determines that the peripheral device is a hardware device that supports the peripheral communication protocol by scanning the interface statement of the peripheral device, the game application can generate an information query request and encapsulate the information query request according to the peripheral communication protocol. , obtain the encapsulated data; then, send the encapsulated data to the communication driver, so that after the peripheral device obtains the encapsulated data through the communication driver, it can decapsulate the encapsulated data according to the peripheral communication protocol and obtain the information query request. . Wherein, the way in which the peripheral device obtains the encapsulated data through the communication driver may include: the communication driver actively sends the encapsulated data to a customized output endpoint in the customized communication interface included in the peripheral device, and then, the peripheral device obtains the encapsulated data from the customized output endpoint. Get the encapsulated data.
s52,外设设备在获取到该封装数据后,采用外设通信协议对该封装数据进行解封装处理(即解析),得到信息查询请求;然后,外设设备响应于该信息查询请求拉取设备信息,并采用外设通信协议对设备信息进行封装处理,得到封装数据,此时该封装数据包括封装处理得到的反馈结果。其中,外设设备按照外设通信协议对设备信息进行封装处理的具体实施过程,前述描述的封装处理的实施过程是类似的,可简要概括为:根据设备信息的数据类型,从外设通信协议中获取该数据类型对应的信息结构,作为信息查询结构,然后,将设备信息填入或写入该信息查询结构中,生成反馈结果,以实现对设备信息的封装。s52, after obtaining the encapsulated data, the peripheral device uses the peripheral communication protocol to decapsulate (ie parse) the encapsulated data and obtain the information query request; then, the peripheral device pulls the device in response to the information query request information, and uses a peripheral communication protocol to encapsulate the device information to obtain encapsulated data. At this time, the encapsulated data includes the feedback results obtained by the encapsulation process. Among them, the specific implementation process of the peripheral device encapsulating the device information according to the peripheral communication protocol. The implementation process of the encapsulation process described above is similar and can be briefly summarized as: according to the data type of the device information, from the peripheral communication protocol Obtain the information structure corresponding to the data type as the information query structure, and then fill in or write the device information into the information query structure to generate feedback results to realize the encapsulation of the device information.
举例来说,可以在对设备信息进行封装处理时,可以将表一所示的示例性的设备信息填入信息查询结构中,以生成封装数据。For example, when encapsulating device information, the exemplary device information shown in Table 1 can be filled in the information query structure to generate encapsulated data.
表一
Table I
如表一所示的,填入信息查询结构中的信息可包括外设设备的详情信息(如生产厂商、设备型号以及设备名称)以及特性信息。其中,外设设备的特性信息可用于指示外设设备的至少一种设备能力,外设设备的特性信息可以按位填入信息查询结构;例如,若外设设备支持目标特性,则可以将目标特性所占的二进制位填为1,以指示该外设设备支持该目标特性对应的设备能力。特性信息例如可以包括外设设备中新增的硬件结构相关的设备能力。新增的硬件结构例如为振动装置、转子马达或者三轴陀螺仪等。示例性的外设设备可能支持的特性信息可参见表二。As shown in Table 1, the information filled in the information query structure may include detailed information of the peripheral device (such as manufacturer, device model, and device name) and characteristic information. Among them, the characteristic information of the peripheral device can be used to indicate at least one device capability of the peripheral device, and the characteristic information of the peripheral device can be filled in the information query structure bit by bit; for example, if the peripheral device supports the target characteristic, the target can be The binary bit occupied by the characteristic is filled with 1 to indicate that the peripheral device supports the device capability corresponding to the target characteristic. For example, the characteristic information may include device capabilities related to new hardware structures in the peripheral device. Newly added hardware structures include vibration devices, rotor motors, or three-axis gyroscopes. Feature information that exemplary peripheral devices may support can be found in Table 2.
表二

Table II

如表二所示,可以采用十六进制来表示外设设备的特性信息;当然,本申请实施例并不限定具体采用哪种进制来表示外设设备的特性,在此说明。通过将外设设备支持的特性信息按位填入信息结构,使得游戏应用在获取到特性信息后,能够根据位推测出外设设备是否支持某种特性;例如,假设外设设备的双摇杆能力是用二进制的第一来表示的,那么如果游戏应用接收到的设备信息中包括十六进制0x1,将该0x1转换为二进制0001,则此时确定该二进制的第一位为数字1,表示外设设备支持双摇杆的设备能力。As shown in Table 2, hexadecimal can be used to represent the characteristic information of the peripheral device; of course, the embodiment of the present application does not limit which hexadecimal system is used to express the characteristics of the peripheral device, which is explained here. By filling the feature 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 feature based on the bits after obtaining the feature information; for example, assuming the dual joystick capability of the peripheral device is represented by the first digit of binary, then if the device information received by the game application includes hexadecimal 0x1, and the 0x1 is converted into binary 0001, then it is determined that the first digit of the binary is the number 1, which means Peripheral devices support dual joystick device capabilities.
s53,外设设备可将该反馈结果回传至定制通信接口中的定制输入端点,以使游戏应用通过通信驱动程序从定制输入端点中获取反馈结果;并根据外设通信协议对反馈结果进行解封装处理,得到外设设备的设备信息。其中,游戏应用通过驱动程序从定制输入端点获取反馈结果的具体实施过程可包括:通信驱动程序可定时扫描该定制输入端点,当从定制输入端点中扫描到外设设备发送的反馈结果后,可实现对该反馈结果的获取;然后,游戏应用也可定时扫描通信驱动程序,以便于在通信驱动程序中存在外设设备发送的反馈结果后,游戏应用能够从通信驱动程序中获取到外设设备发送的反馈结果。s53, the peripheral device can transmit the feedback result back to the customized input endpoint in the customized communication interface, so that the game application can obtain the feedback result from the customized input endpoint through the communication driver; and interpret the feedback result according to the peripheral communication protocol. Encapsulation processing to obtain device information of peripheral devices. Among them, the specific implementation process of the game application obtaining the feedback result from the customized input endpoint through the driver may include: the communication driver may scan the customized input endpoint regularly, and when the feedback result sent by the peripheral device is scanned from the customized input endpoint, the communication driver may Realize the acquisition of the feedback result; then, the game application can also periodically scan the communication driver, so that after there is a feedback result sent by the peripheral device in the communication driver, the game application can obtain the peripheral device from the communication driver Send feedback results.
上述过程中,需说明的是,除了通信驱动程序采用定时扫描的方式从定制输入端点中获取反馈结果外,本申请实施例还支持定制输入端点主动将接收到的反馈结果发送至通信驱动程序。或者,本申请实施例还支持定制输入端点在获取到反馈结果后,向通信驱动程序发送反馈指令,以使通信驱动程序在接收到该反馈指令后从定制输入端点扫描反馈结果。同理,游戏应用除了可以定制扫描通信驱动成功以获取反馈结果外,也可以按照上述描述的方式获取反馈结果,如通信驱动程序主动将反馈结果发送至游戏应用,或通信驱动程序向游戏应用发送反馈指令来指示游戏应用主动获取反馈结果。本申请实施例对定制接口和通信驱动程序之间,以及通信驱动程序和游戏应用之间的数据传输的具体实现方式不作限定。In the above process, it should be noted that in addition to the communication driver using scheduled scanning to obtain feedback results from the customized input endpoint, embodiments of the present application also support the customized input endpoint to proactively send the received feedback results to the communication driver. Alternatively, the embodiment of the present application also supports the customized input endpoint to send a feedback instruction to the communication driver after obtaining the feedback result, so that the communication driver scans the feedback result from the customized input endpoint after receiving the feedback instruction. Similarly, in addition to customizing the scanning communication driver to obtain feedback results, the game application can also obtain the feedback results in the manner described above. For example, the communication driver actively sends the feedback results to the game application, or the communication driver sends the feedback results to the game application. Feedback instructions to instruct the game application to actively obtain feedback results. The embodiments of this application do not limit the specific implementation of data transmission between the customized interface and the communication driver, and between the communication driver and the game application.
进一步的,游戏应用在获取到外设设备的设备信息,可按照该设备信息来对指令进行有效性检测。其中,指令有效可理解为该指令能够被游戏应用识别或解析,并根据识别后的结果进行相应处理;指令无效可理解为该指令不能被游戏应用进行识别,游戏应用在接收到无效的指令后,不作反馈或通知外设设备该指令不可识别。具体实现中,游戏应用根据外设设备的设备信息对指令进行有效性检测的实现过程可包括:若游戏应用接收到外设设备发送的输入指令,则确定外设设备生成该输入指令所需使用的第一设备能力。输入指令用于表示外设设备生成的指令,如输入指令是双摇杆向左移动指令,那么确定外设设备生成该指令所需使用的第一设备能力包括双摇杆能力。然后,采用第一设备能力对特性信息所指示的至少一种设备能力进行能力命中匹配,以得到能力命中匹配结果,所谓能力命中匹配即是指在特性信息所指示的至少一种设备能力中查询是否存在第一设备能力。最后,根据能力命中结果对输入指令进行有效性检测;其中,若第一设备能力命中(存在于)至少一种设备能力,即该第一设备能力属于特性信息中的一种设备能力,则该输入指令被确定为有效指令。Further, after the game application obtains the device information of the peripheral device, it can check the validity of the instruction according to the device information. Among them, if the instruction is valid, it can be understood that the instruction can be recognized or parsed by the game application, and the corresponding processing will be carried out according to the recognition result; if the instruction is invalid, it can be understood that the instruction cannot be recognized by the game application. After receiving the invalid instruction, the game application , without giving feedback or notifying the peripheral device that the command cannot be recognized. In a specific implementation, the implementation process of the game application checking the validity of the instruction based on the device information of the peripheral device may include: if the game application receives the input instruction sent by the peripheral device, determining the use required by the peripheral device to generate the input instruction. The first device capability. The input instruction is used to represent an instruction generated by a peripheral device. If the input instruction is an instruction to move a double joystick to the left, then it is determined that the first device capability required by the peripheral device to generate the instruction includes the dual joystick capability. Then, the first device capability is used to perform capability hit matching on at least one device capability indicated by the characteristic information to obtain a capability hit matching result. The so-called capability hit matching refers to querying in at least one device capability indicated by the characteristic information. Whether first device capabilities exist. Finally, the validity of the input instruction is tested according to the capability hit result; wherein, if the first device capability hits (exists in) at least one device capability, that is, the first device capability belongs to one of the device capabilities in the characteristic information, then the The input command was determined to be a valid command.
2)交互数据包括外设控制指令,该外设控制指令用于控制外设设备执行游戏反馈操作。这里,游戏反馈操作用于表示由游戏应用指示外设设备执行的向用户进行反馈的操作,例如为振动操作。其中,游戏应用向外设设备发送外设控制指令,以使外设设备执行游戏反馈操作的示例性实施过程可参见图6a:2) The interactive data includes peripheral control instructions, which are used to control peripheral devices to perform game feedback operations. Here, the game feedback operation is used to represent an operation that the game application instructs the peripheral device to perform to provide feedback to the user, such as a vibration operation. The exemplary implementation process of the game application sending peripheral control instructions to the peripheral device so that the peripheral device performs game feedback operations can be seen in Figure 6a:
s61,游戏应用若检测到需控制外设设备执行游戏反馈操作,则可获取外设设备支持的特性信息;其中,游戏应用获取外设设备支持的特性信息的方式可包括:从存储空间中获取历史缓存的外设设备所支持的特性信息,或者,按照前述图5a所示实现方式,从外设设备侧获取外设设备所支持的特性信息。s61, if the game application detects that it needs to control the peripheral device to perform a game feedback operation, it can obtain the characteristic information supported by the peripheral device; wherein, the method for the game application to obtain the characteristic information supported by the peripheral device may include: obtaining from the storage space Historically cached feature information supported by the peripheral device, or, according to the aforementioned implementation shown in Figure 5a, obtain feature information supported by the peripheral device from the peripheral device side.
s62,游戏应用在外设设备的特性信息所指示的至少一种设备能力中查找目标设备能力,该目标设备能力是指:用于指示外设设备执行游戏反馈操作的设备能力。具体地,游戏应用在确定需控制外设 设备执行的游戏反馈操作后,可确定外设设备执行该游戏反馈操作所需的目标设备能力;然后,在特性信息所指示的至少一种设备能力中进行能力命中匹配,若从至少一种设备能力中匹配到目标设备能力,则确定外设设备具有执行游戏反馈操作的设备能力。s62. The game application searches for the target device capability in at least one device capability indicated by the characteristic information of the peripheral device. The target device capability refers to the device capability used to instruct the peripheral device to perform a game feedback operation. Specifically, the game application determines that it needs to control the peripherals After the device performs the game feedback operation, the target device capabilities required by the peripheral device to perform the game feedback operation can be determined; then, capability hit matching is performed among at least one device capability indicated by the characteristic information. If the capability matches the target device capability, it is determined that the peripheral device has the device capability to perform game feedback operations.
s63,游戏应用从外设设备的特性信息所指示的至少一种设备能力中,查找到目标设备能力后,可根据该目标设备能力生成用于控制外设设备执行游戏反馈操作的外设控制指令,且此时生成的外设控制指令为有效输出指令,即该指令能够被外设设备识别并响应。例如,外设设备的特性信息指示外设设备具备振动能力,则外设设备可生成的外设控制指令可称为振动指令,此时振动指令中可包括用于控制外设设备执行振动操作的振动数据,如表三所示:s63, after the game application finds the target device capability from at least one device capability indicated by the characteristic information of the peripheral device, it can generate a peripheral control instruction for controlling the peripheral device to perform a game feedback operation based on the target device capability. , and the peripheral control command generated at this time is a valid output command, that is, the command can be recognized and responded to by the peripheral device. For example, if the characteristic information of the peripheral device indicates that the peripheral device has the ability to vibrate, the peripheral control instructions that the peripheral device can generate can be called vibration instructions. In this case, the vibration instructions can include instructions for controlling the peripheral device to perform vibration operations. Vibration data, as shown in Table 3:
表三
Table 3
然后,游戏应用可按照外设通信协议将振动数据填入振动信息结构中,以是实现对振动指令的封装处理,并将封装数据发送至外设设备,以使外设设备在基于封装数据得到振动指令,能够根据振动指令所包含的振动数据进行振动操作。Then, the game application can fill the vibration data into the vibration information structure according to the peripheral communication protocol, so as to realize the encapsulation processing of the vibration instructions, and send the encapsulated data to the peripheral device, so that the peripheral device obtains the information based on the encapsulated data. Vibration instructions can perform vibration operations based on the vibration data contained in the vibration instructions.
s64,游戏应用按照外设通信协议对该外设控制指令进行封装处理,生成封装数据;并将该封装数据发送至通信驱动程序,以使通信驱动程序将该封装数据发送至外设设备的定制输出端点,这样外设设备可接收到游戏应用发送的外设控制指令,并响应该外设控制指令执行相应的游戏反馈操作。s64, the game application encapsulates the peripheral control instructions 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 customization of the peripheral device Output endpoint, so that the peripheral device can receive the peripheral control instructions sent by the game application and perform corresponding game feedback operations in response to the peripheral control instructions.
以游戏反馈操作包括振动操作为例,此情况下,游戏应用生成的外设控制指令用于控制外设设备执行振动操作。具体实现中,外设设备中包括一个或多个振动装置,该振动装置可包括振动马达(或简称为马达),每个马达配置有相应的参数,该参数可包括但不限于:振动方向、振动频率或振动模式,用于控制马达的振动。一种实现方式中,在游戏应用运行游戏的过程中,若游戏应用检测到游戏的游戏画面中存在振动对象,即存在需要振动的游戏角色,那么可将用于控制外设设备中的默认振动装置进行振动的操作,确定为第一振动操作;其中,该默认振动装置可包括外设设备提供的一个或多个振动装置中的任一个。如图6b所示,假设游戏画面所描述的游戏场景包括:在山坡上向上行驶的汽车,那么可以确定该游戏画面中需要振动的振动对象包括汽车,则游戏应用可以基于默认振动装置的参数生成外设控制指令,此时该外设控制指令可以称为振动指令,并将振动指令下发至外设设备,以使外设设备响应该振动指令控制默认振动装置进行振动,以模拟真实环境中的振动对象进行振动所产生的振动效果。进一步的,若外设设备中的默认振动装置601位于外设设备的中心位置,则外设设备控制该默认振动装置执行振动操作时,操作对象的两种手均能感受到振动。Take the game feedback operation including vibration operation as an example. In this case, the peripheral control instructions generated by the game application are used to control the peripheral device to perform vibration operations. In specific implementation, the peripheral equipment includes one or more vibration devices. The vibration device may include a vibration motor (or simply referred to as a motor). Each motor is configured with corresponding parameters. The parameters may include but are not limited to: vibration direction, Vibration frequency, or vibration pattern, used to control the vibration of a motor. In one implementation, when the game application is running the game, if the game application detects that there is a vibration object in the game screen, that is, there is a game character that needs to vibrate, then it can be used to control the default vibration in the peripheral device. The device performs a vibration operation, which is determined as the first vibration operation; wherein the default vibration device may include any one of one or more vibration devices provided by the peripheral device. As shown in Figure 6b, assuming that the game scene described by the game screen includes: a car driving upwards on a hillside, then it can be determined that the vibration objects that need to vibrate in the game screen include cars, and the game application can generate based on the parameters of the default vibration device Peripheral control command. At this time, the peripheral control command can be called a vibration command, and the vibration command is sent to the peripheral device, so that the peripheral device responds to the vibration command and controls the default vibration device to vibrate to simulate the real environment. The vibration effect produced by the vibration of the vibrating object. 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 operating subject can feel the vibration.
其他实现方式中,在游戏应用运行游戏的过程中,可以根据振动对象的位置,以及外设设备中的各个振动装置的位置信息,从外设设备中选取目标振动装置,并将用于控制目标振动装置机械能振动的操作,确定为第一振动操作。也就是说,可以根据振动对象在游戏画面中的具体位置(如坐标),从外设设备中确定出与振动装置在游戏画面中的位置相近的振动装置作为目标振动装置,并使得外设设备控制该目标振动装置执行振动操作,以实现模拟真实环境中振动对象进行振动的振动效果,营造更为真实的游戏体验。如图6c所示,假设游戏画面所描述的游戏场景包括:在山坡上向上行驶的汽车,那么可以确定该游戏画面中需要振动的振动对象包括汽车;然后,检测该振动对象“汽车”在游戏画面中的位置,如在以游戏画面的左上角为原点的坐标轴中,汽车的坐标位置为(20,5),那么确定该汽车位于游戏画面的右上角区域,则确定外设设备中部署在右侧手柄的振动装置602为目标振动装置;并根据该目标振动装置的参数生成外设控制指令,并将振动指令下发至外设设备,以使外设设备响应该振动指令控制目标振动装置进行振动,此时操作对象的右手相比于左手能够感受到更为明显的振动效果,以提高给操作对象更为真实的游戏体验。In other implementations, when the game application is running the game, the target vibration device can be selected from the peripheral device based on the position of the vibration object and the position information of each vibration device in the peripheral device, and will be used to control the target The operation of mechanical energy vibration of the vibration device is determined as the first vibration operation. That is to say, according to the specific position (such as coordinates) of the vibration object in the game screen, a vibration device that is close to the position of the vibration device in the game screen can be determined from the peripheral device as the target vibration device, and the peripheral device can The target vibration device is controlled to perform a vibration operation to achieve a vibration effect that simulates the vibration of a vibrating object in a real environment, creating a more realistic gaming experience. As shown in Figure 6c, assuming that the game scene described by the game screen includes: a car driving upward on a hillside, then it can be determined that the vibration objects that need to vibrate in the game screen include cars; then, it is detected that the vibration object "car" is in the game The position in the screen, for example, in the coordinate axis with the upper left corner of the game screen as the origin, the coordinate position of the car is (20,5), then determine that the car is located in the upper right corner of the game screen, then determine the deployment of the peripheral device The vibration device 602 on the right handle is the target vibration device; and generates peripheral control instructions according to the parameters of the target vibration device, and sends the vibration instructions to the peripheral equipment, so that the peripheral equipment responds to the vibration instructions to control the target vibration. The device vibrates. At this time, the right hand of the operating subject can feel a more obvious vibration effect than the left hand, so as to provide the operating subject with a more realistic gaming experience.
需说明的是,上述只是给出示例性的外设控制指令为振动指令时的数据传输过程;在游戏应用运行游戏的过程中,游戏应用还可以根据具体的游戏场景和外设设备的特性信息产生其他外设控制指令;如外设设备的特性信息包括音频反馈能力,那么游戏应用在检测到游戏场景中存在控制外设设备执行音效输出的操作时,生成音频反馈指令,以使外设设备响应该音频反馈指令输出音效,为操作对象打造更为真实的游戏体验。 It should be noted that the above is only an exemplary data transmission process when the peripheral control instruction is a vibration instruction; during the process of the game application running the game, the game application can also use the specific game scene and the characteristic information of the peripheral device to Generate other peripheral control instructions; if the characteristic information of the peripheral device includes audio feedback capability, then when the game application detects that there is an operation to control the peripheral device to perform sound effect output in the game scene, it generates an audio feedback instruction so that the peripheral device Sound effects are output in response to the audio feedback command to create a more realistic gaming experience for the operating object.
3)交互数据包括模式切换命令,该模式切换命令用于命令外设设备将通信模式切换至定制通信模式,以使外设设备在游戏应用运行游戏的过程中,使用外设通信协议进行数据传输。具体地,由于游戏应用是运行在终端的操作系统上的,导致游戏应用的运行可能会受到操作系统的限制,因此,在游戏应用具有向外设设备发送模式切换命令的需求时,需先检测操作系统是否支持通过所述外设通信协议和所述通信驱动程序传输该模式切换命令,以得到相应的检测结果;然后,根据检测结果确定是否由游戏应用通过通信驱动程序直接传输模式切换命令至外设设备。3) The interactive data includes a mode switching command, which is used to command the peripheral device to switch the communication mode to a customized communication mode, so that the peripheral device uses the peripheral communication protocol for data transmission while the game application is running the game. . Specifically, since the game application runs on the operating system of the terminal, the operation of the game application may be restricted by the operating system. Therefore, when the game application has the need to send a mode switching command to a peripheral device, it needs to be detected first. Whether the operating system supports transmitting the mode switching command through the peripheral communication protocol and the communication driver to obtain the corresponding detection result; and then, based on the detection result, determine whether the game application directly transmits the mode switching command to the communication driver through the communication driver. Peripheral devices.
其中:若检测结果指示操作系统支持,则确定游戏应用可以通过通信驱动程序直接传输模式切换命令。这种直接传输模式切换命令的示意图可参见图7a;具体包括:游戏应用可以获取外设通信协议,并按照外设通信协议和通信驱动程序直接向外设设备传输该模式切换命令;然后,外设设备在接收到该模式切换命令后,可响应该模式切换命令将通信模式切换至定制通信模式;当外设设备处于定制通信模式下,操作系统支持外设设备和游戏应用通过使用外设通信协议传输任一数据,如外设设备可以按照外设通信协议和通信驱动程序,将操作对象的目标操作和/或电量信息等数据直接传输给游戏应用。Among them: if the detection result indicates that the operating system supports it, it is determined that the game application can directly transmit the mode switching command through the communication driver. The schematic diagram of this direct transmission of mode switching commands can be seen in Figure 7a; the details include: 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, the peripheral After receiving the mode switching command, the 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 communicate using the peripheral device The protocol transmits any data. For example, a peripheral device can directly transmit data such as the target operation and/or power information of the operating object to the game application according to the peripheral communication protocol and communication driver.
反之,若检测结果指示检测到操作系统不支持,则确定游戏应用不可以通过通信驱动程序之间传输模式切换命令,那么模式切换命令可经由操作系统转发至外设设备。这种由操作系统转发模式切换命令的实现方式可参见图7b;具体包括:游戏应用可生成振动序列,该振动序列可以包括一串默认的字符串(如字符串“123”),用于触发外设设备执行模式切换命令;然后,游戏应用将生成的振动序列和交互数据(如模式切换命令)发送给操作系统的管理模块,以使管理模块通过通信驱动程序,将振动序列和交互数据转发给外设设备;这样外设设备在接收到振动序列时,可以确定需要进行模式切换,进一步根据模式切换命令将通信模式切换至定制通信模式。在一个实施例中,游戏应用将模式切换命令发送给操作系统的管理模块,以使管理模块通过通信驱动程序,将模式切换命令转发给外设设备;这样外设设备根据模式切换命令将通信模式切换至定制通信模式。On the contrary, if the detection result indicates that the operating system is not supported, it is determined that the game application cannot transmit the mode switching command through the communication driver, and then the mode switching command can be forwarded to the peripheral device via the operating system. The implementation of this mode switching command forwarded by the operating system can be seen in Figure 7b; specifically, the game application can generate a vibration sequence, and the vibration sequence can include a default string (such as the string "123") for triggering The peripheral device executes the mode switching command; then, the game application sends the generated vibration sequence and interaction data (such as the mode switching command) to the management module of the operating system, so that the management module forwards the vibration sequence and interaction data through the communication driver To the peripheral device; in this way, when the peripheral device receives the vibration sequence, it can determine that mode switching is required, and further switch the communication mode to the customized communication mode according to the mode switching command. In one embodiment, the game application sends the mode switching command to the management module of the operating system, so that the management module forwards the mode switching command to the peripheral device through the communication driver; in this way, the peripheral device changes the communication mode according to the mode switching command. Switch to customized communication mode.
二、电子设备包括外设设备。此情况下,在使用外设设备操控游戏应用提供的游戏的整个过程中,外设设备需传输的交互数据可以包括但不限于:输入信号以及电量预警信号。下面对上述给出的两种示例性的交互数据的数据传输过程进行详细阐述。2. Electronic equipment includes peripheral equipment. In this case, during the entire process of using the peripheral device to control the game provided by the game application, the interactive data that the peripheral device needs to transmit may include but is not limited to: input signals and power warning signals. The data transmission process of the two exemplary interactive data given above will be described in detail below.
1)交互数据包括输入信号。具体实现中,在外设设备处于定制通信模式下,若在游戏应用运行游戏的过程中,外设设备检测到游戏的操作对象输入的目标操作,则外设设备可以根据目标操作生成输入信号,此时可将该输入信号作为交互数据;并按照外设通信协议将输入信号填入输入信息结构中,以实现对输入信号的封装处理;然后,通过通信驱动程序将封装后的封装数据传输给游戏应用,使得游戏应用在获取到封装数据后,对封装数据进行解封装处理得到交互数据,并根据交互数据对游戏的游戏画面进行更新。如图8所示,在操作对象使用外设设备操作游戏的过程中,若外设设备检测到操作对象针对游戏对象801输入的向上滑动操作,表示外设设备想要游戏对象801跟随向上滑动操作执行跳跃动作,则外设设备可以根据该向上滑动操作生成输入信号,并将该输入信号作为交互数据直接通过通信驱动程序传输给游戏应用;然后,游戏应用获取到交互数据后,可根据该交互数据确定出游戏对象执行跳跃动作时的游戏画面,并采用该游戏对象执行跳跃动作时的游戏画面,更新显示执行跳跃动作之前的游戏画面。1) Interaction data includes input signals. In the specific implementation, when the peripheral device is in the customized communication mode, if the peripheral device detects the target operation input by the operating object of the game while the game application is running the game, the peripheral device can generate an input signal according to the target operation. The input signal can be used as interactive data; and the input signal is filled into the input information structure according to the peripheral communication protocol to realize the encapsulation processing of the input signal; then, the encapsulated encapsulated data is transmitted to the game through the communication driver The application enables the game application to decapsulate the encapsulated data to obtain interactive data after obtaining the encapsulated data, and update the game screen of the game based on the interactive data. As shown in Figure 8, when the operating object uses the peripheral device to operate the game, if the peripheral device detects the upward sliding operation input by the operating object on the game object 801, it means that the peripheral device wants the game object 801 to follow the upward sliding operation. Perform a jumping action, the peripheral device can generate an input signal based on the upward sliding operation, and transmit the input signal as interactive data directly to the game application through the communication driver; then, after the game application obtains the interactive data, it can The data determines the game screen when the game object performs the jumping action, and uses the game screen when the game object performs the jumping action to update and display the game screen before the jumping action is performed.
2)交互数据包括电量预警信号。具体实现中,在操作对象使用外设设备操控游戏的过程中,即在外设设备的运行过程中,外设设备可以获取自身的设备电量,如定制获取设备电量;若外设设备检测到设备电量小于电量阈值,表示此时外设设备的电量较低,则外设设备可以生成电量预警信号,此时该电量预警信号作为交互数据;然后,采用外设通信协议对该电量预警信号进行封装,具体是将外设设备的设备信息添加至电量信息结构中,得到封装处理后的封装数据;然后,将该封装数据回传至定制输入接口,这样游戏应用可通过通信驱动程序从该定制输入接口中扫描到封装数据,并在对该封装数据解析处理后得到电量预警信号。进一步的,游戏应用在获取到该交互数据(即电量预警信号)后,可根据交互数据生成电量预警信息,并在游戏应用的应用界面中显示该电量预警信息,该电量预警信息用于提示外设设备需充电,有利于操作对象及时了解外设设备的剩余电量情况,避免由于外设设备断电导致的游戏中段,进而提升操作对象的游戏体验,提升用户黏性。一种示例性的外设设备主动进行电量预警的实现方式可参见图9,游戏画面中显示有电量预警信息901。 2) Interactive data includes power warning signals. In the specific implementation, when the operating object uses the peripheral device to control the game, that is, during the operation of the peripheral device, the peripheral device can obtain its own device power, such as customizing the device power; if the peripheral device detects the device power is less than the power threshold, it means that the power of the peripheral device is low at this time, and the peripheral device can generate a power warning signal. At this time, the power warning signal is used as interactive data; then, the peripheral communication protocol is used to encapsulate the power warning signal. Specifically, the device information of the peripheral device is added to the power information structure to obtain the encapsulated data after encapsulation; then, the encapsulated data is returned to the customized input interface, so that the game application can use the communication driver to obtain the encapsulated data from the customized input interface. The package data is scanned, and the power warning signal is obtained after parsing and processing the package data. Further, after the game application obtains the interactive data (i.e., the power warning signal), it can generate the power warning information based on the interactive data, and display the power warning information in the application interface of the game application. The power warning information is used to prompt external users. If the device needs to be charged, it will help the operator know the remaining power of the peripheral device in a timely manner and avoid mid-game interruption due to power outage of the peripheral device, thus improving the gaming experience of the operator and increasing user stickiness. An exemplary implementation method for a peripheral device to actively perform power warning can be seen in Figure 9. Power warning information 901 is displayed on the game screen.
需要说明的是,上述只是对电子设备分别为游戏应用和外设设备的几种示例性的交互数据的数据传输过程进行了阐述,并不会对本申请实施例产生限定。It should be noted that the above is only an explanation of the data transmission process of several exemplary interactive data in which the electronic device is a game application and a peripheral device, and does not limit the embodiments of the present application.
综上所述,本申请实施例可按照终端中部署的通信驱动程序所遵循的数据传输规范,在游戏应用和外设设备之间定制一个外设通信协议,由于该定制的外设通信协议是基于通信驱动程序所遵循的数据传输规范编写的,而通信驱动程序所遵循的数据传输规范在各种终端中是统一通用的,这使得该定制的外设通信协议支持跨终端使用,提高外设通信协议的适用性。并且,使用该定制的外设通信协议能够实现游戏应用和外设设备之间的直接通信,使得游戏应用和外设设备之间传输的数据不再受到终端中的操作系统的限制,从而游戏应用和外设设备之间可以发送更为丰富的数据,实现外设设备中更为丰富的游戏操控能力,可增加游戏的趣味性,进而提升用户黏性。To sum up, the embodiments of this application can customize a peripheral communication protocol between the game application and the peripheral device according to the data transmission specification followed by the communication driver deployed in the terminal, because the customized peripheral communication protocol is It is written based on the data transmission specifications followed by the communication driver, and the data transmission specifications followed by the communication driver are unified and universal among various terminals. This enables the customized peripheral communication protocol to support cross-terminal use and improve peripherals. Applicability of communication protocols. Moreover, using this customized peripheral communication protocol can realize direct communication between game applications and peripheral devices, so that the data transmitted between game applications and peripheral devices is no longer restricted by the operating system in the terminal, so that game applications Richer data can be sent to and from peripheral devices to achieve richer game control capabilities in peripheral devices, which can increase the fun of the game and thereby enhance user stickiness.
基于上述数据传输方法实施例的描述,本申请实施例还公开了一种数据传输装置,该数据传输装置可以是运行于电子设备中的一个计算机程序(包括程序代码)。该数据传输装置可以执行图4所示的方法。请参见图10,所述数据传输装置可以运行如下单元:Based on the description of the above data transmission method embodiments, embodiments of the present application also disclose a data transmission device. The data transmission device may be a computer program (including program code) running in an electronic device. The data transmission device can perform the method shown in Figure 4. Referring to Figure 10, the data transmission device can run the following units:
获取单元1001,用于当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;终端通过内部的通信驱动程序收发数据,外设通信协议是按照通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的;The acquisition unit 1001 is used to obtain the peripheral communication protocol when interactive data needs to be transmitted between the game application in the terminal and the peripheral device; the terminal sends and receives data through the internal communication driver, and the peripheral communication protocol is in accordance with the communication driver Data transmission specifications, customized for communication between the game application and the peripheral device;
处理单元1002,用于使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据。The processing unit 1002 is used to transmit interactive data between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
在一种实施方式中,处理单元1002用于在用于使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据时,可具体用于:In one implementation, when the processing unit 1002 is used to transmit interactive data between a game application and a peripheral device using a peripheral communication protocol and through a communication driver, it may be specifically used to:
采用外设通信协议对交互数据进行封装处理,得到封装数据;Use peripheral communication protocols to encapsulate interactive data to obtain encapsulated data;
将封装数据发送到通信驱动程序中,以使数据接收方从通信驱动程序中获取封装数据;Send the encapsulated data to the communication driver so that the data receiver obtains the encapsulated data from the communication driver;
其中,若封装数据是由游戏应用发送到通信驱动程序中的,则数据接收方是指外设设备;若封装数据是由外设设备发送到通信驱动程序中的,则数据接收方是指游戏应用。Among them, if the encapsulated data is sent by the game application to the communication driver, the data receiver refers to the peripheral device; if the encapsulated data is sent by the peripheral device to the communication driver, the data receiver refers to the game application.
在一种实施方式中,外设通信协议中规定了一种或多种数据类型所对应的信息结构;处理单元1002在采用外设通信协议对交互数据进行封装处理,得到封装数据时,可具体用于:In one implementation, the peripheral communication protocol stipulates the information structure corresponding to one or more data types; when the processing unit 1002 uses the peripheral communication protocol to encapsulate the interactive data and obtains the encapsulated data, it can specifically Used for:
确定交互数据的数据类型;Determine the data type of interactive data;
在外设通信协议中查询交互数据的数据类型所对应的信息结构,作为目标信息结构;Query the information structure corresponding to the data type of the interactive data in the peripheral communication protocol as the target information structure;
将交互数据写入目标信息结构中,得到封装数据。Write the interactive data into the target information structure to obtain encapsulated data.
在一种实施方式中,该装置搭载于游戏应用中,通信驱动程序中包括外设设备的一个或多个通信接口的接口声明;处理单元1002还可用于:In one implementation, the device is installed in a game application, and the communication driver includes interface declarations for one or more communication interfaces of peripheral devices; the processing unit 1002 can also be used to:
从通信驱动程序中扫描外设设备的各个通信接口的接口声明,在得到的各个接口声明中查找指定协议标识;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 interface declaration, the communication protocol identified by the specified protocol identifier is determined as the peripheral communication protocol.
在一种实施方式中,交互数据包括用于查询外设设备的设备信息的信息查询请求,设备信息至少包括外设设备所支持的特性信息;处理单元1002还可用于:In one implementation, the interaction data includes an information query request for querying device information of a peripheral device, and the device information at least includes feature information supported by the peripheral device; the processing unit 1002 may also be used to:
在通信驱动程序中存在外设设备发送的反馈结果后,从通信驱动程序中获取反馈结果;反馈结果是由外设设备响应于信息查询请求,采用外设通信协议对设备信息进行封装处理所得到的;After there is a feedback result sent by the peripheral device 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 using the peripheral communication protocol to encapsulate the device information. of;
根据外设通信协议对反馈结果进行解封装处理,得到外设设备的设备信息。The feedback result is decapsulated according to the peripheral communication protocol to obtain the device information of the peripheral device.
在一种实施方式中,特性信息用于指示外设设备的至少一种设备能力;处理单元1002还可用于:In one implementation, the characteristic information is used to indicate at least one device capability of the peripheral device; the processing unit 1002 may also be used to:
若接收到外设设备发送的输入指令,则确定外设设备生成输入指令所需使用的第一设备能力;If an input command sent by the peripheral device is received, determine the first device capability required by the peripheral device to generate the input command;
采用第一设备能力对特性信息所指示的至少一种设备能力进行能力命中匹配,以得到能力命中匹配结果,所述能力命中匹配是指在所述特性信息所指示的至少一种设备能力中查询是否存在所述第一设备能力;The first device capability is used to perform capability hit matching on at least one device capability indicated by the characteristic information to obtain a capability hit matching result. The capability hit matching refers to querying in at least one device capability indicated by the characteristic information. Whether the first device capability exists;
根据能力命中匹配结果对输入指令进行有效性检测;其中,若第一设备能力属于所述至少一种设 备能力中的一种,则输入指令被确定为有效指令。The validity of the input instruction is tested according to the capability hit matching result; wherein, if the first device capability belongs to the at least one device If the input command is one of the equipment capabilities, the input command is determined to be a valid command.
在一种实施方式中,交互数据包括外设控制指令,处理单元1002还可用于:In one implementation, the interaction data includes peripheral control instructions, and the processing unit 1002 can also be used to:
若检测到需控制外设设备执行游戏反馈操作,则获取外设设备支持的特性信息,特性信息用于指示外设设备的至少一种设备能力;If it is detected that the peripheral device needs to be controlled to perform a game feedback operation, the characteristic information supported by the peripheral device is obtained, and the characteristic information is used to indicate at least one device capability of the peripheral device;
在特性信息所指示的至少一种设备能力中查找目标设备能力,目标设备能力是指:用于支持外设设备执行游戏反馈操作的设备能力;Search for the target device capability in at least one device capability indicated by the characteristic information. The target device capability refers to: the device capability used to support peripheral devices to perform game feedback operations;
若查找到目标设备能力,则生成用于控制外设设备执行游戏反馈操作的外设控制指令。If the target device capability is found, a peripheral control instruction for controlling the peripheral device to perform a game feedback operation is generated.
在一种实施方式中,外设设备中包括一个或多个振动装置,游戏反馈操作包括第一振动操作;处理单元1002还可用于:In one implementation, the peripheral device includes one or more vibration devices, and the game feedback operation includes a first vibration operation; the processing unit 1002 may also be used to:
在游戏应用运行游戏的过程中,若检测到游戏的游戏画面中存在振动对象,则将用于控制外设设备中的默认振动装置进行振动的操作,确定为第一振动操作;While the game application is running the game, if a vibration object is detected in the game screen, the operation used to control the default vibration device in the peripheral device to vibrate is determined as the first vibration operation;
或者,根据振动对象在游戏画面中的位置,以及外设设备中的各个振动装置的位置信息,从外设设备中选取目标振动装置,并将用于控制目标振动装置进行振动的操作,确定为第一振动操作。Or, according to the position of the vibration object in the game screen and the position information of each vibration device in the peripheral device, select the target vibration device from the peripheral device, and determine the operation used to control the target vibration device to vibrate. First vibration operation.
在一种实施方式中,游戏应用运行在终端的操作系统上,且在外设设备处于定制通信模式下,操作系统支持外设设备和游戏应用通过使用外设通信协议传输任一数据;In one embodiment, the game application runs on the operating system of the terminal, and 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;
其中,交互数据包括模式切换命令,模式切换命令用于命令外设设备将通信模式切换至定制通信模式,以使外设设备在游戏应用运行游戏的过程中,使用外设通信协议进行数据传输;Among them, the interactive data includes a mode switching command, which is used to command the peripheral device to switch the communication mode to a customized communication mode, so that the peripheral device uses the peripheral communication protocol for data transmission during the game application running the game;
处理单元1002还可用于:The processing unit 1002 may also be used to:
检测操作系统是否支持模式切换命令,通过外设通信协议和通信驱动程序进行传输;Detect whether the operating system supports mode switching commands and transmit them through peripheral communication protocols and communication drivers;
若支持,则触发执行获取外设通信协议的步骤;If supported, trigger the execution of the steps to obtain the peripheral communication protocol;
若不支持,则生成振动序列,振动序列用于触发外设设备执行模式切换;将振动序列和交互数据发送给操作系统的管理模块,以使管理模块通过通信驱动程序,将振动序列和交互数据转发给外设设备。If it is not supported, a vibration sequence is generated, which is used to trigger the peripheral device to perform mode switching; the vibration sequence and interaction data are sent to the management module of the operating system, so that the management module transmits the vibration sequence and interaction data through the communication driver forwarded to peripheral devices.
在一种实施方式中,该装置搭载在外设设备上,处理单元1002还可用于:In one implementation, the device is mounted on a peripheral device, and the processing unit 1002 can also be used to:
在游戏应用运行游戏的过程中,若检测到游戏的操作对象输入的目标操作,则根据目标操作生成输入信号作为交互数据;While the game application is running the game, if a target operation input by the game's operating object is detected, an input signal is generated as interactive data based on the target operation;
其中,游戏应用在获取到交互数据后,根据交互数据对游戏的游戏画面进行更新。Among them, after the game application obtains the interaction data, it updates the game screen of the game according to the interaction data.
在一种实施方式中,该装置搭载在外设设备上,处理单元1002还可用于:In one implementation, the device is mounted on a peripheral device, and the processing unit 1002 can also be used to:
在外设设备的运行过程中,获取外设设备的设备电量;During the operation of the peripheral device, obtain the device power of the peripheral device;
若设备电量小于电量阈值,则生成电量预警信号作为交互数据;If the device's power is less than the power threshold, a power warning signal is generated as interactive data;
其中,游戏应用在获取到交互数据后,根据交互数据生成电量预警信息,并在游戏应用的应用界面中显示电量预警信息。Among them, after the game application obtains the interaction data, it generates power warning information based on the interaction data, and displays the power warning information in the application interface of the game application.
在一种实施方式中,外设设备包括基于外设通信协议所定制的定制通信接口,定制通信接口包括定制输入端点和定制输出端点;In one implementation, the peripheral device includes a customized communication interface customized based on the peripheral communication protocol, and the customized communication interface includes a customized input endpoint and a customized output endpoint;
其中,外设设备是通过所述定制输入端点,将数据发送给通信驱动程序;且外设设备是通过定制输出端点,从通信驱动程序中获取数据的。Wherein, 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.
在一种实施方式中,交互数据是在外设设备处于定制通信模式下传输的;In one embodiment, the interactive data is transmitted while the peripheral device is in a customized communication mode;
其中,外设设备是在通过定制输出端点,获取到游戏应用发送的心跳指令的情况下,维持在定制通信模式下工作的。Among them, the peripheral device maintains working in the customized communication mode after obtaining the heartbeat command sent by the game application through the customized output endpoint.
根据本申请的另一个实施例,图10所示的数据传输装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,基于数据处理装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。According to another embodiment of the present application, each unit in the data transmission device shown in Figure 10 can be separately or entirely combined into one or several other units to form, or some of the units (some) can be further disassembled. It is divided into multiple units with smaller functions, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the data processing device may also include other units. In practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by multiple units in cooperation.
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、 只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算设备上运行能够执行如图4中所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图10中所示的数据传输设备,以及来实现本申请实施例的数据传输方法。所述计算机程序可以记载于例如计算机可读记录介质上,并通过计算机可读记录介质装载于上述计算设备中,并在其中运行。According to another embodiment of the present application, the system can be configured by including a central processing unit (CPU), a random access storage medium (RAM), A computer program (including program code) capable of executing the steps involved in the corresponding method as shown in Figure 4 is run on a general-purpose computing device such as a computer with processing elements and storage elements such as a read-only storage medium (ROM) to construct such as The data transmission device shown in Figure 10 is used to implement the data transmission method according to the embodiment of the present application. The computer program may be recorded on, for example, a computer-readable recording medium, loaded into the above-mentioned computing device through the computer-readable recording medium, and run therein.
本申请实施例中,可按照终端中的通信驱动程序所遵循的数据传输规范,在游戏应用和外设设备之间定制一个外设通信协议,由于该定制的外设通信协议是基于通信驱动程序所遵循的数据传输规范编写的,而通信驱动程序所遵循的数据传输规范在各种终端中是统一通用的,这使得该定制的外设通信协议支持跨终端使用,提高外设通信协议的适用性。并且,使用该定制的外设通信协议能够实现游戏应用和外设设备之间的直接通信,使得游戏应用和外设设备之间传输的数据不再受到终端中的操作系统的限制,从而游戏应用和外设设备之间可以发送更为丰富的数据,提供丰富的游戏操控能力,进而提升用户黏性。In the embodiment of this application, a peripheral communication protocol can be customized between the game application and the peripheral device according to the data transmission specification followed by the communication driver in the terminal, because the customized peripheral communication protocol is based on the communication driver The data transmission specifications followed by the communication driver are unified and universal among various terminals. This enables the customized peripheral communication protocol to support cross-terminal use and improves the applicability of the peripheral communication protocol. sex. Moreover, using this customized peripheral communication protocol can realize direct communication between game applications and peripheral devices, so that the data transmitted between game applications and peripheral devices is no longer restricted by the operating system in the terminal, so that game applications Richer data can be sent to and from peripheral devices, providing rich game control capabilities, thereby increasing user stickiness.
图11示出了本申请一个示例性实施例提供的一种电子设备的结构示意图;请参见图11,该电子设备至少包括处理器1101、通信接口1102和计算机可读存储介质1103。该电子设备包括处理器1101、通信接口1102以及计算机可读存储介质1103。其中,处理器1101、通信接口1102以及计算机可读存储介质1103可通过总线或者其它方式连接。其中,通信接口1102用于接收和发送数据。计算机可读存储介质1103可以存储在电子设备的存储器中,计算机可读存储介质1103用于存储计算机程序,计算机程序包括程序指令,处理器1101用于执行计算机可读存储介质1103存储的程序指令。处理器1101(或称CPU(Central Processing Unit,中央处理器))是电子设备的计算核心以及控制核心,其适于实现一条或多条指令,具体适于加载并执行一条或多条指令从而实现相应方法流程或相应功能。Figure 11 shows a schematic structural diagram of an electronic device provided by an exemplary embodiment of the present application; please refer to Figure 11. The electronic device at least includes a processor 1101, a communication interface 1102 and a computer-readable storage medium 1103. The electronic device includes a processor 1101, a communication interface 1102, and a computer-readable storage medium 1103. Among them, the processor 1101, the communication interface 1102 and the computer-readable storage medium 1103 can be connected through a bus or other means. Among them, the communication interface 1102 is used to receive and send data. The computer-readable storage medium 1103 may be stored in the memory of the electronic device. The computer-readable storage medium 1103 is used to store a computer program. The computer program includes 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 core and control core of the electronic device. It is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve Corresponding method flow or corresponding function.
本申请实施例还提供了一种计算机可读存储介质(Memory),计算机可读存储介质是电子设备中的记忆设备,用于存放程序和数据。可以理解的是,此处的计算机可读存储介质既可以包括电子设备中的内置存储介质,当然也可以包括电子设备所支持的扩展存储介质。计算机可读存储介质提供存储空间,该存储空间存储了电子设备的处理系统。并且,在该存储空间中还存放了适于被处理器1101加载并执行的一条或多条的指令,这些指令可以是一个或多个的计算机程序(包括程序代码)。需要说明的是,此处的计算机可读存储介质可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器;可选的,还可以是至少一个位于远离前述处理器的计算机可读存储介质。Embodiments of the present application also provide a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in an electronic device and is used to store programs and data. It can be understood that the computer-readable storage medium here may include a built-in storage medium in the electronic device, and of course may also include an extended storage medium supported by the electronic device. The computer-readable storage medium provides storage space that stores the processing system of the electronic device. Furthermore, one or more instructions suitable for being loaded and executed by the processor 1101 are also stored in the storage space. These instructions may be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory; optionally, it can also be at least one located remotely The computer-readable storage medium of the aforementioned processor.
在一个实施例中,该计算机可读存储介质中存储有一条或多条指令;由处理器1101加载并执行计算机可读存储介质中存放的一条或多条指令,以实现上述数据传输方法实施例中的相应步骤;计算机可读存储介质中的一条或多条指令由处理器1101加载并执行如下步骤:In one embodiment, one or more instructions are stored in the computer-readable storage medium; the processor 1101 loads and executes one or more instructions stored in the computer-readable storage medium to implement the above data transmission method embodiment. The corresponding steps in; one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and execute the following steps:
当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;终端通过内部的通信驱动程序收发数据,外设通信协议是按照通信驱动程序的数据传输规范,在游戏应用和外设设备之间定制的;When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver. The peripheral communication protocol is in accordance with the data transmission specification of the communication driver. In the game Customized between applications and peripheral devices;
使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据。Interaction data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
在一种实施方式中,计算机可读存储介质中的一条或多条指令由处理器1101加载并在执行使用外设通信协议并通过通信驱动程序,在游戏应用和外设设备之间传输交互数据时,具体执行如下步骤:In one embodiment, one or more instructions in a computer-readable storage medium are loaded by the processor 1101 and executed using a peripheral communication protocol and through a communication driver to transmit interactive data between the game application and the peripheral device. , specifically perform the following steps:
采用外设通信协议对交互数据进行封装处理,得到封装数据;Use peripheral communication protocols to encapsulate interactive data to obtain encapsulated data;
将封装数据发送到通信驱动程序中,以使数据接收方从通信驱动程序中获取封装数据;Send the encapsulated data to the communication driver so that the data receiver obtains the encapsulated data from the communication driver;
其中,若封装数据是由游戏应用发送到通信驱动程序中的,则数据接收方是指外设设备;若封装数据是由外设设备发送到通信驱动程序中的,则数据接收方是指游戏应用。Among them, if the encapsulated data is sent by the game application to the communication driver, the data receiver refers to the peripheral device; if the encapsulated data is sent by the peripheral device to the communication driver, the data receiver refers to the game application.
在一种实施方式中,外设通信协议中规定了一种或多种数据类型所对应的信息结构;计算机可读存储介质中的一条或多条指令由处理器1101加载并在执行在采用外设通信协议对交互数据进行封装处理,得到封装数据时,具体执行如下步骤:In one implementation, the peripheral communication protocol specifies the information structure corresponding to one or more data types; one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and executed using the external device. Assume that the communication protocol encapsulates the interactive data. When the encapsulated data is obtained, the following steps are performed:
确定交互数据的数据类型;Determine the data type of interactive data;
在外设通信协议中查询交互数据的数据类型所对应的信息结构,作为目标信息结构; Query the information structure corresponding to the data type of the interactive data in the peripheral communication protocol as the target information structure;
将交互数据写入目标信息结构中,得到封装数据。Write the interactive data into the target information structure to obtain encapsulated data.
在一种实施方式中,该装置搭载于游戏应用中,通信驱动程序中包括外设设备的一个或多个通信接口的接口声明;计算机可读存储介质中的一条或多条指令由处理器1101加载并还执行如下步骤:In one implementation, the device is installed in 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 the computer-readable storage medium are generated by the processor 1101 Load and also perform the following steps:
从通信驱动程序中扫描外设设备的各个通信接口的接口声明,在得到的各个接口声明中查找指定协议标识;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 interface declaration, the communication protocol identified by the specified protocol identifier is determined as the peripheral communication protocol.
在一种实施方式中,交互数据包括用于查询外设设备的设备信息的信息查询请求,设备信息至少包括外设设备所支持的特性信息;计算机可读存储介质中的一条或多条指令由处理器1101加载并还执行如下步骤:In one implementation, the interaction data includes an information query request for querying device information of the peripheral device, and the device information at least includes characteristic information supported by the peripheral device; one or more instructions in the computer-readable storage medium are composed of Processor 1101 loads and also performs the following steps:
在通信驱动程序中存在外设设备发送的反馈结果后,从通信驱动程序中获取反馈结果;反馈结果是由外设设备响应于信息查询请求,采用外设通信协议对设备信息进行封装处理所得到的;After there is a feedback result sent by the peripheral device 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 using the peripheral communication protocol to encapsulate the device information. of;
根据外设通信协议对反馈结果进行解封装处理,得到外设设备的设备信息。The feedback result is decapsulated according to the peripheral communication protocol to obtain the device information of the peripheral device.
在一种实施方式中,特性信息用于指示外设设备的至少一种设备能力;计算机可读存储介质中的一条或多条指令由处理器1101加载并还执行如下步骤:In one implementation, the characteristic information is used to indicate at least one device capability of the peripheral device; one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
若接收到外设设备发送的输入指令,则确定外设设备生成输入指令所需使用的第一设备能力;If an input command sent by the peripheral device is received, determine the first device capability required by the peripheral device to generate the input command;
采用第一设备能力对特性信息所指示的至少一种设备能力进行能力命中匹配;Using the first device capability to perform capability hit matching on at least one device capability indicated by the characteristic information;
根据能力命中匹配结果对输入指令进行有效性检测;其中,若第一设备能力命中至少一种设备能力,则输入指令被确定为有效指令。The validity of the input instruction is tested according to the capability hit matching result; if the first device capability hits at least one device capability, the input instruction is determined to be a valid instruction.
在一种实施方式中,交互数据包括外设控制指令,计算机可读存储介质中的一条或多条指令由处理器1101加载并还执行如下步骤:In one implementation, the interactive data includes peripheral control instructions, and one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
若检测到需控制外设设备执行游戏反馈操作,则获取外设设备支持的特性信息,特性信息用于指示外设设备的至少一种设备能力;If it is detected that the peripheral device needs to be controlled to perform a game feedback operation, the characteristic information supported by the peripheral device is obtained, and the characteristic information is used to indicate at least one device capability of the peripheral device;
在特性信息所指示的至少一种设备能力中查找目标设备能力,目标设备能力是指:用于支持外设设备执行游戏反馈操作的设备能力;Search for the target device capability in at least one device capability indicated by the characteristic information. The target device capability refers to: the device capability used to support peripheral devices to perform game feedback operations;
若查找到目标设备能力,则生成用于控制外设设备执行游戏反馈操作的外设控制指令。If the target device capability is found, a peripheral control instruction for controlling the peripheral device to perform a game feedback operation is generated.
在一种实施方式中,外设设备中包括一个或多个振动装置,游戏反馈操作包括第一振动操作;计算机可读存储介质中的一条或多条指令由处理器1101加载并还执行如下步骤:In one embodiment, one or more vibration devices are included in the peripheral device, and the game feedback operation includes a first vibration operation; one or more instructions in the computer-readable storage medium are loaded by the processor 1101 and the following steps are also performed: :
在游戏应用运行游戏的过程中,若检测到游戏的游戏画面中存在振动对象,则将用于控制外设设备中的默认振动装置进行振动的操作,确定为第一振动操作;While the game application is running the game, if a vibration object is detected in the game screen, the operation used to control the default vibration device in the peripheral device to vibrate is determined as the first vibration operation;
或者,根据振动对象在游戏画面中的位置,以及外设设备中的各个振动装置的位置信息,从外设设备中选取目标振动装置,并将用于控制目标振动装置进行振动的操作,确定为第一振动操作。Or, according to the position of the vibration object in the game screen and the position information of each vibration device in the peripheral device, select the target vibration device from the peripheral device, and determine the operation used to control the target vibration device to vibrate. First vibration operation.
在一种实施方式中,游戏应用运行在终端的操作系统上,且在外设设备处于定制通信模式下,操作系统支持外设设备和游戏应用通过使用外设通信协议传输任一数据;In one embodiment, the game application runs on the operating system of the terminal, and 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;
其中,交互数据包括模式切换命令,模式切换命令用于命令外设设备将通信模式切换至定制通信模式,以使外设设备在游戏应用运行游戏的过程中,使用外设通信协议进行数据传输;Among them, the interactive data includes a mode switching command, which is used to command the peripheral device to switch the communication mode to a customized communication mode, so that the peripheral device uses the peripheral communication protocol for data transmission during the game application running the game;
计算机可读存储介质中的一条或多条指令由处理器1101加载并还执行如下步骤:One or more instructions in the computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
检测操作系统是否支持模式切换命令,通过外设通信协议和通信驱动程序进行传输;Detect whether the operating system supports mode switching commands and transmit them through peripheral communication protocols and communication drivers;
若支持,则触发执行获取外设通信协议的步骤;If supported, trigger the execution of the steps to obtain the peripheral communication protocol;
若不支持,则生成振动序列,振动序列用于触发外设设备执行模式切换命令;将振动序列和交互数据发送给操作系统的管理模块,以使管理模块通过通信驱动程序,将振动序列和交互数据转发给外设设备。If it is not supported, a vibration sequence is generated, which is used to trigger the peripheral device to execute a mode switching command; the vibration sequence and interaction data are sent to the management module of the operating system, so that the management module transmits the vibration sequence and interaction through the communication driver. The data is forwarded to the peripheral device.
在一种实施方式中,该装置搭载在外设设备上,计算机可读存储介质中的一条或多条指令由处理器1101加载并还执行如下步骤:In one implementation, the device is mounted on a peripheral device, and one or more instructions in a computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
在游戏应用运行游戏的过程中,若检测到游戏的操作对象输入的目标操作,则根据目标操作生成输入信号作为交互数据; While the game application is running the game, if a target operation input by the game's operating object is detected, an input signal is generated as interactive data based on the target operation;
其中,游戏应用在获取到交互数据后,根据交互数据对游戏的游戏画面进行更新。Among them, after the game application obtains the interaction data, it updates the game screen of the game according to the interaction data.
在一种实施方式中,该装置搭载在外设设备上,计算机可读存储介质中的一条或多条指令由处理器1101加载并还执行如下步骤:In one implementation, the device is mounted on a peripheral device, and one or more instructions in a computer-readable storage medium are loaded by the processor 1101 and also perform the following steps:
在外设设备的运行过程中,获取外设设备的设备电量;During the operation of the peripheral device, obtain the device power of the peripheral device;
若设备电量小于电量阈值,则生成电量预警信号作为交互数据;If the device's power is less than the power threshold, a power warning signal is generated as interactive data;
其中,游戏应用在获取到交互数据后,根据交互数据生成电量预警信息,并在游戏应用的应用界面中显示电量预警信息。Among them, after the game application obtains the interaction data, it generates power warning information based on the interaction data, and displays the power warning information in the application interface of the game application.
在一种实施方式中,外设设备包括基于外设通信协议所定制的定制通信接口,定制通信接口包括定制输入端点和定制输出端点;In one implementation, the peripheral device includes a customized communication interface customized based on the peripheral communication protocol, and the customized communication interface includes a customized input endpoint and a customized output endpoint;
其中,外设设备是通过所述定制输入端点,将数据发送给通信驱动程序;且外设设备是通过定制输出端点,从通信驱动程序中获取数据的。Wherein, 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.
在一种实施方式中,交互数据是在外设设备处于定制通信模式下传输的;In one embodiment, the interactive data is transmitted while the peripheral device is in a customized communication mode;
其中,外设设备是在通过定制输出端点,获取到游戏应用发送的心跳指令的情况下,维持在定制通信模式下工作的。Among them, the peripheral device maintains working in the customized communication mode after obtaining the heartbeat command sent by the game application through the customized output endpoint.
基于同一发明构思,本申请实施例中提供的电子设备解决问题的原理与有益效果与本申请方法实施例中数据传输方法解决问题的原理和有益效果相似,可以参见方法的实施的原理和有益效果,为简洁描述,在这里不再赘述。Based on the same inventive concept, the principles and beneficial effects of solving problems by the electronic equipment provided in the embodiments of the present application are similar to the principles and beneficial effects of solving the problems by the data transmission method in the method embodiments of the present application. Please refer to the principles and beneficial effects of the implementation of the method. , for the sake of concise description, we will not go into details here.
本申请实施例还提供一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。电子设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该电子设备执行上述数据传输方法。Embodiments of the present application also provide a computer program product or computer program. The computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the above data transmission method.
本领域普通技术人员可以意识到,结合本申请中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用,使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementations should not be considered to be beyond the scope of this application.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程设备。计算机指令可以存储在计算机可读存储介质中,或者通过计算机可读存储介质进行传输。计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如,同轴电缆、光纤、数字用户线(DSL))或无线(例如,红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(Solid State Disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. A computer program product includes one or more computer instructions. When computer program instructions are loaded and executed on a computer, processes or functions described in accordance with embodiments of the present invention are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. Computer instructions may be stored in or transmitted over a computer-readable storage medium. Computer instructions may be transmitted from one website, computer, server, or data center to another website by wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. , computer, server or data center for transmission. Computer-readable storage media can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or other integrated media that contains one or more available media. Available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), etc.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。 The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present invention. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (18)

  1. 一种数据传输方法,包括:A data transmission method including:
    当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;所述终端通过内部的通信驱动程序收发数据,所述外设通信协议是按照所述通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的;When interactive data needs to be transmitted between the game application in the terminal and the peripheral device, the peripheral communication protocol is obtained; the terminal sends and receives data through the internal communication driver, and the peripheral communication protocol is in accordance with the communication driver Data transmission specifications, customized for communication between the game application and the peripheral device;
    使用所述外设通信协议并通过所述通信驱动程序,在所述游戏应用和所述外设设备之间传输所述交互数据。The interactive data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  2. 如权利要求1所述的方法,其中,所述使用所述外设通信协议并通过所述通信驱动程序,在所述游戏应用和所述外设设备之间传输所述交互数据,包括:The method of claim 1, wherein said transmitting the interactive data between the game application and the peripheral device using the peripheral communication protocol and through the communication driver includes:
    采用所述外设通信协议对所述交互数据进行封装处理,得到封装数据;Using the peripheral communication protocol to encapsulate the interactive data to obtain encapsulated data;
    将所述封装数据发送到所述通信驱动程序中,以使数据接收方从所述通信驱动程序中获取所述封装数据;Send the encapsulated data to the communication driver, so that the data recipient obtains the encapsulated data from the communication driver;
    其中,若所述封装数据是由所述游戏应用发送到所述通信驱动程序中的,则所述数据接收方是指所述外设设备;若所述封装数据是由所述外设设备发送到所述通信驱动程序中的,则所述数据接收方是指所述游戏应用。Wherein, if the encapsulated data is sent to the communication driver by the game application, the data recipient refers to the peripheral device; if the encapsulated data is sent by the peripheral device into the communication driver, then the data recipient refers to the game application.
  3. 如权利要求2所述的方法,其中,所述外设通信协议中规定了一种或多种数据类型所对应的信息结构;所述采用所述外设通信协议对所述交互数据进行封装处理,得到封装数据,包括:The method of claim 2, wherein the peripheral communication protocol specifies information structures corresponding to one or more data types; and the interaction data is encapsulated using the peripheral communication protocol. , get the encapsulated data, including:
    确定所述交互数据的数据类型;Determine the data type of the interactive data;
    在所述外设通信协议中查询所述交互数据的数据类型所对应的信息结构,作为目标信息结构;Query the information structure corresponding to the data type of the interactive data in the peripheral communication protocol as the target information structure;
    将所述交互数据写入所述目标信息结构中,得到封装数据。The interactive data is written into the target information structure to obtain encapsulated data.
  4. 如权利要求1-3任一项所述的方法,其中,所述方法由所述游戏应用执行,所述通信驱动程序中包括所述外设设备的一个或多个通信接口的接口声明;所述方法还包括:The method according to any one of claims 1 to 3, wherein the method is executed by the game application, and the communication driver includes interface declarations of one or more communication interfaces of the peripheral device; The above methods also include:
    从所述通信驱动程序中扫描所述外设设备的各个通信接口的接口声明,在得到的各个接口声明中查找指定协议标识,所述指定协议标识为外设通信协议的标识;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, where the specified protocol identifier is the identifier of the peripheral communication protocol;
    若在至少一个所述接口声明中查找到所述指定协议标识,则将所述指定协议标识所标识的通信协议确定为外设通信协议。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 a peripheral communication protocol.
  5. 如权利要求4所述的方法,其中,所述交互数据包括用于查询所述外设设备的设备信息的信息查询请求,所述设备信息至少包括所述外设设备所支持的特性信息;所述方法还包括:The method of claim 4, wherein the interaction data includes an information query request for querying device information of the peripheral device, and the device information at least includes feature information supported by the peripheral device; The above methods also include:
    在所述通信驱动程序中存在所述外设设备发送的反馈结果后,从所述通信驱动程序中获取所述反馈结果;所述反馈结果是由所述外设设备响应于所述信息查询请求,采用所述外设通信协议对所述设备信息进行封装处理所得到的;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 in response to the information query request , obtained by encapsulating the device information using the peripheral communication protocol;
    根据所述外设通信协议对所述反馈结果进行解封装处理,得到所述外设设备的设备信息。Decapsulate the feedback result according to the peripheral communication protocol to obtain device information of the peripheral device.
  6. 如权利要求5所述的方法,其中,所述特性信息用于指示所述外设设备的至少一种设备能力;所述方法还包括:The method of claim 5, wherein the characteristic information is used to indicate at least one device capability of the peripheral device; the method further includes:
    若接收到所述外设设备发送的输入指令,则确定外设设备生成所述输入指令所需使用的第一设备能力;If an input instruction sent by the peripheral device is received, determine the first device capability required by the peripheral device to generate the input instruction;
    采用所述第一设备能力对所述特性信息所指示的至少一种设备能力进行能力命中匹配,以得到能力命中匹配结果,所述能力命中匹配是指在所述特性信息所指示的至少一种设备能力中查询是否存在所述第一设备能力;Using the first device capability to perform capability hit matching on at least one device capability indicated by the characteristic information to obtain a capability hit matching result, where the capability hit matching refers to at least one device capability indicated by the characteristic information. Query whether the first device capability exists in the device capabilities;
    根据能力命中匹配结果对所述输入指令进行有效性检测;其中,若所述第一设备能力属于所述至少一种设备能力中的一种,则所述输入指令被确定为有效指令。 The input instruction is tested for validity according to the capability hit matching result; wherein, if the first device capability belongs to one of the at least one device capability, the input instruction is determined to be a valid instruction.
  7. 如权利要求4所述的方法,其中,所述交互数据包括外设控制指令,所述方法还包括:The method of claim 4, wherein the interaction data includes peripheral control instructions, the method further comprising:
    若检测到需控制所述外设设备执行游戏反馈操作,则获取所述外设设备支持的特性信息,所述特性信息用于指示所述外设设备的至少一种设备能力;If it is detected that the peripheral device needs to be controlled to perform a game feedback operation, the characteristic information supported by the peripheral device is obtained, and the characteristic information is used to indicate at least one device capability of the peripheral device;
    在所述特性信息所指示的至少一种设备能力中查找目标设备能力,所述目标设备能力是指:用于支持所述外设设备执行所述游戏反馈操作的设备能力;Search for a target device capability in at least one device capability indicated by the characteristic information, where the target device capability refers to: a device capability used to support the peripheral device to perform the game feedback operation;
    若查找到所述目标设备能力,则生成用于控制所述外设设备执行所述游戏反馈操作的外设控制指令。If the target device capability is found, a peripheral control instruction for controlling the peripheral device to perform the game feedback operation is generated.
  8. 如权利要求7所述的方法,其中,所述外设设备中包括一个或多个振动装置,所述游戏反馈操作包括第一振动操作;所述方法还包括:The method of claim 7, wherein the peripheral device includes one or more vibration devices, and the game feedback operation includes a first vibration operation; the method further includes:
    在所述游戏应用运行游戏的过程中,若检测到所述游戏的游戏画面中存在振动对象,则将用于控制所述外设设备中的默认振动装置进行振动的操作,确定为所述第一振动操作;While the game application is running the game, if a vibration object is detected in the game screen of the game, the operation used to control the default vibration device in the peripheral device to vibrate is determined as the third a vibration operation;
    或者,根据所述振动对象在所述游戏画面中的位置,以及所述外设设备中的各个振动装置的位置信息,从所述外设设备中选取目标振动装置,并将用于控制所述目标振动装置进行振动的操作,确定为所述第一振动操作。Or, according to the position of the vibration 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 used to control the The target vibration device performs a vibration operation, which is determined to be the first vibration operation.
  9. 如权利要求4所述的方法,其中,所述游戏应用运行在所述终端的操作系统上,且在所述外设设备处于定制通信模式下,所述操作系统支持所述外设设备和所述游戏应用通过使用所述外设通信协议传输任一数据;The method of claim 4, wherein the game application runs on an operating system of the terminal, and when the peripheral device is in a customized communication mode, the operating system supports the peripheral device and all The game application transmits any data by using the peripheral communication protocol;
    其中,所述交互数据包括模式切换命令,所述模式切换命令用于命令所述外设设备将通信模式切换至所述定制通信模式,以使所述外设设备在所述游戏应用运行游戏的过程中,使用所述外设通信协议进行数据传输;Wherein, the interactive data includes a mode switching command, the mode switching command is used to command the peripheral device to switch the communication mode to the customized communication mode, so that the peripheral device can be used when the game application is running the game. During the process, the peripheral communication protocol is used for data transmission;
    所述方法还包括:The method also includes:
    检测所述操作系统是否支持通过所述外设通信协议和所述通信驱动程序传输所述模式切换命令;Detect whether the operating system supports transmitting the mode switching command through the peripheral communication protocol and the communication driver;
    若支持,则触发执行所述获取外设通信协议的步骤;If supported, trigger the execution of the step of obtaining the peripheral communication protocol;
    若不支持,则生成振动序列,所述振动序列用于触发所述外设设备执行所述模式切换命令;将所述振动序列和所述交互数据发送给所述操作系统的管理模块,以使所述管理模块通过所述通信驱动程序,将所述振动序列和所述交互数据转发给所述外设设备。If it is not supported, generate a vibration sequence, which is used to trigger the peripheral device to execute the mode switching command; send the vibration sequence and the interaction data to the management module of the operating system, so that The management module forwards the vibration sequence and the interaction data to the peripheral device through the communication driver.
  10. 如权利要求1-3任一项所述的方法,其中,所述方法由所述外设设备执行,所述方法还包括:The method according to any one of claims 1-3, wherein the method is performed by the peripheral device, and the method further includes:
    在所述游戏应用运行游戏的过程中,若检测到所述游戏的操作对象输入的目标操作,则根据所述目标操作生成输入信号作为交互数据;While the game application is running the game, if a target operation input by the operating object of the game is detected, an input signal is generated as interactive data based on the target operation;
    其中,所述游戏应用在获取到所述交互数据后,根据所述交互数据对所述游戏的游戏画面进行更新。Wherein, after acquiring the interaction data, the game application updates the game screen of the game according to the interaction data.
  11. 如权利要求1-3任一项所述方法,其中,所述方法由所述外设设备执行,所述方法还包括:The method according to any one of claims 1-3, wherein the method is executed by the peripheral device, and the method further includes:
    在所述外设设备的运行过程中,获取所述外设设备的设备电量;During the operation of the peripheral device, obtain the device power of the peripheral device;
    若所述设备电量小于电量阈值,则生成电量预警信号作为交互数据;If the power of the device is less than the power threshold, a power warning signal is generated as interactive data;
    其中,所述游戏应用在获取到所述交互数据后,根据所述交互数据生成电量预警信息,并在所述游戏应用的应用界面中显示所述电量预警信息。Wherein, after acquiring the interactive data, the game application generates power warning information based on the interactive data, and displays the power warning information in an application interface of the game application.
  12. 如权利要求1-3任一项所述的方法,其中,所述外设设备包括基于所述外设通信协议所定制的定制通信接口,所述定制通信接口包括定制输入端点和定制输出端点;The method according to any one of claims 1 to 3, wherein the peripheral device includes a customized communication interface customized based on the peripheral communication protocol, and the customized communication interface includes a customized input endpoint and a customized output endpoint;
    其中,所述外设设备是通过所述定制输入端点,将数据发送给所述通信驱动程序;且所述外设设备是通过所述定制输出端点,从所述通信驱动程序中获取数据的。Wherein, 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.
  13. 如权利要求12所述的方法,其中,所述交互数据是在所述外设设备处于定制通信模式下传输 的;The method of claim 12, wherein the interactive data is transmitted when the peripheral device is in a customized communication mode. of;
    其中,所述外设设备是在通过所述定制输出端点,获取到所述游戏应用发送的心跳指令的情况下,维持在所述定制通信模式下工作的。Wherein, the peripheral device maintains working in the customized communication mode after obtaining the heartbeat command sent by the game application through the customized output endpoint.
  14. 如权利要求1-13中任一项所述的方法,其中,所述交互数据为在所述外设设备配置有新增的硬件结构的情况下,所述终端中操作系统的管理模块不支持转发的所述硬件结构相关的数据,所述硬件结构用于执行与游戏应用有关的交互操作,所述转发为:由管理模块接收到游戏应用和所述外设设备中的发送方的数据后,向游戏应用和所述外设设备中的接收方发送接收到的数据。The method according to any one of claims 1 to 13, wherein the interactive data is that when the peripheral device is configured with a new hardware structure, the management module of the operating system in the terminal does not support The forwarded data related to the hardware structure, the hardware structure is used to perform interactive operations related to the game application, the forwarding is: after the management module receives the data of the sender in the game application and the peripheral device , sending the received data to the receiver in the game application and the peripheral device.
  15. 一种数据传输装置,包括:A data transmission device including:
    获取单元,用于当终端中的游戏应用和外设设备之间需传输交互数据时,获取外设通信协议;所述终端通过内部的通信驱动程序收发数据,所述外设通信协议是按照所述通信驱动程序的数据传输规范,为所述游戏应用和所述外设设备之间的通信定制的;The acquisition unit is used to acquire the peripheral communication protocol when interactive data needs to be transmitted between the game application in the terminal and the peripheral device; the terminal sends and receives data through the internal communication driver, and the peripheral communication protocol is in accordance with the required The data transmission specification of the communication driver is customized for the communication between the game application and the peripheral device;
    使用所述外设通信协议并通过所述通信驱动程序,在所述游戏应用和所述外设设备之间传输所述交互数据。The interactive data is transmitted between the game application and the peripheral device using the peripheral communication protocol and through the communication driver.
  16. 一种电子设备,包括:An electronic device including:
    处理器,适于执行计算机程序;A processor adapted to execute a computer program;
    计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序被所述处理器执行时,实现如权利要求1-14任一项所述的数据传输方法。A computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, the data transmission method according to any one of claims 1-14 is implemented.
  17. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序适于由处理器加载并执行如权利要求1-14任一项所述的数据传输方法。A computer-readable storage medium stores a computer program, and the computer program is adapted to be loaded by a processor and execute the data transmission method according to any one of claims 1-14.
  18. 一种计算机程序产品,存储有一条或多条指令,所述一条或多条指令适于由处理器加载并执行如权利要求1-14任一项所述的方法。 A computer program product storing one or more instructions, the one or more instructions being suitable for being loaded by a processor and executing the method according to any one of claims 1-14.
PCT/CN2023/090483 2022-04-29 2023-04-25 Data transmission method and apparatus, and electronic device, storage medium and program product WO2023207941A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210466211.9A CN117012017A (en) 2022-04-29 2022-04-29 Data transmission method, device, equipment and medium
CN202210466211.9 2022-04-29

Publications (1)

Publication Number Publication Date
WO2023207941A1 true WO2023207941A1 (en) 2023-11-02

Family

ID=88517796

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/090483 WO2023207941A1 (en) 2022-04-29 2023-04-25 Data transmission method and apparatus, and electronic device, storage medium and program product

Country Status (2)

Country Link
CN (1) CN117012017A (en)
WO (1) WO2023207941A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004025582A1 (en) * 2002-09-13 2004-03-25 Igt Usb device protocol for a gaming machine
CN1677378A (en) * 2004-03-31 2005-10-05 微软公司 Multi-system game controller that operates in multiple USB modes
WO2006039134A2 (en) * 2004-10-01 2006-04-13 Wms Gaming Inc. System and method for converting gaming peripheral communication
CN102780862A (en) * 2011-05-12 2012-11-14 青岛海信电器股份有限公司 Remote control data transmission method for television and interaction device
CN106075902A (en) * 2016-06-14 2016-11-09 广州小鸡快跑网络科技有限公司 Game paddle, the game control method connected based on BLE and device
CN112090061A (en) * 2020-09-16 2020-12-18 深圳未来游戏设备科技有限公司 Game peripheral mode adjusting method aiming at Bluetooth communication protocol

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004025582A1 (en) * 2002-09-13 2004-03-25 Igt Usb device protocol for a gaming machine
CN1677378A (en) * 2004-03-31 2005-10-05 微软公司 Multi-system game controller that operates in multiple USB modes
WO2006039134A2 (en) * 2004-10-01 2006-04-13 Wms Gaming Inc. System and method for converting gaming peripheral communication
CN102780862A (en) * 2011-05-12 2012-11-14 青岛海信电器股份有限公司 Remote control data transmission method for television and interaction device
CN106075902A (en) * 2016-06-14 2016-11-09 广州小鸡快跑网络科技有限公司 Game paddle, the game control method connected based on BLE and device
CN112090061A (en) * 2020-09-16 2020-12-18 深圳未来游戏设备科技有限公司 Game peripheral mode adjusting method aiming at Bluetooth communication protocol

Also Published As

Publication number Publication date
CN117012017A (en) 2023-11-07

Similar Documents

Publication Publication Date Title
JP6312877B2 (en) Method, apparatus and system for intelligently controlling a device and plug and play device
US11213743B2 (en) Method, system and electronic device for achieving remote control of computer game by game controller
US10773161B2 (en) Mobile phone game interface
CN105611364B (en) Method, device and system for interaction between portable digital equipment and large screen
WO2019001347A1 (en) Screen projection method for mobile device, storage medium, terminal and screen projection system
WO2022188595A1 (en) Method and apparatus for displaying application picture, and terminal, screen projection system and medium
CN104823180B (en) Distributed Synergy user interface and application projection
TWI487362B (en) Method of modifying interface of a handheld device and related multimedia system
JP2006343884A (en) Screen display program, computer-readable storage medium storing screen display program, screen display device, portable terminal device and screen display method
CN114339332B (en) Mobile terminal, display device and cross-network screen projection method
KR20210146919A (en) Game controller capable of operating in Bluetooth Low Energy (BLE) mode
JP5930390B2 (en) Information processing apparatus and information processing system
CN112245904B (en) Method, system, storage medium and computer device for supporting cross-service game
AU2013388030B2 (en) Method, apparatus, and system for intelligently controlling device, and plug-and-play device
US20150363188A1 (en) Information Processing Device and Information Processing System
CN114007143A (en) Information interaction method, device and equipment, computer storage medium and program product
CN111880845A (en) Method, system and device for controlling target application
WO2023207941A1 (en) Data transmission method and apparatus, and electronic device, storage medium and program product
WO2024082906A1 (en) Information acquisition method and apparatus, bluetooth device, terminal device, and storage medium
WO2024051148A1 (en) Cloud game control method and apparatus, electronic device, and storage medium
WO2023001086A1 (en) Device control method and apparatus based on cloud application, and electronic device and readable medium
CN115837159A (en) Virtual handle control method based on android device and storage medium
WO2023173838A1 (en) Virtual scene loading method and apparatus, device, computer-readable storage medium, and computer program product
JP2009070412A (en) Screen display program, computer-readable storage medium storing screen display program, screen display device, movie terminal device, and screen display method
WO2015101340A1 (en) Function activation method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23795374

Country of ref document: EP

Kind code of ref document: A1