Method for simulating foldable screen device, and electronic device

By introducing virtual hardware and operating system interaction into electronic devices, different forms of foldable screen devices can be simulated, solving the problem of poor simulation effects of existing tools and achieving efficient developer debugging and cost reduction.

WO2026158089A1PCT designated stage Publication Date: 2026-07-30HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2026-01-13
Publication Date
2026-07-30

AI Technical Summary

Technical Problem

Existing developer tools cannot realistically simulate the display effects of foldable screen devices in different forms, making debugging difficult and costly for developers.

Method used

By introducing virtual hardware, including virtual sensors and virtual displays, into electronic devices, different forms of foldable screen devices are simulated. Real frame data is generated and displayed to simulate the interface by utilizing the interaction between the first operating system and the second operating system.

Benefits of technology

It enables accurate simulation of display effects in different forms without the need for a physical foldable screen device, reducing development costs and improving development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026072170_30072026_PF_FP_ABST
    Figure CN2026072170_30072026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a method for simulating a foldable screen device, and an electronic device. A first operating system of the electronic device may register a virtual sensor with a second operating system, and by means of changing parameters of the virtual sensor, the second operating system may generate frame data on the basis of the parameters of the virtual sensor. The first operating system of the electronic device displays a simulation interface on the basis of the frame data generated by the second operating system. Since the simulation interface is generated on the basis of the frame data of the second operating system, display effects of a foldable screen device in different forms can be well simulated, thereby facilitating the work of a developer and improving the development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

A method for simulating a foldable screen device and an electronic device

[0001] This application claims priority to Chinese Patent Application No. 202510125108.1, filed on January 26, 2025, entitled “A Method for Simulating a Foldable Screen Device and an Electronic Device”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of electronic devices, and more specifically, to a method for simulating a foldable screen device and an electronic device. Background Technology

[0003] With the rapid development of the application ecosystem and developer business, developer tools with multi-category device simulation capabilities are becoming increasingly important for developers. Developing once and deploying across multiple platforms also facilitates debugging. In the consumer market, foldable screen devices occupy a significant share. To achieve this, developer software needs to simulate the display of foldable screen devices in different states (such as unfolded, folded, and semi-folded). However, current developer tools offer poor simulation of foldable devices, hindering developers' work. Therefore, how to simulate the display effects of foldable screen devices has become a pressing technical problem. Summary of the Invention

[0004] This application provides a method and electronic device for simulating foldable screen devices, which can realistically simulate the display effects of foldable screen devices in different forms, thus helping developers and improving development efficiency.

[0005] In a first aspect, a method for simulating a foldable screen device is provided. This method is applied to an electronic device including a first operating system and a second operating system. The first operating system runs the second operating system via developer tools and registers virtual hardware within the second operating system. The virtual hardware includes a virtual sensor used to simulate a sensor in the foldable screen device for detecting form. The method includes: the first operating system, in response to a first operation by a user, setting parameters of the virtual sensor to a first parameter, wherein the first parameter corresponds to a first form of the foldable screen device; the second operating system generating a first frame of data based on the first parameter; the second operating system sending the first frame of data to the first operating system; and the first operating system displaying a first simulated interface based on the first frame of data, the first simulated interface used to simulate the interface of the foldable screen device in the first form.

[0006] In this embodiment, the first operating system of the electronic device can register virtual sensors with the second operating system, and by changing the parameters of the virtual sensors, the second operating system can generate frame data based on the parameters of the virtual sensors. The first operating system of the electronic device displays a simulated interface based on the frame data generated by the second operating system. Since the simulated interface is generated based on the frame data of the second operating system, it can effectively simulate the display effect of foldable screen devices in different forms, which is helpful for developers, improves development efficiency, and eliminates the need for developers to use physical foldable screen devices, thus reducing development costs.

[0007] It is understood that the technical solutions provided in this application can generally be applied to scenarios where developers test the display effect of applications in different forms of foldable screen devices when there is no physical foldable screen device. In this case, developers can accurately simulate the interface displayed by the foldable screen device in different states through developer tools.

[0008] It can also be understood that the technical solutions provided in this application embodiment can also be applied to scenarios where developers test the display effect of applications in different forms of foldable screen devices when there is a physical foldable screen device. In this case, developers can connect the physical foldable screen device to a computer and accurately simulate the interface displayed by the foldable screen device in different states through developer tools. In the above process, developers do not need to adjust the form of the physical foldable screen device.

[0009] In conjunction with the first aspect, in some implementations of the first aspect, the virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen is used to simulate the outer display screen of the foldable screen device, and the second virtual display screen is used to simulate the inner display screen of the foldable screen device, the foldable screen device being an inwardly foldable screen device. The method further includes: the second operating system controlling the first virtual display screen to be in a first state and controlling the second virtual display screen to be in a second state according to the first parameter; the second operating system sending first instruction information to the first operating system, the first instruction information being used to indicate that the first virtual display screen is in the first state and the second virtual display screen is in the second state; the first operating system displaying a first simulated interface according to the first frame data, including: the first operating system drawing the first frame data on a first drawing display screen according to the first instruction information to display the first simulated interface.

[0010] In conjunction with the first aspect, in some implementations of the first aspect, when the first form is an unfolded state, the first state is a powered-off state and the second state is a powered-on state; when the first form is a folded state, the first state is the powered-on state and the second state is the powered-off state; when the first form is a semi-folded state, the first state is the powered-off state and the second state is the powered-on state.

[0011] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the first operating system, in response to a second operation by a user, setting the parameters of the virtual sensor to a second parameter, the second parameter corresponding to a second form of the foldable screen device; the second operating system generating second frame data based on the second parameter, and controlling the first virtual display screen to be in the second state and controlling the second virtual display screen to be in the first state; the second operating system sending the second frame data and second indication information to the first operating system, the second indication information indicating that the first virtual display screen is in the second state and the second virtual display screen is in the first state; the first operating system destroying the first drawing display screen and creating a second drawing display screen based on the second indication information; and the first operating system drawing the second frame data on the second drawing display screen to display a second simulated interface, the second simulated interface simulating the interface of the foldable screen device in the second form.

[0012] In this embodiment of the application, when the first operating system switches from simulating the first form to simulating the second form, the first operating system can switch between different drawing displays, so that the developer can perceive the change in form and the simulation effect is more realistic.

[0013] In this embodiment, since the first and second simulated interfaces are generated by the second operating system based on the parameters of the virtual sensors, and the first and second simulated interfaces are the same as the display interface of the real foldable screen device, the switching transition is natural and does not appear abrupt.

[0014] In conjunction with the first aspect, in some implementations of the first aspect, the first form is an unfolded state and the second form is a folded state; or the first form is the folded state and the second form is an unfolded state; or the first form is the folded state and the second form is a semi-folded state; or the first form is the semi-folded state and the second form is the folded state.

[0015] In conjunction with the first aspect, in some implementations of the first aspect, the first form is the folded state, the second form is the unfolded state, and the orientation of the second drawing display screen is the portrait orientation. The method further includes: the first operating system responding to a third operation by the user to set the parameters of the virtual sensor to a third parameter, wherein the third parameter corresponds to the third form of the foldable screen device, which is the semi-folded state; the second operating system generating third frame data according to the third parameter; the second operating system sending the third frame data to the first operating system; the first operating system adjusting the orientation of the second drawing display screen to the landscape orientation; and the first operating system drawing the third frame data on the second drawing display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in the third form.

[0016] In this embodiment of the application, when the first operating system switches from the simulated unfolded state to the simulated semi-folded state, the first operating system can change the display direction of the drawing display screen, so that the developer can perceive the change in direction and the simulation effect is more realistic.

[0017] In conjunction with the first aspect, in some implementations of the first aspect, the first form is the folded state, the second form is the semi-folded state, and the display direction of the second drawing display screen is the landscape direction. The method further includes: the first operating system responding to a third operation by the user to set the parameters of the virtual sensor to a third parameter, wherein the third parameter corresponds to the third form of the foldable screen device, which is the unfolded state; the second operating system generating a third frame of data based on the third parameter; the second operating system sending the third frame of data to the first operating system; the first operating system adjusting the orientation of the second drawing display screen to the portrait direction; and the first operating system drawing the third frame of data on the second drawing display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in the third form.

[0018] In this embodiment of the application, when the first operating system switches from a simulated semi-folded state to a simulated unfolded state, the first operating system can change the display orientation of the drawing display screen, so that the developer can perceive the change in orientation and the simulation effect is more realistic.

[0019] In conjunction with the first aspect, in some implementations of the first aspect, the virtual hardware further includes a first virtual display screen, wherein the first virtual display screen corresponds to the foldable display screen of the foldable screen device, the foldable screen device being an outward foldable screen device, and the first operating system displays a first simulated interface based on the first frame data, including: the first operating system drawing the first frame data on a first drawing display screen to display the first simulated interface.

[0020] In conjunction with the first aspect, in some implementations of the first aspect, when the first operating system displays the first simulated interface, the size of the first drawing display screen is a first size. The method further includes: the first operating system, in response to a second operation by the user, setting the parameters of the virtual sensor to second parameters, wherein the second parameters correspond to a second form of the foldable screen device; the second operating system generating second frame data based on the second parameters; the second operating system sending the second frame data to the first operating system; the first operating system adjusting the size of the first drawing display screen to the second size; and the first operating system drawing the second frame data on the first drawing display screen to display the second simulated interface, the second simulated interface being used to simulate the interface of the foldable screen device in the second form.

[0021] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the first operating system responding to a second operation by the user to set the parameters of the virtual sensor to a second parameter, wherein the second parameter corresponds to a second form of the foldable screen device; the second operating system generating second frame data based on the second parameter; the second operating system sending the second frame data to the first operating system; the first operating system destroying the first drawing display screen and creating a second drawing display screen; the first operating system drawing the second frame data on the second drawing display screen to display a second simulated interface, the second simulated interface being used to simulate the interface of the foldable screen device in the second form.

[0022] In conjunction with the first aspect, in some implementations of the first aspect, when the first form is a semi-folded state, the method further includes: the first operating system displaying a folded avoidance area on the first simulation interface.

[0023] In this embodiment of the application, when simulating the semi-folded state of a foldable screen device, a folding avoidance area can also be displayed, so that developers can avoid setting interface elements in the folding avoidance area when developing applications, ensuring that the application can adapt to different forms of foldable screen devices.

[0024] In conjunction with the first aspect, in some implementations of the first aspect, the virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen is used to simulate the outer display screen of the foldable screen device, and the second virtual display screen is used to simulate the inner display screen of the foldable screen device, the foldable screen device is an inwardly foldable screen device, and the first form is an unfolded state or a semi-folded state. The method further includes: the second operating system controlling the first virtual display screen and the second virtual display screen to be in a power-on state according to the first parameter; the second operating system sending third instruction information to the first operating system, the third instruction information being used to indicate that the first virtual display screen and the second virtual display screen are in the power-on state; the first operating system displaying a first simulated interface according to the first frame data, including: the first operating system drawing the first frame data on the first drawing display screen and the second drawing display screen according to the third instruction information to display the first simulated interface, the first simulated interface including a first simulated sub-interface drawn on the first drawing display screen and a second simulated sub-interface drawn on the second drawing display screen.

[0025] In conjunction with the first aspect, in some implementations of the first aspect, the virtual sensor is used to simulate a rotating shaft sensor and / or to simulate a magnetic attraction sensor.

[0026] In conjunction with the first aspect, in some implementations of the first aspect, the first operating system displays a first interface, which is a developer tool interface. The first interface includes a first control, which is associated with the first form, and the first operation is an operation performed on the first control.

[0027] In a second aspect, an electronic device is provided, comprising one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the foregoing aspects or any possible implementation thereof to be performed.

[0028] Thirdly, a computer-readable storage medium is provided, comprising a computer program or instructions that, when executed on a computer, cause the first aspect and any possible implementation of the method of the first aspect to be performed.

[0029] Fourthly, a computer program product is provided, comprising a computer program or instructions that, when executed on a computer, cause the first aspect and any possible implementation of the method of the first aspect to be performed.

[0030] Fifthly, a computer program is provided that, when run on a computer, causes the methods described in the first aspect and any possible implementation thereof to be executed.

[0031] Sixthly, an electronic device according to an embodiment of this application includes modules / units for performing the above aspects or any possible design of the above aspects; these modules / units can be implemented in hardware or implemented by hardware executing corresponding software.

[0032] For the beneficial effects of aspects two through six, please refer to the beneficial effects of aspect one, which will not be repeated here. Attached Figure Description

[0033] Figure 1 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application.

[0034] Figure 2 is a set of GUIs provided in an embodiment of this application.

[0035] Figure 3 is a schematic diagram of the operating system of the electronic device provided in the embodiment of this application.

[0036] Figure 4 is a schematic diagram of the system architecture provided in an embodiment of this application.

[0037] Figure 5 shows a set of GUIs provided in an embodiment of this application.

[0038] Figure 6 shows a set of GUIs provided in an embodiment of this application.

[0039] Figure 7 shows a set of GUIs provided in an embodiment of this application.

[0040] Figure 8 is a schematic flowchart of a method for simulating a foldable screen device provided in an embodiment of this application.

[0041] Figure 9 is a schematic diagram of the software architecture provided in an embodiment of this application. Detailed Implementation

[0042] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0043] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one, two, or more than two. The term “and / or” is used to describe the relationship between related objects, indicating that three relationships may exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship.

[0044] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0045] 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, such as a laptop computer. In other embodiments, the electronic device may also be a desktop computer.

[0046] For example, Figure 1 shows a schematic diagram of the structure of an 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, a sensor module 170, a button 180, and a display screen 190, wherein the sensor module 170 includes a touch sensor 170A, etc.

[0047] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0048] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0049] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0050] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0051] In some embodiments, the processor 110 may include one or more interfaces. Interfaces 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.

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

[0053] 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 one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0054] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0055] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates 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 processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device or displays an image or video through the display screen 190. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0056] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, 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), and infrared (IR) technologies. 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0057] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via 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-CDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0058] Electronic device 100 implements display functions through a GPU, a display screen 190, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 190 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0059] Display screen 190 is used to display images, videos, etc. Display screen 190 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc.

[0060] The external storage 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 storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

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

[0062] Touch sensor 170A, also known as a "touch panel," can be located on display screen 190. The touch sensor 170A and display screen 190 together form a touchscreen, also known as a "touch screen." Touch sensor 170A detects touch operations applied to or near it. The touch sensor can transmit 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 display screen 190. In other embodiments, touch sensor 170A may also be located on the surface of electronic device 100, in a different position than display screen 190.

[0063] With the rapid development of the application ecosystem and developer business, developer tools with multi-category device simulation capabilities are becoming increasingly important for developers. Developing once and deploying across multiple platforms also facilitates debugging. In the consumer market, foldable screen devices occupy a significant market share. To achieve this, developer software needs the ability to simulate the display effects of different foldable screen device states (such as unfolded, folded, and semi-folded). In reality, the display effect of the same interface on a foldable screen device may differ in different states. However, current developer tools simulate foldable screen devices poorly, failing to accurately reproduce the display effects of foldable screen devices in different states. This will be explained below with reference to Figure 2.

[0064] Figure 2 shows a set of graphical user interfaces (GUIs).

[0065] As shown in Figure 2(a), the electronic device displays a simulated interface 201 and a status bar 202. The simulated interface 201 is the interface of the foldable screen device simulated by the developer tools, and can also be considered part of the developer tools' interface. The electronic device can display controls 203 and 204 in the status bar, where control 203 corresponds to the unfolded state of the foldable screen device, and control 204 corresponds to the folded state. The electronic device can respond to the user's click on control 203 to simulate the interface displayed when the foldable screen device is in the unfolded state. The electronic device can respond to the user's click on control 204 to simulate the interface displayed when the foldable screen device is in the folded state.

[0066] It should be noted that the GUI shown in Figure 2 can be a simulated debugging scenario for developers. In this scenario, developers can simulate the display interface of a foldable screen device through developer tools without a physical foldable screen device.

[0067] Referring again to Figure 2(a), the electronic device can simulate the desktop display effect when the foldable screen device is in the unfolded state using developer tools. The desktop includes icons 205, 206, 207, 208, 209, and a search bar 210. When the electronic device detects a user click on control 204, it can display the GUI shown in Figure 2(b) in response to that click.

[0068] As shown in Figure 2(b), the electronic device, responding to the user's click on control 204, can simulate the desktop display effect when the foldable screen device is in a folded state. It is clear from the figure that when the electronic device switches from simulating the desktop display effect when the foldable screen is in an unfolded state to simulating the desktop display effect when the foldable screen device is in a folded state, the desktop icons only include icons 205, 206, and 207, while icons 208 and 209 are not present, and the search bar 210 is not fully displayed. However, in reality, when the foldable screen device switches from an unfolded state to a folded state, the number of icons, search bar, and other interface elements on the desktop does not change, and they are all fully displayed. In other words, the electronic device fails to truly simulate the display effect of a foldable screen device switching from an unfolded state to a folded state.

[0069] Similarly, when simulating a foldable screen device switching from a folded state to an unfolded state, the electronic device only stretches the interface and its elements horizontally, which is also inconsistent with reality.

[0070] Furthermore, since both the simulated switch from folded to unfolded state and the simulated switch from unfolded to folded state only involve a change in resolution, the switching process is very abrupt and does not match the actual switching process of foldable screen devices.

[0071] Currently, developers can connect physical foldable screen devices to computers via wired or wireless means. In this case, if the developer changes the form factor of the physical foldable screen device, the computer can display an interface in the corresponding form. However, this method requires developers to purchase foldable screen devices, which are often quite expensive. This raises the barrier for developers to create applications adapted for foldable screen devices, hindering the expansion of the foldable screen device application ecosystem.

[0072] In conclusion, if electronic devices are only simulated using developer tools, the simulation results are poor and do not match reality, which is detrimental to developers' work. On the other hand, if developers use physical foldable devices for development, it increases their financial burden.

[0073] Based on this, the embodiments of this application provide a method for simulating a foldable screen device, which can more realistically simulate a foldable screen device, facilitates development work, and does not require the use of a physical foldable screen device.

[0074] In this embodiment, the electronic device includes a first operating system (or a native operating system) and a second operating system. Based on these two operating systems, the electronic device can include two operating environments: a host and a guest, as shown in Figure 3. The first operating system is the operating system installed on the electronic device, and the second operating system is the operating system installed on a virtual machine or running in a container. The host can provide related services to users based on the hardware of the electronic device and the first operating system. The guest can provide related services to users based on the hardware of the electronic device, virtual hardware, and the second operating system. The virtual hardware can be registered by the first operating system through developer tools. The second operating system is understood as the operating system mounted on the foldable screen device.

[0075] In some embodiments, the first operating system may be a desktop operating system, and the second operating system may be a mobile operating system.

[0076] In this application embodiment, the first operating system and the second operating system are not specifically limited. For example, the first operating system includes, but is not limited to, Windows operating system, macOS, etc., and the second operating system includes, but is not limited to, Android operating system, HarmonyOS operating system, etc.

[0077] In some embodiments, the first operating system and the second operating system may be the same or the same type of operating system. For example, the first operating system and the second operating system may be HarmonyOS. The first operating system may be HarmonyOS for computers (such as desktop computers and laptop computers), and the second operating system may be HarmonyOS for mobile devices (such as mobile phones).

[0078] In this embodiment of the application, the developer tool may be an application in a first operating system, and the developer tool is used to run a second operating system.

[0079] Figure 4 shows a schematic diagram of the system architecture provided in the embodiment of this application. As shown in Figure 4, the system architecture includes an interface triggering layer, a virtual sensor layer, a virtual display screen layer, and a drawing layer.

[0080] The interface trigger layer is located on the first operating system side and is used to provide developers with multiple interactive controls in the developer tools to switch between different forms of foldable screen devices.

[0081] For example, the developer tools include controls #1, #2, and #3, corresponding to the folded, unfolded, and semi-folded states of the foldable screen device, respectively. The electronic device can respond to user clicks on these controls, simulating different forms of the foldable screen device through the developer tools. When simulating different forms of the foldable screen device, the electronic device can not only simulate the changes in display size under different forms, but also the display effects under different forms.

[0082] The virtual sensor layer is located on the second operating system side. This layer includes one or more virtual sensors, which can correspond to the real sensors in the foldable screen device. The electronic device can simulate the real sensors of the foldable screen device using these virtual sensors; that is, the electronic device can change the parameters of these virtual sensors to simulate the parameters of the real sensors in different configurations of the foldable screen device. This allows the second operating system to generate corresponding frame data based on the parameters of the virtual sensors.

[0083] It is understandable that, for the same form factor of a foldable screen device, the parameters of the virtual sensor and its corresponding real sensor can be the same.

[0084] For example, a foldable screen device can determine its shape by detecting the folding angle using a real hinge sensor. If the folding angle detected by the real hinge sensor is between 30° and 130°, and the folding angle is 90°, the foldable screen device can determine that it is in a semi-folded state. In this embodiment, a virtual hinge sensor can be added. When the electronic device sets the folding angle detected by this virtual hinge sensor to 90°, the second operating system can determine that the foldable screen device is in a semi-folded state and generate corresponding frame data based on the folding angle.

[0085] For example, a foldable screen device can detect whether it is in a folded state using a magnetic sensor. When the foldable screen device is in a folded state, the parameter detected by the magnetic sensor is parameter #1. In this embodiment, a virtual magnetic sensor can be added. When the electronic device sets the parameter detected by this virtual magnetic sensor to parameter #1, the second operating system can determine that the foldable screen device is in a folded state.

[0086] It is understood that, in this embodiment of the application, by registering a virtual sensor corresponding to the real sensor in the second operating system, the second operating system can detect the parameters of the virtual sensor. When the parameters of the virtual sensor change, the second operating system can generate corresponding frame data based on the parameters of the virtual sensor.

[0087] The virtual display layer is located on the second operating system side, and the virtual display layer can include one or more virtual displays to simulate the real display of the foldable screen device.

[0088] For example, a real foldable screen electronic device includes an inner screen and an outer screen. The inner screen is a foldable screen. When the foldable screen device is in a folded state, the inner screen is powered off and the outer screen is powered on. When the foldable screen device is in an unfolded state, the inner screen is powered on and the outer screen is powered off. In this embodiment, virtual display screen #1 and virtual display screen #2 can be added to simulate the outer screen and inner screen, respectively. When the second operating system determines that the device is in a folded state, it controls virtual display screen #1 to power on and virtual display screen #2 to power off. When the second operating system determines that the device is in an unfolded state, it controls virtual display screen #1 to power off and virtual display screen #2 to power on.

[0089] The rendering layer, located on the first operating system side, is used to render and display the virtual interface based on frame data generated by the second operating system. This simulated interface can be understood as the interface displayed on a real foldable screen device.

[0090] The system architecture provided by the embodiments of this application has been described above. The method for simulating a foldable screen device provided by the embodiments of this application will be described below.

[0091] Figure 5 illustrates a set of GUIs provided in an embodiment of this application.

[0092] As shown in Figure 5(a), the electronic device displays a simulated interface 501 and a status bar 502. The simulated interface 501 corresponds to the interface displayed when the foldable screen device is in the unfolded state. When the electronic device displays interface 501, the parameters corresponding to the virtual sensors are recorded as the first parameter.

[0093] In some embodiments, the first operating system of the electronic device can register the virtual sensor with the second operating system through developer tools. The first operating system of the electronic device can set the parameters of the virtual sensor as a first parameter when the developer tools are first launched, thereby displaying the GUI shown in Figure 5(a).

[0094] In some embodiments, the developer tools include a settings interface in which the developer can set the unfolded state of the simulated foldable screen device, so that the first operating system of the electronic device can set the parameters of the virtual sensor as a first parameter to display the GUI as shown in 5(a).

[0095] Referring again to Figure 5(a), since interface 501 corresponds to the interface displayed when the foldable screen device is in the unfolded state, the electronic device can also display control 503 in the status bar 502. Control 503 corresponds to the unfolded state of the foldable screen device, and its shape is similar to that of the unfolded foldable screen device. When the electronic device detects a user clicking on control 503, it can display the GUI shown in Figure 5(b).

[0096] As shown in Figure 5(b), in response to a user clicking control 503, the electronic device can display a status bar 504, which displays controls 503, 505, and 506. Control 505 corresponds to the folded state of the foldable screen device, and control 506 corresponds to the half-folded state of the foldable screen device. The shape of control 505 is similar to the folded shape of the foldable screen device, and the shape of control 506 is similar to the half-folded shape of the foldable screen device. When the first operating system of the electronic device detects the user clicking control 505, it can display the GUI shown in Figure 5(c) in response to this operation.

