Preview method and related device

Through the terminal device preview method that monitors and updates resource file changes in real time, the problem of low debugging and preview efficiency when developing 3D applications in the prior art is solved, real-time preview and debugging of 3D models by developers is realized, and development efficiency and experience are improved.

CN119576865APending Publication Date: 2025-03-07HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311156072.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2025-03-07

Smart Images

  • Figure CN119576865A_ABST
    Figure CN119576865A_ABST
Patent Text Reader

Abstract

The invention provides a preview method and a related device. The preview method comprises the steps that the preview effect of a currently developed 3D image is output according to M compiling files, the M compiling files correspond to currently developed M code files in a one-to-one mode, at least one code file in the M code files quotes a resource file containing a 3D model, and M is an integer; when a first resource file which is quoted by a first code file in the at least one code file and contains the 3D model changes, compiling the first code file to obtain a first compiled file; and outputting a preview effect of the developed 3D image corresponding to the change of the first resource file based on the first compiling file and other compiling files obtained by compiling code files except the first code file in the M compiling files. According to the preview method, under the condition that a developer does not need to restart a preview function, the latest effect of the corresponding 3D image after the developer debugs the parameters from the resource file can be previewed in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal devices, and in particular to a preview method and related apparatus for terminal devices. Background Art

[0002] Some applications in electronic devices can present a three-dimensional (3D) effect when presenting a UI interface to the user, so as to bring a stronger visual enjoyment and visual experience to the user. Such applications are also commonly referred to as 3D applications. Developers can develop the above 3D applications based on some integrated development environments (IDEs). During development, you can first import some resource files of the 3D models that need to be presented, and then directly reference these resource files when writing code files to improve development efficiency.

[0003] Some current IDEs provide developers with a preview function. After the developer has developed the code file for the 3D application, the developer can start the preview function to view the designed UI interface, so that the developer can observe whether the displayed 3D effect meets the requirements based on the preview UI interface. If it does not meet the requirements, the developer can adjust the relevant parameters in the resource file and restart the preview function to view the adjusted 3D effect.

[0004] However, this method has the following problems: low development and debugging efficiency and poor developer experience. Summary of the invention

[0005] The present application provides a preview method and related devices for enabling developers to preview in real time the latest effect of a 3D model corresponding to parameters adjusted by the developer from a resource file without restarting the preview function.

[0006] In a first aspect, the present application provides a processing method for a terminal device, comprising: outputting a preview effect of a currently developed three-dimensional 3D image according to M compiled files, the M compiled files corresponding one-to-one to the currently developed M code files, at least one of the M code files references a resource file containing a 3D model, and M is an integer; when a first resource file containing a 3D model referenced by a first code file in at least one code file changes, compiling the first code file to obtain a first compiled file; and outputting a preview effect of the developed 3D image corresponding to the change of the first resource file based on the first compiled file and other compiled files compiled from code files other than the first code file in the M compiled files.

[0007] As an example, the change in the first resource file includes at least one of the following: modifying a parameter in the first resource file, adding a parameter in the first resource file, and deleting a parameter in the first resource file.

[0008] It should be understood that in this embodiment, since the M compiled files are continuously updated as the resource files change when the preview effect of the 3D image is output, the preview effect of the generated 3D image to be displayed is continuously updated as the resource files change, that is, the preview interface displayed to the developer is continuously updated as the resource files change. Therefore, the developer can preview the latest effect of the model corresponding to the parameters adjusted by the developer from the resource file in real time without restarting the preview function.

[0009] In the embodiment, in one implementation, the code file (i.e., the first code file) affected when the first resource file changes can be determined by establishing a mapping relationship between M code files and referenced resource files. The mapping relationship is also referred to as first information, and the first information indicates the resource file referenced by each code file in the M code files, or in other words, the first information indicates which code files reference the same resource file, and which resource files are referenced by each code file.

[0010] In this way, when the developer modifies the parameters of a resource file, the affected code files that reference the resource file can be determined through the first information, and the affected code files can be recompiled for updating, so that the corresponding 3D image preview effect is updated after adjusting the parameters.

[0011] In combination with the first aspect, in a possible implementation, after outputting a preview effect of the currently developed 3D image according to the M compiled files and before compiling the first code file, the method further includes: monitoring whether the first resource file referenced by the first code file changes.

[0012] For example, in one implementation, a first hash value of a first resource file may be obtained at a first moment; a second hash value of the first resource file may be obtained at a second moment; and if the first hash value is different from the second hash value, it is determined that the first resource file has changed.

