Message receiving method and system and electronic equipment

By using Hooked read and Hooked write functions in electronic devices, combined with LD_PRELOAD to replace the basic libc function, simulate communication services, the problem of physical cards and special equipment in the existing technology is solved, and communication testing solutions that simplify operations and reduce costs are realized plan.

CN119031331APending Publication Date: 2024-11-26HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310582953.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-23
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The prior art requires physical cards or special equipment in communication testing, which are complex and costly, making it difficult to meet the needs of communication testing-related services.

Method used

By using Hooked read and Hooked write functions in electronic devices, combined with LD_PRELOAD to replace the libc basic function, simulate communication services, realize message reception and processing, simplify operations and reduce costs.

Benefits of technology

It realizes that the communication testing process is simplified, the cost is reduced, and the efficiency and flexibility of communication testing is improved without the need for physical cards and special equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031331A_ABST
    Figure CN119031331A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message receiving method and system and electronic equipment. In the technical scheme provided by the embodiment of the invention, second electronic equipment sends a first receiving instruction of a first message to first electronic equipment; the first electronic device obtains a second receiving instruction according to the first receiving instruction and the Hooked read function, generates first prompt information used for prompting that the first application receives the first message according to the second receiving instruction, and displays the first prompt information, the operation is simple, the cost is low, and development of communication test related services is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of computer technology, and in particular to a message receiving method, system and electronic device. [Background technology]

[0002] Internal testing of communication-related services (such as sending and receiving text messages, making or receiving phone calls, network registration, network roaming, signal strength, time zone updates, etc.), third-party application development or product demonstrations all require physical cards or dedicated communication laboratories or dedicated network equipment, which are complex to operate and costly, and are not conducive to the development of communication test-related businesses. [Summary of the invention]

[0003] In view of this, the embodiments of the present invention provide a message receiving method, system and electronic device, which are simple to operate and low in cost, and are conducive to the development of communication test related services.

[0004] In a first aspect, an embodiment of the present invention provides a message receiving method, which is applied to a first electronic device, and the method includes:

[0005] Receiving a first receiving instruction of a first message sent by a second electronic device;

[0006] Obtain a second receiving instruction according to the first receiving instruction and the Hooked read function;

[0007] generating, according to the second receiving instruction, first prompt information for prompting the first application to receive the first message;

[0008] The first prompt information is displayed.

[0009] In combination with the first aspect, in some implementations of the first aspect, obtaining the second receiving instruction according to the first receiving instruction and the Hooked read function includes:

[0010] According to the first receiving instruction, obtaining a first issuing instruction through a Hooked write function;

[0011] According to the first issued instruction, obtaining, through a modem, a first processing result of the first issued instruction;

[0012] According to the first processing result, a second receiving instruction is obtained through the Hooked read function.

[0013] In combination with the first aspect, in some implementations of the first aspect, the first message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message, or a time zone update message.

[0014] In combination with the first aspect, in some implementations of the first aspect, the method further includes:

[0015] In response to a user clicking a first control of a second message in the first application, generating a second sending instruction of the second message;

[0016] According to the second issued instruction, a second processing result is obtained by searching the target library for a processing result corresponding to the second issued instruction;

[0017] generating second prompt information according to the second processing result;

[0018] The second prompt information is displayed.

[0019] In combination with the first aspect, in some implementations of the first aspect, the second message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message, or a time zone update message.

[0020] In combination with the first aspect, in some implementations of the first aspect, the first control includes a send control, a dial control, a confirmation control, a registration control, a test control, or an update control.

[0021] In combination with the first aspect, in some implementations of the first aspect, obtaining the second processing result by searching the target library for a processing result corresponding to the second issuing instruction according to the second issuing instruction includes:

[0022] According to the second issuing instruction, obtaining the second processing result corresponding to the second issuing instruction through the Hooked write function and the target library;

[0023] The second processing result is returned through the Hooked read function.

[0024] In combination with the first aspect, in some implementations of the first aspect, the target library includes a scene library or a recording library.

[0025] In a second aspect, an embodiment of the present invention provides a message receiving system, the system comprising:

[0026] The second electronic device is used to send a first receiving instruction of a first message to the first electronic device;

[0027] The first electronic device is used to obtain a second receiving instruction according to the first receiving instruction and a Hooked read function, generate first prompt information for prompting the first application to receive the first message according to the second receiving instruction, and display the first prompt information.

[0028] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory is used to store a computer program, and the computer program comprises program instructions, and when the processor runs the program instructions, the electronic device executes the steps of the method described above.

[0029] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program request is executed by a computer, the computer is caused to execute the method as described above.

[0030] In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes instructions. When the computer program product is run on a computer or any at least one processor, the computer executes the functions / steps in the above method.

[0031] In the technical solutions of the message receiving method, system and electronic device provided by the embodiments of the present invention, the second electronic device sends a first receiving instruction of a first message to the first electronic device; the first electronic device obtains a second receiving instruction according to the first receiving instruction and a Hooked read function, and generates, according to the second receiving instruction, a first prompt information for prompting the first application that the first message has been received, and displays the first prompt information, which is simple to operate and low in cost, and is conducive to the development of communication test related businesses.

Brief Description of the Drawings

[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0033] Figure 1 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0034] Figure 2 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention;

[0035] Figure 3 An architecture diagram of a message receiving system provided by an embodiment of the present invention;

[0036] Figure 4 A flowchart of a message receiving method provided by an embodiment of the present invention;

[0037] Figure 5 for Figure 4A specific flow chart of obtaining a second receiving instruction according to the first receiving instruction and the Hooked read function;

[0038] Figure 6 for Figure 4 According to the second issued instruction, by searching the target library for the processing result corresponding to the second issued instruction, a specific flow chart of the second processing result is obtained;

[0039] Figure 7 A schematic structural diagram of a first electronic device provided by an embodiment of the present invention. [Specific implementation method]

[0040] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0041] It should be clear that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0043] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0044] Figure 1 A schematic structural diagram of an electronic device 100 is shown.

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

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

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

[0048] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

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

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

[0051] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0052] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0053] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0054] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0076] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0077] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0078] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0079] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0080] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, 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.

[0081] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.

[0082] Figure 2 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0083] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0084] The application layer can include a series of application packages.

[0085] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

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

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

[0088] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0089] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0090] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

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

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

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

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

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

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

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

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

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

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

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

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

[0103] The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.

[0104] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through the camera 193.

[0105] MockRil was originally designed and developed by Google. Its principle is to replace the RIL program with a pile in the Radio Interface Layer (RIL) and simulate the RIL interface to achieve communication service simulation. However, MockRil involves a large number of interface piles in RIL, which is a large development workload and technically difficult. In addition, since each major version of the Android Open Source Project (AOSP) changes the RIL and upper-layer logic, each major version of AOSP requires a lot of adaptation development, and the compatibility is insufficient.

[0106] In addition, internal testing of communication-related businesses, third-party application development or product demonstrations all require physical cards or dedicated communication laboratories or dedicated network equipment, which are complex to operate and costly, and are not conducive to the development of communication testing-related businesses.

[0107] Based on the above technical problem, an embodiment of the present invention provides a message receiving system. Figure 3 An architectural diagram of a message receiving system provided in an embodiment of the present invention.

[0108] The message receiving system includes a first electronic device 30 and a second electronic device 20. The first electronic device 30 and the second electronic device 20 are wirelessly connected. Figure 3 As shown, the second electronic device 20 includes a socket client 21 and a first communication module 22. The first electronic device 30 includes a socket service module 31, a first function (Hooked open function) module 32, a second function (Hooked write function) module 33, a third function (Hooked read function) module 34, a modem 35, a first application 36, a screen 37 and a second communication module 38. The hardware structure and software structure of the electronic device provided in the embodiment of the present invention can be referred to. Figure 1 and Figure 2 Related description about electronic device 100.

[0109] The second electronic device 20 is configured to send a first receiving instruction of a first message to the first electronic device 30 .

[0110] For example, the first electronic device 30 is a mobile phone, the second electronic device 20 is a computer, and the computer sends a text message receiving instruction to the mobile phone through HDC.

[0111] Exemplarily, the first message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message, or a time zone update message.

[0112] like Figure 3 As shown, the socket client 21 is used to send a first receiving instruction of a first message to the first communication module 22 .

[0113] For example, in a scenario simulating a mobile phone receiving text messages, the computer sends a first receiving instruction of the text message to the first communication module 22 through the socket client 21, and the first receiving instruction is an instruction for receiving the text message.

[0114] like Figure 3 As shown, the first communication module 22 is used to send a first receiving instruction of a first message to the second communication module 38 of the first electronic device 30 .

[0115] For example, in a scenario simulating a mobile phone receiving a text message, the computer sends a first receiving instruction of the text message to the second communication module 38 of the mobile phone through the first communication module 22 .

[0116] The first electronic device 30 is used to obtain a second receiving instruction according to the first receiving instruction and the Hooked read function, generate first prompt information for prompting the first application 36 to receive the first message according to the second receiving instruction, and display the first prompt information.

[0117] Among them, the first electronic device 30 is specifically used to obtain a first sending instruction through a Hooked write function according to a first receiving instruction; obtain a first processing result of the first sending instruction through a modem according to the first sending instruction; and obtain a second receiving instruction through a Hooked read function according to the first processing result.

[0118] Usually, the Vendorlib in the electronic device communicates with the modem through the read function or the write function, sends AT instructions through the write function, and reports AT instructions through the read function.

[0119] For example, the original communication record is as follows:

[0120] Device A sends a message to device B: "Are you there?";

[0121] Device B replies to device A: “Not here”.

[0122] The embodiment of the present invention utilizes LD_PRELOAD to replace the libc basic functions (such as open function, read function, write function, etc.) in the electronic device system, blocks or modifies the sending instructions or reporting instructions, and finally realizes the communication service simulation.

[0123] For example, in the embodiment of the present invention, a polite processing mechanism is added to the electronic device to perform polite processing on the message, and the communication record is as follows:

[0124] When device A sends a message to device B, the Hooked open function is triggered and the system obtains the handle. Since multiple devices may send messages at the same time, after obtaining the handle, it can be fixed to the channel for the call between device A and device B, so that only the call between device AB is handled politely, and other calls are not handled politely.

[0125] Device A sends a message to device B: "Are you there?" The system receives the message from device A, processes it politely, and then sends it to device B: "Hello, are you there?"

[0126] Device B replies to device A with the message: "Not here." The system receives the message from device B, processes it politely, and then sends it back to device A: "Hello, I'm not available right now. Please leave a message and I'll get back to you later!"

[0127] Exemplarily, the embodiment of the present invention uses a Hooked open function to replace the open function. The Hooked open function records the file descriptor (fd) of each file opened by the modem, so as to narrow the hook scope.

[0128] Exemplarily, the embodiment of the present invention uses a Hooked read function to replace the read function. The Hooked read function reports a scene-specific AT command or transparently transmits it according to scene requirements.

[0129] Exemplarily, the embodiment of the present invention uses a Hooked write function to replace the write function. The Hooked write function replaces the issued AT command or transparent transmission according to the scene requirements.

[0130] After the embodiment of the present invention uses LD_PRELOAD to replace the libc basic functions in the electronic device system, the electronic device follows the Linux function loading order, that is, LD_PRELOAD>LD_LIBRARY_PATH> / etc / ld.so.cache> / lib> / usr / lib. It should be noted that in addition to the solution of using LD_PRELOAD to replace the libc basic functions, the LD_LIBRARY_PATH> / etc / ld.so.cache> / lib method can also be used to implement the functions described in the embodiment of the present invention. The embodiment of the present invention simulates control through lower-level functions, and major version changes do not involve changes in the modem layer. Vendlib or Ril code changes do not require re-adaptation and development. The amount of code to achieve this functional capability is minimal, the solution is optimal, and the operation is simple and the cost is low, which is conducive to the development of communication test related businesses.

[0131] like Figure 3As shown, the second communication module 38 is used to send a first receiving instruction of a first message to the socket service module 31 .

[0132] For example, in a scenario simulating a mobile phone receiving a text message, the second communication module 38 of the mobile phone sends a first receiving instruction of a first message to the socket service module 31 .

[0133] like Figure 3 As shown, the socket service module 31 is used to receive a first receiving instruction of a first message, and send the first receiving instruction to the second function module 33 and the first function module 32 .

[0134] For example, in a scenario simulating a mobile phone receiving text messages, after the socket service module 31 of the mobile phone receives a first receiving instruction of a text message sent by a computer, the first receiving instruction is sent to the second function module 33 and the first function module 32 .

[0135] like Figure 3 As shown, the first function module 32 is used to obtain a first message according to a first receiving instruction, and fix a message channel between the first electronic device 30 and the second electronic device 20 according to the first message.

[0136] like Figure 3 As shown, the second function module 33 is used to obtain a first sending instruction according to the first receiving instruction and the Hooked write function, and send the first sending instruction to the modem 35.

[0137] For example, in a scenario of simulating a mobile phone receiving text messages, after receiving a first receiving instruction, the second function module 33 of the mobile phone simulates a first sending instruction through a Hooked write function, and sends the first sending instruction to the modem 35 .

[0138] like Figure 3 As shown, the modem 35 is used to obtain a first processing result of the first issuing instruction according to the first issuing instruction, and send the first processing result to the third function module 34.