[0097] The first operating system of the electronic device responds to the developer's click on control 505 and can modify the parameters of the virtual sensor to the second parameters. This allows the second operating system to generate and send frame data corresponding to the folded state to the first operating system based on the second parameters. The first operating system can then draw based on the frame data generated by the second operating system to display the GUI shown in Figure 5(c).

[0098] As shown in Figure 5(c), in response to the user's click on the control 505, the electronic device can display a simulated interface 507, which corresponds to the interface displayed when the foldable screen device is in a folded state.

[0099] Referring again to Figure 5(c), the electronic device can also display control 505 in the status bar 502.

[0100] It is understandable that when the foldable screen device is an inward-folding screen device and is in a folded state, the simulated interface 507 can correspond to the interface displayed on the outer display screen of the inward-folding screen device. When the foldable screen device is an outward-folding screen device and is in a folded state, the sub-display screen #1 of the foldable display screen of the outward-folding screen device is used to display the interface, and the simulated interface 507 can correspond to the interface displayed on the sub-display screen #1 of the foldable display screen of the outward-folding screen device.

[0101] When the electronic device detects that the user clicks on control 506, it can display the GUI shown in Figure 5(d) in response to the operation.

[0102] The first operating system of the electronic device responds to the developer's click on control 506 and can modify the parameters of the virtual sensor to the third parameter. This allows the second operating system to generate and send the frame data corresponding to the half-folded state to the first operating system based on the third parameter. The first operating system can then draw based on the frame data generated by the second operating system to display the GUI shown in Figure 5(d).

[0103] As shown in Figure 5(d), the electronic device can display a simulated interface 508 in response to the user's click on the control 506. The simulated interface 508 corresponds to the interface displayed when the foldable screen device is in a semi-folded state.

[0104] Referring again to (d) in Figure 5, when the electronic device displays the simulation interface 508, the folding avoidance area 509 can be displayed on the simulation interface 508.

[0105] Referring again to (d) in Figure 5, the electronic device can also display control 506 in the status bar 502.

[0106] Understandably, in real-world scenarios, when a foldable screen device is in a semi-folded state, the foldable area of ​​the display is bent, making user operation inconvenient and the display effect of interface elements in that area less than ideal. Therefore, when a foldable screen device is in a semi-folded state, controls and other interface elements should not be placed in the foldable area. In this embodiment, by adding a folding avoidance area 508 to the simulated interface 507, developers can avoid placing interface elements in the folding avoidance area 508 when developing applications, ensuring that the application can adapt to different forms of foldable screen devices.

[0107] Comparing Figures 5(a)-(d), we can see that the orientation of simulation interfaces 501 and 507 is portrait orientation, while the orientation of simulation interface 508 is landscape orientation.

[0108] When using a foldable screen device, it may be in landscape or portrait mode. Landscape mode refers to the device's orientation when displayed horizontally. Portrait mode refers to the device's orientation when displayed vertically. In landscape mode, the foldable screen displays horizontal bars, while in portrait mode, the display displays vertical bars.

[0109] Because foldable screen devices come in both landscape and portrait orientations, their display directions are also either horizontal or vertical. In a landscape orientation, the width of the screen is greater than its height. In other words, when the width of the screen is greater than its height, the display direction is called landscape, and the screen appears as horizontal bars. Conversely, in a portrait orientation, the width of the screen is less than its height. In other words, when the width of the screen is less than its height, the display direction is called portrait, and the screen appears as vertical bars.

[0110] In this embodiment, the first operating system of the electronic device can register virtual sensors with the second operating system, and by changing the parameters of the virtual sensors, the second operating system can generate different frame data based on different parameters of the virtual sensors. The first operating system of the electronic device displays a simulated interface based on the frame data generated by the second operating system. Since the simulated interface is generated based on the frame data of the second operating system, it can effectively simulate the display effects of foldable screen devices in different forms, which is helpful for developers and improves development efficiency.

[0111] In the GUI shown in Figure 5, taking the simulated desktop as an example, in some other embodiments of this application, the simulated interface displayed by the electronic device can be the interface of an application running on the foldable screen device, which will be described below with reference to Figure 6.

[0112] Figure 6 illustrates a set of GUIs provided in an embodiment of this application.

[0113] As shown in Figure 6(a), the electronic device displays a simulated interface 601 and a status bar 602. The simulated interface 601 corresponds to the video playback interface displayed when the foldable screen device is in the folded state. When the electronic device displays interface 601, the parameters corresponding to the virtual sensors are recorded as the first parameter. The electronic device can also display a control 603 in the status bar 602, where the control 603 corresponds to the unfolded state of the foldable screen device.

[0114] When the electronic device’s first operating system detects that the developer has switched to the simulated unfolded state, it can display the GUI shown in Figure 6(b) in response to the operation.

[0115] As shown in Figure 6(b), in response to the developer's operation of switching to the simulated unfolded state, the electronic device can display a simulated interface 604, which corresponds to the video playback interface displayed when the foldable screen device is in the unfolded state, i.e., the video is played in full screen on the simulated interface 604. The electronic device can also display a control 605 in the status bar 602, which corresponds to the unfolded state of the foldable screen device.

[0116] It should be noted that the description of the developer's operation to switch to the simulated unfolded state can be found in the description of Figure 5, and will not be repeated here for the sake of brevity.

[0117] When the electronic device’s primary operating system detects that the developer has switched to a simulated semi-folded state, it can display the GUI shown in Figure 6(c) in response to the operation.

[0118] As shown in Figure 6(c), in response to the developer's operation of switching to a simulated half-folded state, the electronic device can display a simulated interface 606, which corresponds to the video playback interface displayed when the foldable screen device is in a half-folded state. The electronic device can also display a control 607 in the status bar 602, which corresponds to the half-folded state of the foldable screen device.

[0119] It should be noted that the description of the developer's operation of switching to the simulated semi-folded state can be found in the description of Figure 5, and will not be repeated here for the sake of brevity.

[0120] Referring again to Figure 6(c), when the electronic device displays a simulated interface 606, this simulated interface 606 may include simulated sub-interfaces 606-1 and 606-2. When the foldable screen device is in a semi-folded state, the foldable display screen may include sub-display screen #1 and sub-display screen #2. Simulated sub-interface 606-1 corresponds to the interface displayed on sub-display screen #1 when the foldable screen device is displaying a video playback interface, and simulated sub-interface 606-2 corresponds to the interface displayed on sub-display screen #2 when the foldable screen device is displaying a video playback interface. Compared to the electronic device in Figure 6(b) playing video in full-screen mode on interface 604, when the electronic device simulates the semi-folded state of the foldable screen device, the interface layout during video playback can be changed. That is, the video is played on simulated sub-interface 606-1, and interface elements such as a progress bar, return control, and pause control are displayed on simulated sub-interface 606-2. The interface for playing video when the simulated foldable screen device is in the unfolded, folded, and semi-folded states is the same as the interface displayed on the actual foldable screen device.

[0121] Referring again to Figure 6(c), when the electronic device displays the simulation interface 607, the folding avoidance area 608 can be displayed on the interface 607.

[0122] In Figures 5 and 6 above, the electronic device displays a single simulated interface when simulating different forms of a foldable screen device. However, this application does not impose specific limitations on this. In other embodiments of this application, the electronic device may display two simulated interfaces when simulating the unfolded or semi-folded state of an inward-folding screen device. One simulated interface simulates the outer screen display of the inward-folding screen device, and the other simulates the inner screen display. For example, when a user takes a photo using the rear camera of the foldable screen device, if the foldable screen device is in the unfolded state, a preview interface can be displayed on the outer screen so that the subject can see the preview image, and a shooting interface can be displayed on the inner screen so that the user can take the photo.

[0123] Figure 7 illustrates another set of GUIs provided in an embodiment of this application.

[0124] As shown in Figure 7, the electronic device displays a simulated interface 701, a simulated interface 702, and a status bar 703. Simulated interface 701 corresponds to the interface displayed on the outer screen when the rear camera is activated in the unfolded state of the inward-folding screen device; that is, the electronic device can display a preview image on simulated interface 701. Simulated interface 702 corresponds to the interface displayed on the inner screen when the rear camera is activated in the unfolded state of the inward-folding screen device; that is, the electronic device can display preview images, shooting controls, and other interface elements on the simulated interface.

[0125] The electronic device can also display control 704 in the status bar 703, which corresponds to the expanded state.

[0126] It should be noted that in the example shown in Figure 7, the people in interfaces 701 and 702 may not be actual photos, but rather preset by the developer tools to facilitate the developer's adjustment of camera functions.

[0127] It should also be noted that Figure 7 only shows two simulated interfaces when the electronic device simulates the unfolded state of the foldable screen device. In other embodiments of this application, the electronic device can also display two simulated interfaces when simulating the semi-folded state of the foldable screen device.

[0128] The above section introduced the method for simulating a foldable screen device provided in the embodiments of this application, using a GUI. The following section will introduce the method for simulating a foldable screen device provided in the embodiments of this application, using a flowchart.

[0129] Figure 8 shows a schematic flowchart of a method for simulating a foldable screen device provided in an embodiment of this application. This method can be executed by an electronic device or by a component of the electronic device (e.g., a processor, chip system, etc.). The following description uses an electronic device as the executing entity. As shown in Figure 8, the method 800 includes:

[0130] S801, the first operating system of the electronic device responds to the first operation by setting the parameters of the virtual sensor to the first parameter.

[0131] As mentioned above, the first operating system can register virtual hardware with the second operating system through developer tools. This virtual hardware includes virtual sensors. The electronic device can respond to the user's first operation by setting the parameters of the virtual sensors to a first parameter, which corresponds to the first form of the foldable screen device.

[0132] In some embodiments, the first operation is the operation of the developer launching the developer tools.

[0133] When the first operating system of the electronic device detects the operation of launching the developer tools, it can launch the developer tools and register the virtual sensor with the second operating system through the developer tools. In this way, the first operating system can set the parameters of the virtual sensor as the first parameter.

[0134] In some embodiments, the first operation is an operation performed by the developer in the settings interface of the developer tool to simulate the first form of the foldable screen device.

[0135] The developer tools include a settings interface where developers can set the first form of the simulated foldable screen device, so that the first operating system of the electronic device can set the parameters of the virtual sensors as the first parameters.

[0136] In some embodiments, the first operation is an operation performed by the developer on the first control.

[0137] The first control corresponds to the first form of the foldable screen device. Before generating the first parameters of the virtual sensor, the first operating system of the electronic device can generate the second parameter of the virtual sensor. This second parameter corresponds to the second form of the foldable screen device, meaning that the simulated interface currently displayed by the first operating system of the electronic device is used to simulate the interface when the foldable screen device is in the second form. When the first operating system of the electronic device detects a user's operation on the first control (such as clicking the first control), in response to this operation, it can set the parameter of the virtual sensor to the first parameter.

[0138] For example, the first control can be control 503, control 505 or control 506 as shown in Figure 5, and the first operation can be the developer clicking on control 503, control 505 or control 506.

[0139] S802, the second operating system generates the first frame of data based on the first parameter.

[0140] The second operating system includes a driver program corresponding to the virtual sensor, enabling it to detect changes in the virtual sensor's parameters. When the virtual sensor's parameter is a first parameter, the second operating system can read this first parameter and generate a first frame of data based on it.

[0141] It is understandable that the first frame data generated by the second operating system executing S802 is the same as the frame data generated by the operating system of the foldable screen device based on the first parameters of the foldable screen device's sensors in the real case.

[0142] S803, the second operating system sends the first frame of data to the first operating system.

[0143] Correspondingly, the first operating system receives the first frame of data sent by the second operating system.

[0144] S804, the first operating system displays the first simulated interface based on the first frame of data.

[0145] The first simulated interface is used as the display interface for the foldable screen device in its first form.

[0146] For example, as shown in Figure 5(a), the first operating system of the electronic device can display a simulated interface 501, which corresponds to the interface displayed when the foldable screen device is in the unfolded state.

[0147] In this embodiment, the first operating system of the electronic device can register virtual sensors with the second operating system, and by changing the parameters of the virtual sensors, the second operating system can generate frame data based on the parameters of the virtual sensors. The first operating system of the electronic device displays a simulated interface based on the frame data generated by the second operating system. Since the simulated interface is generated based on the frame data of the second operating system, it can effectively simulate the display effect of foldable screen devices in different forms, which is helpful for developers, improves development efficiency, and eliminates the need for developers to use physical foldable screen devices, thus reducing development costs.

[0148] In this embodiment, when the developer has a physical foldable screen device and connects it to an electronic device, the electronic device can still simulate the interface displayed in different forms of the foldable screen using the method described above. This eliminates the need for the developer to manually change the form of the physical foldable screen device, thus extending the lifespan of the foldable screen device.

[0149] In some embodiments, the virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen corresponds to the outer display screen of the foldable screen device, and the second virtual display screen corresponds to the inner display screen of the foldable screen device, and the foldable screen device is an inner foldable screen device. In other words, in this embodiment, the first virtual display screen is registered with the second operating system to simulate the outer display screen of the foldable screen device, and the second virtual display screen is registered to simulate the inner display screen of the foldable screen device. It is understood that when the foldable screen device is an inner foldable screen device and is in a folded state, the outer display screen of the foldable screen device is powered on, and the inner display screen is powered off. When the foldable screen device is an inner foldable screen device and is in an unfolded or semi-folded state, the outer display screen of the foldable screen device is powered off, and the inner display screen is powered on, or both the outer and inner display screens are powered on. The sizes of the first virtual display screen and the second virtual display screen can be the same as the sizes of the outer and inner display screens, respectively.

[0150] Since the virtual hardware includes a first virtual display and a second virtual display, the corresponding first operating system can include a drawing display #1 and a drawing display #2, where drawing display #1 corresponds to the first virtual display and drawing display #2 corresponds to the second virtual display. The first operating system can draw a frame data display simulation interface on one of the drawing display displays. When the power-on / off states of the first and second virtual displays change, the first operating system can destroy the old drawing display and recreate a new one to draw the frame data. The drawing display can be understood as a window (Windows) used to carry the frame data. After receiving the frame data, the first operating system can draw the frame data on the drawing display through a drawing service.

[0151] Understandably, since the first virtual display screen and the second virtual display screen have different sizes, the sizes of the drawing display screen #1 and the drawing display screen #2 are also different.

[0152] Since the virtual hardware includes a first virtual display screen and a second virtual display screen, the second operating system can control the power-on and power-off states of the first and second virtual display screens based on the first parameters of the virtual sensors, and can send instruction information to the first operating system to indicate the power-on and power-off states of the first and second virtual display screens. The first operating system can determine the drawing display screen based on the instruction information and draw frame data on the determined drawing display screen.

[0153] In summary, Method 800 also includes:

[0154] The second operating system controls the first virtual display screen to be in a first state and controls the second virtual display screen to be in a second state based on the first parameter.

[0155] The second operating system sends a first instruction message to the first operating system.

[0156] Correspondingly, the first operating system receives the first instruction information sent by the second operating system. The first instruction information is used to indicate that the first virtual display screen is in a first state and to control the second virtual display screen to be in a second state.

[0157] S804, the first operating system displays the first simulated interface based on the first frame of data, including:

[0158] The first operating system draws a first frame of data on the first drawing display screen according to the first instruction information to display the first simulation interface.

[0159] When the first operating system draws the first frame of data on the first display screen according to the first instruction information, it may include the following possible implementation methods:

[0160] In one possible implementation, the first parameter corresponds to a folded state, and the second operating system can control the first virtual display screen to be powered on and the second virtual display screen to be powered off. The second operating system can also send instruction information #1 to the first operating system, which indicates that the first virtual display screen is powered on and the second virtual display screen is powered off. After receiving instruction information #1, the first operating system can draw a first frame of data on the drawing display screen #1 to display the first simulated interface.

[0161] In one possible implementation, the first state corresponding to the first parameter is a semi-folded state. The second operating system can control the first virtual display screen to be in a power-off state and the second virtual display screen to be in a power-on state. The second operating system can also send instruction information #2 to the first operating system, which indicates that the first virtual display screen is in a power-off state and the second virtual display screen is in a power-on state. After receiving instruction information #2, the first operating system can draw the first frame of data on the drawing display screen #2 to display the first simulated interface.

[0162] In one possible implementation, the first state corresponding to the first parameter is an expanded state. The second operating system can control the first virtual display screen to be in a power-off state and the second virtual display screen to be in a power-on state. The second operating system can also send instruction information #2 to the first operating system, which indicates that the first virtual display screen is in a power-off state and the second virtual display screen is in a power-on state. After receiving instruction information #2, the first operating system can draw the first frame of data on the drawing display screen #2 to display the first simulated interface.

[0163] As described above, when the first form is an unfolded state or a semi-folded state, both the first virtual display screen and the second virtual display screen can be powered on. The second operating system can then send indication information to the first operating system to indicate that both the first and second virtual display screens are powered on. When the first operating system draws the first frame of data on the first display screen based on this indication information, the following possible implementation methods may be included:

[0164] In one possible implementation, the first state corresponding to the first parameter is an expanded state, and the second operating system can control the first and second virtual display screens to be powered on. The second operating system can also send instruction information #3 to the first operating system, which indicates that the first and second virtual display screens are powered on. After receiving instruction information #3, the first operating system can draw a first frame of data on drawing display screen #1 and drawing display screen #2 to display two simulated interfaces. These two simulated interfaces can be understood as simulated sub-interfaces of the first simulated interface; that is, the first simulated interface includes the simulated sub-interface drawn on drawing display screen #1 and the simulated sub-interface drawn on drawing display screen #2. The first drawing display screen includes drawing display screen #1 and drawing display screen #2.

[0165] In one possible implementation, the first form corresponding to the first parameter is a semi-folded state, and the second operating system can control the first and second virtual display screens to be powered on. The second operating system can also send instruction information #3 to the first operating system, which indicates that the first and second virtual display screens are powered on. After receiving instruction information #3, the first operating system can draw the first frame of data on drawing display screen #1 and drawing display screen #2 to display two simulated interfaces. These two simulated interfaces can be understood as simulated sub-interfaces of the first simulated interface. The first drawing display screen includes drawing display screen #1 and drawing display screen #2.

[0166] It should be noted that, as described above, when the first state is either unfolded or semi-folded, the first operating system can draw frame data on the drawing display screen #2 to display the simulated interface. Specifically, when the first state is unfolded, the display direction of the drawing display screen #2 can be portrait orientation, meaning the simulated interface is displayed as vertical bars. When the first state is semi-folded, the display direction of the drawing display screen #2 can be landscape orientation, meaning the simulated interface is displayed as horizontal bars. In other words, in these embodiments, the folded state corresponds to one drawing display screen, and the semi-folded and unfolded states correspond to one drawing display screen.

[0167] It should also be noted that in some other embodiments, when the first form is in an unfolded state, the first operating system can draw frame data on the drawing display screen #2 to display the simulated interface; when the first form is in a semi-folded state, the first operating system can draw frame data on the drawing display screen #3 to display the simulated interface. In other words, in these embodiments, each form can correspond to a separate drawing display screen.

[0168] In some embodiments, the method 800 further includes:

[0169] The first operating system responds to the user's second action by setting the parameters of the virtual sensor to the second parameter.

[0170] The second parameter corresponds to the second form of the foldable screen device, where the first form is an unfolded state and the second form is a folded state, or the first form is a folded state and the second form is an unfolded state, or the first form is a folded state and the second form is a semi-folded state, or the first form is a semi-folded state and the second form is a folded state.

[0171] The second operating system generates the second frame data based on the second parameter, and controls the first virtual display screen to be in the second state and controls the second virtual display screen to be in the first state.

[0172] The second operating system sends a second frame of data and a second instruction message to the first operating system. The second instruction message is used to indicate that the first virtual display screen is in a second state and the second virtual display screen is in the first state.

[0173] The first operating system destroys the first drawing display screen and creates a second drawing display screen according to the second instruction information.

[0174] The first operating system draws a second frame of data on the second drawing display to show the second simulation interface, which is used to simulate the interface of the foldable screen device in the second form.

[0175] The second operating system switching the state of the first virtual display screen and the second virtual display screen, the first operating system destroying the first drawing display screen and creating the second drawing display screen, and drawing the second frame of data on the second drawing display screen can include the following possible implementation methods:

[0176] In one possible implementation, the first state corresponding to the first parameter is a folded state, and the second state corresponding to the second parameter is an unfolded state. The second operating system can control the first virtual display screen to change from a power-on state to a power-off state and the second virtual display screen to change from a power-off state to a power-on state. The second operating system can also send instruction information #2 to the first operating system, which indicates that the first virtual display screen is in a power-off state and the second virtual display screen is in a power-on state. After receiving instruction information #2, the first operating system can destroy the drawing display screen #1 and create the drawing display screen #2, and draw a second frame of data on the drawing display screen #2 to display the second simulated interface. In this possible implementation, the drawing display screen #1 is the first drawing display screen, and the drawing display screen #2 is the second drawing display screen.

[0177] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 507. When the operation of the developer clicking the control 505 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 503 is detected, the simulated interface 507 can be switched to the simulated interface 501.

[0178] In one possible implementation, the first state corresponding to the first parameter is a folded state, and the second state corresponding to the second parameter is a semi-folded state. The second operating system can control the first virtual display screen to change from a power-on state to a power-off state and the second virtual display screen to change from a power-off state to a power-on state. The second operating system can also send instruction information #2 to the first operating system, which indicates that the first virtual display screen is in a power-off state and the second virtual display screen is in a power-on state. After receiving instruction information #2, the first operating system can destroy the drawing display screen #1 and create a drawing display screen #2, and draw a second frame of data on the drawing display screen #2 to display the second simulated interface. In this possible implementation, the drawing display screen #1 is the first drawing display screen, and the drawing display screen #2 is the second drawing display screen.

[0179] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 507. When the operation of the developer clicking the control 505 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 506 is detected, the simulated interface 507 can be switched to the simulated interface 508.

[0180] In one possible implementation, the first state corresponding to the first parameter is a semi-folded state, and the second state corresponding to the second parameter is a folded state. The second operating system can control the first virtual display screen to change from a power-off state to a power-on state and the second virtual display screen to change from a power-on state to a power-off state. The second operating system can also send instruction information #1 to the first operating system, which indicates that the first virtual display screen is in a power-on state and the second virtual display screen is in a power-off state. After receiving instruction information #1, the first operating system can destroy the drawing display screen #2 and create the drawing display screen #1, and draw a second frame of data on the drawing display screen #1 to display the second simulated interface. In this possible implementation, the drawing display screen #2 is the first drawing display screen, and the drawing display screen #1 is the second drawing display screen.

[0181] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 508. When the operation of the developer clicking the control 506 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 505 is detected, the simulated interface 508 can be switched to the simulated interface 507.

[0182] In one possible implementation, the first state corresponding to the first parameter is an unfolded state, and the second state corresponding to the second parameter is a folded state. The second operating system can control the first virtual display screen to change from a power-off state to a power-on state and the second virtual display screen to change from a power-on state to a power-off state. The second operating system can also send instruction information #1 to the first operating system, which indicates that the first virtual display screen is in a power-on state and the second virtual display screen is in a power-off state. After receiving instruction information #1, the first operating system can destroy the drawing display screen #2 and create the drawing display screen #1, and draw a second frame of data on the drawing display screen #1 to display the second simulated interface. In this possible implementation, the drawing display screen #2 is the first drawing display screen, and the drawing display screen #1 is the second drawing display screen.

[0183] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 501. When the operation of the developer clicking the control 503 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 505 is detected, the simulated interface 501 can be switched to the simulated interface 507.

[0184] In other embodiments, when the first form is an unfolded state and the second form is a semi-folded state, or the first form is a semi-folded state and the second form is an unfolded state, the second operating system may not change the states of the first virtual display screen and the second virtual display screen. The first operating system may draw the second frame data in the following possible implementations:

[0185] In one possible implementation, the first state corresponding to the first parameter is a semi-folded state, and the second state corresponding to the second parameter is an unfolded state. The second operating system can maintain the state of the first and second virtual displays. The first operating system can destroy the drawing display #3 and create a drawing display #2, and draw a second frame of data on the drawing display #2 to display the second simulated interface. In this possible implementation, the drawing display #3 is the first drawing display, and the drawing display #2 is the second drawing display.

[0186] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 508. When the operation of the developer clicking the control 506 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 504 is detected again, the simulated interface 508 can be switched to the simulated interface 501.

[0187] In one possible implementation, the first state corresponding to the first parameter is an expanded state, and the second state corresponding to the second parameter is a folded state. The second operating system can maintain the state of the first and second virtual displays. The first operating system can destroy the drawing display #2 and create a drawing display #3, and draw a second frame of data on the drawing display #3 to display the second simulated interface. In this possible implementation, the drawing display #2 is the first drawing display, and the drawing display #3 is the second drawing display.

[0188] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 501. When the operation of the developer clicking the control 503 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 505 is detected, the simulated interface 501 can be switched to the simulated interface 507.

[0189] In this embodiment of the application, when the first operating system switches from simulating the first form to simulating the second form, the first operating system can switch between different drawing displays, so that the developer can perceive the change in form and the simulation effect is more realistic.

[0190] In some embodiments, the first state is a folded state, the second state is an unfolded state, and the direction of the second drawing display screen is a portrait orientation. The method 800 further includes:

[0191] The first operating system responds to the user's third operation by setting the parameters of the virtual sensor to the third parameter, which corresponds to the third form of the foldable screen device, namely the semi-folded state.

[0192] The second operating system generates the third frame of data based on the third parameter.

[0193] The second operating system sends a third frame of data to the first operating system.

[0194] The first operating system adjusts the orientation of the second display screen to landscape mode.

[0195] The first operating system draws a third frame of data on the second display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in its third form.

[0196] As described above, when the first state is either unfolded or semi-folded, the first operating system can draw frame data on the second rendering display to show the simulated interface. Specifically, when the first state is unfolded, the display orientation of the second rendering display can be portrait, meaning the simulated interface is displayed as vertical bars. When the first state is semi-folded, the display orientation of the second rendering display can be landscape, meaning the simulated interface is displayed as horizontal bars. Therefore, when the first operating system determines to switch from the unfolded state to the semi-folded state, it can adjust the orientation of the second rendering display from portrait to landscape, and then draw a third frame of data on the second rendering display to show the third simulated interface.

[0197] In this embodiment of the application, when the first operating system switches from the simulated unfolded state to the simulated semi-folded state, the first operating system can change the display direction of the drawing display screen, so that the developer can perceive the change in direction and the simulation effect is more realistic.

[0198] In some embodiments, the first form is a folded state, the second form is a semi-folded state, and the display orientation of the second drawing display screen is a landscape orientation. The method 800 further includes:

[0199] The first operating system responds to the user's third operation by setting the parameters of the virtual sensor to the third parameter, which corresponds to the third form of the foldable screen device, namely the unfolded state.

[0200] The second operating system generates the third frame of data based on the third parameter.

[0201] The second operating system sends a third frame of data to the first operating system.

[0202] The first operating system adjusts the orientation of the second display screen to portrait mode.

[0203] The first operating system draws a third frame of data on the second display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in its third form.

[0204] When the first operating system determines that it is switching from the semi-folded state to the unfolded state, it can adjust the orientation of the second drawing display screen from the horizontal orientation to the vertical orientation, and then draw the third frame of data on the second drawing display screen to display the third simulation interface.

[0205] In this embodiment of the application, when the first operating system switches from a simulated semi-folded state to a simulated unfolded state, the first operating system can change the display orientation of the drawing display screen, so that the developer can perceive the change in orientation and the simulation effect is more realistic.

[0206] In the above description, the foldable screen device is taken as an example of an inward-folding screen device. In other embodiments of this application, the foldable screen device can also be an outward-folding screen device. When the foldable screen device is an outward-folding screen device, the virtual hardware also includes a first virtual display screen, wherein the first virtual display screen corresponds to the foldable display screen of the foldable screen device. In other words, in the embodiments of this application, the first virtual display screen is registered with the second operating system to simulate the foldable display screen of the foldable screen device. It is understood that, unlike the inward-folding screen device, the folded state, half-folded state, or unfolded state of the outward-folding screen device corresponds to the same foldable display screen, that is, the foldable display screen is always powered on. Therefore, in these embodiments, the first operating system can draw different frame data through one drawing display screen, or it can draw different frame data through multiple drawing display screens.

[0207] Understandably, when the first operating system draws different frame data through a drawing display, it can change the size of that drawing display to correspond to the folded, semi-folded, and unfolded states.

[0208] In some embodiments, when the first operating system displays the first simulated interface, the size of the first drawing display screen is a first size, and the method 800 further includes:

[0209] In response to the user's second operation, the first operating system sets the parameters of the virtual sensor to a second parameter, which corresponds to the second form of the foldable screen device.

[0210] The second operating system generates the second frame of data based on the second parameter.

[0211] The second operating system sends a second frame of data to the first operating system.

[0212] The first operating system adjusts the size of the first drawing display screen to the second size.

[0213] The first operating system draws a second frame of data on the first drawing display screen to display a second simulated interface, which is used to simulate the interface of the foldable screen device in its second form.

[0214] One possible implementation involves a first state of folding and a second state of unfolding. The first size can be understood as the size of the interface displayed when the foldable screen device is in the folded state, and the second size can be understood as the size of the interface displayed when the foldable screen device is in the unfolded state. When the first operating system determines that it is switching from a simulated folded state to a simulated unfolded state, it can adjust the size of the first rendering display screen from the first size to the second size, and render a second frame of data on the first rendering display screen to simulate the interface of the foldable screen device in the unfolded state.

[0215] One possible implementation involves a first state of unfolded operation and a second state of folded operation. The first size can be understood as the size of the interface displayed when the foldable screen device is in the unfolded state, and the second size can be understood as the size of the interface displayed when the foldable screen device is in the folded state. When the first operating system determines that it is switching from a simulated unfolded state to a simulated folded state, it can adjust the size of the first rendering display screen from the first size to the second size, and render a second frame of data on the first rendering display screen to simulate the interface of the foldable screen device in the folded state.

[0216] In some embodiments, the virtual hardware further includes a first virtual display screen, wherein the first virtual display screen corresponds to the foldable display screen of a foldable screen device, and the foldable screen device is an outward foldable screen device. The method 800 further includes:

[0217] In response to the user's second operation, the first operating system sets the parameters of the virtual sensor to a second parameter, which corresponds to the second form of the foldable screen device.

[0218] The second operating system generates the second frame of data based on the second parameter.

[0219] The second operating system sends a second frame of data to the first operating system.

[0220] The first operating system destroys the first drawing display screen and creates a second drawing display screen.

[0221] The first operating system draws a second frame of data on the second drawing display to show the second simulation interface, which is used to simulate the interface of the foldable screen device in the second form.

[0222] As described above, the first virtual display screen is always powered on. The first operating system can draw different frame data through multiple drawing displays. When the first operating system determines that it is switching from the first simulated mode to the second simulated mode, it can destroy the first drawing display screen and create the second drawing display screen, and draw the second frame data on the second drawing display screen to display the second simulated interface.

[0223] Figure 9 shows a schematic diagram of the software architecture provided in an embodiment of this application.

[0224] As shown in Figure 9, the host side of the electronic device includes a first operating system, which comprises developer tools, a communication module, and a rendering module. The developer tools are used to run a second operating system and register virtual hardware with it. The communication module is used for data interaction with the second operating system. The rendering module is used to render frame data.

[0225] The second operating system can be divided into multiple layers, including an application layer, a framework layer, a hardware abstraction layer (HAL), a driver layer, and a virtual hardware layer. The application layer of the second operating system can include a series of applications, such as browsers, app stores, cameras, gallery, calendars, call apps, maps, navigation apps, Bluetooth, music, video, SMS, instant messaging applications, etc., which are not limited in the embodiments of this application.

[0226] The framework layer includes sensor services, which provide sensor capabilities to various applications in the application layer. In this embodiment, applications can have different layouts depending on the form factor of the foldable screen device. The applications can sense changes in form factor through the sensor services and then determine the corresponding layout.

[0227] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and the hardware circuitry. It encapsulates the underlying hardware drivers and provides a generic interface for the framework layer to call these drivers. The HAL includes a sensor driver interface, which provides a stable sensor capability interface for the framework layer's sensor services.

[0228] The driving layer, which includes the driving of multiple sensors, is used to ensure the normal operation of the sensors.

[0229] The virtual hardware layer includes virtual hardware registered by the first operating system, such as virtual sensors and virtual displays.

[0230] When the first operating system changes the parameters of the virtual sensor, the corresponding driver in the driver layer can receive the virtual sensor parameters and report them to the hardware abstraction layer. The hardware abstraction layer reads the parameters from the driver layer and provides a calling interface for the sensor server in the framework layer. Various applications in the application layer can subscribe to the parameters through the sensor service in the framework layer and can generate corresponding frame data according to the changes in the parameters, so that the workflow is the same as during real switching. Therefore, the first operating system can realistically simulate a foldable screen device.

[0231] The method for simulating a foldable screen device provided in the embodiments of this application has been described in detail above. In the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terminology and / or descriptions between the various embodiments are consistent and can be referenced by each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.

[0232] The foregoing primarily describes the method for simulating a foldable screen device provided in this application from the perspective of an electronic device. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0233] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments described above, and will not be repeated here.

[0234] This application provides a readable storage medium containing instructions that, when executed by an electronic device, cause the electronic device to perform the technical solution described in the above embodiments. The implementation principle and technical effects are similar and will not be repeated here.

[0235] This application provides a chip for executing instructions. When the chip is running, it executes the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.

[0236] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.

[0237] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0238] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

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

[0240] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0241] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0242] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be included within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.

Claims

1. A method for simulating a foldable screen device, characterized in that, The method is applied to an electronic device, which includes a first operating system and a second operating system. The first operating system runs the second operating system through developer tools and registers virtual hardware in the second operating system. The virtual hardware includes a virtual sensor, which is used to simulate a sensor used for form detection in a foldable screen device. The method includes: In response to the user's first operation, the first operating system sets the parameters of the virtual sensor to a first parameter, wherein the first parameter corresponds to the first form of the foldable screen device; The second operating system generates the first frame of data based on the first parameter; The second operating system sends the first frame of data to the first operating system; The first operating system displays a first simulated interface based on the first frame data. The first simulated interface is used to simulate the interface of a foldable screen device in the first form.

2. The method according to claim 1, characterized in that, The virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen is used to simulate the outer display screen of the foldable screen device, and the second virtual display screen is used to simulate the inner display screen of the foldable screen device, wherein the foldable screen device is an inwardly foldable screen device. The method further includes: The second operating system controls the first virtual display screen to be in a first state and controls the second virtual display screen to be in a second state based on the first parameter; The second operating system sends a first instruction message to the first operating system, the first instruction message being used to indicate that the first virtual display screen is in a first state and the second virtual display screen is in a second state; The first operating system displays a first simulated interface based on the first frame data, including: The first operating system draws the first frame data on the first drawing display screen according to the first instruction information to display the first simulation interface.

3. The method according to claim 2, characterized in that, When the first form is the unfolded state, the first state is the power-down state, and the second state is the power-on state; When the first form is a folded state, the first state is the power-on state, and the second state is the power-off state; When the first form is a semi-folded state, the first state is a power-down state, and the second state is a power-on state.

4. The method according to claim 2 or 3, characterized in that, The method further includes: In response to the user's second operation, the first operating system sets the parameters of the virtual sensor to a second parameter, which corresponds to the second form of the foldable screen device; The second operating system generates a second frame of data based on the second parameter, and controls the first virtual display screen to be in the second state and controls the second virtual display screen to be in the first state; The second operating system sends the second frame data and the second indication information to the first operating system. The second indication information is used to indicate that the first virtual display screen is in the second state and the second virtual display screen is in the first state. The first operating system destroys the first drawing display screen and creates a second drawing display screen according to the second instruction information; The first operating system draws the second frame data on the second drawing display screen to display the second simulated interface, which is used to simulate the interface of the foldable screen device in the second form.

5. The method according to any one of claims 1 to 4, characterized in that, When the first form is a semi-folded state, the method further includes: The first operating system displays a collapsible avoidance area on the first simulation interface.

6. The method according to claim 4, characterized in that, The first form is an unfolded state, and the second form is a folded state; Alternatively, the first form is the folded state, and the second form is the unfolded state; Alternatively, the first form is the folded state, and the second form is the semi-folded state; Alternatively, the first form is the semi-folded state, and the second form is the folded state.

7. The method according to claim 6, characterized in that, The first state is the folded state, the second state is the unfolded state, the direction of the second drawing display screen is the portrait direction, and the method further includes: In response to a third operation by the user, the first operating system sets the parameters of the virtual sensor to a third parameter, wherein the third parameter corresponds to the third form of the foldable screen device, and the third form is the semi-folded state; The second operating system generates the third frame of data based on the third parameter; The second operating system sends the third frame of data to the first operating system; The first operating system adjusts the orientation of the second display screen to landscape mode; The first operating system draws the third frame of data on the second drawing display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in the third form.

8. The method according to claim 6, characterized in that, The first form is the folded state, the second form is the semi-folded state, the display orientation of the second drawing display screen is the landscape orientation, and the method further includes: In response to a third operation by the user, the first operating system sets the parameters of the virtual sensor to a third parameter, wherein the third parameter corresponds to the third form of the foldable screen device, and the third form is the unfolded state; The second operating system generates the third frame of data based on the third parameter; The second operating system sends the third frame of data to the first operating system; The first operating system adjusts the orientation of the second display screen to portrait mode; The first operating system draws the third frame of data on the second drawing display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in the third form.

9. The method according to claim 1, characterized in that, The virtual hardware also includes a first virtual display screen, wherein... The first virtual display screen is used to simulate the foldable display screen of a foldable screen device, wherein the foldable screen device is an outward foldable screen device. The first operating system displays the first simulated interface based on the first frame data, including: The first operating system draws the first frame data on the first drawing display screen to display the first simulated interface.

10. The method according to claim 9, characterized in that, When the first operating system displays the first simulated interface, the size of the first drawing display screen is a first size, and the method further includes: In response to the user's second operation, the first operating system sets the parameters of the virtual sensor to a second parameter, wherein the second parameter corresponds to the second form of the foldable screen device; The second operating system generates the second frame of data based on the second parameter; The second operating system sends the second frame of data to the first operating system; The first operating system adjusts the size of the first drawing display screen to the second size; The first operating system draws the second frame data on the first drawing display screen to display the second simulated interface, which is used to simulate the interface of the foldable screen device in the second form.

11. The method according to claim 9, characterized in that, The method further includes: In response to the user's second operation, the first operating system sets the parameters of the virtual sensor to a second parameter, wherein the second parameter corresponds to the second form of the foldable screen device; The second operating system generates the second frame of data based on the second parameter; The second operating system sends the second frame of data to the first operating system; The first operating system destroys the first drawing display screen and creates a second drawing display screen; The first operating system draws the second frame data on the second drawing display screen to display the second simulated interface, which is used to simulate the interface of the foldable screen device in the second form.

12. The method according to claim 1, characterized in that, The virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen is used to simulate the outer display screen of the foldable screen device, and the second virtual display screen is used to simulate the inner display screen of the foldable screen device. The foldable screen device is an inwardly foldable screen device, and the first form is an unfolded state or a semi-folded state. The method further includes: The second operating system controls the first virtual display screen and the second virtual display screen to be powered on according to the first parameter; The second operating system sends a third instruction message to the first operating system, the third instruction message being used to indicate that the first virtual display screen and the second virtual display screen are in the power-on state; The first operating system displays a first simulated interface based on the first frame data, including: The first operating system draws the first frame data on a first drawing display screen and a second drawing display screen according to the third instruction information to display the first simulation interface. The first simulation interface includes a first simulation sub-interface drawn on the first drawing display screen and a second simulation sub-interface drawn on the second drawing display screen.

13. The method according to any one of claims 1 to 12, characterized in that, The virtual sensor is used to simulate a rotating shaft sensor and / or to simulate a magnetic attraction sensor.

14. The method according to any one of claims 1 to 13, characterized in that, The first operating system displays a first interface, which is a developer tool interface. The first interface includes a first control, which is associated with the first form. The first operation is an operation performed on the first control.

15. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which, when executed by an electronic device, enables the implementation of the method as described in any one of claims 1 to 14.

16. A chip, characterized in that, The chip includes a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute the method as described in any one of claims 1 to 14.

17. An electronic device, characterized in that, It includes one or more processors; one or more memories; said one or more memories storing one or more computer programs, said one or more computer programs including instructions that, when executed by said one or more processors, cause the method as described in any one of claims 1 to 14 to be performed.

18. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 14.