[0013] In combination with the second aspect, in a possible implementation, the M code files include a second code file, the second code file references a second resource file, and the second resource file is a resource file of a 2D model. The method also includes: when the second resource file changes, determining the second code file that references the second resource file based on the first information; compiling the second code file to obtain a second compiled file; and outputting a preview effect of the 3D image developed corresponding to the change in the second resource file based on the first compiled file, the second compiled file, and other compiled files compiled from code files other than the first code file and the second code file in the M compiled files.

[0014] In this implementation, in addition to supporting developers to preview in real time the latest effects of 3D images corresponding to the parameters adjusted by developers from the resource file of the 3D model without restarting the preview function, it also supports real-time preview of the latest effects of 3D images corresponding to the parameters adjusted by developers from the resource file of the 2D model.

[0015] In a second aspect, the present application provides a preview device, comprising one or more processors; one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the one or more processors, cause the device to perform the following steps: output a preview effect of a currently developed three-dimensional 3D image according to M compiled files, the M compiled files corresponding one-to-one to the currently developed M code files, at least one of the M code files references a resource file containing a 3D model, and M is an integer; when a first resource file containing a 3D model referenced by a first code file in at least one code file changes, compile the first code file to obtain a first compiled file; and output a preview effect of the developed 3D image corresponding to the change of the first resource file based on the first compiled file and other compiled files compiled from code files other than the first code file in the M compiled files.

[0016] In combination with the second aspect, in one implementation, when the instruction is executed by one or more processors, the device performs the following steps: when the first resource file changes, determine the first code file that references the first resource file based on first information, and the first information indicates a mapping relationship between each code file in M ​​code files and the referenced resource file.

[0017] In combination with the second aspect, in one implementation, after previewing the currently developed 3D image based on M compiled files and before compiling the first code file, when the instruction is executed by one or more processors, the device performs the following steps: monitoring whether the first resource file referenced by the first code file changes.

[0018] In combination with the second aspect, in one implementation, when monitoring whether the first resource file referenced by the first code file has changed, when the instruction is executed by one or more processors, the device performs the following steps: obtaining a first hash value of the first resource file at a first moment; obtaining a second hash value of the first resource file at a second moment; and determining that the first resource file has changed when the first hash value is different from the second hash value.

[0019] In conjunction with the second aspect, in one implementation, the change in the first resource file includes at least one of the following: modifying a parameter in the first resource file, adding a parameter in the first resource file, and deleting a parameter in the first resource file.

[0020] In combination with the second aspect, in one implementation, the M code files include a second code file, the second code file references a second resource file, and the second resource file is a resource file of a 2D model. When the instruction is executed by the one or more processors, the device performs the following steps: when the second resource file changes, determine the second code file that references the second resource file based on the first information; compile the second code file to obtain a second compiled file; and output a preview effect of the developed 3D image corresponding to the change of the second resource file based on the first compiled file, the second compiled file, and other compiled files compiled from code files other than the first code file and the second code file in the M compiled files.

[0021] In combination with the second aspect, in one implementation, before previewing the currently developed 3D image according to M compiled files, when the instruction is executed by one or more processors, the electronic device performs the following steps: receiving a first preview instruction, the first preview instruction instructing to turn on the preview function.

[0022] In a third aspect, the present application provides an electronic device, which may include various functional modules for implementing the method in the first aspect. In some implementations, these modules may be implemented in software and / or hardware.

[0023] In a fourth aspect, a computer-readable storage medium is provided, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the first aspect and any possible implementation method of the first aspect are executed.

[0024] In a fifth aspect, a computer program product is provided, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the first aspect and any possible implementation method of the first aspect are executed.

[0025] In a sixth aspect, a computer program is provided, which, when executed on a computer, enables the method in the first aspect and any possible implementation thereof to be executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0027] Figure 2 A software structure block diagram of a terminal device applicable to the embodiments of the present application;

[0028] Figure 3 A preview diagram provided for this application;

[0029] Figure 4 A schematic diagram of the architecture provided for preview in this application;

[0030] Figure 5 A schematic diagram of a preview method provided in accordance with an embodiment of the present application;

[0031] Figure 6 A flowchart of a preview method provided in another embodiment of the present application;

[0032] Figure 7 A schematic structural diagram of a preview device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0033] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0034] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0035] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0036] The following describes an electronic device, a user interface for such an electronic device, and embodiments for using such an electronic device. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or a music player function, such as a mobile phone, a tablet computer, a wearable electronic device with wireless communication function (such as a smart watch), etc. Exemplary embodiments of portable electronic devices include but are not limited to devices equipped with Or a portable electronic device with other operating systems. The portable electronic device may also be other portable electronic devices, such as a laptop computer, etc. It should also be understood that in some other embodiments, the electronic device may not be a portable electronic device, but a desktop computer.

[0037] For example, Figure 1 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0038] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0039] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0040] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0041] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0042] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0043] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0044] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0045] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0046] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0047] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0048] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0049] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0050] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0051] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0052] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0053] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0054] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0055] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0056] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0057] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0058] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0059] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0060] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0061] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0062] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0063] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0064] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the alarm application icon, an instruction to create a new alarm is executed.

[0065] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc. For example, when the mobile phone detects a user's touch operation on the lock screen interface, the mobile phone can collect the user's fingerprint information through the fingerprint sensor 180H, and match the collected fingerprint information with the fingerprint information preset in the mobile phone. If the match is successful, the mobile phone can enter the non-lock screen interface from the lock screen interface.

[0066] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0067] Figure 2 1 is a software structure diagram of an electronic device 100 of the present application example. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.

[0068] like Figure 2 As shown, the application layer may include desktop, calendar, memo, map, navigation, Bluetooth, music, JD.com and short message, etc.

[0069] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer may include some predefined functions.

[0070] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0071] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0072] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc., such as the indication information for prompting a virtual shutter key in the embodiment of the present application. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon can include a view for displaying text and a view for displaying pictures.

[0073] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0074] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0075] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0076] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0077] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0078] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0079] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0080] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0081] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0082] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0083] A 2D graphics engine is a drawing engine for 2D drawings.

[0084] In addition, the system library may also include status monitoring service modules, such as a physical status recognition module for analyzing and identifying user gestures; a sensor service module for monitoring sensor data uploaded by various sensors at the hardware layer to determine the physical status of the electronic device 100.

[0085] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0086] The hardware layer can include various types of sensors, such as Figure 1 The various types of sensors introduced in the present application include acceleration sensors, gyroscope sensors, touch sensors, etc.

[0087] for Figure 1 and Figure 2 The electronic device described above may include some applications that can present a 3D effect when presenting a UI interface to the user, so as to bring a stronger visual enjoyment and visual experience to the user. In this embodiment, such applications are also referred to as 3D applications.

[0088] It should be understood that 3D pictures (or 3D images) in 3D applications all need to be developed by developers.

[0089] Currently, developers can develop based on some integrated development environments (IDEs), such as Android Studio or Xcode. Usually, when developing, you can first import some resource files of 3D models that need to be referenced by 3D images, and then directly reference these resource files when writing code files to improve development efficiency.

[0090] After the developer develops the code file, he can preview it in advance through the preview debugging tool provided by the IDE. Preview is a technology that displays the rendered content in the preview window. This technology does not require connecting multiple physical electronic devices when debugging the UI of multiple electronic devices.

[0091] For example, Figure 3 This is a schematic diagram of an interface of an IDE that supports preview provided by this application. Figure 3 As shown, it includes three areas: resource area, visual code area, and preview area.

[0092] The resource area includes at least one resource file, such as Figure 3 The resource files shown include resource file 1, resource file 2 to resource file P.

[0093] Optionally, a certain resource file is a resource file of a 3D model.

[0094] The visual code area is used by developers to write code files for 3D applications.

[0095] It should be noted that this embodiment does not limit the specific form of the written code file. For example, the code file can be a .Java file, a .C file, a .C++ file, or a .est file, collectively referred to as a visual code file. When a developer writes a code file in the visual code area, he can reference a resource file in the resource file.

[0096] The preview area is used to preview the display effect corresponding to the code file. For example, in one implementation, in response to the developer clicking the preview control provided by the IDE in the current window, the preview is started and the content is displayed to the developer.

[0097] It should be understood that for a 3D model resource file, the 3D model usually has many parameters, such as thousands of parameters, including coordinate position parameters, corner parameters, camera parameters, texture parameters, attribute animation parameters, lighting parameters, etc. When the parameters are different, there may be different effects. In order to display different effects, these parameters need to be constantly debugged during the development process. Among them, debugging the parameters includes, for example, modifying, adding or deleting the parameters.

[0098] One way is to debug (or test) the resource file of the 3D model. Figure 3 As shown in the figure, the developer imported resource file 2 when developing the code file. Resource file 2 includes many parameters of 3D model 1, some of which are matrices (metrics), and the metrics include 10 parameters a1 to a10. At this time, when debugging, the developer can adjust the parameters in resource file 2 to obtain a better display effect. For example, Figure 3 As shown, developers can modify the a10 parameter included in the metric in resource file 2. It should be noted that Figure 3 The image displayed in the preview area (without the 3D effect) is only for illustrating that the preview area will include a preview effect image of the developed file.

[0099] Currently, after developers adjust the parameters of a 3D model in a resource file, if they need to preview the 3D screen (3D image) after the adjustment, they need to restart the preview, resulting in a poor developer experience and low development and debugging efficiency.

[0100] For example, when a developer modifies a configuration file (such as main_page.json) in the resources / base / profile directory, triggering real-time preview is not supported, and the developer needs to restart the preview.

[0101] In view of this, in order to address the problem of low efficiency in the above-mentioned development and debugging, the present application provides a preview method, which can support real-time preview of the latest effect of the 3D image corresponding to the developer after adjusting the parameters from the resource file, without restarting the previewer, thereby greatly improving debugging.

[0102] Below, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.

[0103] resource

[0104] In the process of application development, colors, fonts, spacing, images, 3D models, etc. are often needed, which can be called resources. The values ​​of these resources may be different in different devices or configurations.

[0105] Various resource files used in application development need to be placed in specific subdirectories for storage and management.

[0106] Compile and build

[0107] Compilation and construction is the process of converting the source code, resources, third-party libraries, etc. of the application / service into binary machine code that can be directly run on the hardware device through a compilation tool, and then packaging the binary machine code into a HAP / APP software package and signing the HAP / APP package.

[0108] The technical solution provided by this application is described below in conjunction with the accompanying drawings.

[0109] Before introducing the preview method provided by this application, first refer to Figure 4 , introduces the framework modules required for previewing provided by the embodiment of the present application. Figure 4 As shown, it mainly includes preview plug-in module, first module, restool module, rollup process module, tool chain module and preview engine module. The functions of each of the above modules are introduced below.

[0110] The preview plug-in module is integrated into the IDE to preview the debugging UI interface.

[0111] The first module is a lightweight build tool based on a new front-end that can be combined with a package management mechanism to provide key capabilities such as task management mechanism, task registration and scheduling, project model management, configuration management, and a new command line entry.

[0112] Exemplarily, the first module is a hvigor module.

[0113] Resource compilation tool (e.g., called restool) module, a tool for compiling resource files, creating resource indexes and parsing resources by compiling resource files. Exemplarily, the restool module compiles all resource files such as images, layout files, and strings in the hap package.

[0114] For example, you can use the restool -i command to specify the resource directory to be built or the resource intermediate file directory that needs to be built.

[0115] For example, you can use the restool-x command to specify a resource directory or a single resource path for generating intermediate files. The same command can be specified multiple times.

[0116] Rollup process module, a build tool for packaging code files.

[0117] Specifically, the preview process includes:

[0118] S501, the preview plug-in module starts the first module.

[0119] For example, the first module is the hvigor module, and the hvigor module compilation is started.

[0120] S502: The first module obtains a resource directory.

[0121] The resource directory includes at least one resource file.

[0122] Optionally, at least one resource file includes a resource file of a 3D model.

[0123] Exemplarily, the code file developed by the developer may be a .Java file, a .C file, a .C++ file, or a .est file, etc., which does not constitute a limitation of the present application.

[0124] S503, the first module starts the restool module to compile and link the resource files in the resource directory, store them in the first build product directory, and return them to the first module.

[0125] It should be understood that the first build product directory includes identifiable resource files corresponding to the compilation of each resource file.

[0126] For example, when compiling, the resource directory or a single resource path for generating intermediate files can be specified through the restool-x command, and the build product directory can be specified through the restool-i command. That is, the first build product directory is output after restool compilation and linking.

[0127] In implementation, the restool module is assigned a resource file ID when it is compiled.

[0128] In this step, the restool module compiles all resource files in the resource directory. This can be considered as the first resource compilation in response to the developer starting the preview function operation. For example, in one implementation, when the developer clicks View>Tool Windows>Previewer to start the preview function (that is, it is considered that the developer enters the first preview instruction to start the preview function), the restool module compiles all resource files in the resource directory.

[0129] This step is optional. For example, if the resource file is a resource file that is compatible with the environment of the code file currently being developed by the developer, this step may not be performed.

[0130] S504, the preview plug-in module obtains a resource directory.

[0131] Optionally, the preview plug-in module may also obtain the first build product directory.

[0132] S505: The preview plug-in module notifies the rollup process module to start.

[0133] The rollup process module is used to compile and package the visual code files developed by the developer. Similarly, when the rollup process module is first started, it compiles and packages all the M code files developed by the developer to obtain the corresponding M compiled files. M is a positive integer. For example, M can be 1 or a positive integer greater than 1.

[0134] In this embodiment, at least one code file among the M code files references a resource file containing a 3D model.

[0135] In this embodiment, in order to support developers to preview the latest effect of the corresponding 3D model in real time after adjusting parameters from the resource file, such as Figure 5 As shown, in the preview method provided in this embodiment, after the rollup process module is started, it includes:

[0136] S506: The preview plug-in module monitors that the first resource file in the resource directory has changed.

[0137] Exemplarily, the change in the first resource file may include at least one of the following: a parameter in the first resource file is modified, a parameter is added to the first resource file, and a parameter in the first resource file is deleted.

[0138] For example, in one implementation, the preview plug-in module may calculate the hash value of each resource file in real time, and then consider that the resource file has changed when the currently calculated hash value is different from the last calculated hash value.

[0139] For example, in this embodiment, when the first hash value of the first resource file calculated by the preview plug-in module at the first moment is different from the second hash value of the first resource file calculated at the second moment, it is determined that the first resource file has changed.

[0140] S507: The preview plug-in module starts the restool module to compile the first resource file.

[0141] This step is optional. For example, if the first resource file is a resource file that is compatible with the environment of the code file currently being developed by the developer, this step may not be performed.

[0142] When the first resource file needs to be compiled, in one implementation, the preview plug-in module can send the resource file ID corresponding to the first resource file to the restool module, and the restool module compiles the first resource file accordingly. That is, the preview plug-in module only compiles the resource files that have been monitored to be changed through the restool module, that is, performs incremental compilation, for example, through the compilation link of restool.

[0143] S508: The tool chain module identifies the affected code files based on the first information.

[0144] In this embodiment, the tool chain module has first information established, and the first information indicates the resource file referenced by each of the M code files, so the first information can also be called a mapping relationship between the code file and the referenced resource file. Alternatively, it can also be understood as follows: the first information indicates which code files reference the same resource file, and which resource files are referenced by each code file.

[0145] In this embodiment, identifying the affected code file based on the first information specifically refers to: determining the visual code file that references the first resource file as the affected code file.

[0146] In this embodiment, the identified affected code file is also referred to as a first code file.

[0147] Exemplarily, the resource files include resource file 1 of 3D model 1, resource file 2 of 3D model 2, and resource file 3 of 3D model 3. The visualization code files developed by the developer include visualization code file 1, visualization code file 2, and visualization code file 3. Among them, the resource files referenced by visualization code file 1 include resource file 1, the resource files referenced by visualization code file 2 include resource file 1 and resource file 2, and the resource files referenced by visualization code file 3 include resource file 3. At this time, if the developer modifies the parameters of 3D model 1 in resource file 1, it can be identified that the affected visualization code files are visualization code file 1 and visualization code file 2.

[0148] Optionally, when the first resource file needs to be compiled, the toolchain module can be started by the restool module. For example, the restool module determines that the first resource file has changed based on the difference between the last compilation result and the current compilation result of the first resource file, and then starts the toolchain module.

[0149] Optionally, when the first resource file does not need to be compiled, the toolchain module can also be started through the preview plug-in module. For example, after the preview plug-in module monitors the change of the first resource file, it notifies the toolchain module of the change of the first resource file. At this time, the toolchain module identifies the affected code file based on the first information, that is, identifies the code file that references the first resource file based on the first information.

[0150] S509, the toolchain module (also called the toolchain module) starts the rollup process module.

[0151] That is, the toolchain includes starting the rollup process module for compilation and packaging.

[0152] In this embodiment, the package compiled and packaged by the rollup process module based on the M code files previously obtained before the first resource file changes is called the first program package. It should be understood that the first program package can be considered to be obtained by compiling the M code files and obtaining the M compiled files.

[0153] It should be understood that when the first resource file changes, the first code file that references the first resource file should be recompiled for updating. Therefore, in this embodiment, after detecting that the first resource file has changed, the toolchain module will continue to start the rollup to recompile and package.

[0154] During implementation, since there is no code file among the M code files that references the first resource file, its compilation result is the same as last time. Therefore, the rollup process module can compile only the first code file, and no longer compile the code files that do not reference the first resource file (i.e., the code files that are not affected). Instead, the compilation results corresponding to the code files that do not reference the first resource file in the program package obtained by starting the rollup process last time are directly used to form a second program package.

[0155] In the present application, the compiled file obtained by recompiling the first code file after the rollup process module compiles the first resource file after the first resource file changes is also called the first compiled file.

