Resource control method and electronic device

By dynamically switching the SPI resources of the inner and outer screens in foldable phones, the cost and space occupation problems caused by adding infrared devices are solved, realizing resource-saving infrared device driving, which is suitable for small-sized devices.

WO2025256291A9PCT designated stage Publication Date: 2026-04-02HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

Adding infrared devices to existing electronic devices requires additional SPI resources, resulting in high costs and space consumption, making them difficult to apply to small-sized devices.

Method used

By utilizing the SPI resources of the inner or outer screen in a foldable phone, the connection between the SPI pin and the infrared device can be dynamically switched to drive the infrared device, avoiding the need for additional SPI resources. A resource control module is used to switch the connection between the SPI pin and the infrared device in different screen states.

Benefits of technology

This technology enables the driving of infrared devices without increasing SPI resources, saving the cost and space of electronic devices and making it beneficial for the application of small-sized devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025092344_02042026_PF_FP_ABST
    Figure CN2025092344_02042026_PF_FP_ABST
Patent Text Reader

Abstract

A resource control method and an electronic device. The electronic device comprises: a first screen, a second screen, a first SPI, a second SPI, and a first device, wherein the first screen and the second screen are located on different sides of the electronic device; when the first screen is in a display state and the first device is in a working state, the first screen can be connected to the first SPI, and the first device can be connected to the second SPI; when the second screen is in a display state and the first device is in a working state, the second screen can be connected to the second SPI, and the first device can be connected to the first SPI, that is, an SPI resource of a screen that is not used by a user is provided to the first device, for example, an infrared device, for utilization, so that no SPI resource needs to be added when the first device (for example, the infrared device) is newly added, thereby saving costs of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Resource control method and electronic device

[0001] The present application claims priority to the Chinese patent application No. 202410759417.X, filed on June 12, 2024, and entitled "A resource control method and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the technical field of data transmission, and in particular to a resource control method and electronic device. BACKGROUND

[0003] With the demand for remote control of devices such as air conditioners and smart televisions, electronic devices such as mobile phones generally need to add infrared devices. Users can drive the infrared devices to work through the infrared application (such as an air conditioner remote control application) installed on the electronic device, thereby achieving the demand for remote control.

[0004] The processor in the electronic device needs to be connected to each hardware through a corresponding serial peripheral interface (SPI) to send and receive data. For example, the display screen needs to be connected to the processor through a corresponding SPI to receive the display data sent by the processor. It can be understood that the SPI resources (such as the number of SPIs) provided by the processor in the electronic device are limited, and are generally allocated to the corresponding hardware, i.e., there are no additional SPI resources. Therefore, if other devices such as infrared devices are added, SPI resources need to be added, which will increase the cost of the electronic device. At the same time, the added SPI resources will occupy a certain space in the electronic device, which cannot be realized in some electronic devices that pursue small size. SUMMARY

[0005] To solve the above problems that adding infrared devices requires adding SPI resources, thereby increasing the cost of the electronic device and occupying space, the present application provides a resource control method and electronic device.

[0006] In a first aspect, the present application provides an electronic device, comprising: a first screen, a second screen, a first SPI, a second SPI and a first device, wherein the first screen and the second screen are located at different sides of the electronic device; and corresponding to the first screen being in a display state and the first device being in a working state, the first screen is connected to the first SPI, and the first device is connected to the second SPI; and corresponding to the second screen being in a display state and the first device being in a working state, the second screen is connected to the second SPI, and the first device is connected to the first SPI.

[0007] In an embodiment of the present application, the electronic device can be any electronic device with multiple screens, such as a foldable-screen mobile phone. For example, when the electronic device is a foldable-screen mobile phone, the first screen can be an inner screen, and the second screen can be an outer screen. The first screen in a display state can be the electronic device in an unfolded state, at which time the inner screen is in a display state, indicating that the user is using the inner screen and not using the outer screen. The second screen in a display state can be the electronic device in a folded state, at which time the outer screen is in a display state, indicating that the user is using the outer screen and not using the inner screen.

[0008] Based on the above scheme, the SPI resource can be added without adding the first device (for example, an infrared device), and the driving of the infrared device can be implemented through the SPI resource corresponding to the inner screen or the outer screen, thereby saving the cost of the electronic device, and in addition, the space of the electronic device can be saved, which is conducive to application in small-volume electronic devices.

[0009] In a possible implementation of the first aspect, the first device is an infrared device.

[0010] In some embodiments, the first device can be a device that only uses the SPI master output slave input pin, for example, an infrared device, or other devices.

[0011] In a possible implementation of the first aspect, the electronic device includes a resource control module. When the first screen is in a display state and it is determined that the first device needs to be started, the resource control module controls the first screen to be connected with the first SPI and controls the first device to be connected with the second SPI. When the second screen is in a display state and it is determined that the first device needs to be started, the resource control module controls the second screen to be connected with the second SPI and controls the first device to be connected with the first SPI.

[0012] In a possible implementation of the first aspect, the first SPI includes a first CS pin, a first MOSI pin, a first MISO pin, and a first CLK pin. The first CS pin, the first MOSI pin, the first MISO pin, and the first CLK pin are connected with the first screen, and the first MOSI pin is connected with the first device. The second SPI includes a second CS pin, a second MOSI pin, a second MISO pin, and a second CLK pin. The second CS pin, the second MOSI pin, the second MISO pin, and the second CLK pin are connected with the second screen, and the second MOSI pin is connected with the first device.

[0013] In a possible implementation of the first aspect, the controlling the first screen to be connected with the first SPI and the first device to be connected with the second SPI comprises: the resource control module controls the first MOSI pin to be connected with the first screen and the first device to be connected with the second MOSI pin; the controlling the second screen to be connected with the second SPI and the first device to be connected with the first SPI comprises: the resource control module controls the second MOSI pin to be connected with the second screen and the first device to be connected with the first MOSI pin.

[0014] In a possible implementation of the first aspect, the resource control module comprises a first control device, a second control device, a first switch device, a second switch device, a third switch device and a fourth switch device; an input end of the first switch device is connected with the first screen, an output end of the first switch device is connected with an input end of the second switch device and the first MOSI pin respectively, and a control end of the first switch device is connected with the first control device; an input end of the second switch device is also connected with the first MOSI pin, an output end of the second switch device is connected with the first device, and a control end of the second switch device is connected with the second control device; an input end of the third switch device is connected with the first screen, an output end of the third switch device is connected with an input end of the fourth switch device and the second MOSI pin respectively, and a control end of the third switch device is connected with the second control device; an input end of the fourth switch device is also connected with the second MOSI pin, an output end of the fourth switch device is connected with the first device, and a control end of the fourth switch device is connected with the first control device.

[0015] In a possible implementation of the first aspect, the first switch device, the second switch device, the third switch device and the fourth switch device are MOS, and the first control device and the second control device are PMIC.

[0016] In the embodiments of the present application, the first control device can be a first PMIC, or any device capable of realizing the function of the first control device, and the second control device can be a second PMIC, or any device capable of realizing the function of the second control device. The first switch device can be a first MOS, the second switch device can be a second MOS, the third switch device can be a third MOS, and the fourth switch device can be a fourth MOS.

[0017] In a possible implementation of the first aspect, the resource control module controls the first screen to be connected with the first SPI and the first device to be connected with the second SPI by the following manner: when the first screen is in a display state and it is determined that the first device needs to be started, the resource control module outputs a high level to the control ends of the first switch device and the fourth switch device through the first control device, and outputs a low level to the control ends of the second switch device and the third switch device through the second control device.

[0018] The resource control module is configured to, when the second screen is in the display state and it is determined that the first device needs to be started, control the second control device to output a high level to control ends of the second switch device and the third switch device, and control the first control device to output a low level to control ends of the first switch device and the fourth switch device.

[0019] In a second aspect, the present application provides a resource control method for an electronic device, the electronic device comprising a first screen, a second screen, a first SPI, a second SPI and a first device, wherein the first screen and the second screen are located at different sides of the electronic device; the method comprising:

[0020] corresponding to the first screen being in the display state and it being determined that the first device needs to be started, controlling the first screen to be conductive with the first SPI, and controlling the first device to be conductive with the second SPI; corresponding to the second screen being in the display state and it being determined that the first device needs to be started, controlling the second screen to be conductive with the second SPI, and controlling the first device to be conductive with the first SPI.

[0021] In a third aspect, the present application provides an electronic device comprising a memory configured to store instructions for execution by one or more processors of the electronic device, and a processor, which is one of the processors of the electronic device, configured to execute the resource control method mentioned in the present application. BRIEF DESCRIPTION OF DRAWINGS

[0022] FIG. 1 shows a schematic diagram of a foldable-screen mobile phone according to some embodiments of the present application;

[0023] FIG. 2 shows a schematic diagram of an electronic device according to some embodiments of the present application;

[0024] FIG. 3 shows a schematic diagram of a connection circuit of an inner screen and an SPI according to some embodiments of the present application;

[0025] FIG. 4 shows a schematic diagram of a connection circuit of an outer screen and an SPI according to some embodiments of the present application;

[0026] FIG. 5 shows a schematic diagram of a connection circuit of an infrared device and an SPI according to some embodiments of the present application;

[0027] FIG. 6a shows a schematic diagram of a structure of an electronic device according to some embodiments of the present application;

[0028] FIG. 6b shows a schematic diagram of a structure of an electronic device according to some embodiments of the present application;

[0029] FIG. 7 shows a block diagram of a structure of an electronic device according to some embodiments of the present application;

[0030] FIG. 8 shows a flowchart of a resource control method according to some embodiments of the present application;

[0031] FIG. 9 shows a hardware structure diagram of an electronic device according to some embodiments of the present application. DETAILED DESCRIPTION

[0032] Illustrative embodiments of the present application include, but are not limited to, a resource control method and an electronic device.

[0033] It can be understood that the electronic device provided by the embodiments of the present application includes, but is not limited to, any electronic device with multiple screens such as a folding screen mobile phone and a tablet computer. The embodiments of the present application do not limit the type and form of the electronic device.

[0034] Taking the electronic device as a folding screen mobile phone as an example, the folding screen mobile phone includes a folding screen mobile phone that can be folded up and down and a folding screen mobile phone that can be folded left and right. For the convenience of description, the present application will take the electronic device as a folding screen mobile phone that can be folded left and right as an example for description. FIG. 1 shows a schematic diagram of a folding screen mobile phone according to some embodiments of the present application. As shown in FIG. 1, the folding screen mobile phone 100 includes an outer screen 101 and an inner screen 102. Generally, when the folding screen mobile phone 100 is in a folded state, it can be determined that the user is not currently using the inner screen 102. When the folding screen mobile phone 100 is in an unfolded state, it can be determined that the user is currently using the inner screen 102 and not using the outer screen 101.

[0035] At present, for the folding screen mobile phone, each screen is allocated with a corresponding independent SPI resource, but the user generally uses only one screen at a time.

[0036] Based on this, to solve the above problems, the present application provides a resource allocation circuit which can be applied to a multi-screen electronic device. The resource allocation circuit can include a resource control module. The resource control module is configured to connect the SPI pin of the screen currently not used by the user to a first device when the first device needs to be started. The first device can be an infrared device. For example, when the user opens an infrared application for remote control, the resource control module detects the instruction for driving the infrared device. If it is determined that the folding state of the folding screen mobile phone is in an unfolded state, that is, the user is currently using the inner screen and not using the outer screen, the resource control module connects the SPI pin of the outer screen to the infrared device. When it is determined that the folding state of the folding screen mobile phone is in a folded state, that is, the user is currently not using the inner screen, the resource control module is configured to connect the SPI pin of the inner screen to the infrared device. In this way, in the case of adding an infrared device, the SPI resource does not need to be added, and the driving of the infrared device is realized through the corresponding SPI resource of the inner screen or the outer screen, thereby saving the cost of the electronic device, and further saving the space of the electronic device, which is conducive to the application in small-size electronic devices.

[0037] In some embodiments, the first device can be a device that only uses the SPI Master Output Slave Input (MOSI) pin, for example, the first device can be an infrared device, or other devices. The following takes the first device as an infrared device as an example for description.

[0038] FIG. 2 shows a schematic diagram of an electronic device. As shown in FIG. 2, in some embodiments, the electronic device can include a first screen, a second screen, a first SPI, a second SPI, and an infrared device, wherein the first screen and the second screen are located at different sides of the electronic device; wherein the first screen can be an inner screen, and the second screen can be an outer screen.

[0039] Corresponding to the first screen being in a display state and the infrared device being in a working state, the first screen is connected to the first SPI, and the infrared device is connected to the second SPI. It can be understood that when the first screen is in the display state, it indicates that the first screen needs to use the SPI resource, at this time, the second SPI corresponding to the second screen which does not use the SPI resource can be connected to the infrared device to realize the driving of the infrared device.

[0040] Corresponding to the second screen being in a display state and the infrared device being in a working state, the second screen is connected to the second SPI, and the infrared device is connected to the first SPI. It can be understood that when the second screen is in the display state, it indicates that the second screen needs to use the SPI resource, at this time, the first SPI corresponding to the first screen which does not use the SPI resource can be connected to the infrared device to realize the driving of the infrared device.

[0041] In some embodiments, the electronic device further includes a resource control module, the resource control module is configured to, when the first screen is in a display state and it is determined that the infrared device needs to be started, control the first screen to be connected to the first SPI and the infrared device to be connected to the second SPI; and when the second screen is in a display state and it is determined that the infrared device needs to be started, control the second screen to be connected to the second SPI and the infrared device to be connected to the first SPI.

[0042] The following takes the first screen as an inner screen and the second screen as an outer screen as an example for description of the scheme of the present application.

[0043] In order to make the embodiments of the present application more clear, the following first describes the circuit structure of the SPI, the connection circuit of the infrared device and the SPI, the connection circuit of the inner screen and the SPI, and the connection circuit of the outer screen and the SPI.

[0044] SPI generally includes four pins: a chip select (CS) pin, a clock (CLK) pin, a master output slave input (MOSI) pin, and a master input slave output (MISO) pin.

[0045] The CS pin is used to control the slave device in communication with the master device based on multiple CS pins when the slave device has multiple times. It can be understood that the master device can be a processor, and the slave device can be the inner screen, the outer screen, the infrared device, and the like mentioned in the present application.

[0046] The CLK pin is used for the master device to provide a clock signal to the slave device, wherein the master device and the slave device respectively send data to the data line at the rising edge or the falling edge of the clock line, and read data from the data line at the falling edge or the rising edge.

[0047] The MOSI pin is used to realize the transmission of data from the master device to the slave device.

[0048] The MISO pin is used to realize the transmission of data from the slave device to the master device.

[0049] It should be noted that in the case of SPI controlling the infrared device, the processor sends an SPI signal to the infrared device through SPI. Therefore, in this case, the processor acts as the master device, and the infrared device acts as the slave device.

[0050] FIG. 3 shows a connection circuit schematic diagram of an inner screen and SPI. As shown in FIG. 3, the four pins (for example, a first CS pin, a first MOSI pin, a first MISO pin, and a first CLK pin) of a first SPI are connected to the inner screen. It can be understood that the first SPI can be one of the SPIs in the processor.

[0051] FIG. 4 shows a connection circuit schematic diagram of an outer screen and SPI. As shown in FIG. 4, the four pins (for example, a second CS pin, a second MOSI pin, a second MISO pin, and a second CLK pin) of a second SPI are connected to the outer screen. It can be understood that the second SPI can be one of the SPIs in the processor.

[0052] Figure 5 shows a schematic diagram of a connection circuit of an infrared device and an SPI. As shown in Figure 5, one end of the infrared device is connected to the MOSI pin of the third SPI through a metal-oxide-semiconductor field-effect transistor (MOSFET, MOS for short) to receive the data sent by the processor, and the other end of the infrared device is connected to the power supply.

[0053] It can be understood that the third SPI can be one of the SPIs in the processor, and the MOS is turned on when the signal received by the gate is high, at which time the infrared device receives the SPI signal sent by the processor; the MOS is turned off when the signal received by the gate is low, at which time the infrared device does not receive the SPI signal sent by the processor. Based on this, the processor can send the SPI signal to the infrared device through the MOSI pin to make the infrared device send the corresponding infrared signal of the infrared application.

[0054] It can be understood that the SPI mentioned in the embodiments of the present application can be a specific SPI set in the processor, or an SPI implemented through other pins in the processor.

[0055] Figure 6a shows a schematic diagram of the structure of an electronic device. As shown in Figure 6a, the electronic device can include an inner screen, an outer screen, a first SPI, a second SPI, an infrared device, a fifth switching device, a power supply, and a resource control module.

[0056] The first SPI includes a first CS pin, a first MOSI pin, a first MISO pin, and a first CLK pin; the first CS pin, the first MOSI pin, the first MISO pin, and the first CLK pin are connected to the inner screen, and the first MOSI pin is further connected to the infrared device;

[0057] The second SPI includes a second CS pin, a second MOSI pin, a second MISO pin, and a second CLK pin; the second CS pin, the second MOSI pin, the second MISO pin, and the second CLK pin are connected to the outer screen, and the second MOSI pin is further connected to the infrared device.

[0058] The resource control module includes a first control device, a second control device, a first switching device, a second switching device, a third switching device, and a fourth switching device.

[0059] The input end of the first switching device is connected to the inner screen, the output end of the first switching device is connected to the input end of the second switching device and the first MOSI pin respectively, and the control end of the first switching device is connected to the first control device.

[0060] The input end of the second switch device is also connected with the first MOSI pin, the output end of the second switch device is connected with the fifth switch device, the fifth switch device is connected with the infrared device, and the control end of the second switch device is connected with the second control device;

[0061] The input end of the third switch device is connected with the inner screen, the output end of the third switch device is connected with the input end of the fourth switch device and the second MOSI pin respectively, and the control end of the third switch device is connected with the second control device;

[0062] The input end of the fourth switch device is also connected with the second MOSI pin, the output end of the fourth switch device is connected with the fifth switch device, the fifth switch device is connected with the infrared device, and the control end of the fourth switch device is connected with the first control device.

[0063] In some embodiments, when the signal inputted into the control end of the first switch device is effective (for example, high level), the input end and the output end of the first switch device are turned on; when the signal inputted into the control end of the first switch device is ineffective (for example, low level), the input end and the output end of the first switch device are turned off. The first switch device can be a first MOS, which can be an N-type MOS (referred to as NMOS) or a P-type MOS (referred to as PMOS); when the first MOS is an NMOS, the input end of the first MOS can be a drain, the output end can be a source, and the control end can be a gate; when the first MOS is a PMOS, the input end of the first MOS can be a source, the output end can be a drain, and the control end can be a gate; the first switch device can also be any device (for example, a triode) that can realize the function of the first switch device, wherein: for an NPN triode, the input end, the output end and the control end can be a collector, an emitter and a base respectively; for a PNP triode, the input end, the output end and the control end can be an emitter, a collector and a base respectively, which are not limited in the application.

[0064] In some embodiments, when the signal inputted to the control end of the second switch device is effective (for example, inputted high level), the input end and the output end of the second switch device are turned on; when the signal inputted to the control end of the second switch device is ineffective, the input end and the output end of the second switch device are turned off. The second switch device can be a second MOS, which can be an NMOS or a PMOS; when the second MOS is an NMOS, the input end of the second MOS can be a drain, the output end can be a source, and the control end can be a gate; when the second MOS is a PMOS, the input end of the second MOS can be a source, the output end can be a drain, and the control end can be a gate. The second switch device can also be any other device (for example, a transistor, etc.) that can realize the function of the second switch device described above (for example, for an NPN transistor, the input end, the output end, and the control end can be the collector, the emitter, and the base, respectively; for a PNP transistor, the input end, the output end, and the control end can be the emitter, the collector, and the base, respectively), which is not limited in the present application.

[0065] In some embodiments, when the signal inputted to the control end of the third switch device is effective (for example, inputted high level), the input end and the output end of the third switch device are turned on; when the signal inputted to the control end of the third switch device is ineffective, the input end and the output end of the third switch device are turned off. The third switch device can be a third MOS, which can be an NMOS or a PMOS; when the third MOS is an NMOS, the input end of the third MOS can be a drain, the output end can be a source, and the control end can be a gate; when the third MOS is a PMOS, the input end of the third MOS can be a source, the output end can be a drain, and the control end can be a gate. The third switch device can also be any other device (for example, a transistor, etc.) that can realize the function of the third switch device described above (for example, for an NPN transistor, the input end, the output end, and the control end can be the collector, the emitter, and the base, respectively; for a PNP transistor, the input end, the output end, and the control end can be the emitter, the collector, and the base, respectively), which is not limited in the present application.

[0066] In some embodiments, when the signal inputted to the control end of the fourth switch device is effective (for example, inputted high level), the input end and the output end of the fourth switch device are turned on; when the signal inputted to the control end of the fourth switch device is ineffective, the input end and the output end of the fourth switch device are turned off. The fourth switch device can be a fourth MOS, which can be an NMOS or a PMOS; when the fourth MOS is an NMOS, the input end of the fourth MOS can be a drain, the output end can be a source, and the control end can be a gate; when the fourth MOS is a PMOS, the input end of the fourth MOS can be a source, the output end can be a drain, and the control end can be a gate. The fourth switch device can also be any device (for example, a transistor) capable of realizing the functions of the fourth switch device described above, and the present application does not make any limitation in this regard.

[0067] In some embodiments, the first control device can be a first power management integrated circuit (PMIC) or any device capable of realizing the functions of the first control device, and the second control device can be a second PMIC or any device capable of realizing the functions of the second control device.

[0068] The first switch device in FIG. 6b is taken as a first MOS, the second switch device is taken as a second MOS, the third switch device is taken as a third MOS, the fourth switch device is taken as a fourth MOS, the first control device is taken as a first PMIC, the second control device is taken as a second PMIC, and the fifth switch device is taken as a fifth MOS, and the structure of the electronic device is described below.

[0069] As shown in FIG. 6b, the resource control module includes a first PMIC, a second PMIC, a first MOS, a second MOS, a third MOS, and a fourth MOS;

[0070] The input end of the first MOS is connected with the inner screen, the output end of the first MOS is connected with the input end of the second MOS and the first MOSI pin respectively, and the control end of the first MOS is connected with the first PMIC;

[0071] The input end of the second MOS is also connected with the first MOSI pin, the output end of the second MOS is connected with the fifth MOS, the fifth MOS is connected with the infrared device, and the control end of the second MOS is connected with the second PMIC;

[0072] The input end of the third MOS is connected with the inner screen, the output end of the third MOS is connected with the input end of the fourth MOS and the second MOSI pin respectively, and the control end of the third MOS is connected with the second PMIC;

[0073] The input end of the fourth MOS is also connected with the second MOSI pin, the output end of the fourth MOS is connected with the fifth MOS, the fifth MOS is connected with the infrared device, and the control end of the fourth MOS is connected with the first PMIC;

[0074] When the request of driving the infrared device by the infrared application is detected and it is determined that the current electronic device is in the unfolded state, the resource control module is configured to control the inner screen and the first SPI to be turned on, and the infrared device and the second SPI to be turned on, and the specific operations are as follows:

[0075] When the request of driving the infrared device by the infrared application is detected and it is determined that the current electronic device is in the unfolded state, or it is determined that the inner screen of the current electronic device is in the display state, the electronic device can control the first MOSI pin and the inner screen to be turned on, and the infrared device and the second MOSI pin to be turned on through the resource control module. In some embodiments, the electronic device can control the first PMIC to output a high level to the gate of the first MOS and the fourth MOS to make the source and the drain of the first MOS and the source and the drain of the fourth MOS be turned on, and control the second PMIC to output a low level to the second MOS and the third MOS to make the source and the drain of the first MOS and the source and the drain of the fourth MOS be turned off, so as to realize that the first MOSI pin and the inner screen are turned on, and the infrared device and the second MOSI pin are turned on. And the electronic device can control the first CS pin, the first MISO pin and the first CLK pin to be turned on with the inner screen, so as to realize that the infrared device can work while the inner screen displays.

[0076] It can be understood that when the system on chip (SOC) needs to communicate with the inner screen, that is, when the inner screen needs to be controlled to display, the first PMIC can be pulled high, that is, the first PMIC is controlled to output a high level to the gate of the first MOS and the fourth MOS, so that the source and the drain of the first MOS are turned on and the source and the drain of the fourth MOS are turned on, and the second PMIC is pulled low, that is, the second PMIC is controlled to output a low level to the second MOS and the third MOS, so that the source and the drain of the second MOS are turned off and the source and the drain of the third MOS are turned off. At this time, the first SPI, the first MOS and the inner screen are in a conductive state, the second SPI, the fourth MOS and the infrared device are in a conductive state, the first SPI, the second MOS and the infrared device are in a non-conductive state, and the second SPI, the third MOS and the outer screen are in a non-conductive state. At this time, the MOSI signal of the first SPI only flows to the inner screen and does not flow to the infrared device. The MOSI signal of the second SPI only flows to the infrared device and does not flow to the outer screen, and the MOSI signal of the first SPI and the MOSI signal of the second SPI do not affect each other when they are output at the same time. When the inner screen displays and the infrared device needs to be started, the MOSI signal of the first SPI can be directly controlled to be output to the inner screen, and the MOSI signal of the second SPI is output to the infrared device.

[0077] When the request of driving the infrared device by the infrared application is detected, and it is determined that the current electronic device is in a folded state, the resource control module is used to control the outer screen and the second SPI to be conductive, and the infrared device and the first SPI to be conductive, and the specific process is as follows:

[0078] When the request of driving the infrared device by the infrared application is detected, and it is determined that the current electronic device is in a folded state, or it is determined that the outer screen of the current electronic device is in a display state, the electronic device can control the second MOSI pin and the outer screen to be conductive, and the infrared device and the first MOSI pin to be conductive through the resource control module. In some embodiments, the electronic device can control the first MOSI pin and the inner screen to be conductive, and the infrared device and the second MOSI pin to be conductive by controlling the second PMIC to be in a high level state (that is, controlling the second PMIC to output a high level to the second MOS and the third MOS, so that the source and the drain of the second MOS are turned on and the source and the drain of the third MOS are turned on), and controlling the first PMIC to be in a low level state (controlling the first PMIC to output a low level to the gate of the first MOS and the fourth MOS, so that the source and the drain of the first MOS are turned off and the source and the drain of the fourth MOS are turned off). The electronic device can also control the second CS pin, the second MISO pin and the second CLK pin to be conductive with the outer screen. Thus, the infrared device can be driven to work while the outer screen displays.

[0079] When the SOC needs to communicate with the outer screen, that is, when the outer screen needs to be controlled to display, the second PMIC is pulled high to be in a high level state, that is, the second PMIC is controlled to output a high level to the second MOS and the third MOS, so that the source and the drain of the second MOS are turned on, and the source and the drain of the third MOS are turned on; the first PMIC is pulled low to be in a low level state, that is, the first PMIC is controlled to output a low level to the gate of the first MOS and the fourth MOS, so that the source and the drain of the first MOS are disconnected, and the source and the drain of the fourth MOS are disconnected. At this time, the first SPI, the first MOS and the inner screen are in a non-conductive state, the second SPI, the fourth MOS and the infrared device are in a non-conductive state, the first SPI, the second MOS and the infrared device are in a conductive state, and the second SPI, the third MOS and the outer screen are in a conductive state. At this time, the MOSI signal of the second SPI only flows to the outer screen and does not flow to the infrared device, the MOSI signal of the first SPI only flows to the infrared device and does not flow to the outer screen, and the MOSI signal of the first SPI and the MOSI signal of the second SPI do not affect each other when they are output at the same time. When the outer screen displays and the infrared device needs to be started, the MOSI signal of the second SPI can be directly controlled to be output to the inner screen, and the MOSI signal of the first SPI is output to the infrared device.

[0080] In some embodiments, the present application provides a resource control method for the electronic device mentioned in the present application, the method comprising:

[0081] corresponding to the inner screen being in a display state and determining that the infrared device needs to be started, controlling the inner screen to be conductive with the first SPI and the infrared device to be conductive with the second SPI;

[0082] corresponding to the outer screen being in a display state and determining that the infrared device needs to be started, controlling the outer screen to be conductive with the second SPI and the infrared device to be conductive with the first SPI.

[0083] In some embodiments, the resource control module, when the inner screen is in a display state and it is determined that the infrared device needs to be started, controls the inner screen to be conductive with the first SPI and the infrared device to be conductive with the second SPI;

[0084] The resource control module, when the outer screen is in a display state and it is determined that the infrared device needs to be started, controls the outer screen to be conductive with the second SPI and the infrared device to be conductive with the first SPI. Details of controlling the inner screen to be conductive with the first SPI and the infrared device to be conductive with the second SPI are as described above, and will not be repeated here.

[0085] In some embodiments, when it is determined that the electronic device is in a first state, it can be determined that the inner screen is in a display state, and the first state is an unfolded state; when it is determined that the electronic device is in a second state, it can be determined that the outer screen is in a display state, and the second state is a folded state.

[0086] The resource control method in the embodiments of the present application is described below in combination with the structure of an electronic device.

[0087] FIG. 7 is a structural block diagram of an electronic device according to an embodiment of the present application. The electronic device includes an application layer, a hardware abstract layer, a kernel layer and a hardware layer.

[0088] As shown in FIG. 7, the application layer can include an infrared application, which is configured to drive the infrared device in response to a request of a user to drive the infrared device. The infrared application is configured to detect a request to emit an infrared signal and send the request to emit the infrared signal to a ConsumerIr Android Interface Definition Language (Aidl) service.

[0089] The application layer can also include camera, gallery, calendar, call, map, navigation, Bluetooth, music, video, short message and other applications, which are not shown in FIG. 7.

[0090] The hardware abstract layer (HAL) includes a touch panel (TP) Aidl service, a Daemon service and a ConsumerIr Aidl service.

[0091] The TP Aidl service is configured to detect the state of the electronic device, such as a folded state and an unfolded state.

[0092] The ConsumerIr Aidl service is configured to send SPI data corresponding to the infrared signal to a ConsumerIr driver.

[0093] The kernel layer includes a TP driver, a ConsumerIr driver and an SPI master controller.

[0094] The ConsumerIr driver is configured to configure the transmission rate of the SPI data to be the SPI data transmission rate corresponding to the infrared device and send an SPI data transmission request corresponding to the infrared signal to the TP driver.

[0095] The TP driver is configured to, after receiving the SPI data transmission request, control the second PMIC to be in a high level state and the first PMIC to be in a low level state if the current electronic device (for example, a mobile phone) is in a folded state, and control the first PMIC to be in a high level state and the second PMIC to be in a low level state if the current mobile phone is in an unfolded state.

[0096] The SPI master controller is used to control the various SPIs in electronic devices.

[0097] The hardware layer includes MOS devices (such as the first MOS, second MOS, third MOS and fourth MOS mentioned above), PMIC devices (such as the first PMIC and second PMIC mentioned above), internal and external hardware of the TP, and infrared devices.

[0098] Figure 8 shows a flowchart of a resource control method according to an embodiment of this application. The method can be used in the electronic devices mentioned in this application, and the method includes:

[0099] 801: The infrared application has detected a request to transmit an infrared signal.

[0100] In some embodiments, infrared applications may include applications that enable functions such as air conditioner remote control and television remote control. When a user initiates a remote control request for an air conditioner, television, etc., through an infrared application, the infrared application detects the request to transmit an infrared signal.

[0101] 802: The infrared application sends a request to transmit an infrared signal to the Consumer Infrared (ConsumerIr) Aidel service.

[0102] 803: The Consumer Infrared (ConsumerIr) Aidel service sends the SPI data corresponding to the infrared signal to the Consumer Infrared (ConsumerIr) driver.

[0103] In some embodiments, the SPI data corresponding to the infrared signal can be the SPI data packet corresponding to the infrared signal.

[0104] 804: The ConsumerIr driver configures the SPI data transmission rate to the SPI data transmission rate corresponding to the infrared device.

[0105] It is understandable that, since there is a difference between the SPI data transmission rate corresponding to the TP and the data transmission rate corresponding to the infrared device, it is necessary to change the SPI data transmission rate corresponding to the TP to the SPI data transmission rate corresponding to the infrared device.

[0106] In some embodiments, the SPI data transmission rate corresponding to the infrared device can be preset based on actual needs, and is not limited here.

[0107] 805: The ConsumerIr driver sends an SPI data transmission request to the TP driver.

[0108] In some embodiments, the ConsumerIr driver can send SPI data to the interface in the TP driver that provides SPI data transmission.

[0109] 806: The TP driver receives the SPI data transmission request, and if the current mobile phone is in the folded state, controls the second PMIC to be in the high level state and the first PMIC to be in the low level state; if the current mobile phone is in the unfolded state, controls the first PMIC to be in the high level state and the second PMIC to be in the low level state.

[0110] In some embodiments, the TP driver can make hardware resource settings in advance based on the state of the electronic device, for example, if it is determined that the mobile phone state is the folded state, that is, the user needs to use the outer screen, the CS pin and CLK pin hardware resource settings used by the outer screen can be changed to SPI, and the CS pin and CLK pin hardware resource settings used by the inner screen can be changed to GPIO, so as to facilitate the allocation of the SPI resources corresponding to the inner screen to the infrared device when receiving the transmission request of the infrared signal. If it is determined that the mobile phone state is the unfolded state, that is, the user needs to use the inner screen, the CS pin and CLK pin hardware resource settings used by the inner screen can be changed to SPI, and the CS pin and CLK pin hardware resource settings used by the outer screen can be changed to GPIO, so as to facilitate the allocation of the SPI resources corresponding to the outer screen to the infrared device when receiving the transmission request of the infrared signal.

[0111] In some embodiments, the TP driver can make hardware resource settings in advance based on the state of the electronic device, for example, if it is determined that the mobile phone state is the folded state, that is, the user needs to use the outer screen, the CS pin and CLK pin hardware resource settings used by the outer screen can be changed to SPI, and the CS pin and CLK pin hardware resource settings used by the inner screen can be changed to GPIO, so as to facilitate the allocation of the SPI resources corresponding to the inner screen to the infrared device when receiving the transmission request of the infrared signal. If it is determined that the mobile phone state is the unfolded state, that is, the user needs to use the inner screen, the CS pin and CLK pin hardware resource settings used by the inner screen can be changed to SPI, and the CS pin and CLK pin hardware resource settings used by the outer screen can be changed to GPIO, so as to facilitate the allocation of the SPI resources corresponding to the outer screen to the infrared device when receiving the transmission request of the infrared signal.

[0112] In some embodiments, if the current mobile phone is in a folded state, it indicates that the user uses the outer screen, at this time the second PMIC can be pulled high to be in a high level state, that is, the second PMIC is controlled to output a high level to the second MOS and the third MOS, so that the source and drain of the second MOS are turned on and the source and drain of the third MOS are turned on; the first PMIC is pulled low to be in a low level state, that is, the first PMIC is controlled to output a low level to the gate of the first MOS and the fourth MOS, so that the source and drain of the first MOS are disconnected and the source and drain of the fourth MOS are disconnected. So that the first SPI, the first MOS and the inner screen are in a non-conductive state, the second SPI, the fourth MOS and the infrared device are in a non-conductive state, the first SPI, the second MOS and the infrared device are in a conductive state, and the second SPI, the third MOS and the outer screen are in a conductive state. At this time, the MOSI signal of the second SPI will only flow to the outer screen and will not flow to the infrared device. The MOSI signal of the first SPI will only flow to the infrared device and will not flow to the inner screen, and the MOSI signals of the first SPI and the second SPI will not affect each other when they are output at the same time; when the infrared device needs to be started, the MOSI signal of the second SPI can be directly output to the outer screen, and the MOSI signal of the first SPI is output to the infrared device, and the first CS pin, the first CLK pin and the first MISO pin connected to the inner screen will have no electrical signal;

[0113] In some embodiments, if the current mobile phone is in an unfolded state, it indicates that the user uses the inner screen, at this time the first PMIC can be pulled high, that is, the first PMIC is controlled to output a high level to the gate of the first MOS and the fourth MOS, so that the source and drain of the first MOS are turned on and the source and drain of the fourth MOS are turned on, and the second PMIC is pulled low, that is, the second PMIC is controlled to output a low level to the second MOS and the third MOS, so that the source and drain of the second MOS are disconnected and the source and drain of the third MOS are disconnected. At this time, the first SPI, the first MOS and the inner screen are in a conductive state, the second SPI, the fourth MOS and the infrared device are in a conductive state, the first SPI, the second MOS and the infrared device are in a non-conductive state, and the second SPI, the third MOS and the outer screen are in a non-conductive state. At this time, the MOSI signal of the first SPI will only flow to the inner screen and will not flow to the infrared device. The MOSI signal of the second SPI will only flow to the infrared device and will not flow to the outer screen, and the MOSI signals of the first SPI and the second SPI will not affect each other when they are output at the same time; when the inner screen displays and the infrared device needs to be started, the MOSI signal of the first SPI can be directly output to the inner screen, and the MOSI signal of the second SPI is output to the infrared device. And the second CS pin, the second CLK pin and the second MISO pin connected to the outer screen will have no electrical signal.

[0114] That is, in the embodiment of the present application, the TP drive can realize that the inner screen is in a display state, and it is determined that the infrared device needs to be started, the inner screen is controlled to be connected with the first SPI, and the infrared device is controlled to be connected with the second SPI.

[0115] corresponding to the outer screen being in a display state, and it is determined that the infrared device needs to be started, the outer screen is controlled to be connected with the second SPI, and the infrared device is controlled to be connected with the first SPI.

[0116] To realize the resource control method in the present application, the device tree file (device tree source, DST, which can be referred to as a dtsi file) corresponding to the infrared device and the dtsi file of the TP need to be configured, which will be introduced respectively.

[0117] Configuration of the dtsi file of the infrared device: To ensure that the kernel drive corresponding to the infrared device is normally started, when the dtsi file of the infrared device is configured, the infrared device can be configured as a slave device of the SPI master controller corresponding to the TP, and the chip selection value of the CS pin is selected as 1.

[0118] Configuration of the dtsi file of the TP: In the dtsi of the TP, the attribute value of the SPI master controller is rewritten and covered, and the chip pin management configuration program (pinctrl) configuration when the SPI master controller (bus) is active and sleeps is reset. It can be understood that the system is set by default to set the management configuration program of the chip pin to SPI when the chip pin is active, and to GPIO when the chip pin is sleep, that is, the functions (func) of the CLK pin, the MOSI pin, the MISO pin and the CS pin are configured to SPI when the chip pin is active, and the functions (func) of the CLK pin, the MOSI pin, the MISO pin and the CS pin are configured to GPIO when the chip pin is sleep.

[0119] In the embodiment of the present application, when the infrared device uses the SPI resource of the outer screen or the inner screen, since the infrared device only uses the MOSI pin, to ensure that there is no data back transmission between the other pins of the SPI of the outer screen or the inner screen and the outer screen or the inner screen, it is necessary to ensure that there is no electrical signal on the CLK pin, the MISO pin and the CS pin involved in the corresponding outer screen or inner screen, so it is necessary to reset the chip pin management configuration program (pinctrl) when the SPI bus is active and sleep to only control the state of the MISO pin and the MOSI pin, and the state control of the CS pin and the CLK pin is given to the slave device drive. In this way, it is avoided that when starting, the drive of the SPI controller is loaded earlier than the drive of the slave device, and the control right of the CS pin and the CLK pin is obtained first, the drive of the slave device cannot apply for the control right of the CS pin and the CLK pin, resulting in that the drive of the slave device fails to control the CS pin and the CLK pin.

[0120] The electronic device and the resource control method provided in the embodiments of the present application can realize that, in the case of adding an infrared device, no SPI resource needs to be added, the driving of the infrared device is realized through the SPI resource corresponding to the inner screen or the outer screen, the cost of the electronic device is saved, in addition, the space of the electronic device is saved, and this is conducive to application in small-size electronic devices.

[0121] The embodiments of the present application provide an electronic device, which includes a memory for storing instructions executed by one or more processors of the electronic device, and a processor which is one of the processors of the electronic device and is used for executing the resource control method mentioned in the present application.

[0122] FIG. 9 shows a schematic diagram of the hardware structure of an electronic device in the embodiments of the present application. As shown in FIG. 9, the electronic device 10 can include a processor 110, a power module 140, a memory 180, a mobile communication module 130, a wireless communication module 120, a sensor module 190, an audio module 150, a camera 170, an interface module 160, a key 1011, and a display screen 1021.

[0123] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 can include more or fewer components than those shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0124] The processor 110 can include one or more processing units, for example, can include a central processor, an image processor, a digital signal processor, a microprocessor, an artificial intelligence processor, or a programmable logic device, and the like processing module or processing circuit. Different processing units can be independent devices or can be integrated in one or more processors. The processor 110 can be provided with a storage unit for storing instructions and data. In some embodiments, the storage unit in the processor 110 is a cache memory 180. The processor can be used to execute the resource control method provided in the embodiments of the present application.

[0125] In some embodiments, the processor 110 can have multiple groups of SPIs, for example, can include the first SPI and the second SPI mentioned above.

[0126] The display screen 1021 is used to display human-computer interaction interfaces, images, videos, and the like. The display screen 1021 includes the inner screen and the outer screen mentioned in the present application.

[0127] The sensor module 190 can include a proximity light sensor, a pressure sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0128] The audio module 150 is used to convert digital audio information into an analog audio signal output, or to convert an analog audio input into a digital audio signal. The audio module 150 can also be used to encode and decode an audio signal. In some embodiments, the audio module 150 can be disposed in the processor 110, or some functional modules of the audio module 150 can be disposed in the processor 110. In some embodiments, the audio module 150 can include a speaker, a receiver, a microphone, and a headset jack.

[0129] In some embodiments, the electronic device 10 further includes a key 1011, a motor, and an indicator, etc. The key 1011 can include a volume key, an on / off key, etc. The motor is used to generate a vibration effect of the electronic device 10, for example, to generate a vibration when the electronic device 10 is called, so as to prompt the user to answer the call. The indicator can include a laser indicator, a radio frequency indicator, an LED indicator, etc.

[0130] Embodiments of the mechanisms disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. Embodiments of the application can be implemented as computer programs or program code executing on programmable systems comprising at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0131] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices, in known fashion. For purposes of this application, a processing system includes any system that has a processor, such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0132] The program code can be implemented in a high level procedural or object oriented programming language to be executed by a processing system. As required, the program code can be translated to machine language during execution. In fact, there is no limitation on the scope for this mechanism described herein, which is capable of being implemented with various programming languages. In any case, the language can be a compiled or interpreted language.

[0133] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can also be implemented as instructions carried by or stored on a transitory or non-transitory machine-readable (e.g., computer-readable) medium, which can be read and executed by one or more processors. For example, the instructions can be downloaded from a network or by way of another computer readable medium. Thus, a machine-readable medium can include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including without limitation floppy disks, optical disks, optical disks, compact discs, read-only memory (CD-ROMs), magnetic disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic or optical cards, flash memory, or a tangible, machine-readable storage used in the transmission of information over the Internet with a propagated signal in electronic, electromagnetic, or optical form, such as carrier waves, infrared signals digital signals, etc. Accordingly, a machine-readable medium includes any type of medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).

[0134] In the drawings, some of the structural or methodological features can be shown in particular arrangements and / or orders. However, it should be understood that such particular arrangements and / or orders can not be required. Instead, these features can be arranged in a different manner and / or order than shown in the illustrative figures, in some embodiments. Additionally, the inclusion of a structural or methodological feature in a particular figure is not meant to imply that such feature is required in all embodiments, and in some embodiments, these features can not be included or can be combined with other features.

[0135] It should be noted that each unit / module mentioned in the device embodiments of the present application is a logical unit / module, in physical, one logical unit / module can be one physical unit / module, also can be a part of one physical unit / module, also can be realized by combination of multiple physical unit / modules, the physical realization of these logical units / modules is not the most important, the combination of the functions realized by these logical units / modules is the key to solve the technical problems proposed in the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce the units / modules which are not closely related to solving the technical problems proposed in the present application, which does not mean that the above-mentioned device embodiments do not have other units / modules.

[0136] It has to be noted that, in the description of the application and in the claims the terms "including" and "having" and the like are used in the sense of "including at least the recited entity or entities, but not excluding others". Furthermore, the terms "first", "second" and the like are used merely as labels, i.e. they are used to distinguish between two entities that have the same or similar characteristics, but do not necessarily indicate a particular order or sequence. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a", "comprising", or "comprises" does not, without more constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0137] While the application has been illustrated and described in detail in the drawings and foregoing description, such illustration and description are to be considered illustrative or exemplary and not restrictive; the application is not limited to the disclosed embodiments.

Claims

1. An electronic device, comprising: The application relates to an electronic device, and relates to a first screen, a second screen, a first SPI, a second SPI and a first device. Corresponding to the first screen being in a display state and the first device being in a working state, the first screen is connected with the first SPI, and the first device is connected with the second SPI. Corresponding to the second screen being in a display state and the first device being in a working state, the second screen is connected with the second SPI, and the first device is connected with the first SPI. The first device is an infrared device.

2. The electronic device of claim 1, wherein, The application further relates to a resource control module.

3. The electronic device of claim 1 or 2, wherein, When the first screen is in a display state and it is determined that the first device needs to be started, the resource control module controls the first screen to be connected with the first SPI and controls the first device to be connected with the second SPI. When the second screen is in a display state and it is determined that the first device needs to be started, the resource control module controls the second screen to be connected with the second SPI and controls the first device to be connected with the first SPI. The first SPI comprises a first CS pin, a first MOSI pin, a first MISO pin and a first CLK pin; the first CS pin, the first MOSI pin, the first MISO pin and the first CLK pin are connected with the first screen, and the first MOSI pin is connected with the first device.

4. The electronic device of claim 3, wherein, The second SPI comprises a second CS pin, a second MOSI pin, a second MISO pin and a second CLK pin; the second CS pin, the second MOSI pin, the second MISO pin and the second CLK pin are connected with the second screen, and the second MOSI pin is connected with the first device. The control of the first screen being connected with the first SPI and the control of the first device being connected with the second SPI comprise that the resource control module controls the first MOSI pin to be connected with the first screen and controls the first device to be connected with the second MOSI pin.

5. The electronic device of claim 4, wherein, The control of the second screen being connected with the second SPI and the control of the first device being connected with the first SPI comprise that the resource control module controls the second MOSI pin to be connected with the second screen and controls the first device to be connected with the first MOSI pin. The resource control module comprises a first control device, a second control device, a first switch device, a second switch device, a third switch device and a fourth switch device.

6. The electronic device of claim 5, wherein, The input end of the first switch device is connected with the first screen, the output end of the first switch device is connected with the input end of the second switch device and the first MOSI pin respectively, and the control end of the first switch device is connected with the first control device. The input end of the second switch device is also connected with the first MOSI pin, the output end of the second switch device is connected with the first device, and the control end of the second switch device is connected with the second control device. The input end of the third switch device is connected with the second MOSI pin, the output end of the third switch device is connected with the second screen, and the control end of the third switch device is connected with the first control device. The input end of the fourth switch device is connected with the first MOSI pin, the output end of the fourth switch device is connected with the first device, and the control end of the fourth switch device is connected with the second control device. An input end of the third switch device is connected with the first screen, an output end of the third switch device is connected with an input end of the fourth switch device and the second MOSI pin respectively, and a control end of the third switch device is connected with the second control device; An input end of the fourth switch device is also connected with the second MOSI pin, an output end of the fourth switch device is connected with the first device, and a control end of the fourth switch device is connected with the first control device.

7. The electronic device of claim 6, wherein, The first switch device, the second switch device, the third switch device and the fourth switch device are MOS, and the first control device and the second control device are PMIC.

8. The electronic device of claim 6 or 7, wherein, The resource control module controls the first screen and the first SPI to be turned on and controls the first device and the second SPI to be turned on in the following manner: When the first screen is in a display state and it is determined that the first device needs to be started, the resource control module outputs a high level to control ends of the first switch device and the fourth switch device through the first control device, and outputs a low level to control ends of the second switch device and the third switch device through the second control device. The resource control module is configured to, when the second screen is in a display state and it is determined that the first device needs to be driven, output a high level to control ends of the second switch device and the third switch device through the second control device, and output a low level to control ends of the first switch device and the fourth switch device through the first control device.

9. A resource control method, characterized by, An electronic device, comprising: a first screen, a second screen, a first SPI, a second SPI and a first device, wherein the first screen and the second screen are located at different sides of the electronic device; The method comprises: corresponding to the first screen being in a display state and it being determined that the first device needs to be started, the first screen and the first SPI are controlled to be turned on, and the first device and the second SPI are controlled to be turned on; corresponding to the second screen being in a display state and it being determined that the first device needs to be started, the second screen and the second SPI are controlled to be turned on, and the first device and the first SPI are controlled to be turned on.

10. An electronic device comprising: The memory is configured to store instructions for execution by one or more processors of the electronic device, and the processor is one of the processors of the electronic device and is configured to execute the resource control method in claim 9.