[0139] For example, in a scenario simulating a mobile phone receiving a text message, the modem 35 of the mobile phone returns a first processing result to the third function module 34 according to the first sending instruction.

[0140] like Figure 3 As shown, the third function module 34 is used to obtain the second receiving instruction through the Hooked read function according to the first processing result, and send the second receiving instruction to the first application 36.

[0141] For example, in a scenario simulating a mobile phone receiving text messages, the third function module 34 of the mobile phone obtains a second receiving instruction through the Hooked read function according to the first processing result, the second receiving instruction is an instruction for receiving the text message, and sends the second receiving instruction to the text message APP.

[0142] Exemplarily, the first application 36 corresponds to the first message. For example, if the first message is a text message, the first application 36 is a text message APP.

[0143] like Figure 3 As shown, the first application 36 is used to generate first prompt information for prompting the first application 36 to receive the first message according to the second receiving instruction, and send the first prompt information to the screen 37.

[0144] For example, in a scenario simulating a mobile phone receiving a text message, the mobile phone's text message APP generates a first prompt message for prompting the text message APP to receive a first message according to a second receiving instruction, i.e., an instruction for receiving a text message, and sends the first prompt message to the screen 37. The first prompt message is a prompt that the text message APP has received a text message.

[0145] like Figure 3 As shown, the screen 37 is used to display the first prompt information.

[0146] For example, in a scenario simulating a mobile phone receiving a text message, the screen 37 of the mobile phone displays a prompt that the text message APP has received the text message.

[0147] In some possible embodiments, the first electronic device 30 is also used to generate a first sending instruction for the second message in response to a user clicking on a first control of the second message in the first application 36; according to the first sending instruction, obtain a second processing result by searching a target library for a processing result corresponding to the first sending instruction; according to the second processing result, generate a second prompt information; and display the second prompt information.

[0148] Exemplarily, the second message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message, or a time zone update message.

[0149] Exemplarily, the first control includes a send control, a dial control, a confirmation control, a registration control, a test control, or an update control.

[0150] Exemplarily, the first application 36 corresponds to the second message. For example, if the first application 36 is a text message APP, the first message is a text message.

[0151] In some possible embodiments, the first electronic device 30 is specifically configured to obtain, according to the second issuing instruction, a second processing result corresponding to the second issuing instruction through a Hooked write function and a target library; and return the second processing result through a Hooked read function.

[0152] Exemplarily, the target library includes a scene library or a recording library.

[0153] like Figure 3 As shown, the first application 36 is used to generate a second sending instruction for the second message in response to a user clicking operation on the first control of the second message in the first application, and send the second sending instruction to the second function module 33.

[0154] For example, in a scenario simulating a mobile phone making a call, the user selects a phone number on the phone APP of the mobile phone and clicks the dial control. The phone APP of the mobile phone generates a sending instruction for making a call and sends a second sending instruction to the second function module 33.

[0155] like Figure 3 As shown, the second function module 33 is also used to obtain a processing result corresponding to the second issuing instruction through the Hooked write function and the target library according to the second issuing instruction, obtain the second processing result and send the second processing result to the third function module 34.

[0156] For example, in a scenario simulating a mobile phone making a call, the second function module 33 of the mobile phone searches for the processing result corresponding to the second issued instruction in the scene library through the Hooked write function according to the second issued instruction, obtains the second processing result and sends the second processing result to the third function module 34.

[0157] For example, in a scenario where a simulated mobile phone makes a call, the second processing result is a successful call or a failed call.

[0158] like Figure 3 As shown, the third function module 34 returns the second processing result to the first application 36 through the Hooked read function.

[0159] For example, in a scenario where a mobile phone is simulating making a call, the third function module 34 of the mobile phone returns a successful call or a failed call to the phone APP through the Hooked read function.

[0160] like Figure 3 As shown, the first application 36 is further used to generate second prompt information according to the second processing result, and send the second prompt information to the screen 37.

[0161] For example, in a scenario where a simulated mobile phone makes a call, the phone APP of the mobile phone generates a second prompt message according to the second processing result, and sends the second prompt message to the screen 37 .

[0162] For example, in a scenario where a simulated mobile phone makes a call, the second prompt information is a prompt information indicating a successful call or a prompt information indicating a failed call.

[0163] like Figure 3 As shown, screen 37 is used to display the second prompt information.

[0164] For example, in a scenario where a simulated mobile phone makes a call, the screen 37 of the mobile phone displays a prompt message indicating a successful call or a prompt message indicating a failed call.

[0165] In summary, the Vendorlib in electronic devices usually communicates with the modem through the read function or the write function, sends AT instructions through the write function, and reports AT instructions through the read function to realize communication service simulation. However, it involves a lot of interface piling, a large amount of development work, and high technical difficulty. Each major version of AOSP requires a lot of adaptation development, and the compatibility is insufficient. In addition, internal testing of communication-related services, third-party application development, or product demonstrations all require physical cards or dedicated communication laboratories or dedicated network equipment, which are complicated to operate and costly, and are not conducive to the development of communication test-related services. The message receiving system provided by the embodiment of the present invention uses LD_PRELOAD to replace the libc basic functions (such as open function, read function, write function, etc.) in the electronic device system, blocks or modifies the issuance of instructions or reporting instructions, and finally realizes the communication service simulation. Since the code changes on Vendlib or Ril in the embodiment of the present invention do not affect the simulation capability, no adaptation is required, the code structure is simple, and less than 1K of code can realize full service simulation; in the scenarios of internal testing of communication-related services (such as simulating SMS sending and receiving, making or answering calls), the mobile phone does not need to insert a card or use auxiliary equipment; in test scenarios such as simulating network registration, network roaming, signal strength, time zone update, etc., there is no need to build a communication laboratory environment or field verification to simulate the network signal scenario.

[0166] based on Figure 3 The system architecture shown in FIG. 1 is an embodiment of the present invention that provides a message receiving method.

[0167] Figure 4 A flowchart of a message receiving method provided by an embodiment of the present invention, applied to Figure 3 The first electronic device shown, Figure 4 As shown, the method includes:

[0168] Step 402: Receive a first receiving instruction of a first message sent by a second electronic device.

[0169] In this step, if Figure 3 As shown, the second communication module of the first electronic device receives the first receiving instruction of the first message and forwards it to the socket service module; the socket service module forwards the first receiving instruction to the second function module.

[0170] The hardware structure and software structure of the electronic device provided by the embodiment of the present invention can be found in Figure 1 and Figure 2 Related description about electronic device 100.

[0171] For example, the first electronic device is a mobile phone, the second electronic device is a computer, and the computer sends a command for receiving a text message to the mobile phone through the HDC.

[0172] Exemplarily, the first message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message, or a time zone update message.

[0173] Step 404: Obtain a second receiving instruction according to the first receiving instruction and the Hooked read function.

[0174] In this step, if Figure 3 As shown, the first electronic device obtains the second receiving instruction according to the first receiving instruction and the Hooked read function.

[0175] For example, in a scenario of simulating a mobile phone receiving a text message, the mobile phone obtains an instruction for receiving the text message according to the instruction for receiving the text message and the Hooked read function.

[0176] Usually, the Vendorlib in the electronic device communicates with the modem through the read function or the write function, sends AT instructions through the write function, and reports AT instructions through the read function.

[0177] For example, the original communication record is as follows:

[0178] Device A sends a message to device B: "Are you there?";

[0179] Device B replies to device A: “Not here”.

[0180] The embodiment of the present invention utilizes LD_PRELOAD to replace the libc basic functions (such as open function, read function, write function, etc.) in the electronic device system, blocks or modifies the sending instructions or reporting instructions, and finally realizes the communication service simulation.

[0181] For example, in the embodiment of the present invention, a polite processing mechanism is added to the electronic device to perform polite processing on the message, and the communication record is as follows:

[0182] When device A sends a message to device B, the Hooked open function is triggered and the system obtains the handle. Since multiple devices may send messages at the same time, after obtaining the handle, it can be fixed to the channel for the call between device A and device B, so that only the call between device AB is handled politely, and other calls are not handled politely.

[0183] Device A sends a message to device B: "Are you there?" The system receives the message from device A, processes it politely, and then sends it to device B: "Hello, are you there?"

[0184] Device B replies to device A with the message: "Not here." The system receives the message from device B, processes it politely, and then sends it back to device A: "Hello, I'm not available right now. Please leave a message and I'll get back to you later!"

[0185] Exemplarily, the embodiment of the present invention uses a Hooked open function to replace the open function. The Hooked open function records the file descriptor (fd) of each file opened by the modem, so as to narrow the hook scope.

[0186] Exemplarily, the embodiment of the present invention uses a Hooked read function to replace the read function. The Hooked read function reports a scene-specific AT command or transparently transmits it according to scene requirements.

[0187] Exemplarily, the embodiment of the present invention uses a Hooked write function to replace the write function. The Hooked write function replaces the issued AT command or transparent transmission according to the scene requirements.

[0188] After the embodiment of the present invention uses LD_PRELOAD to replace the libc basic functions in the electronic device system, the electronic device follows the Linux function loading order, that is, LD_PRELOAD>LD_LIBRARY_PATH> / etc / ld.so.cache> / lib> / usr / lib. It should be noted that in addition to the solution of using LD_PRELOAD to replace the libc basic functions, the LD_LIBRARY_PATH> / etc / ld.so.cache> / lib method can also be used to implement the functions described in the embodiment of the present invention. The embodiment of the present invention simulates control through lower-level functions, and major version changes do not involve changes in the modem layer. Vendlib or Ril code changes do not require re-adaptation and development. The amount of code to achieve this functional capability is minimal, the solution is optimal, and the operation is simple and the cost is low, which is conducive to the development of communication test related businesses.

[0189] In some possible embodiments, Figure 5 As shown, step 404 specifically includes:

[0190] Step 4042: According to the first receiving instruction, a first issuing instruction is obtained through the Hooked write function.

[0191] In this step, if Figure 3 As shown, the second function module of the first electronic device obtains the first sending instruction according to the first receiving instruction and the Hookedwrite function, and sends the first sending instruction to the modem.

[0192] For example, in a scenario of simulating a mobile phone receiving text messages, after the second function module of the mobile phone receives the instruction to receive text messages, it simulates the first sending instruction through the Hooked write function and sends the first sending instruction to the modem 35.

[0193] Step 4044: According to the first sending instruction, obtain a first processing result of the first sending instruction through the modem.

[0194] In this step, if Figure 3 As shown, the modem of the first electronic device obtains the first processing result of the first sending instruction according to the first sending instruction, and sends the first processing result to the third function module.

[0195] For example, in a scenario where a mobile phone is simulated to receive text messages, the modem of the mobile phone returns the first processing result to the third function module 34 according to the first sending instruction.

[0196] Step 4046: According to the first processing result, obtain a second receiving instruction through the Hooked read function.

[0197] In this step, if Figure 3 As shown, the third function module of the first electronic device obtains the second receiving instruction through the Hooked read function according to the first processing result, and sends the second receiving instruction to the first application 36.

[0198] For example, in a scenario simulating a mobile phone receiving text messages, the third function module of the mobile phone obtains an instruction for receiving the text message through the Hooked read function according to the first processing result, and sends the instruction for receiving the text message to the text message APP.

[0199] Exemplarily, the first application corresponds to the first message. For example, if the first message is a text message, then the first application is a text message APP.

[0200] Step 406: Generate first prompt information for prompting the first application to receive the first message according to the second receiving instruction.

[0201] In this step, if Figure 3 As shown, the first application generates first prompt information for prompting the first application to receive the first message according to the second receiving instruction, and sends the first prompt information to the screen.

[0202] For example, in a scenario simulating a mobile phone receiving a text message, the mobile phone's text message APP generates a first prompt message for prompting the text message APP to receive a first message according to a second receiving instruction, i.e., an instruction for receiving a text message, and sends the first prompt message to the screen. The first prompt message is a prompt that the text message APP has received a text message.

[0203] Step 408: Display the first prompt information.

[0204] In this step, if Figure 3 As shown, the screen displays the first prompt information.

[0205] For example, in a scenario simulating a mobile phone receiving a text message, the screen of the mobile phone displays a prompt that the text message APP has received the text message.

[0206] Optionally, after step 408, the method further includes:

[0207] Step 410: In response to a user clicking operation on a first control of a second message in a first application, a second sending instruction of the second message is generated.

[0208] In this step, if Figure 3 As shown, the first application generates a second sending instruction for the second message in response to a user clicking the first control of the second message in the first application, and sends the second sending instruction to the second function module.

[0209] For example, in a scenario simulating a mobile phone making a call, the user selects a phone number on the phone APP of the mobile phone and clicks the dial control. The phone APP of the mobile phone generates a sending instruction for making a call and sends a second sending instruction to the second function module 33.

[0210] Exemplarily, the second message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message, or a time zone update message.

[0211] Exemplarily, the first control includes a send control, a dial control, a confirmation control, a registration control, a test control, or an update control.

[0212] Exemplarily, the first application corresponds to the second message. For example, if the first application is a text message APP, then the first message is a text message.

[0213] Step 412: According to the second issued instruction, a second processing result is obtained by searching the target library for a processing result corresponding to the second issued instruction.

[0214] In this step, if Figure 3 As shown, the first electronic device obtains the second processing result by searching the target library for the processing result corresponding to the second issued instruction according to the second issued instruction.

[0215] For example, in a scenario where a simulated mobile phone makes a call, the mobile phone obtains the second processing result by searching the target library for the processing result corresponding to the second issued instruction according to the second issued instruction.

[0216] For example, in a scenario where a simulated mobile phone makes a call, the second processing result is a successful call or a failed call.

[0217] In some possible embodiments, Figure 6 As shown, step 412 specifically includes:

[0218] Step 4122: According to the second issuing instruction, the second processing result corresponding to the second issuing instruction is obtained through the Hooked write function and the target library.

[0219] In this step, if Figure 3 As shown, the second function module of the first electronic device obtains the processing result corresponding to the second issuing instruction through the Hooked write function and the target library according to the second issuing instruction, obtains the second processing result and sends the second processing result to the third function module.

[0220] Exemplarily, the target library includes a scene library or a recording library.

[0221] For example, in a scenario simulating a mobile phone making a call, the second function module of the mobile phone searches the scene library for a processing result corresponding to the second instruction through a Hooked write function according to the second instruction, obtains the second processing result and sends the second processing result to the third function module.

[0222] Step 4124: Return the second processing result through the Hooked read function.

[0223] In this step, if Figure 3 As shown, the third function module of the first electronic device returns the second processing result to the first application through the Hooked read function.

[0224] For example, in a scenario where a mobile phone is simulating making a call, the third function module of the mobile phone returns a successful or failed call to the phone APP through a Hooked read function.

[0225] Step 414: Generate second prompt information according to the second processing result.

[0226] In this step, if Figure 3 As shown, the first application of the first electronic device generates second prompt information according to the second processing result, and sends the second prompt information to the screen.

[0227] For example, in a scenario where a simulated mobile phone makes a call, the phone APP of the mobile phone generates a prompt message of successful dialing or a prompt message of failed dialing according to the success or failure of the dialing, and sends the prompt message of successful dialing or the prompt message of failed dialing to the screen.

[0228] Step 416: Display the second prompt information.

[0229] In this step, if Figure 3 As shown, the screen of the first electronic device displays the second prompt information.

[0230] For example, in a scenario where a simulated mobile phone makes a call, the screen of the mobile phone displays a prompt message indicating a successful call or a prompt message indicating a failed call.

[0231] In the embodiment of the present invention, the execution order of steps 410-416 and steps 402-408 is not limited and they may exist independently.

[0232] In summary, the Vendorlib in electronic devices usually communicates with the modem through the read function or the write function, sends AT instructions through the write function, and reports AT instructions through the read function to realize communication service simulation. However, it involves a lot of interface piling, a large amount of development work, and high technical difficulty. Each major version of AOSP requires a lot of adaptation development, and the compatibility is insufficient. In addition, internal testing of communication-related services, third-party application development, or product demonstrations all require physical cards or dedicated communication laboratories or dedicated network equipment, which are complicated to operate and costly, and are not conducive to the development of communication test-related services. The message receiving method provided in the embodiment of the present invention uses LD_PRELOAD to replace the libc basic functions (such as open function, read function, write function, etc.) in the electronic device system, blocks or modifies the issuing instructions or reporting instructions, and finally realizes the communication service simulation. Since the code changes on Vendlib or Ril in the embodiment of the present invention do not affect the simulation capability, no adaptation is required, the code structure is simple, and less than 1K of code can realize full service simulation; in the scenario of internal testing of communication-related services (such as simulating SMS sending and receiving, making or answering calls), the mobile phone does not need to insert a card or use auxiliary equipment; in the test scenarios of simulating network registration, network roaming, signal strength, time zone update, etc., there is no need to build a communication laboratory environment or field verification, and the network signal scenario can be simulated.

[0233] In the technical solution of the message receiving method provided by an embodiment of the present invention, a first electronic device receives a first receiving instruction of a first message sent by a second electronic device; a second receiving instruction is obtained according to the first receiving instruction and a Hooked read function; according to the second receiving instruction, a first prompt information is generated to prompt that the first application has received the first message; and the first prompt information is displayed, which is simple to operate and low in cost, and is conducive to the development of communication test related businesses.

[0234] Figure 7 The first electronic device 500 is a schematic diagram of a structure of a first electronic device provided in an embodiment of the present invention. It should be understood that the first electronic device 500 can perform each step of the first electronic device in the above message receiving method. In order to avoid repetition, it is not described in detail here. The first electronic device 500 includes: a receiving unit 501, a processing unit 502 and a display unit 503.

[0235] The receiving unit 501 is configured to receive a first receiving instruction of a first message sent by a second electronic device.

[0236] The processing unit 502 is used to obtain a second receiving instruction according to the first receiving instruction and the Hooked read function; and generate first prompt information for prompting the first application to receive the first message according to the second receiving instruction.

[0237] The display unit 503 is configured to display the first prompt information.

[0238] Optionally, the processing unit 502 is specifically used to obtain a first sending instruction through a Hooked write function according to the first receiving instruction; obtain a first processing result of the first sending instruction through a modem according to the first sending instruction; and obtain a second receiving instruction through the Hooked read function according to the first processing result.

[0239] Optionally, the first message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message or a time zone update message.

[0240] Optionally, the processing unit 502 is also used to generate a second sending instruction for the second message in response to a user clicking operation on the first control of the second message in the first application; according to the second sending instruction, obtain a second processing result by searching the target library for a processing result corresponding to the second sending instruction; and generate a second prompt information according to the second processing result.

[0241] The display unit 503 is further configured to display the second prompt information.

[0242] Optionally, the second message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message or a time zone update message.

[0243] Optionally, the first control includes a send control, a dial control, a confirmation control, a registration control, a test control or an update control.

[0244] Optionally, the processing unit 502 is specifically configured to obtain, according to the second issuing instruction, the second processing result corresponding to the second issuing instruction through a Hooked write function and a target library; and return the second processing result through the Hooked read function.

[0245] Optionally, the target library includes a scene library or a recording library.

[0246] It should be understood that the first electronic device 500 here is embodied in the form of a functional unit. The term "unit" here can be implemented in software and / or hardware form, and is not specifically limited to this. For example, a "unit" can be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a proprietary processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit, and / or other suitable components that support the described functions.

[0247] Therefore, the units of each example described in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0248] The embodiment of the present application provides an electronic device, which may be a terminal device or a circuit device built into the terminal device. The electronic device may be used to execute the functions / steps in the above method embodiment.

[0249] An embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the functions / steps in the above method embodiment.

[0250] The embodiment of the present application also provides a computer program product comprising instructions, and when the computer program product is run on a computer or any at least one processor, the computer executes the functions / steps in the above method embodiment.

[0251] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

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

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

[0254] In several embodiments provided in the present application, any function can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0255] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A message receiving method, It is characterized in that Applied to a first electronic device, the method includes: Receiving a first receiving instruction of a first message sent by a second electronic device; Obtain a second receiving instruction according to the first receiving instruction and the Hooked read function; generating, according to the second receiving instruction, first prompt information for prompting the first application to receive the first message; The first prompt information is displayed.

2. The method according to claim 1, It is characterized in that The obtaining the second receiving instruction according to the first receiving instruction and the Hooked read function includes: According to the first receiving instruction, obtaining a first issuing instruction through a Hooked write function; According to the first issued instruction, obtaining, through a modem, a first processing result of the first issued instruction; According to the first processing result, a second receiving instruction is obtained through the Hooked read function.

3. The method according to claim 1 or 2, It is characterized in that The first message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message, or a time zone update message.

4. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: In response to a user clicking a first control of a second message in the first application, generating a second sending instruction of the second message; According to the second issued instruction, a second processing result is obtained by searching the target library for a processing result corresponding to the second issued instruction; generating second prompt information according to the second processing result; The second prompt information is displayed.

5. The method according to claim 4, It is characterized in that The second message includes a text message, a phone call, a network registration message, a network roaming message, a signal strength test message or a time zone update message.

6. The method according to claim 4 or 5, It is characterized in that The first control includes a send control, a dial control, a confirmation control, a registration control, a test control or an update control.

7. The method according to any one of claims 4 to 6, It is characterized in that The obtaining of the second processing result by searching the target library for the processing result corresponding to the second issuing instruction according to the second issuing instruction includes: According to the second issuing instruction, obtaining the second processing result corresponding to the second issuing instruction through the Hooked write function and the target library; The second processing result is returned through the Hooked read function.

8. The method according to claim 4, It is characterized in that The target library includes a scene library or a recording library.

9. A message receiving system, It is characterized in that include: The second electronic device is used to send a first receiving instruction of a first message to the first electronic device; The first electronic device is used to obtain a second receiving instruction according to the first receiving instruction and a Hooked read function, generate first prompt information for prompting the first application to receive the first message according to the second receiving instruction, and display the first prompt information.

10. An electronic device, It is characterized in that The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and the computer program comprises program instructions. When the processor runs the program instructions, the electronic device executes the steps of the method as claimed in any one of claims 1 to 8.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program request is executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 8.