CN116709609B - Message delivery method, electronic device and storage medium - Google Patents

Message delivery method, electronic device and storage medium Download PDF

Info

Publication number
CN116709609B
CN116709609B CN202211210336.1A CN202211210336A CN116709609B CN 116709609 B CN116709609 B CN 116709609B CN 202211210336 A CN202211210336 A CN 202211210336A CN 116709609 B CN116709609 B CN 116709609B
Authority
CN
China
Prior art keywords
sensor
state parameters
electronic device
working state
controllable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211210336.1A
Other languages
Chinese (zh)
Other versions
CN116709609A (en
Inventor
罗润发
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211210336.1A priority Critical patent/CN116709609B/en
Publication of CN116709609A publication Critical patent/CN116709609A/en
Application granted granted Critical
Publication of CN116709609B publication Critical patent/CN116709609B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a message transmission method, electronic equipment and a storage medium, wherein the method comprises the following steps: storing working state parameters of a first process controllable device of the electronic equipment to a device driver, wherein the device driver is a common module of the first process and a second process of the electronic equipment; and if the current process of calling the Hal library of the sensor is determined to be the second process, reporting the working state parameters of the controllable device of the first process stored by the device driver to the second process. When the first process and the second process are in cross-process communication, the data stream and the control stream can be combined and then transmitted together, so that U-shaped message transmission is realized, cross-process message transmission is realized, and further, one process can acquire the states of the other different processes, so that the corresponding control of the process is performed according to the states of the different processes, and the convenience of process control of the electronic equipment is improved.

Description

Message delivery method, electronic device and storage medium
Technical Field
The present application relates to the field of information interaction technologies, and in particular, to a message transmission method, an electronic device, and a storage medium.
Background
LCD dimming requires obtaining the value of the post Color sensor and simultaneously the current flash state of the mobile phone to confirm the data confidence of the Color temperature device. However, in the Android device, the flash lamp is controlled by the Cam process, the flash lamp state is only rotated in the Cam process, the LCD process and the Cam process are isolated naturally, and the inter-process communication scheme provided by Linux can introduce great hidden trouble, so that the inter-process transmission of the flash lamp state cannot be realized through the existing mechanism.
Disclosure of Invention
The message transmission method provided by the embodiment of the application can realize cross-process communication by storing the flash lamp state parameters in the public module when the processes of the LCD and the Cam need to transmit the flash lamp state in a cross-process manner and reporting the flash lamp state parameters in the public module to the Cam process when the Cam process calls the Hal library of the sensor, thereby improving the convenience of process control of the electronic equipment.
In a first aspect, an embodiment of the present application provides a message passing method, applied to an electronic device, where the method includes: storing working state parameters of a first process controllable device of the electronic equipment to a device driver, wherein the device driver is a common module of the first process and a second process of the electronic equipment; and if the current process of calling the Hal library of the sensor is determined to be the second process, reporting the working state parameters of the controllable device of the first process stored by the device driver to the second process. Through the message transmission method, when different processes (a first process and a second process) need to transmit messages in a crossing way, the data stream and the control stream can be combined and then transmitted together, specifically, the state of the first process can be written into a device driver, the state of the first process can be transmitted to the second process along with the data stream of the second process, and further, U-shaped message transmission is realized, so that the transmission of the messages in the crossing way is realized, and further, one process can acquire the state of the other different process, so that corresponding control of the process is performed according to the states of the different processes, and the convenience of process control of electronic equipment is improved.
Further, saving the operating state parameters of the first process controllable device of the electronic device to the device driver includes: when the first process is determined to call the Hal library of the sensor, the working state of the controllable device of the first process is determined, and the determined current working state parameters of the controllable device of the first process are saved to a device driver.
Further, determining the operating state of the first process steerable device includes: determining that the first process controllable device is in a closed state or in operation; the work comprises a low gear work or a high gear work.
Further, after determining the working state of the first process controllable device, saving the determined current working state parameters of the first process controllable device to the device driver, further includes: if the first process controllable device is in a closed state, setting a mark position of a device driver corresponding to the first process controllable device as a first attribute value; if the first process controllable device is in operation, setting a mark position of a device driver corresponding to the first process controllable device as a second attribute value; wherein saving the determined current operating state parameters of the first process steerable device to the device driver comprises: and storing the determined current working state parameters of the first process controllable device to the device driver based on the marker positions of the device driver corresponding to the first process controllable device.
Further, before determining that the first process invokes the sensor Hal library, the method further comprises: determining whether a current process calling the sensor Hal library is a first process or a second process based on the enabling type of the sensor Hal library; wherein the enabling type comprises a first process enabling or a second process enabling, the first process enabling represents that the first process calls the sensor Hal library currently, and the second process enabling represents that the second process calls the sensor Hal library currently.
Further, if it is determined that the current process of calling the Hal library of the sensor is the second process, before reporting the working state parameter of the controllable device of the first process stored by the device driver to the second process, the method further includes: determining that the current process of calling the Hal library of the sensor is a first process or a second process, and if the current process is the first process, reporting data corresponding to the first process; and if the operation state parameter is the second process, executing the step of reporting the operation state parameter of the controllable device of the first process stored by the device driver to the second process.
Further, the first process includes a camera process and the second process includes a display process.
Further, saving the operating state parameters of the first process controllable device of the electronic device to the device driver includes: the working state parameters of the flash lamp which can be controlled by the camera process are stored in the public module; if the current process of calling the Hal library of the sensor is determined to be the second process, reporting the working state parameters of the controllable device of the first process stored by the device driver to the second process comprises: and if the current process of calling the Hal library of the sensor is determined to be a display process, reporting the working state parameters of the flash lamp to the display process.
In a second aspect, an embodiment of the present application further provides an electronic device, including: a processor and a memory for storing at least one instruction which, when loaded and executed by the processor, implements the messaging method provided in the first aspect.
In a third aspect, embodiments of the present application also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the messaging method provided in the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it will be obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a block diagram of the software architecture of an electronic device according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a data sharing manner between different processes in the related art;
FIG. 4 is a schematic diagram of the isolation between the Cam process and the LCD process of an electronic device;
FIG. 5 is a flow chart of a message passing method according to an embodiment of the present application;
FIG. 6 is a flow chart of a message passing method according to another embodiment of the present application;
FIG. 7 is a block diagram of an electronic device according to one embodiment of the present application;
FIG. 8 is a schematic view of a scenario involving an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The following describes the concept of the present application.
(1) And (3) the process: an application program running in the system, once a program runs, is a process, and is the minimum unit of resource allocation.
(2) Kernel space: the protected memory space can be accessed, and all rights for accessing the underlying hardware devices are available.
Wherein, in the kernel space, the Binder driver transmits data through the memory, and the Binder can create a memory for transmitting data, and the transmission flow is as follows:
the Client process puts the data to be transferred into a virtual memory area corresponding to the kernel space by the Client process; copying virtual memory corresponding to the kernel space from the Client process to a memory of the Binder driver, wherein the memory created by the Binder driver and the virtual memory corresponding to the kernel space are the same memory address, so that the virtual memory is equivalent to direct copying, and the Server process is informed to read data; after receiving the notification, the Server process takes out the corresponding thread from the thread pool, analyzes the data, and writes the final processing result into the virtual memory corresponding to the kernel space by the Server process; copying data of the Server process in the virtual memory corresponding to the kernel space into the memory of the Binder driver, which is equivalent to directly copying the data into the virtual memory corresponding to the kernel space of the Client process due to the memory mapping, and notifying the Client process to read the data; after the Client process receives the notification, the Client process reads the data in the virtual memory corresponding to the kernel space.
(3) User space: the running space of the upper application program and Native layer is not directly accessible to the kernel space by the user space, and the kernel space can be accessed by the system call.
Wherein, the user space is not shared among different processes, but the kernel space is shareable.
The foregoing is a corresponding description of the concepts of the application.
The electronic equipment related to the embodiment of the application can comprise mobile equipment such as mobile phones, notebook computers, tablet computers, wearable equipment and the like. The embodiment of the application does not limit the specific type of the electronic equipment.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Referring to fig. 1, an electronic device 100 provided by an embodiment of the present application may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display 194, a subscriber identity module (subscriber identification module, a SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a video codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, a system coprocessor (System Coprocessor, SCP), and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-INTEGRATED CIRCUIT, I2C) interface, an integrated circuit built-in audio (inter-INTEGRATED CIRCUIT SOUND, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SERIAL DATA LINE, SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (CAMERA SERIAL INTERFACE, CSI), display serial interfaces (DISPLAY SERIAL INTERFACE, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating 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. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (WIRELESS FIDELITY, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation SATELLITE SYSTEM, GNSS), frequency modulation (frequency modulation, FM), near field communication (NEAR FIELD communication, NFC), infrared (IR), etc., applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques can include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (GENERAL PACKET radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation SATELLITE SYSTEM, GLONASS), a beidou satellite navigation system (beidou navigation SATELLITE SYSTEM, BDS), a quasi zenith satellite system (quasi-zenith SATELLITE SYSTEM, QZSS) and/or a satellite based augmentation system (SATELLITE BASED AUGMENTATION SYSTEMS, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a Liquid Crystal Display (LCD) CRYSTAL DISPLAY, an organic light-emitting diode (OLED), an active-matrix organic LIGHT EMITTING diode (AMOLED), a flexible light-emitting diode (FLED), miniled, microLed, micro-oLed, a quantum dot LIGHT EMITTING diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the invention, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 2 is a software configuration block diagram of an electronic device according to an embodiment of the present invention.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun rows (Android runtime) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for the application of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android runtime is responsible for scheduling and management of the android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Information interaction and communication of various states can be performed between the functional modules through an interaction channel (Binder) 201, for example, cross-process communication between different APP and system service modules is provided. In some embodiments, the Android system includes an application layer, an application framework layer, and a Kernel layer (Kernel).
The workflow of the electronic device 100 software and hardware is illustrated below in connection with capturing a photo scene.
When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into the original input event (including information such as touch coordinates, time stamp of touch operation, etc.). The original input event is stored at the kernel layer. The application framework layer acquires an original input event from the kernel layer, and identifies a control corresponding to the input event. Taking the touch operation as a touch click operation, taking a control corresponding to the click operation as an example of a control of a camera application icon, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera driver by calling a kernel layer, and captures a still image or video by the camera 193.
The above is a description of the software system architecture of the electronic device 100 provided by embodiments of the present application.
The message passing method provided by the embodiment of the application is described in detail below with reference to the accompanying drawings.
In the current scheme of communication among processes realized by Linux including Android, a common part is used as a bridge to realize communication among different processes.
Fig. 3 is a schematic diagram of a data sharing manner between different processes in the related art.
Referring to fig. 3, there is isolation between the corresponding user spaces of the first process and the second process, so that direct communication cannot be realized between the user space of the first process and the user space of the second process, that is, data cannot be directly shared, and therefore, inter-process communication is required to realize data sharing. Accordingly, cross-process communication may currently be performed by: by sharing memory, pipes, binders, message queues, etc.
In a scene where display brightness adjustment (LCD dimming) is performed on a display screen of the electronic apparatus 100 (e.g., a mobile phone), it is necessary to acquire a numerical value of a rear Color Sensor (Color Sensor), and also to acquire a flash state of the electronic apparatus 100, and confirm a data confidence of a Color temperature device through the flash state.
Fig. 4 is a schematic diagram of the isolation between Cam process and LCD process of an electronic device.
Referring to fig. 4, the flash of the electronic device 100 is controlled by a camera (Cam) process, and the flash state is rotated only in the Cam process. The display brightness of the display screen of the electronic device 100 is controlled by a display (LCD) process, however, the Cam process and the LCD process are different processes, and there is isolation between the two processes, so that the cross-process transmission of the flash state cannot be realized by the existing mechanism when the LCD dimming is performed.
To overcome the above-mentioned technical problems, the present embodiment provides a message passing method, and the electronic device 100 may use a hardware device common to two different processes to perform cross-process message passing by executing the message passing method. Specifically, in the original design, the data flow and the control flow of a certain process are unidirectional and are both the own flow (private flow) of the process, in other words, data is transmitted from hardware to an upper layer or control signals are transmitted from the upper layer to the hardware. In the message transmission method provided by the embodiment of the application, when different processes (the first process and the second process) need to transmit messages across processes, data streams and control streams can be combined and transmitted together, specifically, the control stream of the first process (such as the state of a controllable device of a certain first process) can be written into a device driver, when the second process calls the device driver, the control stream of the first process stored in the device driver and the data stream of the second process can be transmitted to the second process together, so that U-shaped message transmission is realized, cross-process message transmission is realized, and further, one process can acquire the state of another different process, thereby carrying out corresponding control of the process according to the state of the different process, and improving the convenience of process control of electronic equipment.
It should be noted that, compared with a system call mode that an upper layer controls a lower layer to access the same section of memory from top to bottom in the prior art, the method for transmitting the message provided by the embodiment of the application adopts a driver to actively save the state information of the controllable device of the first process, and can actively splice the stored state information of the controllable device of the first process at the tail end of the data stream of the second process and report the state information to the second process along with the data stream of the second process, thereby belonging to a message transmission mode that the lower layer directly feeds back the upper layer from bottom to top.
In an embodiment of the present application, the manner in which cross-process communication is implemented is by messaging through common portions of different processes. For example, the shared memory and the pipeline in Linux can be implemented by using a part of common modules as connection points, but for independent processes in Android devices, the common modules can be kernel device drivers (drivers).
In the device driver, a plurality of device nodes are usually generated, and the device nodes are used as the isolation between the kernel and the upper layer. The device node may include: control device enable (enable), retrieve device data (data).
Meanwhile, the receiving parameters are of character string types and are obtained through driver function analysis, wherein Kernel driving (comprising the device drivers) receives the parameters through the equipment nodes, analyzes the parameters into actual flag bits, such as enabling issuing of 0-5, and obtains which device is closed or opened according to actual operation intention through analyzing the character string. It should be noted that, the device node belongs to duplex type, and has a write operation, i.e. issues parameters to the device driver; for example, the enable node also has a read operation, that is, the upper layer application reads the data fed back by the device drive; such as the data node described above; the two operations are opposite, but the media transmitted up and down are both character strings.
In one embodiment, the identity information of the process currently controlling the device may be indicated to the device in a parameter-down manner. Wherein, the parameters are divided into three groups of CAM, LCD and FlASH, which respectively correspond to three types. The specific parameter list adopts an enumeration type, and is specifically as follows:
in one embodiment, communication between different processes may be implemented in conjunction with the enable store and data show functions. In an exemplary scenario in which the display screen of the electronic device 100 (e.g., a mobile phone) performs display brightness adjustment (LCD dimming), when an upper Cam process of the electronic device 100 performs a flash related operation, a corresponding parameter (e.g., a flash status parameter) may be issued to an enable_store, and then the flash status parameter may be stored in a device driver (driver), that is, the flash status parameter may be stored in a public portion, and further, the flash status parameter stored in the public portion may be transmitted to the LCD process along with a data stream (data) of the LCD process, so that the flash status parameter of the Cam process may be transferred to the LCD process in a cross-process, and the LCD process performs display brightness adjustment (LCD dimming) based on the flash status parameter acquired in the cross-process.
The flash operation of the electronic device 100 may include pre-flashing and main flashing, where the pre-flashing generally takes 3 seconds, the main flashing generally takes 0.5 seconds, and controlling the flash status parameter to follow the data of the LCD process and reporting the data to the LCD process may enable the LCD process to acquire the real-time property of the flash status parameter.
Fig. 5 is a flow chart of a message passing method according to an embodiment of the present application.
Referring to fig. 5, the message passing method may be applied to the electronic device 100 provided in the embodiment of the present application, and the method specifically includes the following steps:
Step 501: the first process of the electronic device performs a first operational control on the first process steerable device.
In one embodiment, the first process may be a Cam process, the first process controllable device may be a flash lamp controllable by the Cam process, and the first operation control may control the flash lamp (flash) to be turned on, turned off, or turned on/off. The Cam process of the electronic device 100 may determine whether to successfully control the flash according to the flash operation mode (flashmode), and if it is determined that the flash is successfully controlled, step 502 is performed.
Step 502: based on the first operation, the electronic device saves the state parameters of the first process controllable device to a common module of the process.
In an embodiment, the first operation may be a Flash operation, and thus the Cam process of the electronic device 100 may issue a corresponding state parameter to a device driver (driver), and in particular, the corresponding state parameter may be a flash_enable parameter due to the Flash operation. The flash_enable parameter is specifically a Flash state (FLASH STATE). In one embodiment, the Cam process may issue a flash status (FLASH STATE) to the control device enable (enable) node, and further, the control device enable (enable) node may send the flash status (FLASH STATE) issued by the Cam process to the get device data (data) node. In one embodiment, the control device enable node may periodically send its stored flash state (FLASH STATE) to the get device data (data) node.
Step 503: and the public module of the electronic equipment control process reports the stored state parameters of the controllable device of the first process to the second process.
In one embodiment, in the als_work function, when channel data (channel_data) is spliced, a flash state parameter (flash_state) of a node for obtaining device data (data) may be used as a last bit to be spliced, and data to be reported obtained by splicing may be reported to a second process, for example, may be reported to an LCD process.
In other embodiments, when channel data (channel_data) is spliced each time, a flash state parameter (flash_state) of a node for obtaining device data (data) may be used as a last bit to splice, and a data colleague to be reported obtained by splicing may be reported to a plurality of processes requiring the flash state parameter (flash_state).
Fig. 6 is a flow chart of a message passing method according to another embodiment of the present application.
Fig. 7 is a frame diagram of an electronic device according to an embodiment of the present application.
As shown in connection with fig. 6 and 7, the method may be implemented by:
Step 601: the electronics load the sensor Hal library.
KERNEL DRIVER can be used as a public part of two independent processes, and data_show is used as a bridge for data communication, so that the independent state information of a certain process can be transferred to other independent processes. Different en_types (enabling types) are designed for the same sensorHal library (i.e. a sensor Hal library), fields used by the process are set, and then a static library file can be dynamically identified and called, so that different processing flows for different processes are completed.
Step 602: the electronic device determines identity information of a current process calling the Hal library of the sensor, and based on the determination result, if the process is a first process, step 603 is executed, and if the process is a second process, step 604 is executed.
In one embodiment, since different en_types are designed for the same sensorHal library, the fields used by the process are set, and thus, the static library file dynamic identification calling process can be realized. That is, identity information of a process currently calling the sensor Hal library may be determined by en_type in sensorHal library. For example, in a scenario where the Cam process and the LCD process communicate across processes, and the LCD process needs to obtain a flash status parameter in the Cam process, it may be determined that the process currently calling the sensor Hal library is the Cam process or the LCD process according to the en_type, if it is determined that the Cam process currently calls the sensor Hal library (i.e., cam_enable), step 603 is performed, and if it is determined that the LCD process currently calls the sensor Hal library (i.e., lcd_enable), step 604 is performed.
Step 603: the electronics set the sensor Hal library for use by the first process and then execute step 605.
Step 604: the electronics set the sensor Hal library for use by the second process, after which step 608 is performed.
Step 605: the electronic device determines the working state of the first process controllable device, and based on the determination result, if the first process controllable device is in the off state, step 606 is executed, and if the first process controllable device is in the working state, step 607 is executed.
Step 606: after the electronic device sets the flag location of the device driver corresponding to the controllable device of the first process to the first attribute value, step 608 is executed.
In one embodiment, if it is determined that the working state of the first process controllable device is the off state, setting the flag location of the device driver to the first attribute value may be: if it is determined that the operating state of the flash controllable by the Cam process is an off state, the flag position of the device driver is set to 0, and step 608 is performed.
Step 607: after the electronic device sets the flag location of the device driver corresponding to the controllable device of the first process to the second attribute value, step 608 is executed.
If the flash lamp controllable by the Cam process is in operation, the flash lamp may be specifically low-gear operation (low) or high-gear operation (high).
In one embodiment, if it is determined that the operating state of the flash lamp controllable by the Cam process is low or high, the flag position of the device driver is set to 1, and step 608 is performed.
Step 608: the electronic equipment reports the working state parameters of the first process controllable device stored in the common module of the process to the Hal library of the sensor.
Before reporting the working state parameters of the first process controllable device to the upper process, the sensor Hal may be used to intercept information, confirm the identity information of the process currently calling the sensor Hal library, and further report the working state parameters of the first process controllable device to the process needing the information, so as to specifically implement steps 609 to 611.
Step 609: the electronic device determines the identity information of the process currently calling the Hal library of the sensor, and if it is the first process, step 610 is executed, and if it is the second process, step 611 is executed.
Step 610: and the electronic equipment reports the data corresponding to the first process.
In one embodiment, the electronic device 100 may only report color temperature data to the Cam process.
Step 611: and the electronic equipment reports the working state parameters of the controllable device of the first process to the second process.
In one embodiment, the electronic device 100 may report the flash status parameters to the LCD process.
In other embodiments, cross-process messaging is implemented in two ways:
A first mode: the method comprises the steps of using metadata or prop as a public part, storing the state of a flash lamp into the metadata or prop, and starting cyclic monitoring in other independent processes to acquire the data of the public part.
The second mode is as follows: and adopting a folder mechanism defined by Android to realize inter-process communication, designing a corresponding folder service in a flash control part of Camx, carrying out data transmission through a service-manager realized by a system, and adding a receiving logic of the folder in an actual control logic in an LCD (liquid crystal display) to realize acquisition of state information.
The two alternatives can realize the function of inter-process communication, but the current scheme is selected by comprehensively considering the fact that the monitoring frequency in the LCD process is required to be provided to ensure that the latest state of the flash lamp can be acquired in real time because the time of the torch of the flash lamp is shorter under certain use scenes, so that the power consumption rises.
Fig. 8 is a schematic view of a scenario according to an embodiment of the present application.
Referring to fig. 8, the scenario is a scenario in which a plurality of processes use the same hardware resource at the same time and there is synchronization or message transmission. Illustratively, in one scenario, two processes (a first process and a second process) are used simultaneously for the same hardware resource, and synchronization or message transmission exists. In the current device, the AO Cam is used for a plurality of upper layers of application, such as face detection, code scanning and the like, and the current mode can be used, the AO Cam is used as a public part, and the face and mobile phone use condition and the like are transmitted to a code scanning scene to assist in confirming whether code scanning is needed or not, so that the resource use efficiency of the mobile phone is improved.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Referring to fig. 9, the electronic device may include: a processor 901 and a memory 902, the memory 902 for storing at least one instruction which, when loaded and executed by the processor 901, implements a messaging method provided by any one of the embodiments of the present application.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the message passing method provided by any of the embodiments of the application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a Processor (Processor) to perform part of the steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the application.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (10)

1. A method of messaging, for application to an electronic device, the method comprising:
Storing working state parameters of a first process controllable device of the electronic equipment to a device driver, wherein the device driver is a common module of the first process and a second process of the electronic equipment; generating a plurality of equipment nodes in the device driver, wherein the equipment nodes comprise a control device enabling node and a device data acquisition node; the storing the working state parameters of the first process controllable device of the electronic equipment to the device driver comprises the following steps: transmitting the working state parameters to the control device enabling node, and transmitting the working state parameters to the acquisition device data node by the control device enabling node; and
If the current process of calling the Hal library of the sensor is determined to be the second process, reporting the working state parameters of the controllable device of the first process stored by the device driver to the second process; the reporting the working state parameters of the controllable device of the first process stored in the device driver to the second process includes: and splicing the working state parameters of the data nodes of the acquisition device at the tail end of the data flow of the second process, and reporting the working state parameters to the second process along with the data flow of the second process.
2. The method of claim 1, wherein saving the operating state parameters of the first process controllable device of the electronic device to the device driver comprises:
When the first process calls the Hal library of the sensor, the working state of the controllable device of the first process is determined, and the determined current working state parameters of the controllable device of the first process are saved to the device driver.
3. The method of claim 2, wherein determining the operational state of the first process steerable device comprises:
Determining that the first process controllable device is in a closed state or in operation;
wherein, the work includes a low gear work or a high gear work.
4. A method according to claim 3, wherein after determining the operating state of the first process steerable device, saving the determined current operating state parameters of the first process steerable device to the device driver, further comprising:
If the first process controllable device is in a closed state, setting a mark position of a device driver corresponding to the first process controllable device as a first attribute value;
if the first process controllable device is in operation, setting a mark position of a device driver corresponding to the first process controllable device as a second attribute value;
wherein the saving of the determined current operating state parameters of the first process steerable device to the device driver comprises:
And storing the determined current working state parameters of the first process controllable device to the device driver based on the marker positions of the device driver corresponding to the first process controllable device.
5. The method of claim 2, wherein the determining that the first process invoked the sensor Hal library further comprises:
Determining whether a current process calling the sensor Hal library is the first process or the second process based on the enabling type of the sensor Hal library;
Wherein the enabling type comprises a first process enabling or a second process enabling, the first process enabling indicates that the current first process calls the sensor Hal library, and the second process enabling indicates that the current second process calls the sensor Hal library.
6. The method of claim 1, wherein if it is determined that the current process of calling the Hal library is the second process, before reporting the operating state parameter of the first process controllable device stored in the device driver to the second process, the method further comprises:
Determining that the current process calling the Hal library of the sensor is the first process or the second process, and if the current process is the first process, reporting data corresponding to the first process; and if the operation is the second process, executing the step of reporting the working state parameters of the controllable device of the first process, which are stored in the device driver, to the second process.
7. The method of any of claims 1-6, wherein the first process comprises a camera process and the second process comprises a display process.
8. The method of claim 7, wherein saving the operating state parameters of the first process controllable device of the electronic device to the device driver comprises: the working state parameters of the flash lamp which can be controlled by the camera process are stored in the public module;
if it is determined that the current process of calling the Hal library of the sensor is the second process, reporting the working state parameters of the device controllable by the first process, which are stored by the device driver, to the second process includes: and if the current process of calling the Hal library of the sensor is the display process, reporting the working state parameters of the flash lamp to the display process.
9. An electronic device, the electronic device comprising: a processor and a memory for storing at least one instruction that when loaded and executed by the processor implements the messaging method of any of claims 1-8.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements a message passing method according to any of claims 1-8.
CN202211210336.1A 2022-09-30 2022-09-30 Message delivery method, electronic device and storage medium Active CN116709609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211210336.1A CN116709609B (en) 2022-09-30 2022-09-30 Message delivery method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211210336.1A CN116709609B (en) 2022-09-30 2022-09-30 Message delivery method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN116709609A CN116709609A (en) 2023-09-05
CN116709609B true CN116709609B (en) 2024-05-14

Family

ID=87826377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211210336.1A Active CN116709609B (en) 2022-09-30 2022-09-30 Message delivery method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116709609B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547634A (en) * 2016-11-28 2017-03-29 武汉斗鱼网络科技有限公司 A kind of method and device of striding course communication
CN108170549A (en) * 2017-12-28 2018-06-15 努比亚技术有限公司 Mobile terminal restarts localization method, mobile terminal and computer readable storage medium
CN112379952A (en) * 2020-12-09 2021-02-19 成都傲梅科技有限公司 Method for implementing cross-process callback
CN113760578A (en) * 2021-08-28 2021-12-07 特斯联科技集团有限公司 Method, device, equipment and computer program for cross-process rapid transmission of big data
WO2022111665A1 (en) * 2020-11-30 2022-06-02 花瓣云科技有限公司 Application management method and apparatus, and device and storage medium
CN115016957A (en) * 2022-05-26 2022-09-06 湖南三一智能控制设备有限公司 Method, device, terminal and vehicle for cross-process memory sharing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10606670B2 (en) * 2018-04-11 2020-03-31 EMC IP Holding Company LLC Shared memory usage tracking across multiple processes

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106547634A (en) * 2016-11-28 2017-03-29 武汉斗鱼网络科技有限公司 A kind of method and device of striding course communication
CN108170549A (en) * 2017-12-28 2018-06-15 努比亚技术有限公司 Mobile terminal restarts localization method, mobile terminal and computer readable storage medium
WO2022111665A1 (en) * 2020-11-30 2022-06-02 花瓣云科技有限公司 Application management method and apparatus, and device and storage medium
CN112379952A (en) * 2020-12-09 2021-02-19 成都傲梅科技有限公司 Method for implementing cross-process callback
CN113760578A (en) * 2021-08-28 2021-12-07 特斯联科技集团有限公司 Method, device, equipment and computer program for cross-process rapid transmission of big data
CN115016957A (en) * 2022-05-26 2022-09-06 湖南三一智能控制设备有限公司 Method, device, terminal and vehicle for cross-process memory sharing

Also Published As

Publication number Publication date
CN116709609A (en) 2023-09-05

Similar Documents

Publication Publication Date Title
CN113254409B (en) File sharing method, system and related equipment
CN113641271B (en) Application window management method, terminal device and computer readable storage medium
CN114089932B (en) Multi-screen display method, device, terminal equipment and storage medium
WO2021185352A1 (en) Version upgrade method and related apparatus
EP4033354A1 (en) Method and apparatus for installing plug-in, and storage medium
CN110609650B (en) Application state switching method and terminal equipment
CN113438366A (en) Information notification interaction method, electronic device and storage medium
CN114828098B (en) Data transmission method and electronic equipment
CN114691248B (en) Method, device, equipment and readable storage medium for displaying virtual reality interface
CN115599565A (en) Method and device for sending clipboard data
CN116709609B (en) Message delivery method, electronic device and storage medium
CN115017498A (en) Method for operating applet and electronic device
CN113467821A (en) Application program repairing method, device, equipment and readable storage medium
CN110737916A (en) Communication terminal and processing method
CN116048629B (en) System service switching method, control device, electronic equipment and storage medium
CN116048831B (en) Target signal processing method and electronic equipment
CN114826636B (en) Access control system and related methods and apparatus
CN116719376B (en) Voltage control method, device, equipment and storage medium
CN115482143B (en) Image data calling method and system for application, electronic equipment and storage medium
CN116795476B (en) Wallpaper deleting method and electronic equipment
CN116089057B (en) Resource scheduling method, device, storage medium and program product
CN114006969B (en) Window starting method and electronic equipment
WO2024093703A1 (en) Instance management method and apparatus, and electronic device and storage medium
CN117707562A (en) Parameter updating method and terminal equipment
CN114490006A (en) Task determination method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant