CN114490485B - Virtual object control method, system, medium and terminal - Google Patents
Virtual object control method, system, medium and terminal Download PDFInfo
- Publication number
- CN114490485B CN114490485B CN202210082790.7A CN202210082790A CN114490485B CN 114490485 B CN114490485 B CN 114490485B CN 202210082790 A CN202210082790 A CN 202210082790A CN 114490485 B CN114490485 B CN 114490485B
- Authority
- CN
- China
- Prior art keywords
- sensor
- data
- sensor data
- virtual reality
- encrypted
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 25
- 230000005540 biological transmission Effects 0.000 claims abstract description 18
- 238000004891 communication Methods 0.000 claims description 27
- 238000004364 calculation method Methods 0.000 claims description 9
- 238000012795 verification Methods 0.000 claims description 6
- 238000004458 analytical method Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000007654 immersion Methods 0.000 description 1
- 238000002513 implantation Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/606—Protecting data by securing the transmission between two devices or processes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/011—Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/163—In-band adaptation of TCP data exchange; In-band control procedures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Human Computer Interaction (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention relates to a virtual object control method, a system, a medium and a terminal, wherein the method is applied to a virtual reality data receiving end and comprises the following steps: receiving encrypted sensor data sent by each of a plurality of sensor data reading terminals, wherein data transmission is carried out between a virtual reality data receiving terminal and the sensor data reading terminal through a TCP protocol, TCP protocol addresses established between different sensor data reading terminals and the virtual reality data receiving terminal are different, and the sensor data reading terminal reads data acquired by a sensor through a USB HID protocol; analyzing the encrypted sensor data aiming at each encrypted sensor data to obtain speed data and direction data acquired by the sensor; and controlling the movement and the steering of the virtual object under the virtual reality equipment according to the speed data and the direction data. Through the scheme, the virtual object is controlled according to the data acquired by the plurality of sensors, so that the control accuracy and precision can be improved, and the data safety is improved.
Description
Technical Field
The invention relates to the technical field of virtual reality, in particular to a virtual object control method, a virtual object control system, a virtual object control medium and a virtual object control terminal.
Background
The Virtual Reality technology (VR) is a brand new practical technology, and comprises a computer, electronic information and simulation technology, and the basic implementation mode is that the computer simulates a Virtual environment so as to bring the sense of environmental immersion to people. With the continuous development of social productivity and scientific technology, VR technology is increasingly required by various industries, and VR technology is greatly improved and gradually becomes a new scientific and technical field. In the related art, the sensor data is generally directly read under the VR client, and data transmission of multiple sensors cannot be realized.
Disclosure of Invention
The invention aims to provide a virtual object control method, a virtual object control system, a virtual object control medium and a virtual object control terminal, so as to improve the accuracy and precision of virtual object control.
In order to achieve the above object, in a first aspect, the present invention provides a virtual object control method, applied to a virtual reality data receiving end, the method comprising:
receiving encrypted sensor data sent by each of a plurality of sensor data reading terminals, wherein data transmission is carried out between the virtual reality data receiving terminal and the sensor data reading terminal through a TCP protocol, TCP protocol addresses established between different sensor data reading terminals and the virtual reality data receiving terminal are different, and the sensor data reading terminal reads data acquired by a sensor through a USB HID protocol;
analyzing the encrypted sensor data aiming at each encrypted sensor data to obtain speed data and direction data acquired by a sensor;
and controlling the movement and steering of the virtual object under the virtual reality equipment according to the speed data and the direction data.
Optionally, the sensor data reading end generates and transmits the encrypted sensor data by:
reading speed data and direction data acquired by a sensor for establishing USB HID connection at intervals of preset time;
judging whether TCP connection with the virtual reality data receiving end is normal or not;
under the condition of normal connection, splicing a preset prefix encryption header, a sensor data byte length, sensor speed data and direction data, a preset data byte length and a preset data byte to obtain encrypted sensor data, and sending the encrypted sensor data to a virtual reality data receiving end through TCP connection.
Optionally, the sensor data reading end and the sensor establish USB HID communication by the following method:
judging whether the sensor equipment path is stored or not;
under the condition that the sensor equipment path is not stored, acquiring a supplier identification code and a product identification code of the sensor, reading a connection signal of the sensor through the supplier identification code and the product identification code, opening USB HID communication connection of the sensor if the connection signal of the sensor accords with the connection signal of the designated sensor number, and acquiring and storing the sensor equipment path;
under the condition that the sensor equipment path is stored, judging whether the sensor USB HID signal can be normally opened, and under the condition that the sensor USB HID signal can be normally opened, determining that USB HID communication is established between the sensor data reading end and the sensor.
Optionally, the parsing the encrypted sensor data to obtain speed data and direction data collected by the sensor includes:
intercepting a preset prefix encryption header from the encrypted sensor data;
and under the condition that the intercepted preset prefix encryption header passes verification, continuously intercepting speed data and direction data acquired by a sensor from the encrypted sensor data.
Optionally, the controlling the movement and steering of the virtual object under the virtual reality device according to the speed data and the direction data includes:
vector multiplication is carried out on the direction data acquired by the sensor and helmet direction data of the virtual reality equipment, and the steering of the virtual object is controlled according to a vector multiplication result;
taking the speed data acquired by the sensor as the speed of the virtual object, adopting a movement calculation mode of each frame of object in Unity, carrying out product calculation on the movement direction and movement speed of the object and the time interval difference of each frame to obtain the movement data quantity of the virtual object of each frame, and taking the movement result as the actual coordinates and rotation value of the virtual object so as to control the movement of the virtual object.
In a second aspect, the present invention provides a virtual object control system, where the system includes a virtual reality data receiving end and a plurality of sensor data reading ends, and the virtual reality data receiving end includes a receiving module, an analyzing module, and a control module;
the receiving module is used for receiving encrypted sensor data sent by each of a plurality of sensor data reading ends, wherein data transmission is carried out between the virtual reality data receiving end and the sensor data reading end through a TCP protocol, TCP protocol addresses established between different sensor data reading ends and the virtual reality data receiving end are different, and the sensor data reading end reads data acquired by a sensor through a USB HID protocol;
the analysis module is used for analyzing the encrypted sensor data aiming at each encrypted sensor data to obtain speed data and direction data acquired by the sensor;
and the control module is used for controlling the movement and the steering of the virtual object under the virtual reality equipment according to the speed data and the direction data.
Optionally, the sensor data reading end generates and transmits the encrypted sensor data through the following modules:
the reading module is used for reading the speed data and the direction data acquired by the sensor for establishing the USB HID connection at intervals of preset time;
the first judging module is used for judging whether TCP connection with the virtual reality data receiving end is normal or not;
and the sending module is used for splicing the preset prefix encryption header, the sensor data byte length, the sensor speed data and direction data, the preset data byte length and the preset data byte under the condition of normal connection to obtain the encrypted sensor data, and sending the encrypted sensor data to the virtual reality data receiving end through TCP connection.
Optionally, the sensor data reading end and the sensor establish USB HID communication through the following modules:
the second judging module is used for judging whether the sensor equipment path is stored or not;
the storage module is used for acquiring a supplier identification code and a product identification code of the sensor under the condition that the sensor equipment path is not stored, reading a connection signal of the sensor through the supplier identification code and the product identification code, opening USB HID communication connection of the sensor if the connection signal of the sensor accords with the connection signal of the designated sensor number, and acquiring and storing the sensor equipment path;
the determining module is used for judging whether the sensor USB HID signal can be normally opened or not under the condition that the sensor equipment path is stored, and determining that USB HID communication is established between the sensor data reading end and the sensor under the condition that the sensor USB HID signal can be normally opened.
In a third aspect, the present invention provides a readable storage medium having stored thereon a program which, when executed by a processor, implements the steps of the virtual object control method as provided in the first aspect of the present invention.
In a fourth aspect, the present invention provides a control terminal, including a memory for storing a program and a processor for executing the program to implement the steps of the virtual object control method as provided in the first aspect of the present invention.
Through the technical scheme, the virtual reality data receiving end can simultaneously receive the encrypted sensor data sent by the sensor data reading ends, the transmission of the sensor data can be realized, and meanwhile, the control of the virtual object is carried out according to the data acquired by the sensors, so that the control accuracy and precision can be improved. And the data transmission is carried out between the virtual reality data receiving end and the sensor data reading end through a TCP protocol, the sensor data reading end reads the data acquired by the sensor through a USB HID protocol, the sensor data is read by a plurality of sensor data reading ends based on the USB HID serial communication data reading and TCP communication protocol connection, and the sensor data is transmitted to the same virtual reality data receiving end through the TCP protocol, so that the control of the virtual object according to the plurality of sensor data is realized. Meanwhile, the encrypted sensor data is transmitted, so that the multi-sensor data can be well read and transmitted, malicious data can be prevented from being implanted, and the data security is improved.
Drawings
Fig. 1 is a flowchart of a virtual object control method provided according to an exemplary embodiment.
FIG. 2 is a logic diagram of sensor data reading and transmission.
Fig. 3 is a logic diagram of a data parsing flow at the receiving end of virtual reality data.
Fig. 4 is an interaction diagram between a virtual data receiving end and a sensor data reading end.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a flowchart of a virtual object control method according to an exemplary embodiment, which may be applied to a virtual reality data receiving end, and the virtual reality data receiving end may be integrated in a virtual reality device, such as a VR device, a smart helmet, or the like. As shown in fig. 1, the method may include steps 11 to 13.
In step 11, encrypted sensor data transmitted from each of the plurality of sensor data reading terminals is received.
In step 12, the encrypted sensor data is parsed for each encrypted sensor data to obtain speed data and direction data collected by the sensor.
In step 13, the virtual object under the virtual reality device is controlled to move and turn according to the speed data and the direction data.
The data transmission is carried out between the virtual reality data receiving end and the sensor data reading end through a TCP protocol, TCP protocol addresses established between different sensor data reading ends and the virtual reality data receiving end are different, and the sensor data reading end reads data acquired by the sensor through a USB HID protocol. The TCP protocol, the transmission control protocol (TCP, transmission Control Protocol), is a connection-oriented, reliable, byte-stream-based transport layer communication protocol, USB-HID being an abbreviation of Universal Serial Bus-Human Interface Device.
The sensor data reading end reads data acquired by the sensor through a USB HID protocol, the sensor data reading can be realized without installing a driver, the TCP transmission protocol has the characteristics of complete, reliable and timely data transmission, the sensor data is uniformly transmitted to the virtual reality data receiving end through the TCP protocol, signals of a plurality of sensors can be received in the virtual reality data receiving end, and the movement and steering control of a virtual object in the virtual reality equipment can be realized.
Through the technical scheme, the virtual reality data receiving end can simultaneously receive the encrypted sensor data sent by the sensor data reading ends, the transmission of the sensor data can be realized, and meanwhile, the control of the virtual object is carried out according to the data acquired by the sensors, so that the control accuracy and precision can be improved. And the data transmission is carried out between the virtual reality data receiving end and the sensor data reading end through a TCP protocol, the sensor data reading end reads the data acquired by the sensor through a USB HID protocol, the sensor data is read by a plurality of sensor data reading ends based on the USB HID serial communication data reading and TCP communication protocol connection, and the sensor data is transmitted to the same virtual reality data receiving end through the TCP protocol, so that the control of the virtual object according to the plurality of sensor data is realized. Meanwhile, the encrypted sensor data is transmitted, so that the multi-sensor data can be well read and transmitted, malicious data can be prevented from being implanted, and the data security is improved.
In one embodiment, the sensor data reader may generate and transmit encrypted sensor data by:
reading speed data and direction data acquired by a sensor for establishing USB HID connection at intervals of preset time;
judging whether TCP connection with the virtual reality data receiving end is normal or not;
under the condition of normal connection, splicing a preset prefix encryption header, a sensor data byte length, sensor speed data and direction data, a preset data byte length and a preset data byte to obtain encrypted sensor data, and sending the encrypted sensor data to a virtual reality data receiving end through TCP connection.
The preset duration may be preset, for example, by establishing a timer in the window application program to read data every preset duration. The preset prefix encryption header is a preset appointed prefix header and is used for encrypting data, malicious data implantation in the data transmission process is prevented, and meanwhile correct judgment of the data type is guaranteed. For example, the sensor data byte length and the preset data byte length may be set to 4 or 8 byte lengths by convention, without limitation.
In one embodiment, USB HID communication is established between the sensor data reader and the sensor by:
judging whether the sensor equipment path is stored or not;
under the condition that the sensor equipment path is not stored, acquiring a supplier identification code and a product identification code of the sensor, reading a connection signal of the sensor through the supplier identification code and the product identification code, if the connection signal of the sensor accords with the connection signal of the designated sensor number, opening USB HID communication connection of the sensor, and acquiring and storing the sensor equipment path;
under the condition that the sensor equipment path is stored, judging whether the sensor USB HID signal can be normally opened, and under the condition that the sensor USB HID signal can be normally opened, determining that USB HID communication is established between the sensor data reading end and the sensor.
Fig. 2 is a logic diagram for reading and sending sensor data, which can be applied to a sensor data reading end, as shown in fig. 2, a window of a Windows Form system, wherein USB sensor hardware is inserted into a sensor data reading end device, and USB HID data can be read by writing a plug-in library through a window Form application program. The WinForm program may be used for timer timing behavior, i.e., reading sensor data every preset time period as described above, and reading USB HID data. When USB HID data is read, whether a sensor device path is stored or not can be judged firstly, if not, a vendor identification code and a product identification code of a sensor are obtained, each USB device comprises a PID (vendor identification code) and a VID (product identification code) according to the specification of a USB universal serial bus protocol, USB connection signals are read through the PID and the VID, signals of all USB communication connections connected on the current device are checked, connection signals conforming to a specified sensor number are traversed, the USB HID communication connection is opened, a corresponding device path is obtained, and the corresponding device path is stored in a local cache for quick opening of the sensor when the device is operated again later. After the sensor USB signal is opened, the sensor data with corresponding numbers can be read, wherein the sensor data can comprise direction data and speed data, the data type is byte data, and the data reading and the data sending are performed by establishing a timer in the window application program. If the equipment path is stored, whether the USB HID signal of the sensor can be normally opened can be judged, if the USB HID signal can be normally opened, the USB HID communication can be established between the sensor data reading end and the sensor, the USB HID communication reading can be opened, and the reading of the sensor direction and the speed byte data can be carried out. And judging whether TCP connection with the virtual reality data receiving end is normal or not, if so, splicing the preset prefix encryption header, the sensor data byte length, the sensor speed data and direction data, the preset data byte length and the preset data byte to obtain encrypted sensor data, namely TCP protocol data shown in fig. 2, and then sending the spliced data to the virtual reality data receiving end.
In one embodiment, the parsing the encrypted sensor data in step 12 to obtain the speed data and the direction data collected by the sensor may include:
intercepting a preset prefix encryption header from encrypted sensor data;
and under the condition that the intercepted preset prefix encryption header passes verification, continuously intercepting speed data and direction data acquired by the sensor from the encrypted sensor data.
Firstly, verifying an encryption header, preventing malicious data from being implanted, and achieving correct data matching through storage verification and judgment of a data pool object.
In an embodiment, the controlling the movement and the steering of the virtual object under the virtual reality device according to the speed data and the direction data in step 13 may include:
vector multiplication is carried out on the direction data acquired by the sensor and helmet direction data of the virtual reality equipment, and the steering of the virtual object is controlled according to a vector multiplication result;
taking the speed data acquired by the sensor as the speed of the virtual object, adopting a movement calculation mode of each frame of object in Unity, carrying out product calculation on the movement direction and movement speed of the object and the time interval difference of each frame to obtain the movement data quantity of the virtual object of each frame, and taking the movement result as the actual coordinates and rotation value of the virtual object so as to control the movement of the virtual object.
Fig. 3 is a logic diagram of a data parsing flow at the receiving end of virtual reality data. As shown in fig. 3, the Prefix encryption header is a preset Prefix encryption header, and the image bytes may include sensor speed data and direction data, and the custom data byte length is a preset data byte length, and the custom data byte is a preset data byte. When receiving encrypted sensor data, the virtual reality data receiving end firstly intercepts the agreed data encryption header length, judges whether the data encryption header is matched or not, if the data encryption header is not matched, namely, the verification is not passed, the virtual reality data receiving end is finished, and if the data encryption header is not matched, the corresponding byte data length is intercepted continuously, and the corresponding sensor data is obtained. In the case of the correct encrypted header, the example shown in fig. 3 may continue to intercept bytes of 4 or 8 bits in length, which is just an alternative implementation, and is not limiting to the present invention, then converting the length of the int type, i.e. the length of the image bytes, intercept the image byte data of the corresponding length and store it in the data object pool, then intercept bytes of 4 or 8 bits in length, convert the length of the int type, i.e. the length of the custom data bytes, and parse the custom data bytes and store it in the data object pool. The method comprises the steps of analyzing data in a data object pool, carrying out virtual object coordinate assignment calculation, enabling sensor byte data content to comprise speed data and direction data, carrying out vector multiplication on received sensor direction data and helmet direction through judging the helmet direction of VR in a VR client, obtaining a correct moving direction when the sensor interacts, setting a direction vector of a virtual object as a direction after multiplication, enabling the speed of the sensor to be given to the virtual object, calculating the product of the moving direction and moving speed of the object and time interval difference of each frame by using a Unity VR mode, obtaining the moving data quantity of each frame of virtual object, and assigning moving results to actual coordinates and rotating values of the virtual object so as to realize movement of the virtual object. The TCP protocol addresses established by different sensor data reading terminals are different, and the sensor data are sent to the Unity VR client and stored in the data object pool, so that the purpose that one virtual reality terminal receives the sensor data is achieved.
FIG. 4 is an interaction diagram between a virtual data receiving end and a sensor data reading end, wherein an embodiment of the steps has been described above.
Based on the same inventive concept, the invention also provides a virtual object control system, which comprises a virtual reality data receiving end and a plurality of sensor data reading ends, wherein the virtual reality data receiving end comprises a receiving module, an analyzing module and a control module;
the receiving module is used for receiving encrypted sensor data sent by each of a plurality of sensor data reading ends, wherein data transmission is carried out between the virtual reality data receiving end and the sensor data reading end through a TCP protocol, TCP protocol addresses established between different sensor data reading ends and the virtual reality data receiving end are different, and the sensor data reading end reads data acquired by a sensor through a USB HID protocol;
the analysis module is used for analyzing the encrypted sensor data aiming at each encrypted sensor data to obtain speed data and direction data acquired by the sensor;
and the control module is used for controlling the movement and the steering of the virtual object under the virtual reality equipment according to the speed data and the direction data.
Optionally, the sensor data reading end generates and transmits the encrypted sensor data through the following modules:
the reading module is used for reading the speed data and the direction data acquired by the sensor for establishing the USB HID connection at intervals of preset time;
the first judging module is used for judging whether TCP connection with the virtual reality data receiving end is normal or not;
and the sending module is used for splicing the preset prefix encryption header, the sensor data byte length, the sensor speed data and direction data, the preset data byte length and the preset data byte under the condition of normal connection to obtain the encrypted sensor data, and sending the encrypted sensor data to the virtual reality data receiving end through TCP connection.
Optionally, the sensor data reading end and the sensor establish USB HID communication through the following modules:
the second judging module is used for judging whether the sensor equipment path is stored or not;
the storage module is used for acquiring a supplier identification code and a product identification code of the sensor under the condition that the sensor equipment path is not stored, reading a connection signal of the sensor through the supplier identification code and the product identification code, opening USB HID communication connection of the sensor if the connection signal of the sensor accords with the connection signal of the designated sensor number, and acquiring and storing the sensor equipment path;
the determining module is used for judging whether the sensor USB HID signal can be normally opened or not under the condition that the sensor equipment path is stored, and determining that USB HID communication is established between the sensor data reading end and the sensor under the condition that the sensor USB HID signal can be normally opened.
Alternatively, the parsing module may include:
a first interception sub-module, configured to intercept a preset prefix encryption header from the encrypted sensor data;
and the second interception sub-module is used for continuously intercepting the speed data and the direction data acquired by the sensor from the encrypted sensor data under the condition that the intercepted preset prefix encryption header passes verification.
Optionally, the control module may include:
the first control sub-module is used for carrying out vector multiplication on the direction data acquired by the sensor and helmet direction data of the virtual reality equipment, and controlling the steering of the virtual object according to a vector multiplication result;
the second control sub-module is used for taking the speed data acquired by the sensor as the speed of the virtual object, adopting a movement calculation mode of each frame of object in the Unity, carrying out product calculation on the movement direction and the movement speed of the object and the time interval difference of each frame to obtain the movement data quantity of the virtual object of each frame, and taking the movement result as the actual coordinates and the rotation value of the virtual object so as to control the movement of the virtual object.
The present embodiment discloses a readable storage medium having stored thereon a program which, when executed by a processor, implements the steps of the virtual object control method described above. The modules/units integrated by the virtual object control terminal device may be stored in a readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a program to instruct related hardware, where the program may be stored in a readable storage medium, and when the program is executed by a processor, the program may implement the steps of the method embodiments described above. Where the program comprises program code, the program code may be in the form of source code, object code, executable files, or in some intermediate form, etc. The readable medium may include: any entity or device capable of carrying program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a Read-only memory (ROM), a random access memory (RAM, random Access Memory), a software distribution medium, and so forth.
The embodiment also discloses a control terminal, which comprises a memory and a processor, wherein the memory is used for storing a program, and the processor is used for executing the program so as to realize the steps of the virtual object control method.
Further, as an implementation, the processor may be a central processing unit (CentralProcessing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital SignalProcessor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general processor may be a microprocessor or the processor may be any conventional processor, etc., where the processor is a control center of the virtual object control terminal, and connects various parts of the entire virtual object control terminal device using various interfaces and lines.
The memory may be used to store programs and/or modules, and the processor may implement various functions of the virtual object control terminal by running or executing the programs and/or modules stored in the memory, and invoking data stored in the memory. The memory may mainly include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the cellular phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
The present invention is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present invention are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims (6)
1. A virtual object control method, which is applied to a virtual reality data receiving end, the method comprising:
receiving encrypted sensor data sent by each of a plurality of sensor data reading terminals, wherein data transmission is carried out between the virtual reality data receiving terminal and the sensor data reading terminal through a TCP protocol, TCP protocol addresses established between different sensor data reading terminals and the virtual reality data receiving terminal are different, and the sensor data reading terminal reads data acquired by a sensor through a USB HID protocol;
analyzing the encrypted sensor data aiming at each encrypted sensor data to obtain speed data and direction data acquired by a sensor;
according to the speed data and the direction data, controlling movement and steering of a virtual object under virtual reality equipment;
the sensor data reading end generates and transmits the encrypted sensor data by the following modes:
reading speed data and direction data acquired by a sensor for establishing USB HID connection at intervals of preset time;
judging whether TCP connection with the virtual reality data receiving end is normal or not;
under the condition of normal connection, splicing a preset prefix encryption header, a sensor data byte length, sensor speed data and direction data, a preset data byte length and a preset data byte to obtain encrypted sensor data, and sending the encrypted sensor data to the virtual reality data receiving end through TCP connection;
the USB HID communication is established between the sensor data reading end and the sensor by the following modes:
judging whether the sensor equipment path is stored or not;
under the condition that the sensor equipment path is not stored, acquiring a supplier identification code and a product identification code of the sensor, reading a connection signal of the sensor through the supplier identification code and the product identification code, opening USB HID communication connection of the sensor if the connection signal of the sensor accords with the connection signal of the designated sensor number, and acquiring and storing the sensor equipment path;
under the condition that the sensor equipment path is stored, judging whether the sensor USB HID signal can be normally opened, and under the condition that the sensor USB HID signal can be normally opened, determining that USB HID communication is established between the sensor data reading end and the sensor.
2. The method according to claim 1, wherein the parsing the encrypted sensor data to obtain speed data and direction data collected by the sensor comprises:
intercepting a preset prefix encryption header from the encrypted sensor data;
and under the condition that the intercepted preset prefix encryption header passes verification, continuously intercepting speed data and direction data acquired by a sensor from the encrypted sensor data.
3. The virtual object control method according to claim 1, wherein the controlling of the movement and the steering of the virtual object under the virtual reality apparatus according to the speed data and the direction data includes:
vector multiplication is carried out on the direction data acquired by the sensor and helmet direction data of the virtual reality equipment, and the steering of the virtual object is controlled according to a vector multiplication result;
taking the speed data acquired by the sensor as the speed of the virtual object, adopting a movement calculation mode of each frame of object in Unity, carrying out product calculation on the movement direction and movement speed of the object and the time interval difference of each frame to obtain the movement data quantity of the virtual object of each frame, and taking the movement result as the actual coordinates and rotation value of the virtual object so as to control the movement of the virtual object.
4. The virtual object control system is characterized by comprising a virtual reality data receiving end and a plurality of sensor data reading ends, wherein the virtual reality data receiving end comprises a receiving module, an analyzing module and a control module;
the receiving module is used for receiving encrypted sensor data sent by each of a plurality of sensor data reading ends, wherein data transmission is carried out between the virtual reality data receiving end and the sensor data reading end through a TCP protocol, TCP protocol addresses established between different sensor data reading ends and the virtual reality data receiving end are different, and the sensor data reading end reads data acquired by a sensor through a USB HID protocol;
the analysis module is used for analyzing the encrypted sensor data aiming at each encrypted sensor data to obtain speed data and direction data acquired by the sensor;
the control module is used for controlling the movement and the steering of the virtual object under the virtual reality equipment according to the speed data and the direction data;
the sensor data reading end generates and transmits the encrypted sensor data through the following modules:
the reading module is used for reading the speed data and the direction data acquired by the sensor for establishing the USB HID connection at intervals of preset time;
the first judging module is used for judging whether TCP connection with the virtual reality data receiving end is normal or not;
the sending module is used for splicing a preset prefix encryption header, a sensor data byte length, sensor speed data and direction data, a preset data byte length and a preset data byte under the condition that connection is normal to obtain encrypted sensor data, and sending the encrypted sensor data to the virtual reality data receiving end through TCP connection;
the USB HID communication is established between the sensor data reading end and the sensor through the following modules:
the second judging module is used for judging whether the sensor equipment path is stored or not;
the storage module is used for acquiring a supplier identification code and a product identification code of the sensor under the condition that the sensor equipment path is not stored, reading a connection signal of the sensor through the supplier identification code and the product identification code, opening USB HID communication connection of the sensor if the connection signal of the sensor accords with the connection signal of the designated sensor number, and acquiring and storing the sensor equipment path;
the determining module is used for judging whether the sensor USB HID signal can be normally opened or not under the condition that the sensor equipment path is stored, and determining that USB HID communication is established between the sensor data reading end and the sensor under the condition that the sensor USB HID signal can be normally opened.
5. A readable storage medium, on which a program is stored, characterized in that the program, when being executed by a processor, implements the steps of the virtual object control method according to any one of claims 1-3.
6. A control terminal comprising a memory for storing a program and a processor for executing the program to implement the steps of the virtual object control method according to any one of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210082790.7A CN114490485B (en) | 2022-01-24 | 2022-01-24 | Virtual object control method, system, medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210082790.7A CN114490485B (en) | 2022-01-24 | 2022-01-24 | Virtual object control method, system, medium and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114490485A CN114490485A (en) | 2022-05-13 |
CN114490485B true CN114490485B (en) | 2024-02-20 |
Family
ID=81473956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210082790.7A Active CN114490485B (en) | 2022-01-24 | 2022-01-24 | Virtual object control method, system, medium and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114490485B (en) |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103135765A (en) * | 2013-02-20 | 2013-06-05 | 兰州交通大学 | Human motion information capturing system based on micro-mechanical sensor |
CN105652442A (en) * | 2015-12-31 | 2016-06-08 | 北京小鸟看看科技有限公司 | Head-mounted display equipment and interaction method for head-mounted display equipment and intelligent terminal |
CN105898039A (en) * | 2016-03-29 | 2016-08-24 | 乐视控股(北京)有限公司 | Method and system for simulating computer game controller with smart phone |
CN109408128A (en) * | 2018-11-10 | 2019-03-01 | 歌尔科技有限公司 | Split type AR equipment communication means and AR equipment |
CN111318009A (en) * | 2020-01-19 | 2020-06-23 | 张衡 | Somatosensory health entertainment system based on wearable inertial sensing and working method thereof |
CN111438673A (en) * | 2020-03-24 | 2020-07-24 | 西安交通大学 | High-altitude operation teleoperation method and system based on stereoscopic vision and gesture control |
KR20200110998A (en) * | 2019-03-18 | 2020-09-28 | 주식회사 지엘 | Virtual reality interaction hand tracking system using multiple sensors and implementation method thereof |
CN112384755A (en) * | 2018-07-03 | 2021-02-19 | 诺基亚技术有限公司 | Method and apparatus for sensor orientation determination |
US10943395B1 (en) * | 2014-10-03 | 2021-03-09 | Virtex Apps, Llc | Dynamic integration of a virtual environment with a physical environment |
CN113676485A (en) * | 2021-08-27 | 2021-11-19 | 中国电信股份有限公司 | Virtual reality interaction method and device, storage medium and electronic equipment |
CN113856167A (en) * | 2021-09-15 | 2021-12-31 | 郑州航空工业管理学院 | Physical training system and method based on VR technology |
CN113949746A (en) * | 2021-09-07 | 2022-01-18 | 捷开通讯(深圳)有限公司 | Internet of things virtual sensor implementation method and device and intelligent terminal |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10019131B2 (en) * | 2016-05-10 | 2018-07-10 | Google Llc | Two-handed object manipulations in virtual reality |
US11036293B2 (en) * | 2017-12-07 | 2021-06-15 | Flex Ltd. | Method for using fingers to interact with a smart glove worn on a hand |
US11076022B2 (en) * | 2018-12-31 | 2021-07-27 | Lyft, Inc. | Systems and methods for implementing robotics frameworks |
-
2022
- 2022-01-24 CN CN202210082790.7A patent/CN114490485B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103135765A (en) * | 2013-02-20 | 2013-06-05 | 兰州交通大学 | Human motion information capturing system based on micro-mechanical sensor |
US10943395B1 (en) * | 2014-10-03 | 2021-03-09 | Virtex Apps, Llc | Dynamic integration of a virtual environment with a physical environment |
CN105652442A (en) * | 2015-12-31 | 2016-06-08 | 北京小鸟看看科技有限公司 | Head-mounted display equipment and interaction method for head-mounted display equipment and intelligent terminal |
CN105898039A (en) * | 2016-03-29 | 2016-08-24 | 乐视控股(北京)有限公司 | Method and system for simulating computer game controller with smart phone |
CN112384755A (en) * | 2018-07-03 | 2021-02-19 | 诺基亚技术有限公司 | Method and apparatus for sensor orientation determination |
CN109408128A (en) * | 2018-11-10 | 2019-03-01 | 歌尔科技有限公司 | Split type AR equipment communication means and AR equipment |
KR20200110998A (en) * | 2019-03-18 | 2020-09-28 | 주식회사 지엘 | Virtual reality interaction hand tracking system using multiple sensors and implementation method thereof |
CN111318009A (en) * | 2020-01-19 | 2020-06-23 | 张衡 | Somatosensory health entertainment system based on wearable inertial sensing and working method thereof |
CN111438673A (en) * | 2020-03-24 | 2020-07-24 | 西安交通大学 | High-altitude operation teleoperation method and system based on stereoscopic vision and gesture control |
CN113676485A (en) * | 2021-08-27 | 2021-11-19 | 中国电信股份有限公司 | Virtual reality interaction method and device, storage medium and electronic equipment |
CN113949746A (en) * | 2021-09-07 | 2022-01-18 | 捷开通讯(深圳)有限公司 | Internet of things virtual sensor implementation method and device and intelligent terminal |
CN113856167A (en) * | 2021-09-15 | 2021-12-31 | 郑州航空工业管理学院 | Physical training system and method based on VR technology |
Also Published As
Publication number | Publication date |
---|---|
CN114490485A (en) | 2022-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107395614B (en) | Single sign-on method and system | |
CN110351281B (en) | Universal data frame analysis method, device and equipment | |
CN111488166B (en) | Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium | |
CN103927464A (en) | Common validation method, and method, device and system for generating two dimensional code | |
CN101004719A (en) | Embedded system and method for increasing embedded system security | |
EP3035228B1 (en) | Code integrity protection by computing target addresses from checksums | |
CN111797351A (en) | Page data management method and device, electronic equipment and medium | |
CN109376534B (en) | Method and apparatus for detecting applications | |
CN105260644A (en) | INFORMATION PROCESSING APPARATUS and INFORMATION PROCESSING METHOD | |
CN110187986B (en) | Command management method, system, device and computer readable storage medium | |
CN111259364B (en) | Method, device, equipment and storage medium for using national secret encryption card | |
CN112000382B (en) | Linux system starting method and device and readable storage medium | |
CN112668453A (en) | Video identification method and related equipment | |
CN114490485B (en) | Virtual object control method, system, medium and terminal | |
CN112200064B (en) | Image processing method and device, electronic equipment and storage medium | |
CN107145342B (en) | Method and device for processing channel information of application | |
CN110401925A (en) | A kind of generation method and device of communication message | |
CN112395319B (en) | Cache sharing method and device, server and storage medium | |
CN117544334A (en) | Device access method, data exchange method, device and storage medium | |
CN115080147A (en) | H5 page loading method, device, equipment and medium based on artificial intelligence | |
CN114065302A (en) | Data processing method, device, equipment, medium and block chain network | |
CN113722684A (en) | Data tracing method and device, electronic equipment and computer readable storage medium | |
CN112016336A (en) | Method, device, equipment and storage medium for detecting copy card | |
CN111679862A (en) | Cloud host shutdown method and device, electronic equipment and medium | |
CN111179079A (en) | Terminal information acquisition method and device, terminal equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |