Virtual reality seat selection method and device, equipment and storage medium
Through virtual reality technology and WebGL technology, the 3D model of aviation seats is analyzed and rendered, which solves the problem that traditional seat selection methods cannot intuitively display seat details, and improves the user's seat selection experience and decision-making efficiency.
Patent Information
- Application Number
- CN202411428930.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The traditional airline seat selection method cannot intuitively display the actual size, comfort and surrounding environment of the seat, making it difficult for users to make the best choice and the user experience is poor.
Through virtual reality technology, users can obtain seat selection query instructions, query current seat status information, and use WebGL technology to read and parse 3D model files, build rendering data, initialize rendering shaders, perform graphic drawing, and output rendering images to users , providing an immersive seat selection experience.
A more intuitive and convenient seat selection method is realized, improving the user's seat selection experience, allowing users to highly restore the actual seat layout in a virtual environment, including details such as seat spacing, luggage racks, etc.
Smart Images

Figure CN119444949A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of human-computer interaction technology, and in particular to a virtual reality seat selection method, device, equipment and storage medium. Background Art
[0002] VR (Virtual Reality) technology creates an immersive experience by simulating human sensory experience. It uses computer technology to simulate a three-dimensional environment and allows users to interact with it through special equipment (such as VR headsets, controllers, etc.). With the continuous advancement of technology, VR technology has been widely used in entertainment, education, medical care and other fields, bringing great convenience to people's lives and work.
[0003] Currently, aviation has become an important mode of travel for passengers. In addition to traditional factors such as airline brand, aircraft safety, take-off and landing time, and ticket price, passengers are increasingly concerned about the flight experience when flying, including seat comfort, legroom, seat tilt angle and other indicators. However, when carrying out services such as pre-selection of high-quality seats, passengers cannot intuitively feel the extra space advantage brought by the front row seats and often give up related services. Traditional seat selection methods often have problems such as non-intuitive information display and poor user experience. Summary of the invention
[0004] In order to solve the above problems, the present invention proposes a virtual reality seat selection method, device, equipment and storage medium, which provide a more intuitive and convenient seat selection method and improve the user's seat selection experience.
[0005] An embodiment of the present invention provides a virtual reality seat selection method, the method comprising:
[0006] Obtain the user's seat selection query instruction;
[0007] Query the current seat status information according to the seat selection query instruction;
[0008] Acquire a WebGL context according to the seat status information, read a 3D model file in the WebGL context, and parse the 3D model file to extract key data;
[0009] Loading and processing the key data to construct and determine rendering data;
[0010] Initialize the pre-built rendering shader, compile the code, and build the rendering program;
[0011] The rendering data is input into the rendering program for graphics drawing, and a rendering picture is output to the user.
[0012] Preferably, the method further comprises:
[0013] Acquire the seat selection operation instruction fed back by the user through WebSocket technology, and update the seat information in the seat database; or,
[0014] The seat selection operation instruction fed back by the user is obtained through a polling mechanism, and the seat information in the seat database is updated.
[0015] Preferably, obtaining the seat selection query instruction of the user includes:
[0016] Provide instructions and event processing to obtain user interaction operations based on the component development model of Vue.js configured on the front end;
[0017] Determine a seat selection query instruction according to the interactive operation;
[0018] The interactive operations include clicking on a seat, dragging the view, or selecting a flight.
[0019] As a preferred solution, querying the current seat status information according to the seat selection query instruction includes:
[0020] Communicate with the front end through the RESTful API, and query the current seat status information in the preset relational database or NoSQL database according to the seat selection query instruction.
[0021] Preferably, obtaining a WebGL context according to the seat status information, reading a 3D model file in the WebGL context, parsing the 3D model file, and extracting key data includes:
[0022] By selecting the canvas element in the page and calling its getContext'webgl' to obtain the interface for interacting with the graphics hardware, the model format of the 3D model file is determined;
[0023] Get the model file from the preset server through XMLHttpRequest or Fetch API;
[0024] Parsing the model file, and extracting vertex data and face data as the 3D model file according to the rules of the model format;
[0025] Converting the vertex data into a file in a preset format;
[0026] The texture image loaded by the surface data is associated with the vertex data to obtain the key data.
[0027] Preferably, the pre-built rendering shader is initialized, the code is compiled, and the rendering program is constructed, including:
[0028] Use the requestAnimationFrame function to create a continuous animation loop and perform rendering operations in each frame;
[0029] Inside the rendering loop, use the clearColor function to set the color to clear the color buffer, and then use the clear method to clear the color buffer and depth buffer;
[0030] Write a vertex shader that processes the position and color attributes of the vertices, and a fragment shader that calculates the color of each pixel;
[0031] The vertex shader and the fragment shader are combined into the rendering program.
[0032] Preferably, inputting the rendering data into the rendering program for graphics drawing comprises:
[0033] Create and fill the buffer using the createBuffer function or the bufferData function;
[0034] Use the bindBuffer function to bind the buffer and enable the vertex attribute array through the enableVertexAttribArray function;
[0035] Get vertex attribute data from the buffer through the vertexAttribPointer function;
[0036] Use the drawArrays function or the drawElements function to draw graphics according to the rendering data.
[0037] The embodiment of the present invention further provides a virtual reality seat selection device, the device comprising:
[0038] An instruction acquisition module is used to acquire the user's seat selection query instruction;
[0039] A query module, used to query the current seat status information according to the seat selection query instruction;
[0040] A parsing module, used for obtaining a WebGL context according to the seat status information, reading a 3D model file in the WebGL context, and parsing the 3D model file to extract key data;
[0041] A loading module, used for loading and processing the key data, and constructing and determining rendering data;
[0042] The compilation module is used to initialize the pre-built rendering shader, compile the code, and build the rendering program;
[0043] The rendering module is used to input the rendering data into the rendering program to perform graphics drawing and output the rendering picture to the user.
[0044] Preferably, the device further comprises a data synchronization module, which is used to:
[0045] Acquire the seat selection operation instruction fed back by the user through WebSocket technology, and update the seat information in the seat database; or,
[0046] The seat selection operation instruction fed back by the user is obtained through a polling mechanism, and the seat information in the seat database is updated.
[0047] Preferably, the instruction acquisition module is used for:
[0048] Provide instructions and event processing to obtain user interaction operations based on the component development model of Vue.js configured on the front end;
[0049] Determine a seat selection query instruction according to the interactive operation;
[0050] The interactive operations include clicking on a seat, dragging the view, or selecting a flight.
[0051] Preferably, the query module is used for:
[0052] Communicate with the front end through the RESTful API, and query the current seat status information in the preset relational database or NoSQL database according to the seat selection query instruction.
[0053] Preferably, the parsing module is used for:
[0054] By selecting the canvas element in the page and calling its getContext'webgl' to obtain the interface for interacting with the graphics hardware, the model format of the 3D model file is determined;
[0055] Get the model file from the preset server through XMLHttpRequest or Fetch API;
[0056] Parsing the model file, and extracting vertex data and face data as the 3D model file according to the rules of the model format;
[0057] Converting the vertex data into a file in a preset format;
[0058] The texture image loaded by the surface data is associated with the vertex data to obtain the key data.
[0059] Preferably, the compiling module is used for:
[0060] Use the requestAnimationFrame function to create a continuous animation loop and perform rendering operations in each frame;
[0061] Inside the rendering loop, use the clearColor function to set the color to clear the color buffer, and then use the clear method to clear the color buffer and depth buffer;
[0062] Write a vertex shader that processes the position and color attributes of the vertices, and a fragment shader that calculates the color of each pixel;
[0063] The vertex shader and the fragment shader are combined into the rendering program.
[0064] Preferably, the rendering module is used for:
[0065] Create and fill the buffer using the createBuffer function or the bufferData function;
[0066] Use the bindBuffer function to bind the buffer and enable the vertex attribute array through the enableVertexAttribArray function;
[0067] Get vertex attribute data from the buffer through the vertexAttribPointer function;
[0068] Use the drawArrays function or the drawElements function to draw graphics according to the rendering data.
[0069] An embodiment of the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, a virtual reality seat selection method as described in any of the above embodiments is implemented.
[0070] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a virtual reality seat selection method as described in any of the above embodiments.
[0071] The present invention provides a virtual reality seat selection method, device, equipment and storage medium, which obtains the seat selection query instruction of the user; queries the current seat status information according to the seat selection query instruction; obtains the WebGL context according to the seat status information, reads the 3D model file in the WebGL context, and parses the 3D model file to extract key data; loads and processes the key data to construct and determine rendering data; initializes the pre-constructed rendering shader, compiles the code, and constructs a rendering program; inputs the rendering data into the rendering program for graphics drawing, and outputs the rendering picture to the user. The present application scheme provides a more intuitive and convenient seat selection method, which improves the user's seat selection experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 is a flowchart of a virtual reality seat selection method provided by an embodiment of the present invention;
[0073] Figure 2 It is a partial flow chart of a virtual reality seat selection method provided by an embodiment of the present invention;
[0074] Figure 3 is a structural schematic diagram of a system for operating a virtual reality seat selection method provided by an embodiment of the present invention;
[0075] Figure 4 is a structural schematic diagram of a virtual reality seat selection device provided by an embodiment of the present invention;
[0076] Figure 5 It is a structural diagram of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0077] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0078] The existing seat selection methods for airlines are generally classified into three methods:
[0079] 2D floor plan seat selection: Currently, most airlines use 2D floor plans for passengers to select seats. This method is simple and intuitive, but it cannot provide an actual visual experience of the seat, and it is difficult for passengers to judge the specific location of the seat, the field of view, and the relationship with the surrounding facilities.
[0080] Still image display: Some airlines provide still images or videos of the cabin interior, but this only provides limited angles and information and may not fully reflect the actual situation of the passenger's selected seat.
[0081] Text description: Another way is to describe the seat type and features through text, such as "seat next to the emergency exit", "seat near the aisle", etc. This method also lacks intuitiveness and interactivity.
[0082] The problems existing in the prior art mainly include the following aspects:
[0083] Lack of intuitive experience: Passengers cannot intuitively feel the actual size, comfort and field of view of the seat.
[0084] Incomplete information display: The existing seat selection method cannot provide detailed information around the seat, such as the distance between the seat and facilities such as the toilet and kitchen.
[0085] Difficulty in decision making: Due to lack of sufficient information, passengers may feel hesitant when choosing seats and find it difficult to make the best choice.
[0086] Poor user experience: The traditional seat selection method lacks interactivity and immersion, which reduces the overall user experience.
[0087] In view of the above technical problems, this application provides a virtual reality seat selection method, see Figure 1 , is a flowchart of a virtual reality seat selection method provided by an embodiment of the present invention, the method comprising steps S1 to S6;
[0088] S1, obtaining the user's seat selection query instruction;
[0089] S2, querying the current seat status information according to the seat selection query instruction;
[0090] S3, acquiring a WebGL context according to the seat status information, reading a 3D model file in the WebGL context, parsing the 3D model file, and extracting key data;
[0091] S4, loading and processing the key data to construct and determine rendering data;
[0092] S5, initialize the pre-built rendering shader, compile the code, and build the rendering program;
[0093] S6, inputting the rendering data into the rendering program for graphics drawing, and outputting the rendering picture to the user.
[0094] The virtual reality seat selection method provided in this case mainly includes a front-end user interface, three-dimensional rendering, a data interaction module and a back-end server when implemented.
[0095] The front-end user interface is configured on a device or apparatus that interacts with the user to obtain the user's seat selection query instruction.
[0096] The seat selection query instruction is used to start the seat selection rendering system, which determines the corresponding seat status information according to the user's seat selection query instruction, including the seat location, seat size information, surrounding environment information, etc.
[0097] When the status information is specifically queried, a corresponding information query needs to be performed in the back-end database.
[0098] The back-end system is mainly responsible for processing data storage, business logic and front-end data interaction. The back-end system adopts efficient server architecture and database design to ensure the real-time and accuracy of data.
[0099] After the front end obtains the status information, it performs the corresponding rendering process. For the specific process, see Figure 2 , is a partial flow chart of a virtual reality seat selection method provided by an embodiment of the present invention.
[0100] First, a WebGL context is obtained, and the WebGL context is obtained according to the seat status information.
[0101] Perform 3D model file format conversion, that is, obtain a WebGL context according to the seat status information, and read the 3D model file in the WebGL context.
[0102] After obtaining the 3D model file, it is necessary to parse and process the 3D model file, including vertex data conversion and texture information processing.
[0103] Then, a rendering cycle and initialization are performed, the key data is loaded and processed, and the rendering data is constructed and determined;
[0104] Initialize pre-built rendering shaders, compile code, build rendering programs, build vertex and fragment shaders, and create and compile rendering programs.
[0105] After the rendering data is bound and configured, a buffer object is created and filled, and the rendering data is input into the rendering program for graphics drawing.
[0106] Output the rendered image to the user, that is, feed back the corresponding rendered image to the interactive interface.
[0107] It should be noted that the user's interactive interface can be displayed through specific virtual reality equipment to achieve the best display effect.
[0108] This application provides a seat layout display method in a virtual reality environment by feeding back rendering images to users through virtual reality rendering. It can highly restore the actual seat layout in a virtual environment, including details such as seat spacing and luggage racks, providing a more intuitive and convenient seat selection method and improving the user's seat selection experience.
[0109] In another embodiment provided by the present invention, the method further includes:
[0110] Acquire the seat selection operation instruction fed back by the user through WebSocket technology, and update the seat information in the seat database; or,
[0111] The seat selection operation instruction fed back by the user is obtained through a polling mechanism, and the seat information in the seat database is updated.
[0112] When this embodiment is implemented, see Figure 3 , is a schematic diagram of the structure of a system for running the virtual reality seat selection method provided by an embodiment of the present invention.
[0113] The portal in the system includes APP, PC and VR devices, and interacts with users through the portal devices.
[0114] The front end consists of an entry and application services. The entry is used to collect interactive devices of portal devices, obtain interactive operation instructions input by users through the portal through CDN and nginx, and transmit them to the application service for corresponding processing, including rendering processing.
[0115] When rendering, the application service also needs to interact with the backend, including log collection, using logstash+Kibana+ElasticSearch to collect backend logs, using MySQL to store business data, and using redis to store buffered data.
[0116] When real-time data is updated, WebSocket technology is used to achieve real-time communication between the front-end and back-end to ensure instant updates of seat status. When users are selecting seats, the front-end can receive seat selection information from other users in real time to avoid seat conflicts. If WebSocket is not supported, a polling mechanism can be used, where the front-end sends requests to the back-end at regular intervals to obtain the latest seat status.
[0117] In another embodiment provided by the present invention, when obtaining the seat selection query instruction of the user in the above step S1, the following steps are specifically performed:
[0118] The front-end system is the part that users interact with directly. It is built based on the Vue.js framework. Vue.js is a lightweight JavaScript framework suitable for building modern single-page applications (SPA). The front-end system mainly consists of two parts: the user interface and the 3D rendering.
[0119] User interface: Using the component development model of Vue.js, the various functions of the seat selection system are modularized, such as seat selection, seat information display, payment confirmation, etc. CSS and Vue.js's responsive data binding mechanism are used to ensure that the system has a good display effect on different devices and screen sizes. Through the instructions and event processing provided by Vue.js, the user can interact with the system, such as clicking on seats, dragging views, selecting flights, etc.
[0120] In another embodiment of the present invention, querying the current seat status information according to the seat selection query instruction includes:
[0121] Communicate with the front end through the RESTful API, and query the current seat status information in the preset relational database or NoSQL database according to the seat selection query instruction.
[0122] In actual use, the back-end system is mainly responsible for processing data storage, business logic and front-end data interaction. The back-end system adopts efficient server architecture and database design to ensure the real-time and accuracy of data.
[0123] Server-side architecture: The backend communicates with the frontend through RESTful API, providing functions such as seat status query and seat selection request processing. The RESTful API is simple in design and easy to expand and maintain. To ensure instant updates of seat status, the backend can use WebSocket technology to establish a real-time communication connection between the frontend and the backend. When the seat status changes, the frontend is notified in time to update. The backend server is responsible for processing business logic such as seat selection requests, verifying seat status, and updating seat information. The system's response speed and stability are guaranteed through efficient algorithms and data processing technologies.
[0124] Use relational database or NoSQL database to store seat information, user information and flight information. Design reasonable database table structure and index to improve the efficiency of data query and update. Real-time synchronization of front-end and back-end data is achieved through API or WebSocket to ensure that the seat status displayed on the front-end is consistent with the data in the back-end database.
[0125] In another embodiment of the present invention, in the above step S4, a WebGL context is obtained according to the seat status information, a 3D model file in the WebGL context is read, and the 3D model file is parsed to extract key data, including:
[0126] By selecting the canvas element in the page and calling its getContext'webgl' to obtain the interface for interacting with the graphics hardware, the model format of the 3D model file is determined;
[0127] Get the model file from the preset server through XMLHttpRequest or Fetch API;
[0128] Parsing the model file, and extracting vertex data and face data as the 3D model file according to the rules of the model format;
[0129] Converting the vertex data into a file in a preset format;
[0130] The texture image loaded by the surface data is associated with the vertex data to obtain the key data.
[0131] In the specific implementation of this embodiment, the core of the virtual reality seat selection system is realized by rendering a real three-dimensional model of the interior of the aircraft; so as to provide passengers with a more convenient and intuitive seat selection experience. The working process of the method is as follows:
[0132] First, get the WebGL context. Select the canvas element in the page and call its getContext('webgl') method to get the interface for interacting with the graphics hardware. This context is the basis for implementing 3D rendering. Determine the format of the 3D model. Here, the OBJ format is used. The model file usually contains information such as vertex positions, texture coordinates, normal vectors, and face definitions. The model file needs to be read. Get the content of the model file from the server through XMLHttpRequest or Fetch API. After obtaining the file content, it needs to be parsed. According to the rules of the model format, extract key information such as vertex data and face data. For vertex data, it needs to be converted into a format that WebGL can handle, usually storing it in a buffer object. Face data is used to determine which vertices constitute a triangle or polygon, thereby constructing the surface of the model. Texture information also needs to be processed. If the model contains textures, the texture image needs to be loaded and associated with the vertex data so that the texture can be displayed correctly during rendering.
[0133] In another embodiment of the present invention, in step S5, the pre-built rendering shader is initialized, the code is compiled, and the rendering program is constructed, including:
[0134] Use the requestAnimationFrame function to create a continuous animation loop and perform rendering operations in each frame;
[0135] Inside the rendering loop, use the clearColor function to set the color to clear the color buffer, and then use the clear method to clear the color buffer and depth buffer;
[0136] Write a vertex shader responsible for processing the position and color attributes of the vertices, and write a fragment shader responsible for calculating the color of each pixel;
[0137] The vertex shader and the fragment shader are combined into the rendering program.
[0138] When this embodiment is specifically implemented, in the rendering stage, parsing is used, and the requestAnimationFrame function is used to create a continuous animation loop, and the rendering operation is performed in each frame. Inside the rendering loop, the clearColor function must first be used to set the color of the clear color buffer, and then the clear method is used to clear the color buffer and the depth buffer to prepare for new rendering. For actual rendering operations, it is necessary to write vertex shaders and fragment shaders. The vertex shader is responsible for processing the position, color and other attributes of the vertex, and the fragment shader is responsible for calculating the color of each pixel. The shader code is compiled and linked into a rendering program. The vertex shader and fragment shader are created and compiled through the createShader function, the shaderSource function, and the compileShader function, and then the createProgram function, the attachShader function, and the linkProgram function are used to combine them into a rendering program to obtain the rendering program.
[0139] In another embodiment of the present invention, the step S6 of inputting the rendering data into the rendering program for graphics drawing includes:
[0140] Create and fill the buffer using the createBuffer function or the bufferData function;
[0141] Use the bindBuffer function to bind the buffer and enable the vertex attribute array through the enableVertexAttribArray function;
[0142] Get vertex attribute data from the buffer through the vertexAttribPointer function;
[0143] Use the drawArrays function or the drawElements function to draw graphics according to the rendering data.
[0144] When this embodiment is implemented, the data required for rendering, such as vertex position, color, texture coordinates, etc., are prepared and stored in a buffer object. The buffer is created and filled by the createBuffer function and the bufferData function. When rendering, the bindBuffer function is used to bind the buffer, the enableVertexAttribArray function is used to enable the vertex attribute array, and the vertexAttribPointer function is used to configure how to obtain vertex attribute data from the buffer. Finally, the drawArrays function or the drawElements function is used to draw the graphics according to the prepared data.
[0145] When rendering in 3D, use the Three.js library to build and render the 3D scene. Three.js is a powerful JavaScript 3D library that simplifies the use of WebGL. Use Three.js to load external 3D model files (such as OBJ, FBX, etc.) to create a detailed 3D model of the cabin interior, including seats, aisles, luggage racks, etc. Set the Three.js scene, camera, and lighting effects to ensure the realism and efficiency of the 3D rendering. The camera position and angle can be adjusted by the user's drag and zoom operations. Through raycasting technology, users can interact by clicking on the 3D model, obtain detailed information about the seat and display it on the interface.
[0146] This application scheme uses high-precision 3D modeling technology: it adopts advanced 3D reconstruction technology to accurately restore the internal structure of the aircraft, including different seat layouts, cabin types, and aircraft features, so that users can get a close to real seat selection experience in a virtual environment.
[0147] This case provides immersive interactive technology. The system supports users to freely move, rotate the perspective, zoom in and out, etc. through the mouse and keyboard, and uses WebGL technology to achieve real-time rendering to provide an immersive interactive experience.
[0148] This case provides a personalized recommendation engine that integrates machine learning algorithms. Based on the user's preferences (such as legroom requirements, whether they like window seats, etc.), the system automatically recommends the best seat options.
[0149] This case provides real-time data synchronization technology. The system is synchronized with the airline's seat reservation system in real time to ensure that users see the latest seat status and avoid misselection due to data delays.
[0150] This case can achieve multi-platform compatibility. The system supports multiple browsers to ensure access by a wide range of user groups, while using HTML5 technology to achieve cross-platform compatibility.
[0151] This case adopts a high-availability architecture, which uses CDN acceleration technology and distributed server architecture to ensure stable operation and fast response of the system, and maintain a smooth user experience even in high concurrency situations.
[0152] The solution provided in this application has high performance and stability. High-performance Web server: Use NGINX's high performance and stability to handle a large number of concurrent connections to ensure a smooth real-time VR experience. Load balancing and traffic management: Use NGINX's load balancing capabilities to ensure that traffic is evenly distributed among multiple servers, improving the overall stability and response speed of the system.
[0153] Another embodiment of the present invention provides a virtual reality seat selection device, see Figure 4 , is a structural diagram of a virtual reality seat selection device provided by an embodiment of the present invention, the device comprising:
[0154] An instruction acquisition module is used to acquire the user's seat selection query instruction;
[0155] A query module, used to query the current seat status information according to the seat selection query instruction;
[0156] A parsing module, used for obtaining a WebGL context according to the seat status information, reading a 3D model file in the WebGL context, and parsing the 3D model file to extract key data;
[0157] A loading module, used for loading and processing the key data, and constructing and determining rendering data;
[0158] The compilation module is used to initialize the pre-built rendering shader, compile the code, and build the rendering program;
[0159] The rendering module is used to input the rendering data into the rendering program to perform graphics drawing and output the rendering picture to the user.
[0160] The virtual reality seat selection device provided in this embodiment can execute all the steps and functions of the virtual reality seat selection method provided in any of the above embodiments, and the specific functions of the device will not be described in detail here.
[0161] See also Figure 5, is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. The terminal device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a virtual reality seat selection program. When the processor executes the computer program, the steps in each of the above-mentioned virtual reality seat selection method embodiments are implemented, such as Figure 1 Alternatively, the processor implements the functions of each module in the above-mentioned device embodiments when executing the computer program.
[0162] Exemplarily, the computer program may be divided into one or more modules, and the one or more modules are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device. For example, the computer program may be divided into several modules, and the specific functions of each module have been described in detail in a virtual reality seat selection method provided in any of the above embodiments, and the specific functions of the device will not be repeated here.
[0163] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art may understand that the schematic diagram is only an example of a terminal device and does not constitute a limitation on a terminal device. The terminal device may include more or fewer components than shown in the figure, or may combine certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0164] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect the various parts of the entire terminal device.
[0165] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the virtual reality seat selection device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0166] Wherein, if the module integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0167] It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A virtual reality seat selection method, characterized in that: The method comprises: Obtain the user's seat selection query instruction; Query the current seat status information according to the seat selection query instruction; Acquire a WebGL context according to the seat status information, read a 3D model file in the WebGL context, and parse the 3D model file to extract key data; Loading and processing the key data to construct and determine rendering data; Initialize the pre-built rendering shader, compile the code, and build the rendering program; The rendering data is input into the rendering program for graphics drawing, and a rendering picture is output to the user.
2. The virtual reality seat selection method according to claim 1, characterized in that: The method further comprises: Acquire the seat selection operation instruction fed back by the user through WebSocket technology, and update the seat information in the seat database; or, The seat selection operation instruction fed back by the user is obtained through a polling mechanism, and the seat information in the seat database is updated.
3. The virtual reality seat selection method according to claim 1, characterized in that: Get the user's seat selection query command, including: Provide instructions and event processing to obtain user interaction operations based on the component development model of Vue.js configured on the front end; Determine a seat selection query instruction according to the interactive operation; The interactive operations include clicking on a seat, dragging the view, or selecting a flight.
4. The virtual reality seat selection method according to claim 1, characterized in that: Querying the current seat status information according to the seat selection query instruction includes: Communicate with the front end through the RESTful API, and query the current seat status information in the preset relational database or NoSQL database according to the seat selection query instruction.
5. The virtual reality seat selection method according to claim 1, characterized in that: Acquire a WebGL context according to the seat status information, read a 3D model file in the WebGL context, and parse the 3D model file to extract key data, including: By selecting the canvas element in the page and calling its getContext'webgl' to obtain the interface for interacting with the graphics hardware, the model format of the 3D model file is determined; Get the model file from the preset server through XMLHttpRequest or Fetch API; Parsing the model file, and extracting vertex data and face data as the 3D model file according to the rules of the model format; Converting the vertex data into a file in a preset format; The texture image loaded by the surface data is associated with the vertex data to obtain the key data.
6. The virtual reality seat selection method according to claim 1, characterized in that: Initialize the pre-built rendering shader, compile the code, and build the rendering program, including: Use the requestAnimationFrame function to create a continuous animation loop and perform rendering operations in each frame; Inside the rendering loop, use the clearColor function to set the color to clear the color buffer, and then use the clear method to clear the color buffer and depth buffer; Write a vertex shader responsible for processing the position and color attributes of the vertices, and write a fragment shader responsible for calculating the color of each pixel; The vertex shader and the fragment shader are combined into the rendering program.
7. The virtual reality seat selection method according to claim 1, characterized in that: Inputting the rendering data into the rendering program for graphics drawing includes: Create and fill the buffer using the createBuffer function or the bufferData function; Use the bindBuffer function to bind the buffer and enable the vertex attribute array through the enableVertexAttribArray function; Get vertex attribute data from the buffer through the vertexAttribPointer function; Use the drawArrays function or the drawElements function to draw graphics according to the rendering data.
8. A virtual reality seat selection device, characterized in that: The device comprises: An instruction acquisition module is used to acquire the user's seat selection query instruction; A query module, used to query the current seat status information according to the seat selection query instruction; A parsing module, used for obtaining a WebGL context according to the seat status information, reading a 3D model file in the WebGL context, and parsing the 3D model file to extract key data; A loading module, used for loading and processing the key data, and constructing and determining rendering data; The compilation module is used to initialize the pre-built rendering shader, compile the code, and build the rendering program; The rendering module is used to input the rendering data into the rendering program to perform graphics drawing and output the rendering picture to the user.
9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the virtual reality seat selection method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the virtual reality seat selection method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Online seat selection method and system
CN106779117A
Real-time seat selection method and device
CN107241311A
Civil aviation seat selection method based on local inventory
CN113159349A
Seat selection application for social distancing compliance
US10915231B1