[0156] As an example, the resource files still include resource file 1 of 3D model 1, resource file 2 of 3D model 2, and resource file 3 of 3D model 3. For example, the visualization code files developed by the developer include visualization code file 1, visualization code file 2, and visualization code file 3. If the developer modifies the parameters of 3D model 1 in resource file 1, the tool chain module recognizes that the affected visualization code files are visualization code file 1 and visualization code file 2, and starts the rollup process for compilation and packaging: the rollup process can only recompile visualization code file 1 and visualization code file 2, and does not recompile code file 3, but directly obtains the compilation result corresponding to code file 3 in the previous compilation and packaging result, and recomposes a new program package.

[0157] S510, after the rollup process module is compiled and packaged successfully, the preview plug-in module is notified.

[0158] S511, the preview plug-in module starts the preview engine module.

[0159] The preview engine module generates the display interface to be displayed based on the content in the package compiled and packaged by the rollup process module. For example, the preview engine runs the instructions in the package compiled and packaged by the rollup process module, creates corresponding components and loads corresponding resources through parsing, and performs rendering, etc.

[0160] S512: The preview engine module generates the preview effect to be displayed and sends it to the preview engine module so that the preview engine module displays it to the developer through the preview area.

[0161] Among them, the preview effect can also be called preview screen, preview image, preview interface, etc., which does not constitute a limitation of this application.

[0162] That is, the UI interface to be displayed generated by the preview engine module is output to the developer through the preview area.

[0163] S513: Stop the rollup process.

[0164] S514, stop monitoring resource files.

[0165] It should be understood that in this embodiment, since the program package obtained after the rollup process module compiles and packages is continuously updated as the resource file changes, in this embodiment, the display interface that needs to be displayed generated by the preview engine module is continuously updated as the resource file changes, so that the display interface displayed to the prescriber is continuously updated as the resource file changes. Therefore, the developer can preview in real time the latest effect of the 3D image corresponding to the developer's adjustment of parameters from the resource file of the 3D model without restarting the preview function (that is, the developer can preview in real time the latest effect of the 3D model in the 3D image corresponding to the developer's adjustment of parameters from the resource file of the 3D model without restarting the preview function).

[0166] For example, for the above-mentioned first resource file which is a resource file of a 3D model, after the developer starts the preview function and displays the 3D image, the developer thinks that the effect of the 3D image is not very good. At this time, the developer continuously debugs the parameters of the 3D model in the first resource file. In this embodiment, due to the continuous debugging in the first resource file, the restool module will be triggered in real time to recompile the first resource file and the rollup process module will recompile and package the first code file that references the first resource file in real time to obtain an updated program package, so that when the preview engine displays the 3D image, it can display the latest effect of the 3D image corresponding to the content in the first resource file after the change. Thereby improving the efficiency of debugging.

[0167] It can be seen that in the preview method, in order to achieve the preview effect of supporting real-time preview of M code files developed by the developer, after the preview device outputs the preview effect of the currently developed three-dimensional 3D image according to the M compiled files, at least one code file among the M code files references a resource file containing a 3D model; when a first resource file containing a 3D model referenced by a first code file in at least one code file changes, the first code file is determined to be an affected code file and the first code file is recompiled to obtain a first compiled file; then, based on the first compiled file and other compiled files compiled from code files other than the first code file among the M compiled files, a preview effect of the developed 3D image corresponding to the change of the first resource file is output.

[0168] Optionally, in the preview method provided by the present application, when a change in a referenced resource file is detected, the rollup process module can be triggered to compile and package. At this time, the rollup module compiles and packages each of the M code files for update, thereby updating the preview effect. It should be understood that in this way, the developer can also implement the operation without starting the preview function, but due to the Figure 5 In the embodiment shown, this implementation requires compiling all code files, so the update time required is relatively long.

[0169] In the above, the developer has modified the resource file of the 3D model as an example for description, but it should be noted that the above solution can also be extended to modify the resource file of the 2D model.

[0170] For example, after outputting a preview effect of a 3D image developed corresponding to a change in a first resource file, if a second resource file referenced by a second code file included in M ​​code files changes, and the second resource file is a resource file of a 2D model, the method further includes: when the second resource file changes, determining based on the first information that a second code file referencing the second resource file is affected; then compiling the second code file to obtain a second compiled file; and outputting a preview effect of the 3D image developed corresponding to a change in the second resource file based on the first compiled file, the second compiled file, and other compiled files compiled from code files other than the first code file and the second code file in the M compiled files.

