A cross-device page debugging method and device
By using cross-device posture monitoring and virtual reality rendering technology, the problem of mobile browsers being unable to debug VR panoramic H5 has been solved, enabling efficient debugging and code refreshing across devices.
Patent Information
- Application Number
- CN202010001193.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-02
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2040-01-02
AI Technical Summary
In existing technologies, mobile browsers cannot debug VR panoramic H5 effects with breakpoints, resulting in low development efficiency, and the inconsistency of standards between different models and browsers makes debugging difficult.
By monitoring the posture of the page in the browser of the first device, the rotation angle is obtained and converted into a quaternion, which is then transmitted to the server for virtual reality panoramic rendering. The second device is used for breakpoint debugging, and code changes are monitored and refreshed through long links.
It enables cross-device VR panoramic H5 debugging, improves development efficiency, and solves the debugging difficulties caused by browser inconsistency.
Smart Images

Figure CN113064809B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a cross-device page debugging method and apparatus. Background Art
[0002] With the development of mobile Internet and the popularity of smart phones, many applications use the gyroscope data of mobile phones to achieve VR (Virtual Reality) panoramic H5 effects. VR panorama covers almost all industries, including home, home decoration, education, games, etc.
[0003] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:
[0004] The existing development method has low development efficiency. The browser on the mobile phone cannot be debugged at breakpoints, and it is inconvenient to view logs, which is not conducive to error troubleshooting. In addition, there are many mobile phone models, different browser standards are not unified, and the kernel versions are inconsistent, which makes debugging difficult. Therefore, there are many uncertainties when developing VR panorama (H5). Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a cross-device page debugging method and apparatus, which can at least solve the problem that existing handheld devices cannot debug VR panorama (H5).
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a cross-device page debugging method is provided, comprising:
[0007] Performing posture monitoring on a page in a browser of the first device to obtain a rotation angle of the page on each coordinate axis, and converting the rotation angle based on a predetermined conversion matrix to obtain a quaternion; wherein the quaternion represents the posture of the plane where the page is located;
[0008] The quaternion is transmitted to a server, and the quaternion is broadcasted to a second device through the server, so that after the quaternion is rendered in a virtual reality panorama in the second device, breakpoint debugging is performed on the code of the page according to the virtual reality panorama.
[0009] Optionally, before transmitting the quaternion to the server, the method further includes:
[0010] A long link is established with the server, and an identity identifier is transmitted to the server through the long link, so that when the server recognizes that the identity identifier is a producer identity identifier, the long link is determined as a producer long link.
[0011] Optionally, after performing breakpoint debugging on the code of the page according to the virtual reality panorama, the method further includes:
[0012] By linking with the page end, whether the code of the page changes is monitored, so that when the code of the page changes, a page refresh request is transmitted to the page end;
[0013] Receive the debugged code of the page fed back by the page end, and refresh the page based on the code.
[0014] Optionally, after performing breakpoint debugging on the code of the page according to the virtual reality panorama, the method further includes:
[0015] Receiving a code update instruction transmitted by the page end; wherein the code update instruction is generated by the page end after receiving the code transmitted by the second device, and the code is the code after debugging the page;
[0016] The page is refreshed based on the code.
[0017] Optionally, performing virtual reality panoramic rendering on the quaternion in the second device further includes:
[0018] The second device constructs a projection matrix based on an orthogonal projection method, and performs virtual reality panoramic rendering by combining the quaternion and the panoramic model.
[0019] To achieve the above object, according to another aspect of an embodiment of the present invention, a cross-device page debugging apparatus is provided, comprising:
[0020] A posture monitoring module is used to monitor the posture of the page in the browser of the first device, obtain the rotation angle of the page on each coordinate axis, and convert the rotation angle based on a predetermined conversion matrix to obtain a quaternion; wherein the quaternion represents the posture of the plane where the page is located;
[0021] The information transmission module is used to transmit the quaternion to the server, and broadcast the quaternion to the second device through the server, so that after the quaternion is rendered in a virtual reality panorama in the second device, the code of the page is breakpoint debugged according to the virtual reality panorama.
[0022] Optionally, a link establishment module is also included, for:
[0023] A long link is established with the server, and an identity identifier is transmitted to the server through the long link, so that when the server recognizes that the identity identifier is a producer identity identifier, the long link is determined as a producer long link.
[0024] Optionally, a code refresh module is also included for:
[0025] By linking with the page end, whether the code of the page changes is monitored, so that when the code of the page changes, a page refresh request is transmitted to the page end;
[0026] Receive the debugged code of the page fed back by the page end, and refresh the page based on the code.
[0027] Optionally, a code refresh module is also included for:
[0028] Receiving a code update instruction transmitted by the page end; wherein the code update instruction is generated by the page end after receiving the code transmitted by the second device, and the code is the code after debugging the page;
[0029] The page is refreshed based on the code.
[0030] Optionally, a panoramic rendering module is also included for:
[0031] The second device constructs a projection matrix based on an orthogonal projection method, and performs virtual reality panoramic rendering by combining the quaternion and the panoramic model.
[0032] To achieve the above objective, according to yet another aspect of an embodiment of the present invention, a cross-device page debugging electronic device is provided.
[0033] The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned cross-device page debugging methods.
[0034] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the above-mentioned cross-device page debugging methods is implemented.
[0035] According to the solution provided by the present invention, an embodiment of the above invention has the following advantages or beneficial effects: based on the idea that the second device cannot simulate the posture of the first device, and the browser of the first device does not have debugging capabilities, by separating the calculation and rendering of data, the result calculated by the first device is transmitted to the second device, and code debugging is performed on the second device, thereby solving the problem that the VR panorama (H5) cannot be debugged on the first device.
[0036] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0038] Figure 1 This is a schematic diagram of the main process of a cross-device page debugging method according to an embodiment of the present invention;
[0039] Figure 2 is a schematic diagram of constructing a device coordinate system for the first device;
[0040] Figure 3(a) to Figure 3(c) is a schematic diagram of the rotation of each coordinate axis in the first device coordinate system;
[0041] Figure 4 It is a schematic diagram of the interaction process between the middle converter and the first device and the second device;
[0042] Figure 5 It is a schematic diagram of constructing a projection matrix using orthogonal projection;
[0043] Figure 6 It is a schematic diagram of rendering VR panorama and code debugging on the PC side;
[0044] Figure 7 This is a schematic diagram of main modules of a cross-device page debugging apparatus according to an embodiment of the present invention;
[0045] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0046] Fig. 9 It is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0048] See also Figure 1 , which shows a main flow chart of a cross-device page debugging method provided by an embodiment of the present invention, including the following steps:
[0049] S101: monitoring the posture of a page in a browser of a first device to obtain a rotation angle of the page on each coordinate axis, and converting the rotation angle based on a predetermined conversion matrix to obtain a quaternion; wherein the quaternion represents the posture of the plane where the page is located;
[0050] S102: Transmitting the quaternion to a server, broadcasting the quaternion to a second device through the server, so that after performing virtual reality panorama rendering on the quaternion in the second device, breakpoint debugging is performed on the code of the page according to the virtual reality panorama.
[0051] In the above implementation, for step S101, the embodiment of the present invention is applicable to all scenarios in H5 that are applicable to gyroscope data. The first device involved can be a handheld device such as a mobile phone, and the second device can be a PC, a tablet computer, a desktop computer, etc.
[0052] Define the X, Y, and Z axes for the first device. For details, see Figure 2 The coordinate system of the first device is defined on the integrated display screen:
[0053] 1) x is on the display screen plane, the right side of the screen is positive;
[0054] 2) y is on the display screen, the top of the screen is positive;
[0055] 3) z is perpendicular to the display screen and is positive when it moves away from the screen.
[0056] To determine whether the first device is shaking, its placement (horizontally or diagonally), etc., you can listen to the deviceOrientation (gyroscope in the first device) event to obtain the rotation angle of the first device on three coordinate axes: alpha (α) value, beta (β) value, gamma (γ) value. It should be noted that the alpha, beta, and gamma attributes of this event must indicate the orientation of the first device, which is expressed as a conversion from a coordinate system fixed on the earth to a coordinate system fixed on the first device.
[0057] Rotations must use the right-hand rule, that is, positive rotations about an axis are clockwise rotations from the direction of that axis. Starting with the two frames coinciding, the following rules apply to rotations:
[0058] 1) With the z-axis of the first device coordinate system as the axis, rotate alpha degrees. The range of alpha is [0,360), as shown in Figure 3(a).
[0059] 2) With the x-axis of the first device coordinate system as the axis, rotate beta degrees. The range of beta is [-180, 180), as shown in Figure 3(b).
[0060] 3) Rotate gamma with the y-axis of the first device coordinate system as the axis. The scope of gamma is [-90,90), as shown in Figure 3(c).
[0061] Among them, the gyroscope is a device for detecting the angular motion of a high-speed rotating body relative to the inertial space around one or two axes orthogonal to the rotation axis using the momentum of the sensitive housing. Angular motion detection devices made using other principles that have the same function are also called gyroscopes. The gyroscope can measure the rotation and deflection movements very well, accurately analyze and determine the actual movements of the user, and then perform corresponding control operations on the first device based on the movements.
[0062] In step S102 , based on Euler transformation, the rotation angle of the first device is converted into a quaternion.
[0063] In 3D graphics, the most commonly used rotation representation methods are quaternions and Euler angles. Since Euler angles have the problem of universal lock, it is not conducive to subsequent calculations. The usual operation is to convert Euler angles into quaternions. The definition of quaternion q is:
[0064]
[0065] Among them, q means that multiple rotations around the coordinate axis can be equivalent to a certain angle rotation around a certain axis. It stores the information of the rotation axis and the rotation angle, and can conveniently describe the rotation of a rigid body around any axis.
[0066] The conversion method based on converting the ZYX Euler angle (or RPY angle: rotating α, β, γ angles around the fixed coordinate system XYZ) to quaternion is:
[0067]
[0068] Therefore, the first device attitude information collected by the gyroscope this time is converted by the above conversion method to obtain the quaternion of the first device. In addition, when debugging different first devices, the algorithm can be included based on the running page.
[0069] For step S103, the present invention mainly solves the problem that the browser in the first device does not have debugging capabilities. To address this problem, the present invention proposes a method of debugging the page in the first device based on the second device. For example, the PC cannot simulate the posture of the mobile phone, and the browser of the mobile phone does not have debugging capabilities. The two cooperate to implement the page debugging method. For details of the overall process, see Figure 4 shown.
[0070] The first device sends the quaternion of the view coordinates to the server, and the server broadcasts the received quaternion to the second device. In addition to the broadcast method, other methods that can achieve simultaneous reception by multiple terminals are also possible.
[0071] The second device performs VR panoramic rendering and display on the received quaternion in combination with the projection matrix of the orthogonal projection and the coordinates of the panoramic model (the panoramic image can be obtained according to the inherent grid and can be regarded as a globe).
[0072] The specific method for constructing the projection matrix is as follows: the projection matrix Projection is mainly generated by using the orthographic projection method, and the display is guaranteed not to be deformed and to adapt to the screen size.
[0073] The main purpose of orthographic projection is to display 3D content on a 2D screen. All projection lines are perpendicular to the final drawing surface. It is a relatively simple projection technology, that is, the visual space of the geometry to be displayed is an axis-aligned box that will be transformed into the canonical view volume. Figure 5 shown.
[0074] The view volume in the figure is defined by 6 faces:
[0075] Left: x = l
[0076] Right: x = r
[0077] Bottom: y = b
[0078] Top: y = t
[0079] Near: z = n
[0080] Far: z = f
[0081] Consider the three coordinate axes separately. Starting from the x-axis, the x-coordinate range of the points in the viewing volume is [l, r]. Transform it to the range [-1, 1]: l≤x≤r;
[0082] Reduce the range and subtract l from each term, so that the leftmost term changes to 0. Another way is to shift the range so that it is centered at 0 instead of 0 at one end, but this way the algebra is neater, and we get: 0≤xl≤rl;
[0083] Assume that the desired x-value range is 2 units wide, from 1 to -1, so multiply each term by 2 / (rl). Note that (rl) is the width of the view volume, so it is always a positive number, so don't worry about the inequality sign changing direction: 0≤(2x-2l) / (rl)≤2; then subtract one from each term to get the desired range: -1≤(2x-2l) / (rl)-1≤1;
[0084] Divide the middle part into two parts to facilitate the subsequent matrix form conversion:
[0085]
[0086] The middle term of the inequality is the formula for converting x to the canonical view volume:
[0087]
[0088] The transformation of the Y axis is the same as that of the x axis, except that y replaces x, t replaces r, and b replaces l. The result is:
[0089]
[0090] For the Z axis, we need to map z to the range [0,1]. The z coordinate is initially in the range [n,f]: n≤z≤f. The subsequent steps are similar to the previous ones, and finally we get the transformation formula for the z axis:
[0091]
[0092] Based on the above three projection formulas, the projection matrix can be derived:
[0093]
[0094] In a 3D scene, you can use the MVP matrix (Model-View-Projection) transformation to achieve observation of objects. Among them, MVP is a general formula in graphics and has a general solution.
[0095] The user can use the debugging plug-in of the browser (such as Chrome or other browsers that support H5) to perform code breakpoint debugging on the second device. Figure 6 As shown in the figure, the code is HTML code, which describes the framework and content of the page. Breakpoint debugging allows the program to execute only to the point where it is allowed to execute, so that it is easy to find program errors when debugging the program.
[0096] In addition, the second device mainly modifies the code to debug the page source code, and the modified code needs to be published to the web end again to facilitate the first device to refresh the page. After that, the gyroscope continues to monitor the posture of the first device, and the second device renders the VR panorama of the page and performs code breakpoint debugging.
[0097] For the code debugged on the second device, you can update the code of the page in the browser of the first device in two ways:
[0098] 1) The first device actively updates, that is, the first device monitors in real time whether the code of the page on the web end has changed. If it has changed, the first device extracts / receives the code from the web end to refresh the page;
[0099] 2) The first device is passively updated, that is, the second device loads the modified code resource to the web end, and then the web end automatically sends the modified code to the first device to update the code in the first device.
[0100] The method provided in the above embodiment is based on the idea that the second device cannot simulate the posture of the first device and the browser of the first device does not have debugging capabilities. By separating the calculation and rendering of data, the results calculated by the first device are transmitted to the second device, and code debugging is performed on the second device, thereby solving the problem that the VR panorama (H5) cannot be debugged on the first device.
[0101] In addition, the transit service of the present invention is mainly implemented using the H5 websocket protocol; wherein the WebSocket protocol is a long link, the goal of which is to provide full-duplex two-way communication on an independent persistent connection, so that the first device and the second device can actively send and receive data to each other.
[0102] It should be noted that Websocket is a standard protocol. Developers can customize the transmission format, which is a common method. Usually, the client will initiate a WebSocket request through a short link. After obtaining a response from the server, the established connection will use HTTP upgrade to convert the HTTP protocol to the WebSocket protocol. Both the web browser and the server must implement the WebSockets protocol to establish and maintain the connection. Since WebSockets links exist for a long time, unlike typical HTTP links, they have an important impact on the server.
[0103] The first device is a producer, and the second device is a consumer. After the first device establishes a connection with the server, it first sends a first identity (for example, {"type:":1}). The server recognizes the identity and adds the websocket link to type 1 to the producer queue.
[0104] Similarly, for the second device, after establishing a link with the server, it first sends a second identity (for example, {"type:":2}) to the server. The server recognizes the identity and adds the websocket link of type 2 to the consumer queue.
[0105] It should be noted that in the present invention, the identity identifiers of all producers are consistent, and the identity identifiers of consumers are also consistent.
[0106] See also Figure 7 , showing a schematic diagram of main modules of a cross-device page debugging apparatus 700 provided by an embodiment of the present invention, including:
[0107] The posture monitoring module 701 is used to monitor the posture of the page in the browser of the first device, obtain the rotation angle of the page on each coordinate axis, and convert the rotation angle based on a predetermined conversion matrix to obtain a quaternion; wherein the quaternion represents the posture of the plane where the page is located;
[0108] The information transmission module 702 is used to transmit the quaternion to the server, and broadcast the quaternion to the second device through the server, so that after the quaternion is rendered in a virtual reality panorama in the second device, the code of the page is breakpoint debugged according to the virtual reality panorama.
[0109] The implementation device of the present invention further includes a link establishment module 703 (not shown in the figure), which is used to:
[0110] A long link is established with the server, and an identity identifier is transmitted to the server through the long link, so that when the server recognizes that the identity identifier is a producer identity identifier, the long link is determined as a producer long link.
[0111] The implementation device of the present invention further includes a code refreshing module 703, which is used to:
[0112] By linking with the page end, whether the code of the page changes is monitored, so that when the code of the page changes, a page refresh request is transmitted to the page end;
[0113] Receive the debugged code of the page fed back by the page end, and refresh the page based on the code.
[0114] The implementation device of the present invention further includes a code refreshing module 704 (not shown in the figure), which is used to:
[0115] Receiving a code update instruction transmitted by the page end; wherein the code update instruction is generated by the page end after receiving the code transmitted by the second device, and the code is the code after debugging the page;
[0116] The page is refreshed based on the code.
[0117] The implementation device of the present invention further includes a panoramic rendering module 705 (not shown in the figure), which is used to:
[0118] The second device constructs a projection matrix based on an orthogonal projection method, and performs virtual reality panoramic rendering by combining the quaternion and the panoramic model.
[0119] In addition, the specific implementation content of the device described in the embodiment of the present invention has been described in detail in the method described above, so the repeated content will not be described again here.
[0120] Figure 8 An exemplary system architecture 800 is shown in which embodiments of the present invention may be applied.
[0121] like Figure 8 As shown, the system architecture 800 may include terminal devices 801, 802, 803, a network 804 and a server 805 (just an example). The network 804 is used to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. The network 804 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0122] The user can use the terminal devices 801, 802, 803 to interact with the server 805 through the network 804 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 801, 802, 803.
[0123] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting page browsing, including but not limited to a smart first device, a tablet computer, a laptop computer, a desktop computer, and the like.
[0124] The server 805 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using the terminal devices 801 , 802 , and 803 (only as an example).
[0125] It should be noted that the method provided in the embodiment of the present invention is generally executed by the server 805 , and accordingly, the device is generally set in the server 805 .
[0126] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0127] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0128] like Fig. 9As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0129] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0130] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.
[0131] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0132] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a posture monitoring module and an information transmission module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the information transmission module may also be described as a "module for transmitting quaternions".
[0134] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0135] Performing posture monitoring on the page in the browser of the first device to obtain the rotation angle of the page on each coordinate axis, and converting the rotation angle based on a predetermined conversion matrix to obtain a quaternion; wherein the quaternion represents the posture of the plane where the page is located;
[0136] The quaternion is transmitted to a server, and the quaternion is broadcasted to a second device through the server, so that after the quaternion is rendered in a virtual reality panorama in the second device, breakpoint debugging is performed on the code of the page according to the virtual reality panorama.
[0137] According to the technical solution of an embodiment of the present invention, based on the idea that the second device cannot simulate the posture of the first device and the browser of the first device does not have debugging capabilities, the calculation and rendering of data are separated, the calculation results are transmitted to the second device, and code debugging is performed on the second device, thereby solving the problem that the VR panorama (H5) cannot be debugged on the first device.
[0138] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A cross-device page debugging method, characterized in that: include: Perform posture monitoring on the page in the browser of the first device to obtain the rotation angle of the page on each coordinate axis, and convert the rotation angle based on a predetermined conversion matrix to obtain a quaternion; wherein the second device cannot simulate the posture of the first device, the browser of the first device does not have debugging capability, and the quaternion represents the posture of the plane where the page is located; Transmitting the quaternion to a server, broadcasting the quaternion to a second device through the server, so that after performing virtual reality panorama rendering on the quaternion in the second device, breakpoint debugging is performed on the code of the page based on the virtual reality panorama and a debugging plug-in of a browser supporting VR panorama; Among them, before transmitting the quaternion to the server, it also includes: the first device and the second device respectively establish long links with the server, and transmit the identity identifier to the server through the long link, so that when the server recognizes the identity identifier as a producer identity identifier, the long link is determined as a producer long link, and when the server recognizes the identity identifier as a consumer production identity identifier, the long link is determined as a consumer long link.
2. The method according to claim 1, characterized in that After the code of the page is debugged at breakpoints according to the virtual reality panorama, the method further includes: The first device monitors whether the code of the page changes through a link with the Web end, and transmits a page refresh request to the Web end when it is detected that the code of the page changes; Receive the code after debugging the page fed back by the Web end, and refresh the page based on the code.
3. The method according to claim 1, characterized in that: After the code of the page is debugged at breakpoints according to the virtual reality panorama, the method further includes: The first device receives a code update instruction transmitted by the Web end; wherein the code update instruction is generated by the Web end after receiving the code transmitted by the second device, and the code is the code after debugging the page; The page is refreshed based on the code.
4. The method according to claim 1, characterized in that: Performing virtual reality panoramic rendering on the quaternion in the second device also includes: The second device constructs a projection matrix based on an orthogonal projection method, and performs virtual reality panoramic rendering by combining the quaternion and the panoramic model.
5. A cross-device page debugging device, characterized in that: include: A posture monitoring module is used to monitor the posture of the page in the browser of the first device, obtain the rotation angle of the page on each coordinate axis, and convert the rotation angle based on a predetermined conversion matrix to obtain a quaternion; wherein the second device cannot simulate the posture of the first device, the browser of the first device does not have debugging capabilities, and the quaternion represents the posture of the plane where the page is located; An information transmission module, used for transmitting the quaternion to a server, broadcasting the quaternion to a second device through the server, so that after performing virtual reality panorama rendering on the quaternion in the second device, breakpoint debugging is performed on the code of the page based on the virtual reality panorama and a debugging plug-in of a browser supporting VR panorama; Among them, before transmitting the quaternion to the server, it also includes: the first device and the second device respectively establish long links with the server, and transmit the identity identifier to the server through the long link, so that when the server recognizes the identity identifier as a producer identity identifier, the long link is determined as a producer long link, and when the server recognizes the identity identifier as a consumer production identity identifier, the long link is determined as a consumer long link.
6. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
