Page data processing method, device and electronic device
By embedding subpages in the web page to load the rendering program and realizing data communication through the web interface, the Unity rendering program occupies a lot of memory and crashes affect the main page, and the independence of the rendering program does not affect the display and memory management of the main page when it crashes.
Patent Information
- Application Number
- CN202111388503.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2041-11-22
AI Technical Summary
When the Unity renderer loads multiple environment data in a web page, it occupies a large amount of memory resources, causing the page to crash, and the renderer error will affect the normal use of the entire page.
By embedding subpages in the main page, the subpage is used to load the rendering program and realize data communication through the web interface to avoid the main page crash caused by rendering program errors.
It realizes that the display of the main page does not affect the rendering program crashes, and the memory overflow problem is avoided through independent memory management.
Smart Images

Figure CN114115875B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device and electronic device for processing page data. Background Art
[0002] Currently, the Unity rendering program is being used more and more widely. For example, it can be used in Web pages to render 3D content.
[0003] Usually, a rendering program needs to load multiple environment data on a page to implement a rendering function, and loading multiple environment data on a page will occupy a large amount of memory resources.
[0004] In the prior art, if an error occurs in the rendering program itself, the entire page will crash, affecting the normal use of other functions of the page. Summary of the invention
[0005] In view of this, the embodiments of the present specification provide a method, device and electronic device for processing page data, so as to complete the rendering process through sub-pages and avoid the main page crash caused by errors in the rendering program.
[0006] To solve the above technical problems, the embodiments of this specification are implemented as follows:
[0007] A method for processing page data is applied to a Web page, wherein the Web page includes a main page and a subpage embedded in the main page, the subpage is used to load a rendering program, and the main page and the subpage can realize data communication through a Web interface, and the method includes:
[0008] Receive page data to be processed;
[0009] Determining whether the page data to be processed is first component data generated based on the main page;
[0010] If it is the first component data, calling the Web interface to send the default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface;
[0011] The component is displayed on the main page based on the component information.
[0012] In some embodiments, the method further comprises:
[0013] Determining whether the page data to be processed is second component data generated based on the sub-page;
[0014] If it is the second component data, the Web interface is called to send the second component data to the main page, so that the main page displays the 3D rendering data based on the second component data.
[0015] In some embodiments, the method further comprises:
[0016] When a release instruction for releasing the sub-page memory space is received, determining a memory address of the memory space corresponding to the sub-page memory;
[0017] Release the data corresponding to the memory address.
[0018] In some embodiments, the release instruction specifically includes: an instruction to close the rendering program, an instruction to refresh the sub-page, and / or an instruction to release the memory space of the rendering program.
[0019] In some embodiments, the sub-page is provided with a monitoring function, and the method further comprises:
[0020] When the monitoring function monitors a keyboard operation event, the operation instruction corresponding to the keyboard operation event is sent;
[0021] Execute the operation instruction.
[0022] In some embodiments, the rendering program is a Unity rendering program.
[0023] In some embodiments, the Web interface is a postMessage interface.
[0024] Another aspect of the present invention provides a device for processing page data, which is applied to a Web page, wherein the Web page includes a main page and a subpage embedded in the main page, the subpage is used to load a rendering program, and the main page and the subpage can achieve data communication through a Web interface, and the device includes:
[0025] A receiving module, used for receiving page data to be processed;
[0026] A determination module, used to determine whether the page data to be processed is first component data generated based on the main page;
[0027] a processing module, configured to, if the component data is the first component data, call the Web interface to send default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface;
[0028] A display module is used to display the component on the main page based on the component information.
[0029] Another aspect of the present invention further provides an electronic device, comprising:
[0030] at least one processor; and,
[0031] a memory communicatively connected to the at least one processor; wherein,
[0032] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0033] Receive page data to be processed of a Web page; wherein the Web page includes a main page and a sub-page embedded in the main page, the sub-page is used to load a rendering program, and the main page and the sub-page can achieve data communication through a Web interface;
[0034] Determining whether the page data to be processed is first component data generated based on the main page;
[0035] If it is the first component data, calling the Web interface to send the default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface;
[0036] The component is displayed on the main page based on the component information.
[0037] The beneficial effects that can be achieved by the embodiments of the present invention include at least:
[0038] In an embodiment of the present invention, since a sub-page is embedded in the main page of a Web page, when the main page needs to render the first component data, the rendering operation can be completed through a rendering program set in the sub-page, and the transmission of the above-mentioned rendering data can be realized through a Web interface. When the rendering program crashes, the display of the main page will not be affected. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 It is a flowchart of a method for processing page data provided by an embodiment of the present invention.
[0041] Figure 2 It is a schematic diagram of the structure of a Web page in an embodiment of the present invention.
[0042] Figure 3 A schematic diagram of the structure of a device for processing page data provided in an embodiment of this specification.
[0043] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0044] The embodiments of the present invention mainly involve the scene in which a Web page uses a Unity rendering program, wherein the Unity rendering program is an application component for developing 3D content such as games and animations, and can render 3D content in a Web page.
[0045] Since the Unity renderer needs to load multiple environment files in the page, it takes up a lot of memory resources. If you need to release memory resources after loading these environment files in the page, you can only close the page or refresh the page to do so. If the release is not performed, the page will crash when the memory overflows. In addition, since the Untiy renderer is highly coupled with the page, a crash caused by an error in the Unity renderer itself may cause the entire page to crash.
[0046] In view of this, a method for processing page data is provided in an embodiment of the present invention.
[0047] Figure 1 It is a flowchart of a method for processing page data provided by an embodiment of the present invention.
[0048] The embodiment of the present invention discloses a method for processing page data, which is applied to a Web page, wherein the Web page includes a main page and a subpage embedded in the main page, the subpage is used to load a rendering program, and the main page and the subpage can realize data communication through a Web interface.
[0049] Figure 2 Schematic diagram of the structure of a Web page in an embodiment of the present invention. Figure 2 As shown, in an embodiment of the present invention, a main page 21 and a sub-page 22 are set in a Web page 20, and the sub-page can be embedded in the main page. When the main page is displayed, the sub-page can display the content of the Unity rendering program, and the main page and the sub-page can realize data communication, and data transmission can be realized through the Web interface. Among them, the Web interface is a postMessage interface, which can realize cross-resource communication. Of course, the size and position of the sub-page 22 can be modified accordingly according to the 3D display area, which is not specifically limited here.
[0050] In the embodiment of the present invention, the sub-page is embedded in the main page, which is equivalent to becoming a part of the main page, but the allocation of memory resources is independent of each other.
[0051] In an embodiment of the present invention, the method includes:
[0052] S100: receiving page data to be processed;
[0053] S200, determining whether the page data to be processed is first component data generated based on the main page;
[0054] S300: If it is the first component data, calling the Web interface to send default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface;
[0055] S400: Display the component on the main page based on the component information.
[0056] In the embodiment of the present invention, based on the set web page page architecture, when the main page needs to process page data, the page data can be processed based on the page architecture. If the page data is component data, the component data is 3D rendered in the subpage, and the main page is only displayed.
[0057] When receiving the page data to be processed, it is determined whether the page data to be processed is first component data generated based on the main page.
[0058] Among them, the first component data is data that needs to call resources for 3D rendering.
[0059] For example, when a 3D component needs to be added, a rendering operation is performed through a 3D rendering program to obtain the component.
[0060] In the embodiment of the present invention, when the page data to be processed is ordinary data, corresponding processing can be directly performed.
[0061] Wherein, determining whether the page data to be processed is the first component data generated based on the main page specifically includes:
[0062] Determine whether the page data to be processed is initiated by the main page, and if so, determine the data type of the page data to be processed;
[0063] If the data type of the page data to be processed is 3D component data to be rendered, it is determined that the page data to be processed is first component data.
[0064] In the embodiment of the present invention, when the operation of adding a component is performed in the main page, data communication can be performed with the sub-page.
[0065] In step 300, the Web interface is called to send the default component data corresponding to the first component data to the subpage. Since the subpage is configured with a Unity renderer, the Unity renderer can generate a new component based on the default component data, add a unique id and location information, and return it to the main page through the subpage.
[0066] Among them, the rendering process of the Unity rendering program has not changed. The main page only displays the components displayed by the Unity rendering program through the sub-pages. In terms of visual effect, it looks like the components are displayed directly on the homepage.
[0067] In step 400, the main page displays the component based on the parameter.
[0068] It can be seen that when adding components, the main page itself does not need to set the Unity rendering program, but the sub-page performs the rendering process. When the main page needs to change data, it can perform the rendering process based on the Unity rendering program set by the sub-page. This allows the Unity rendering program to be decoupled from the main page. When memory needs to be released, only the memory space corresponding to the sub-page needs to be released, without closing the main page or refreshing the main page. Moreover, even if the Unity rendering program of the sub-page fails, it will not cause the main page to crash, and the content displayed on the main page will not be affected.
[0069] In the embodiment of the present invention, the component is in the unity rendering program, the unity rendering program is visible in the sub-page, and the sub-page is visible in the main page, so the component can be displayed in the main page.
[0070] In the embodiment of the present invention, the functions of the sub-pages can be understood as:
[0071] 1. Data bridge, receives the main page data and sends it to the unity rendering program, receives the unity data and sends it to the main page.
[0072] 2. Load the unity rendering program and display it, providing independent memory allocation, which can achieve the effect of closing the browser tab when unloading the main page.
[0073] For example, in a web page that needs to display a 3D geographic scene, the main page can display the 3D data displayed by the unity rendering program through a subpage. When adding a label component to the 3D geographic scene, the label component rendered by the unity rendering program can be displayed through the subpage. And the main page can upload the component information corresponding to the label component to the server.
[0074] For another example, in a 3D game, the prop column in the main page needs to add a 3D effect interface. When the main page generates data to be processed, it can be rendered through the Unity rendering program in the sub-page to obtain the id, address information, etc. of the interface, and then sent to the server for storage based on at least the above id and address information, and the 3D effect interface is displayed through the sub-page. Since the Unity rendering program is not directly set in the main page, even if the rendering times are too many and the memory is about to overflow, the memory of the sub-page can be released in time to avoid crashes. Moreover, when the Unity rendering program itself crashes, since it only affects the sub-page, and the sub-page does not affect the display and basic operations in the main page, it will not affect the user's gaming experience in the main page.
[0075] In an embodiment of the present invention, the first component data can be any relevant data that can render a 3D effect component, such as game props in a 3D game, a status bar, a function menu in a chart, etc. As long as the data needs to call a rendering program, it can be called the first component data.
[0076] In the embodiment of the present invention, the specific process of embedding a sub-page into a main page may include:
[0077] The address of the sub-page is sent to the configuration item of the iframe. The iframe framework is used to embed other pages into the current page. The association relationship can be established through the above configuration items. When the address of the sub-page is entered into the configuration item, the sub-page can be embedded into the main page when the configuration item is run. The sub-page loads the Untiy rendering program normally.
[0078] When you need to reinstall or switch the version of the Unity rendering program, such as modifying or reinstalling the project package, you only need to delete the iframe node corresponding to the original subpage. In the embodiment of the present invention, deleting the iframe node is equivalent to directly closing a window of the browser, which can enable the browser to release the memory corresponding to the window, that is, the memory space corresponding to the subpage in the embodiment of the present application.
[0079] It can be understood that in the embodiment of the present invention, the main page itself does not include components, but only serves as a display interface display component. The component is a component of the unity rendering program. The sub-page is used as a bridge to complete data interaction with the main page and is uploaded to the server for storage through the main page.
[0080] In an embodiment of the present invention, since a sub-page is embedded in the main page of a Web page, when the main page needs to render the first component data, the rendering operation can be completed through a rendering program set in the sub-page, and the transmission of the above-mentioned rendering data can be realized through a Web interface. When the rendering program crashes, the display of the main page will not be affected.
[0081] Based on the above embodiments, when the data of a sub-page changes, the present invention can also transfer the data of the sub-page to the main page for use by the main page.
[0082] Based on the above embodiment, the method further includes:
[0083] Determining whether the page data to be processed is second component data generated based on the sub-page;
[0084] If it is the second component data, the Web interface is called to send the second component data to the main page, so that the main page displays the 3D rendering data based on the second component data.
[0085] In the embodiment of the present invention, if the page data to be processed is the second component data, that is, when the sub-page needs to send data to the main page, the second component data can also be sent to the main page through the Web interface. The second component data is, for example, rendered 3D data.
[0086] When it is determined that the sub-page generates the second component data, the second component data is sent to the main page through the Web interface, wherein the second component data may be component information of the component, and the component information may include id and address information.
[0087] The main page can display 3D rendering data based on the second component data.
[0088] In an embodiment of the present invention, the second component data generated based on the sub-page data can also be displayed in the home page. Wherein, the aforementioned main page can display the 3D rendering data displayed by the Untiy rendering program through the sub-page.
[0089] Based on the above embodiment, the method further includes:
[0090] When a release instruction for releasing the sub-page memory space is received, determining a memory address of the memory space corresponding to the sub-page memory;
[0091] Release the data corresponding to the memory address.
[0092] In some embodiments, the release instruction specifically includes: an instruction to close the rendering program, an instruction to refresh the sub-page, and / or an instruction to release the memory space of the rendering program.
[0093] In the embodiment of the present invention, when the content needs to be released, only the memory resources corresponding to the sub-page may be released.
[0094] The release instruction can be sent after an active operation or after passive generation. The active operation can be sent by the user through a refresh operation or by a program through a scheduled task. The passive generation can be a release instruction automatically generated when system resources reach a certain threshold. Alternatively, the browser where the web page is located automatically releases the memory.
[0095] The release instruction may specifically include an instruction to close the rendering program, an instruction to refresh the subpage, and / or an instruction to release the rendering program memory space, etc. After receiving the release instruction, only the memory address space corresponding to the subpage is released.
[0096] In the embodiment of the present invention, when the memory needs to be released, the entire page may not be refreshed, and only the memory space of the sub-page may be released, thereby ensuring the normal operation of the main page.
[0097] In the embodiment of the present invention, when releasing the memory, the iframe is uninstalled, thereby achieving the release of the page memory space corresponding to the sub-page without affecting the normal use of the main page.
[0098] On the basis of the above-mentioned embodiment, in the embodiment of the present invention, when the focus is on the sub-page, some events cannot be identified. Based on this, in the embodiment of the present invention, a monitoring function is also provided.
[0099] Based on the above embodiment, the sub-page is provided with a monitoring function, and the method further includes:
[0100] When the monitoring function monitors a keyboard operation event, the operation instruction corresponding to the keyboard operation event is sent;
[0101] Execute the operation instruction.
[0102] In the embodiment of the present invention, the monitoring function of the main page is bound to the sub-page, so that the operation on the sub-page can also trigger the corresponding event.
[0103] The event can be a keyboard operation event. When the focus of the web page is on the subpage, if a keyboard operation event is monitored, the corresponding event can also be triggered. Keyboard operation events include shortcut operations, etc.
[0104] Since in the embodiment of the present invention, the event monitoring event is bound, so when the focus is on the subpage or the main page, the monitoring of the keyboard operation event can be normally realized. Of course, the monitoring events that other monitoring functions can realize should also be used as equal embodiments, and will not be repeated here.
[0105] In the embodiment of the present invention, after the architecture of the Web page is changed, the original function can still be realized, and the stability of the Unity rendering program is enhanced.
[0106] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 3 The embodiments of this specification provide corresponding to Figure 1 A schematic diagram of the structure of a device for processing page data. Figure 3 As shown, the device is applied to a Web page, wherein the Web page includes a main page and a sub-page embedded in the main page, the sub-page is used to load a rendering program, the main page and the sub-page can realize data communication through a Web interface, and the device includes:
[0107] A receiving module 31, used for receiving page data to be processed;
[0108] A determination module 32, used to determine whether the page data to be processed is first component data generated based on the main page;
[0109] The processing module 33 is configured to, if the component data is the first component data, call the Web interface to send the default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface;
[0110] The display module 34 is configured to display the component on the main page based on the component information.
[0111] It is understood that the above modules refer to computer programs or program segments for executing one or more specific functions. In addition, the distinction between the above modules does not mean that the actual program codes must also be separated.
[0112] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.
[0113] Figure 4 The embodiments of this specification provide corresponding to Figure 1 A schematic diagram of the structure of an electronic device. Figure 4 As shown, the electronic device 500 may include:
[0114] at least one processor 510; and,
[0115] A memory 530 in communication with the at least one processor; wherein,
[0116] The memory 530 stores instructions 520 executable by the at least one processor 510. The instructions are executed by the at least one processor 510 to enable the at least one processor 510 to:
[0117] Receive page data to be processed of a Web page; wherein the Web page includes a main page and a sub-page embedded in the main page, the sub-page is used to load a rendering program, and the main page and the sub-page can achieve data communication through a Web interface;
[0118] Determining whether the page data to be processed is first component data generated based on the main page;
[0119] If it is the first component data, calling the Web interface to send the default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface;
[0120] Display the component on the main page based on the component information
[0121] The above describes specific embodiments of the present specification. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0122] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other.
[0123] The devices, electronic devices and methods provided in the embodiments of this specification correspond to each other, and therefore, the devices and electronic devices also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding devices and equipment will not be repeated here.
[0124] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0125] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0126] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0127] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0128] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0133] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0134] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0135] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0136] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0137] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for processing page data, characterized in that: Applied to a Web page, wherein the Web page includes a main page and a sub-page embedded in the main page, the sub-page is used to load a rendering program, and the main page and the sub-page can realize data communication through a Web interface, and the method includes: Receive page data to be processed; If the page data to be processed is initiated by the main page, and the data type of the page data to be processed is 3D component data to be rendered, determining that the page data to be processed is first component data; Calling the Web interface to send default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface; generating a component according to the default component data is to implement a rendering operation on the default component data; The component is displayed on the main page based on the component information.
2. The method according to claim 1, characterized in that The method further comprises: Determining whether the page data to be processed is second component data generated based on the sub-page; If it is the second component data, the Web interface is called to send the second component data to the main page, so that the main page displays the 3D rendering data based on the second component data.
3. The method according to claim 1, characterized in that The method further comprises: When a release instruction for releasing the sub-page memory space is received, determining a memory address of the memory space corresponding to the sub-page memory; Release the data corresponding to the memory address.
4. The method according to claim 3, characterized in that The release instruction specifically includes: an instruction to close the rendering program, an instruction to refresh the sub-page and / or an instruction to release the memory space of the rendering program.
5. The method according to claim 1, characterized in that The subpage is provided with a monitoring function, and the method further comprises: When the monitoring function monitors a keyboard operation event, an operation instruction corresponding to the keyboard operation event is obtained; Execute the operation instruction.
6. The method according to any one of claims 1 to 5, characterized in that: The rendering program is a Unity rendering program.
7. The method according to any one of claims 1 to 5, characterized in that: The Web interface is a postMessage interface.
8. A device for processing page data, characterized in that: Applied to a Web page, wherein the Web page includes a main page and a sub-page embedded in the main page, the sub-page is used to load a rendering program, and the main page and the sub-page can realize data communication through a Web interface, and the device includes: A receiving module, used for receiving page data to be processed; a determination module, configured to determine that the page data to be processed is first component data if the page data to be processed is initiated by the main page and the data type of the page data to be processed is 3D component data to be rendered; A processing module, configured to call the Web interface to send default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface; the generating of the component according to the default component data is to implement the rendering operation of the default component data; A display module is used to display the component on the main page based on the component information.
9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Receive page data to be processed of a Web page; wherein the Web page includes a main page and a sub-page embedded in the main page, the sub-page is used to load a rendering program, and the main page and the sub-page can achieve data communication through a Web interface; If the page data to be processed is initiated by the main page, and the data type of the page data to be processed is 3D component data to be rendered, determining that the page data to be processed is first component data; Calling the Web interface to send default component data generated based on the first component data to the sub-page, so that the sub-page generates a component according to the default component data and sends the component information of the component to the main page through the Web interface; generating a component according to the default component data is to implement a rendering operation on the default component data; The component is displayed on the main page based on the component information.
Citation Information
Patent Citations
Page rendering method and device, electronic device and computer-readable medium
CN108984714A
Webpage synchronization method and device, equipment and storage medium
CN112612449A