[0171] Furthermore, as long as the developer modifies the parameters in the resource file, the preview area displays the latest effect corresponding to the content change in the resource file in real time, which can be attributed to the concept of this application. Figure 6 , illustrating a preview method provided by another embodiment of the present application, such as Figure 6 Said method comprises:

[0172] S601, outputting a preview effect of a currently developed image according to a first compilation result obtained after compiling K code files developed by a developer, where K is an integer and at least one code file among the K code files has a referenced resource file.

[0173] Among them, outputting the preview effect of the currently developed image can also be called outputting the preview effect of the currently developed UI interface, or called currently outputting the preview effect diagram or image of the currently developed UI interface.

[0174] For example, the referenced resource file may be a resource file of a 2D model, a resource file of a 3D model, or a resource file of a higher-dimensional model, which is not a limitation of the present application. For example, it may include a resource file of an image, a resource file of a string, etc.

[0175] S602, when the target resource file changes, identifying the target code file that references the target resource file.

[0176] It should be understood that the target resource file is included in all resource files referenced by the K code files.

[0177] When implementing, you can do something like Figure 5 In an embodiment, a mapping relationship between a code file and a referenced resource file is established. That is, a mapping relationship is established to indicate which code files reference the same resource file, and which resource files are referenced by each code file. Accordingly, when a change is detected in a target resource file, such as a developer modifying a parameter in the target resource file, or adding a new parameter to the target resource file, or deleting a parameter in the target resource file, etc., a target code file that references the target resource file is determined based on the mapping relationship. In this embodiment, these target code files are also referred to as affected code files.

[0178] S603: Update the compiled first target compiled file corresponding to the target code file included in the first compilation result to a second target compiled file obtained by recompiling the target code file.

[0179] It should be understood that the affected code files should be recompiled to ensure that the preview effect of the developed UI interface output to the developer corresponds to the preview effect of the corresponding UI interface after the target resource file changes.

[0180] It should be understood that after the first target compiled file corresponding to the target code file included in the first compiled result is updated to the second target compiled file after the target code file is recompiled, the first compiled result is updated to the second compiled result. That is, the second compiled result is obtained by the second target compiled file obtained by recompiling the target code file and other compiled files in the first compiled result obtained by compiling code files other than the target code file.

[0181] S604: Output a preview effect of the currently developed image based on the second compilation result.

[0182] In the preview method provided in this embodiment, after the developer modifies the content of the target resource file, the latest effect of the model corresponding to the modified content of the target resource file can be displayed in real time without the developer having to restart the preview function.

[0183] Figure 7 This is a schematic diagram of the structure of a preview device provided by an embodiment of the present application. Figure 7 As shown, the preview device 700 may include a processor 701 and an interface circuit 702. The processor 701 and the interface circuit 702 are coupled to each other. It is understood that the interface circuit 702 may be a transceiver or an input-output interface. Optionally, the device 700 may also include a memory 703 for storing instructions executed by the processor 701 or storing input data required by the processor 701 to execute instructions or storing data generated after the processor 701 executes instructions.

[0184] For example, when the instruction is executed by the one or more processors, the device performs the following steps: outputting a preview effect of a currently developed three-dimensional 3D image according to M compiled files, the M compiled files corresponding one-to-one to the currently developed M code files, at least one of the M code files references a resource file containing a 3D model, and M is an integer; when a first resource file containing a 3D model referenced by a first code file in the at least one code file changes, compiling the first code file to obtain a first compiled file; and outputting a preview effect of the developed 3D image corresponding to the change of the first resource file based on the first compiled file and other compiled files compiled from code files other than the first code file in the M compiled files.

[0185] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.

[0186] For example,

[0187] The embodiment of the present application provides a computer program product, when the computer program product is run on an electronic device, the electronic device executes the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above method-related embodiments, and will not be repeated here.

[0188] The embodiment of the present application provides a readable storage medium, the readable storage medium contains instructions, when the instructions are executed in an electronic device, the electronic device executes the technical solution of the above embodiment. The implementation principle and technical effect are similar, and will not be repeated here.

[0189] The embodiment of the present application provides a chip, the chip is used to execute instructions, when the chip is running, the technical solution in the above embodiment is executed. The implementation principle and technical effect are similar, and will not be repeated here.

[0190] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0191] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0192] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0193] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0194] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0195] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0196] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiment of the present application, which should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A preview method, characterized in that: include: Outputting a preview effect of a currently developed three-dimensional 3D image according to M compiled files, wherein the M compiled files correspond one-to-one to the currently developed M code files, and at least one of the M code files references a resource file containing a 3D model, and M is an integer; When a first resource file containing a 3D model referenced by a first code file in the at least one code file changes, compile the first code file to obtain a first compiled file; A preview effect of a 3D image developed corresponding to a change in the first resource file is output based on the first compiled file and other compiled files among the M compiled files compiled from code files other than the first code file.

