Dynamic interactive loading optimization method for web programs and U3D applications

Through geolocation-based proxy server optimization and dynamic loading technology of Unity3D editor, the inefficiency of data transmission caused by static data in WebVR experience projects is solved, and dynamic content management and performance improvements are achieved.

CN114297559BActive Publication Date: 2024-11-05QINGDAO RES INST OF BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111671835.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-11-05
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

Due to the inefficient data transmission caused by static data, existing WebVR experience projects cannot dynamically modify content in the website background management page, resulting in problems such as network fluctuations, delays and excessive server load.

Method used

Adopt a decision-making mechanism based on geolocation information, optimize data cache and loading through a proxy server, reduce the number of HTTP requests, and dynamically load three-dimensional scenes and materials using the Unity3D editor, and create effective indexes in the database to improve query efficiency.

Benefits of technology

It realizes reducing data footprint and the number of HTTP requests, improving user experience and access efficiency, reducing server load and network latency, and allowing real-time dynamic management and update content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0003449761700000021
    Figure BDA0003449761700000021
  • Figure BDA0003449761700000041
    Figure BDA0003449761700000041
  • Figure BDA0003449761700000042
    Figure BDA0003449761700000042
Patent Text Reader

Abstract

This application discloses a dynamic interactive loading optimization method for web programs and U3D applications, which belongs to the field of virtual reality. This application solves the problem that website programs and unity applications can only communicate one-way in the past. It actively obtains feedback data from the web end at a certain frequency and performs this operation regardless of whether the web program is running. The efficiency of MySQL queries is improved by creating effective indexes. Compared with previous front-end development, network files are integrated, and the packaging method is adopted to reduce the website operation load, effectively solve network fluctuations and delays, and improve access efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a dynamic interactive loading optimization method for a web program and a U3D application, and belongs to the field of virtual reality. Background Art

[0002] As VR technology has gradually entered the public eye in recent years, the popularity of application types and technologies in the VR field has been increasing, and more and more industries and technology fields have gradually combined with VR technology. As the most commonly used browsing method for users for a long time, the development of browser-side VR display (WebVR) has also become increasingly mature. WebVR technology has roughly developed into the following aspects: (1) Using panoramic shooting equipment, taking 360-degree scene pictures or recording videos in the actual scene instead of the viewer standing in place to observe the surrounding scene, and finally after synthesizing from different angles, the panoramic picture or panoramic video displayed on the page is browsed from the perspective of shooting. (2) The shooting and synthesis method is similar to the former, but the difference is that by simulating the behavior of the viewer watching while moving, the surrounding scene is photographed, and multiple synthesis is performed based on the scene distinction, and a browsing order relationship is established between different scenes to simulate browsing behavior, so that the viewer can experience the tour without being present. (3) Different from the previous two points, during the production process, the modeling method is used to replace the original shooting synthesis, and the scene is generated in a true 3D stereoscopic form. The entire scene is also a whole, and the perspective can be freely rotated and moved inside. This form can also make a model of an object for display. Unlike the panoramic view with a fixed observation point as the center and only the surrounding scene can be viewed, the 3D display form is not limited to the display perspective. It is centered on the object and displayed from multiple angles. In addition, due to the characteristics of the model form, different interactive functions can be added to operate the model, such as opening the door of the room in the scene and walking out to browse other scenes, or disassembling a model to view the internal structure.

[0003] While WebVR programs are being introduced into website programs, the configuration required by the programs themselves and the user experience requirements for the programs are also gradually increasing. Due to the rapidity and effectiveness of Web front-end optimization in improving user experience in website programs, some large foreign Internet companies have already started related research and have produced many successful contributions. For example, Microsoft launched the Ajax application optimization tool - Doloto. Many years ago, Yahoo proposed the famous Yahoo performance optimization 34 golden rules, including minimizing the number of HTTP requests, reducing DNS queries, and avoiding jumps. Google has also developed a tool to measure web page performance, PageSpeed.

[0004] Most of the common WebVR experience projects nowadays are static data. Static data will result in that after the program is developed by the developer and deployed on the website, users can only access existing resources and content when browsing. The web browsing method is to upload the program to the server after development. After configuration, users can access the corresponding URL on the web page. After the program is developed and deployed to the server of the website, if the content is modified again, such as materials and models, the developer must modify the program again, upload it to the server, and replace the modified content. The above steps must be repeated every time a modification is made, and it is impossible to modify, upload, and other operations in the background management page of the website.

[0005] In addition, due to the surge in user mobile devices, the increase in access frequency, and the restrictions brought about by changes in browser carriers, data transmission also has certain limitations. Since the data is stored in the server in real time, the current database query efficiency is low. The large number of website files causes network fluctuations and delays, which leads to data loss. Frequent data requests will also occupy server bandwidth and even waste user traffic. Summary of the invention

[0006] The present invention provides a dynamic interactive loading optimization method for a web program and a U3D application, which selects an optimal cache solution based on a decision-making mechanism of geographic location information, reduces the space occupied by application data, and reduces the number of HTTP requests.

[0007] The technical solution adopted by the present invention is a dynamic interactive loading optimization method of a web program and a U3D application, comprising the following steps:

[0008] 1) Establish the client and web server architecture, and establish a data connection between the client and the web server through the Internet; implant the application on the web server and establish a database;

[0009] 2) Build a web server using LAMP architecture or LNMP architecture;

[0010] 3) Establish the user front-end browsing end and the administrator back-end management end of the client;

[0011] 4) Create a 3D scene through the unity3D editor; on the administrator's backend management side, use the dynamic loading method to load the 3D scene and load texture files, materials, scenes and other materials to the web server through the unity3D editor;

[0012] 5) Setting a location determination module and multiple proxy servers, the client establishes data connection with the web server through the proxy server; for data that changes frequently in the network area, the location determination module is used to obtain the relationship between the browser device location and the proxy server location of the frequently changed data; the browser device is connected to the proxy server closest to it, and the three-dimensional scene is interacted with the web server through the proxy server.

[0013] Optimized, the above-mentioned dynamic interactive loading optimization method of the web program and the U3D application, in step 5), the work of the position judgment module includes position information acquisition and position information calculation;

[0014] Location information acquisition includes: using the user's public network IP address, mobile phone tower ID, GPS information, a series of wireless access point signal strengths, and MAC addresses of the browser device as location determination information, transmitting them to the location information service provider through the HTTPS protocol, and matching the location determination information with the relevant database for search and calculation, and finally returning a similar location information; obtaining the geographic location information of the proxy servers around the similar location information returned by the browser device;

[0015] The location information calculation includes: calculating the distance between the proxy server and the geographical location of the user's mobile device, and obtaining the longitude and latitude A (W A , J A ) and the latitude and longitude B (W B , J B ) to calculate the distance L between two points, and the calculation formula is derived as follows:

[0016]

[0017] Where R=9378.137 is the radius of the earth.

[0018] The optimized method for dynamic interactive loading of the web program and the U3D application is as follows: In step 4), the dynamic loading process of the unity3D editor includes:

[0019] When the Unity 3D editor is running, one or several initial solutions are loaded by default. After uploading the 3D model and materials in the administrator's backend management terminal, the upload address of all materials corresponding to each 3D model is generated and saved. The 3D model file is stored in the specified folder of the server, and the information data is saved in the database.

[0020] When the program file in the unity3D editor receives data sent by the web end through a specific interface, it obtains a new material file or the storage location of the material file based on the parsed data;

[0021] According to the storage location, the required files are automatically downloaded from the server file storage location, and loaded after downloading; when the user visits the user's front-end browser, according to the operation prompt, click the switch button to switch the corresponding material;

[0022] The web server uses the WebGL project file exported by the Unity3D editor to embed and display it directly in the Hypertext Markup Language page.

[0023] Optimized, the dynamic interactive loading optimization method of the above web program and U3D application, the data interaction process between the Web server and the unity3D editor includes, through the address and interface agreed upon by the Web server and the unity3D editor, the Web server obtains the project file identifier exported by the unity3D editor, actively sends data to the unity3D editor and is received and parsed by the unity3D editor; the parsing function of the unity3D editor after receiving the data is only triggered and started after the Web server sends the data.

[0024] The optimized method for dynamically interacting and loading the web program and the U3D application further includes creating a valid index in the database; creating a valid index in the database includes:

[0025] When establishing a database, create an index table that stores the index column value and the storage location of the row where the value is located; when creating the index table, create indexes for the primary key attribute and foreign key attribute columns respectively; create indexes for attribute columns that often appear in search conditions; create indexes for attribute columns that often appear and need to be sorted after orderby; update the index data, dynamically maintain the index data, and synchronously complete the rearrangement of the index data.

[0026] The optimized method for dynamic interactive loading of the above web program and U3D application integrates the client website files when the client is established, and packages some of the client website files in JavaScript and CSS packages.

[0027] Optimized, the dynamic interactive loading optimization method of the above web program and U3D application, the web server selects to execute CSS cascading style through media query; the web server selects different CSS cascading styles according to the device screen of different user front-end browsing terminals through the media query function; the CSS cascading style file is imported through the link @import or @media.

[0028] The advantages of this application are:

[0029] (1) The technical solution of the present application solves the problem that the website program and the Unity application can only communicate in one direction in the past. Feedback data is actively obtained from the web end at a certain frequency and this operation is performed regardless of whether the web program is running or not.

[0030] (2) In the technical solution of the present application, the efficiency of MySQL query is improved by creating an effective index. For example, if there is a test data table tl, which consists of 3 columns of integer data and contains 100,000 data, the statement SELECT c1, c2 c3 FROM t1 WHERE c1 = 50001 is used to query the 50001st record. When the index is not used, the query takes 0.06 seconds. After the primary key index is established on the query condition cl, the query time is reduced to 0.00 seconds, and the query speed is significantly improved.

[0031] (3) Compared with previous front-end development, the technical solution of this application integrates network files and adopts a packaging approach to reduce the website operation load, effectively solves network fluctuations and delay problems, and improves access efficiency.

[0032] (4) The technical solution of this application uses a judgment mechanism based on geographic location to optimize the performance of Web front-end engineering. It reduces repeated network requests from the client, reduces the frequency of network use, reduces the number of logical processing times of the server, reduces server load energy consumption, and optimizes related performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is the system architecture diagram of this application;

[0034] Figure 2 This is the LAMP architecture diagram for this application;

[0035] Figure 3 This is the LNMP architecture diagram of this application;

[0036] Figure 4 A flowchart of this application;

[0037] Figure 5 This is a diagram of the working principle of the WorkerMan process of this application. DETAILED DESCRIPTION

[0038] The technical features of the present invention are further described below in conjunction with the accompanying drawings and specific embodiments.

[0039] The present invention is a dynamic interactive loading optimization method for web programs and U3D applications, comprising the following steps:

[0040] 1) Establish the client and web server architecture, and establish a data connection between the client and the web server through the Internet; implant the application on the web server and establish a database;

[0041] 2) Building a web server based on the LAMP architecture;

[0042] 3) Establish the user front-end browsing end and the administrator back-end management end of the client;

[0043] 4) Create a 3D scene through the unity3D editor; on the administrator's backend management side, use the dynamic loading method to load the 3D scene to the web server through the unity3D editor and load the map files, materials, scenes and other materials;

[0044] 5) Setting a location determination module and multiple proxy servers, the client establishes data connection with the web server through the proxy server; for data that changes frequently in the network area, the location determination module is used to obtain the relationship between the browser device location and the proxy server location of the frequently changed data; the browser device is connected to the proxy server closest to it, and the three-dimensional scene is interacted with the web server through the proxy server.

[0045] The technical solution of this embodiment adopts the B / S (Browser / Server) architecture, that is, the browser and server architecture mode architecture. The architecture of this embodiment is as follows: Figure 1 As shown. This architecture includes the client and the web server. The main logic calculation and analysis functions are implemented on the web server. The advantage of this model is that it simplifies the client. The client only needs to install a browser to interact with the web server, which has better versatility. The program owner builds the server environment, installs program files, deploys the database, and configures the extension support required for the application to run on the web server. Through the domain name resolution service, users can open the link through the browser of a computer or mobile phone or scan the QR code to access the application address and achieve external network access.

[0046] The web server of this embodiment can be built using the LAMP architecture, which is a combination of Linux system, Apache network server, MySQL database, and PHP programming language. Figure 2 As shown in the figure. The process of a web server processing a dynamic data request is as follows: the Apache web server first processes the user's HTTP request, HTTPD parses the URL to obtain the path of the required resource, and reads the resource stored on the hard disk. If the resource is static, a response message is constructed and sent back to the user. If it is dynamic, the resource address is sent to the PHP parser, and after parsing, the content is sent back to HTTPD to construct a response message and send it back to the user. If the resource involves reading and writing a database, the PHP-MySQL driver is used to obtain relevant data from the database.

[0047] The client in this embodiment is divided into user front-end browsing and administrator back-end management from the user's perspective. After the administrator deploys and sets the basic settings of the website, users and administrators can log in to the corresponding port according to the address of accessing different application programs. Figure 4 The flowchart performs corresponding operations according to the needs. After the program development is completed, the administrator makes changes, uploads and other operations in the background, and the user can view the modifications made in the backend in real time in the foreground, thereby switching the display.

[0048] In step 4), the dynamic loading process of the Unity3D editor includes:

[0049] When the Unity 3D editor is running, one or several initial solutions are loaded by default. After uploading the 3D model and materials in the administrator's backend management terminal, the upload address of all materials corresponding to each 3D model is generated and saved. The 3D model file is stored in the specified folder of the server, and the information data is saved in the database.

[0050] When the program file in the unity3D editor receives data sent by the web end through a specific interface, it obtains a new material file or the storage location of the material file based on the parsed data;

[0051] According to the storage location, the required files are automatically downloaded from the server storage location, and loaded after downloading. When the user visits the user's front-end browser, according to the operation prompt, click the switch button to switch the corresponding material, so as to achieve the purpose of dynamic management;

[0052] The web server uses the WebGL project file exported by the Unity3D editor to embed and display it directly in the HTML (Hypertext Markup Language) page to avoid the browser being unable to open the program due to plug-in support issues.

[0053] In step 5), the role of the location judgment module is to execute a judgment mechanism for data that changes frequently in a specific area by obtaining the browser device location and the proxy server location relationship, and decide when to synchronize and update the data, thereby reducing HTTP requests. The work of the location judgment module includes location information acquisition and location information calculation.

[0054] The location information acquisition includes: acquiring the current GPS information of the device. There are two geographical location information in the system, namely the geographical location information of the browser device running the Web application and the geographical location information of the proxy server.

[0055] The geographic location of the browser device is obtained through the Geolocation API (geolocation application program interface) in HTML5. The principle of the Geolocation API is to transmit multiple information including the user's public IP address, mobile phone signal tower ID, GPS information, a series of wireless access point signal strengths and MAC addresses to a location information service provider through the HTTPS protocol, and try to match the information with a large number of related databases for search and calculation, and finally return a similar location information.

[0056] Because different location information service providers are used, and there are differences in the algorithms and databases used, the geographic location obtained by the web application may be different due to the different browser platforms used. Since the device's geographic location is one of the important privacy of users, the browser will ask the user whether to grant this permission when the web application needs to obtain the user's geographic location.

[0057] The location information calculation includes: calculating the distance between the proxy server and the geographical location of the user's mobile device, and obtaining the longitude and latitude A (W A , J A ) and the latitude and longitude B (W B , J B ) to calculate the distance L between two points, and the calculation formula is derived as follows:

[0058] Where R=9378.137 is the radius of the earth.

[0059] The data interaction process between the Web server and the Unity3D Editor includes: through the address and interface agreed upon by the Web server and the Unity3D Editor, the Web server obtains the project file identifier exported by the Unity3D Editor, actively sends data to the Unity3D Editor, and the Unity3D Editor receives and parses the data; the Unity3D Editor's parsing function after receiving the data is only triggered and started after the Web server sends the data, and does not need to be started frequently. The main code is as follows:

[0060]

[0061]

[0062] In order to improve the query speed in the database, the present embodiment adopts the improvement measure of creating effective indexes.

[0063] Index optimization is a physical query optimization technique. An index is a simple physical table that stores the index column value and the storage location of the row where the value is located. It enables database applications to find the desired data without scanning the entire table, just like the table of contents of a book allows readers to quickly find the content they want to read. If there is an index on the search condition column, then when the table data volume is large, using the index scan is better than the full table sequential scan. In the database design stage, you can follow the following rules to create an index.

[0064] Create a valid index in the database; Creating a valid index in the database includes,

[0065] When establishing a database, create an index table that stores the index column value and the storage location of the row where the value is located; when creating the index table, create indexes for the primary key attribute and foreign key attribute columns respectively. Create indexes for attribute columns that often appear in search conditions. Create indexes for attribute columns that often appear in orderby and need to be sorted. In particular, clustered indexes will be dynamically maintained when updating table data, and data rearrangement will be completed synchronously. Therefore, do not create indexes on non-essential data columns, especially for a table where records are frequently inserted, updated, and deleted.

[0066] In order to avoid network fluctuations or network delays on the website server, which would affect the normal use and experience of users, this project optimizes the front-end development technology of the website to improve the service quality of the website. During the design, the website files were first integrated, and some website files were packaged in JavaScript and CSS packages, which reduced the operating load of the website server, streamlined the code in the website design, and improved the access efficiency of the user's browser.

[0067] The web server selects and executes CSS cascading styles through media queries; the web server selects different CSS cascading styles according to the device screens of different user front-end browsers through the media query function; the CSS cascading style files are imported through the links @import or @media.

[0068] The communication between the proxy server and the Web server is realized by building the WorkerMan communication framework in the proxy server. The WorkerMan framework is a high-performance asynchronous PHP socket instant communication framework, and its core is multi-process + Epoll + non-blocking IO. The WorkerMan framework consists of multiple Worker basic containers, and its working principle is as follows: Figure 5As shown in the figure, each Worker process operates independently and can open multiple process listening ports, using Epoll+ non-blocking IO. Each Worker process also maintains its own client connection independently and processes the data sent by these clients independently. In order to maintain stability, the master process is only responsible for monitoring the child process, not responsible for receiving data or performing any business logic. The process of the master process is: first perform an environment check, then become a daemon process, then install the signal and create a socket communication monitor, and finally create a worker to monitor the signal status.

[0069] Example 2

[0070] The difference between this embodiment and embodiment 1 is that the Web server can also be built using LNMP, and its architecture is as follows: Figure 3 shown.

[0071] In this embodiment, the Unity program can be replaced by a program developed by three.js or Babylon.js. Three.js is a webGL framework, which is an encapsulation of the WebGL API interface. Babylon.js is a WebGL development framework launched by Microsoft.

[0072] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Any changes, modifications, additions or substitutions made by ordinary technicians in this technical field within the essential scope of the present invention should fall within the protection scope of the present invention.

Claims