2. The method according to claim 1, characterized in that The method further comprises: When the first resource file changes, the first code file that references the first resource file is determined based on first information, where the first information indicates a mapping relationship between each code file in the M code files and the referenced resource file.

3. The method according to claim 1 or 2, characterized in that: After outputting the preview effect of the currently developed 3D image according to the M compiled files and before compiling the first code file, the method further includes: Monitor whether the first resource file referenced by the first code file changes.

4. The method according to claim 3, characterized in that The monitoring whether the first resource file referenced by the first code file changes includes: Obtaining a first hash value of the first resource file at a first moment; Obtaining a second hash value of the first resource file at a second moment; When the first Hash value is different from the second Hash value, it is determined that the first resource file has changed.

5. The method according to any one of claims 1 to 4, characterized in that The change in the first resource file includes at least one of the following: modifying a parameter in the first resource file, adding a parameter in the first resource file, and deleting a parameter in the first resource file.

6. The method according to any one of claims 2 to 5, characterized in that The M code files include a second code file, the second code file references a second resource file, and the second resource file is a resource file of a 2D model. The method further includes: When the second resource file changes, determining the second code file that references the second resource file based on the first information; Compiling the second code file to obtain a second compiled file; Output a preview effect of the 3D image developed corresponding to the change of the second resource file based on the first compiled file, the second compiled file and other compiled files compiled from the M compiled files by code files other than the first code file and the second code file.

7. The method according to any one of claims 1 to 6, characterized in that Before previewing the currently developed 3D image according to the M compiled files, the method further includes: A first preview instruction is received, where the first preview instruction instructs to enable a preview function.

8. A preview device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions. When the instructions are executed by the one or more processors, the apparatus performs the following steps: Outputting a preview effect of a currently developed three-dimensional 3D image according to M compiled files, wherein the M compiled files correspond one-to-one to the currently developed M code files, and at least one of the M code files references a resource file containing a 3D model, and M is an integer; When a first resource file containing a 3D model referenced by a first code file in the at least one code file changes, compile the first code file to obtain a first compiled file; A preview effect of a 3D image developed corresponding to a change in the first resource file is output based on the first compiled file and other compiled files among the M compiled files compiled from code files other than the first code file.

9. The device according to claim 8, characterized in that When the instructions are executed by the one or more processors, the device performs the following steps: When the first resource file changes, the first code file that references the first resource file is determined based on first information, where the first information indicates a mapping relationship between each code file in the M code files and the referenced resource file.

10. The device according to claim 8 or 9, characterized in that After previewing the currently developed 3D image according to the M compiled files and before compiling the first code file, when the instruction is executed by the one or more processors, the apparatus performs the following steps: Monitor whether the first resource file referenced by the first code file changes.

11. The device according to claim 10, characterized in that When monitoring whether the resource file referenced by the first code file changes, when the instruction is executed by the one or more processors, the device performs the following steps: Obtaining a first hash value of the first resource file at a first moment; Obtaining a second hash value of the first resource file at a second moment; When the first Hash value is different from the second Hash value, it is determined that the first resource file has changed.

12. The device according to any one of claims 8 to 11, characterized in that The change in the first resource file includes at least one of the following: modifying a parameter in the first resource file, adding a parameter in the first resource file, and deleting a parameter in the first resource file.

13. The device according to any one of claims 9 to 12, characterized in that The M code files include a second code file, the second code file references a second resource file, and the second resource file is a resource file of a 2D model. When the instruction is executed by the one or more processors, the device performs the following steps: When the second resource file changes, determining the second code file that references the second resource file based on the first information; Compiling the second code file to obtain a second compiled file; Output a preview effect of the 3D image developed corresponding to the change of the second resource file based on the first compiled file, the second compiled file and other compiled files compiled from the M compiled files by code files other than the first code file and the second code file.

14. The device according to any one of claims 8 to 13, characterized in that Before previewing the currently developed 3D image according to the M compiled files, when the instructions are executed by the one or more processors, the apparatus performs the following steps: A first preview instruction is received, where the first preview instruction instructs to enable a preview function.

15. An electronic device, characterized in that: The invention comprises a preview device as claimed in any one of claims 8 to 14.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code for computer execution, wherein the program code includes instructions for implementing the method according to any one of claims 1 to 7.

17. A computer program product, characterized in that The computer program product comprises instructions for implementing the method according to any one of claims 1 to 7.