1. A method for optimizing dynamic interactive loading of a web program and a U3D application, comprising the following steps: 1) Establish the client and web server architecture, and establish a data connection between the client and the web server through the Internet; implant the application on the web server and establish a database; 2) Build a web server using LAMP architecture or LNMP architecture; 3) Establish the user front-end browsing end and the administrator back-end management end of the client; It is characterized in that it also includes the following steps: 4) Create a 3D scene through the unity3D editor; on the administrator's backend management side, use the dynamic loading method to load the 3D scene and load texture files, materials, scenes and other materials to the web server through the unity3D editor; 5) Setting a location determination module and multiple proxy servers, the client establishes data connection with the web server through the proxy server; for data that changes frequently in the network area, the location determination module is used to obtain the relationship between the browser device location and the proxy server location of the frequently changed data; the browser device is connected to the proxy server closest to it, and the three-dimensional scene is interacted with the web server through the proxy server.

2. The method for optimizing dynamic interactive loading of web programs and U3D applications according to claim 1, characterized in that: In step 5), the work of the location determination module includes location information acquisition and location information calculation; Location information acquisition includes: using the user's public network IP address, mobile phone tower ID, GPS information, a series of wireless access point signal strengths, and MAC addresses of the browser device as location determination information, transmitting them to the location information service provider through the HTTPS protocol, and matching the location determination information with the relevant database for search and calculation, and finally returning a similar location information; obtaining the geographic location information of the proxy servers around the similar location information returned by the browser device; The location information calculation includes: calculating the distance between the proxy server and the geographical location of the user's mobile device, and obtaining the longitude and latitude A (W A , J A ) and the latitude and longitude B (W B , J B ) is used to calculate the distance between two points. The calculation formula is derived as follows: Where R=9378.137 is the radius of the earth.

3. The method for optimizing dynamic interactive loading of web programs and U3D applications according to claim 1, characterized in that: In step 4), the dynamic loading process of the Unity3D editor includes: When the Unity 3D editor is running, one or several initial solutions are loaded by default. After uploading the 3D model and materials in the administrator's backend management terminal, the upload address of all materials corresponding to each 3D model is generated and saved. The 3D model file is stored in the specified folder of the server, and the information data is saved in the database. When the program file in the unity3D editor receives data sent by the web end through a specific interface, it obtains a new material file or the storage location of the material file based on the parsed data; According to the storage location, the required files are automatically downloaded from the server file storage location, and loaded after downloading; when the user visits the user's front-end browser, according to the operation prompt, click the switch button to switch the corresponding material; The web server uses the WebGL project file exported by the Unity3D editor to embed and display it directly in the Hypertext Markup Language page.

4. The method for optimizing dynamic interactive loading of web programs and U3D applications according to claim 1, characterized in that: The data interaction process between the Web server and the Unity 3D Editor includes: through the address and interface agreed upon by the Web server and the Unity 3D Editor, the Web server obtains the project file identifier exported by the Unity 3D Editor, actively sends data to the Unity 3D Editor, and is received and parsed by the Unity 3D Editor; the parsing function of the Unity 3D Editor after receiving the data is only triggered and started after the Web server sends the data.

5. The method for optimizing dynamic interactive loading of web programs and U3D applications according to claim 1, characterized in that: It also includes creating valid indexes in the database; creating valid indexes in the database includes, When establishing a database, create an index table that stores the index column value and the storage location of the row where the value is located; when creating the index table, create indexes for the primary key attribute and foreign key attribute columns respectively; create indexes for attribute columns that often appear in search conditions; create indexes for attribute columns that often appear and need to be sorted after orderby; update the index data, dynamically maintain the index data, and synchronously complete the rearrangement of the index data.

6. The method for optimizing dynamic interactive loading of web programs and U3D applications according to claim 1, characterized in that: When the client is established, the client website files are integrated and some of the client website files are packaged in JavaScript and CSS packages.

7. The method for optimizing dynamic interactive loading of web programs and U3D applications according to claim 1, characterized in that: The web server selects and executes CSS cascading styles through media queries; the web server selects different CSS cascading styles according to the device screens of different user front-end browsers through the media query function; the CSS cascading style files are imported through the links @import or @media.