WO2021018005A1 - 一种跨进程通信方法、装置及设备 - Google Patents

一种跨进程通信方法、装置及设备 Download PDF

Info

Publication number
WO2021018005A1
WO2021018005A1 PCT/CN2020/103876 CN2020103876W WO2021018005A1 WO 2021018005 A1 WO2021018005 A1 WO 2021018005A1 CN 2020103876 W CN2020103876 W CN 2020103876W WO 2021018005 A1 WO2021018005 A1 WO 2021018005A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
service interface
file
version
interface
Prior art date
Application number
PCT/CN2020/103876
Other languages
English (en)
French (fr)
Inventor
徐吉
毛天阳
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20846960.1A priority Critical patent/EP3992796A4/en
Publication of WO2021018005A1 publication Critical patent/WO2021018005A1/zh
Priority to US17/649,280 priority patent/US11853820B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery

Definitions

  • This application relates to the field of terminal technology, and in particular to a cross-process communication method, device and equipment.
  • the Android system uses an Android interface definition language (AIDL) to open the interface of the services provided by this application, and provide developers through AIDL tool that automatically converts AIDL files (usually .AIDL files) written by AIDL into intermediate files (usually .java files).
  • the AIDL tool is integrated into the Android Studio (Android development platform) tool chain, which is automatically triggered and executed during compilation.
  • the AIDL tool provides this intermediate file to other applications and this application, and other applications and this application integrate the JAVA file into its own project to implement cross-process invocation services.
  • the embodiments of the present application provide a cross-process communication method, device, and equipment to improve the compatibility of AIDL files of different versions and improve the reliability of cross-process invocation services.
  • an embodiment of the present application provides a cross-process communication method, which is applicable to terminal devices, and the method includes: at least one second application program sends an access request to the first application program through cross-process communication, and the access request uses To request access to the service of the first application, the access request includes an identifier uniquely corresponding to the target service interface of the service. Then the first application program determines the target service interface according to the identifier, and executes the method object corresponding to the target service interface to generate an execution result.
  • this method is based on a new AIDL file conversion method to achieve cross-process communication, which can improve the reliability of cross-process invocation of services to a certain extent.
  • the method before at least one second application program sends an access request to the first application program through cross-process communication, the method further includes:
  • At least one second application program determines the identifier uniquely corresponding to the attribute information of the target service interface through the first JAVA file; wherein the attribute information includes at least one of the interface name and interface parameter type of the target service interface, and the first JAVA
  • the file corresponds to the Android interface definition language AIDL file of the first version of the first application. Then the first application program determines the target service interface according to the identifier, in a specific manner: the first application program determines the target service interface corresponding to the identifier through the second JAVA file, and the second JAVA file and the first application program Corresponding to the AIDL file of the second version.
  • the second application program can access the service in the first application program based on the identifier uniquely corresponding to the service interface.
  • the identifier uniquely corresponding to the attribute information of the target service interface is a hash value obtained by performing a hash operation on at least one of the interface name and interface parameter type of the target service interface.
  • the first JAVA file is obtained by converting the AIDL file of the first version according to the set rules
  • the second JAVA file is obtained by converting the AIDL file of the second version according to the set rules
  • the setting rules include: obtaining the attribute information of each service interface from the AIDL file of the first version of the first application, and determining the identifier uniquely corresponding to each service interface according to the attribute information of each service interface; Convert the AIDL file into a JAVA file by describing the unique identifier corresponding to each service interface.
  • the embodiments of the present application provide an AIDL file conversion method, which is applied to a device with development functions.
  • the method includes: the device obtains the attribute information of the service interface from the AIDL file of the first application, and the device obtains the attribute information of the service interface according to the The attribute information of the service interface determines the identifier uniquely corresponding to the service interface, and then converts the AIDL file into a JAVA file according to the identifier uniquely corresponding to the service interface.
  • this method can improve the compatibility of AIDL files of different versions, and to a certain extent can improve the reliability of calling services across processes.
  • the attribute information includes at least one of interface name and interface parameter type.
  • the device determines the identifier uniquely corresponding to the service interface according to the attribute information of the service interface, and the specific method is: hash operation on at least one of the interface name and interface parameter type of the service interface to generate a hash value corresponding to the service interface , Where different service interfaces have different hash values, and the same service interface has the same hash value.
  • the device converts the AIDL file into a JAVA file according to the identifier uniquely corresponding to the service interface.
  • the specific method is to convert the AIDL file into a JAVA file according to the hash value corresponding to the service interface.
  • the device can determine the hash value uniquely corresponding to the interface through the foregoing method, thereby ensuring that the service in the first application can be accessed normally.
  • the device also sends the JAVA file to the server corresponding to at least one second application, and the at least one application is an application that accesses the service in the first application.
  • the device sends the JAVA file to the second application, so that the second application can access the services of the first application.
  • an embodiment of the present application provides a terminal device, including a processor and a memory.
  • the memory is used to store one or more computer programs; when one or more computer programs stored in the memory are executed by the processor, the terminal device can implement any one of the possible design methods of the first aspect.
  • an embodiment of the present application further provides a device, which includes a module/unit that executes any one of the possible design methods in the first aspect.
  • modules/units can be realized by hardware, or by hardware executing corresponding software.
  • an embodiment of the present application provides a device including a processor and a memory.
  • the memory is used to store one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the device can implement any one of the possible design methods of the second aspect.
  • an embodiment of the present application further provides a device, which includes a module/unit that executes any one of the possible design methods of the second aspect.
  • modules/units can be realized by hardware, or by hardware executing corresponding software.
  • an embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium includes a computer program.
  • the computer program runs on an electronic device, the electronic device executes any of the above aspects. Any one of the possible design methods.
  • the embodiments of the present application also provide a method that includes a computer program product, which when the computer program product runs on a terminal, causes the electronic device to perform any one of the possible designs in any of the foregoing aspects.
  • FIG. 1 is a schematic diagram of a communication system provided by an embodiment of this application.
  • FIG. 2 is a schematic structural diagram of a device with development functions provided by an embodiment of the application.
  • FIG. 3 is a schematic flowchart of an AIDL file conversion method provided by an embodiment of the application.
  • FIG. 4 is a schematic flowchart of a cross-process communication method provided by an embodiment of this application.
  • FIG. 5 is a schematic diagram of another cross-process communication method provided by an embodiment of this application.
  • FIG. 6 is a schematic diagram of another cross-process communication method provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of another cross-process communication method provided by an embodiment of this application.
  • FIG. 8 is a schematic diagram of another cross-process communication method provided by an embodiment of this application.
  • FIG. 9 is a schematic flowchart of an AIDL file conversion method provided by an embodiment of the application.
  • FIG. 10 is a schematic structural diagram of a mobile phone provided by an embodiment of this application.
  • Figure 11 is a schematic structural diagram of an Android operating system provided by an embodiment of the application.
  • FIG. 12 is a schematic structural diagram of a terminal device provided by an embodiment of this application.
  • Cross-process communication refers to the communication between multiple applications installed on the same terminal device. That is to say, one or more applications installed by the terminal device access another application installed by it, and the first application to be accessed will also be expressed as a local application or a service (Service) in the following to access the first application
  • Service service
  • the second application of the program is expressed as a third-party application or client.
  • AIDL files are manually written by developers.
  • the operating system can convert AIDL files into JAVA files through the AIDL conversion tool.
  • System software package refers to the installation package of system software.
  • System software is the interface between computer hardware and users.
  • the most representative system software is the operating system, such as Windows 7, Android 6.0.
  • Application software package refers to the installation package of the application running on the operating system.
  • Application installation packages are related to specific applications and are customized and developed by developers according to the specific needs of users, such as Meitu Xiuxiu and Beauty Camera.
  • An IDE is an application program used in a program development environment, which generally includes a code editor, a compiler, a regulator, and a graphics tool.
  • a code editor for example, the Xcode programming software on the iOS system and the Eclipse programming software on the Android system are typical IDEs.
  • each interface in the AIDL file is assigned a serial number that continuously increases from 1, and these serial numbers are defined in the constants of the JAVA file.
  • the first version of the AIDL file defines three service interfaces provided externally by the camera application, namely, the aperture service interface (void Aperture), the portrait service interface (void Portrait), and the night scene service interface (void Nightscape).
  • the existing AIDL conversion tool converts the first version of the AIDL file, it will assign serial numbers 1, 2 and 3 to the aperture service interface, the portrait service interface and the night view service interface in turn, and convert the JAVA file of the first version, that is, the first
  • the corresponding relationship between the service interface and the serial number in the version of the JAVA file is shown in Table 1.
  • Service interface Serial number Aperture Service Interface (void Aperture) 1 Portrait Service Interface (void Portrait)) 2 Nightscape service interface (void Nightscape) 3
  • the second version of the AIDL file defines two service interfaces provided by the camera application externally, namely the portrait service interface (void Portrait) and Nightscape service interface (void Nightscape). That is, the developer deleted the void aperture service interface (void Aperture) when writing the second version of the AIDL file.
  • the existing AIDL conversion tool converts the second version of the AIDL file, it will assign serial numbers 1, 2 to the portrait service interface and the night scene service interface in turn, and convert the second version of the JAVA file, that is, the second version of the JAVA file
  • Table 2 The corresponding relationship between service interface and serial number is shown in Table 2.
  • the mobile phone integrates the first JAVA file in the application software package obtained from a third-party application server (such as the beauty camera application server) (the first JAVA file is obtained by converting the first version of the AIDL file), and the mobile phone’s
  • the second JAVA file is integrated in the system software package (the second JAVA file is converted by compiling the second version of the AIDL file).
  • the mobile phone installs the application software package and runs the third-party application.
  • the third-party application calls the camera application's nightscape service interface (void Nightscape)
  • the third-party application uses the first JAVA file to determine the interface name corresponding to the nightscape service interface (void Nightscape)
  • the serial number of is 3, and the call request sent by the third-party application to the camera application includes serial number 3.
  • the camera application searches for the second JAVA file to determine that there is no service interface corresponding to serial number 3, so the camera The application reports back to the third-party application the call result that the function is not available.
  • third-party applications cannot be used normally in the hardware environment where the night view function of the mobile phone is actually available due to the failure of the service interface docking.
  • Third-party applications can only present users with poor shooting quality, which seriously affects the user experience.
  • an embodiment of the present application provides an AIDL file conversion method, which can be applied to a device with a compiling function.
  • the method includes: the device obtains the attribute information of the service interface from the AIDL file of the first application, and the service The interface is one or more service interfaces provided by the first application program.
  • the device determines the identifier uniquely corresponding to the service interface according to the attribute information of the service interface, and then the device converts the AIDL file into a JAVA file according to the identifier uniquely corresponding to the service interface.
  • the third-party application can determine the attribute information of the called service interface through the JAVA file The unique corresponding identifier, and then the call request sent by the third-party application to the local application includes the unique corresponding identifier. Assuming that the version number of the JAVA file integrated in the local application is higher than the version number of the JAVA file integrated by the third-party application, the local application can determine the service interface corresponding to the identifier through the JAVA file integrated by the local application, and then execute the service interface correspondence Method object, and feedback the execution result to the third-party application.
  • the embodiment of this application improves the AIDL tool that comes with Android.
  • the improved AIDL tool can execute the software program corresponding to the above-mentioned AIDL file conversion method, and the AIDL file is converted into JAVA by the improved AIDL tool.
  • File, the JAVA file is integrated in the system software package of the local application and the application software package of the third-party application.
  • a local application is an application that comes with the system
  • a third-party application is an application newly created by a developer, and the owner of the application is not the system manufacturer or the device manufacturer that runs the application.
  • the local application can still determine the corresponding service interface based on the corresponding relationship between the service interface and the identifier in the JAVA file and using the identifier in the call request sent by the third-party application. Therefore, this method can improve the compatibility of different versions of AIDL files, and to a certain extent can improve the reliability of cross-process calling services.
  • an embodiment of the present application provides a communication system.
  • the communication system includes a device 100, a terminal device 200, and a server 300.
  • the terminal device 200 and the device 100 can be directly connected through a data line or can communicate with each other through a communication network.
  • the device 100 and the server 300 communicate through the network.
  • the device 100 is installed with an integrated development environment (IDE) for compiling and generating the system software package of the terminal device 200;
  • the server 300 is a third-party application server for compiling and generating the application software package of the third-party application.
  • IDE integrated development environment
  • the communication network may be a local area network or a wide area network switched by a relay device.
  • the communication network may be a short distance communication network such as a wifi hotspot network, a wifi direct network, a Bluetooth network, a zigbee network, or a near field communication (NFC) network.
  • the communication network may be a 3rd-generation wireless telephone technology (3G) network, or the 4th generation mobile communication technology (4G). ) Network, the fifth-generation mobile communication technology (5G) network, the future evolution of the public land mobile network (PLMN) or the Internet, etc.
  • the device 100 uses the integrated AIDL conversion tool described above to obtain the attribute information of the service interface from the AIDL file of the local application.
  • the attribute information of the device determines the identifier uniquely corresponding to the service interface, and then converts the AIDL file into a JAVA file according to the identifier uniquely corresponding to the service interface, and the JAVA file is integrated in the system software package in the device 100.
  • the device 100 also provides the JAVA file to the server 300, and the server 300 integrates the JAVA file into the application software package of the third-party application.
  • the terminal device 200 downloads the updated system software package from the device 100, and then saves it locally, and updates the installed local applications on the terminal device 200.
  • the terminal device 200 downloads the updated application software package from the server 300, and then saves it locally, and updates the installed third-party applications on the terminal device 200.
  • the version updates of the two may be different, the third-party application is compared with the local application , There is a certain lag in the version update of AIDL files.
  • the device 100 may be a server with a compiling function or a cloud server.
  • FIG. 2 shows a block diagram of a part of the structure of a device 100 related to various embodiments of the present application.
  • the device 100 may include a processor 201, a memory 202, and a transceiver 203.
  • the one or more computer programs are stored in the aforementioned memory 201 and configured to be executed by the one or more processors 202.
  • the processor 201 can be a central processing unit (CPU) or a digital processing unit.
  • the processor 201 is the control center of the device 100. It uses various interfaces and lines to connect various parts of the entire device 100. Or execute the computer program stored in the memory 202 and call the data stored in the memory 202 to perform various functions and data processing of the device 100.
  • the memory 202 is used to store a computer program to be run. If the device 100 is a cloud server, the memory 202 also stores a compilation result generated by the Android operating system obtained from a server with a compilation function. The compilation result includes The JAVA file is generated by the improved AIDL tool to convert the AIDL file. In addition, if the device 100 is a server with a compiling function, the memory 202 stores the Android operating system source code and the compilation result generated by compiling the Android operating system source code. The compilation result includes JAVA files, and the JAVA files are generated by the improved AIDL tool to convert the AIDL files.
  • the transceiver 203 is configured to send the JAVA file generated by the processor 201 to the server 300 corresponding to the third-party application.
  • the processor 201 is configured to integrate executable files into the Android software package of the local application, and the transceiver 203 is also configured to send the Android software package of the local application to the terminal device 200.
  • connection medium between the processor 201 and the memory 202 described above is not limited in the embodiment of the present application.
  • the memory 202, the processor 201, and the transceiver 203 are connected by a bus 204 in FIG. 2, and the bus is represented by a thick line in FIG. 2.
  • the connection mode between other components is only for schematic illustration. , Is not limited.
  • the bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in FIG. 2, but it does not mean that there is only one bus or one type of bus.
  • the memory 202 may be a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 203 may also be a non-volatile memory (non-volatile memory), such as a read-only memory, Flash memory (flash memory), hard disk drive (HDD) or solid-state drive (SSD), or memory 202 can be used to carry or store program codes in the form of instructions or data structures and can be used by Any other medium accessed by the computer, but not limited to this.
  • the memory 203 may be a combination of the above-mentioned memories.
  • FIG. 3 a schematic flowchart of an AIDL file conversion method is provided for this embodiment of the application.
  • the method may be executed by the device 100.
  • the specific steps are as follows.
  • Step 301 The device 100 obtains the attribute information of the service interface from the AIDL file of the first application.
  • the service interface is one or more service interfaces provided by the first application program, and one or more applications installed on the terminal device can access another installed application.
  • the first application program in the embodiment of the present application refers to Applications accessed by other applications, generally the first application refers to the application that comes with the system.
  • the first application can be expressed as a local application or a service.
  • the first application program may be a camera application, a call application, a short message application, etc. in a smart phone.
  • the attribute information may be at least one of the interface name and interface parameter type of the service interface.
  • the interface parameter type can be integer, character, byte, boolean, etc.
  • the aperture service interface void execAperture() ⁇ &image ⁇ in the camera application has an interface name of execAperture(), and the interface parameter type is &image (original image address), which is byte type.
  • Step 302 The device 100 determines an identifier uniquely corresponding to the service interface according to the attribute information of the service interface.
  • the identifier uniquely corresponding to the service interface can be a string, a hash value, or a random value.
  • the device 100 uses a hash function to perform a hash operation on at least one of the interface name of the service interface and the interface parameter type to generate a hash value corresponding to the service interface, where the hash values of different service interfaces Different, the hash value of the same service interface is the same.
  • Manner 2 The device 100 uses at least one of the interface name of the service interface and the interface parameter type as a random seed, and uses a random function to generate a random value.
  • Step 303 The device 100 converts the AIDL file into a JAVA file according to the identifier uniquely corresponding to the service interface.
  • the AIDL file is the service interface and data declaration of the first application.
  • the AIDL conversion tool in the device 100 generates a JAVA file from the AIDL file according to the identifier uniquely corresponding to the service interface.
  • the generated JAVA file will be packaged into the system software package of the first application.
  • the device 100 defines these three service interfaces of the camera application in the first version of the AIDL file.
  • the first version of the AIDL file is shown in Table 3.
  • the AIDL conversion tool converts the AIDL file of the first version into the JAVA file of the first version as shown in Table 4.
  • the device 100 packages the JAVA file of the first version into a system software package. If the user's mobile phone performs a software update, the mobile phone obtains the system software package including the JAVA file of the first version from the device 100 and saves it locally. Further, the device 100 also sends the generated JAVA file of the first version to the server 300 corresponding to at least one second application, and the server 300 packages the JAVA file of the first version into the application software package of the second application.
  • the second application refers to an application that accesses services in the first application, also known as a third-party application or client.
  • the first application is a camera application in a mobile phone
  • the second application is a beauty camera application.
  • the device 100 sends the JAVA file of the first version shown in Table 4 to the server 300 of the beauty camera application, and the server 300 packages the JAVA file of the first version into the application software package of the beauty camera application.
  • the user updates the beauty camera application in the mobile phone, and the mobile phone obtains the application software package including the JAVA file of the first version from the server 300 and saves it locally.
  • the beauty camera application uses the JAVA file of the first version to determine that the hash value corresponding to the interface name of the aperture service interface is 0XF6457850, so the hash value sent to the camera application is 0XF6457850
  • the camera application determines through the first version of the JAVA file that the service interface corresponding to the hash value 0XF6457850 is execAperture(), so the camera application executes the method object of the execAperture(), generates the execution result, and sends the execution result to Beauty camera application.
  • the device 100 defines the remaining two service interfaces of the camera application to the AIDL of the second version File. Then the AIDL conversion tool converts the AIDL file of the second version into the JAVA file of the second version as shown in Table 5. The device 100 packages the JAVA file of the second version into the APK of the camera application. If the user updates the camera application in the mobile phone, the mobile phone obtains the APK including the JAVA file of the second version from the device 100 and saves it locally.
  • the device 100 also sends the generated JAVA file of the second version to the server 300 corresponding to at least one second application, and the server 300 packages the JAVA file of the second version into the APK of the second application.
  • the beauty camera application uses the JAVA file of the first version to determine that the hash value corresponding to the interface name of the night scene service interface is 0X98342122, so the beauty camera application sends the information including the scatter to the camera application.
  • the column value is the call request of 0X98342122.
  • the camera application determines through the JAVA file of the second version that the service interface corresponding to the hash value 0X98342122 is execNightscape(), so the camera application executes the method object of execNightscape(), generates the execution result, and The execution result is sent to the beauty camera application.
  • the second application program that accesses the first application program uses a low-version JAVA file
  • the second application program can still normally access the first application program with a high-version JAVA file.
  • the method provided in the embodiments of the present application can improve the compatibility of AIDL files of different versions and improve the reliability of calling services across processes.
  • an embodiment of the present application also provides a schematic flow diagram of a cross-process communication method. As shown in FIG. 4, the method is suitable for terminal devices including at least two application programs. The specific steps are as follows.
  • Step 401 The second application program sends an access request to the first application program through cross-process communication.
  • the access request is used to request access to the service of the first application, and the access request includes an identifier uniquely corresponding to the target service interface of the service.
  • One or more applications installed on a terminal device can access another installed application.
  • the first application in the embodiment of the present application refers to an application accessed by other applications, and generally the first application refers to an application that comes with the system.
  • the first application can be expressed as a local application or a service.
  • the first application program may be a camera application, a call application, a short message application, etc. in a smart phone.
  • the second application refers to an application that accesses a service in the first application, and is also called a third-party application or client.
  • the first application is a camera application and the second application is a beauty camera application.
  • the beauty camera application sends an access request to access the aperture service interface void execAperture() through the cross-process communication camera application.
  • the access request is Including the unique identifier corresponding to the aperture service interface void execAperture().
  • the identifier can be a string, a hash value, or a random value. Refer to the description of step 303 for the method of generating the identifier, and the details are not repeated here.
  • Step 402 The first application program determines the target service interface according to the identifier, and executes the method object corresponding to the target service interface to generate an execution result.
  • the camera application determines that the target service interface is void execAperture() according to the identifier in the access request. Therefore, the camera application executes the method object of the service interface and generates the execution result.
  • the second application before the second application sends an access request to the first application through cross-process communication, the second application first determines through the first version of the JAVA file that it uniquely corresponds to the attribute information of the target service interface logo.
  • the beauty camera application first determines the identifier uniquely corresponding to the attribute information of the aperture service interface through the first version of the JAVA file.
  • the attribute information includes at least one of the interface name of the target service interface and the interface parameter type.
  • the target service interface is the aperture service interface void execAperture() ⁇ &image ⁇
  • the interface name of the aperture service interface is execAperture()
  • the interface parameter type is &image (The original image address).
  • the beauty camera determines that the unique identifier corresponding to the attribute information of the aperture service interface is 0XF6457850.
  • the first application program determines the target service interface corresponding to the identifier through the second version JAVA file, wherein the second version JAVA file corresponds to the second version AIDL file of the first application program.
  • the camera application determines the void execAperture corresponding to the identifier 0XF6457850 through the second version JAVA file.
  • the improved AIDL conversion tool in the device 100 compares the first version AIDL file (Icamera.aidl shown in Table 3) 501 in FIG. 5 Perform the conversion to generate the first version JAVA file (Icamera.java shown in Table 4) 502.
  • Case 1 The beauty camera application calls the aperture service interface void Aperture(), that is, the beauty camera uses the first version JAVA file 502 to determine that the identifier corresponding to the aperture service interface void Aperture() is 0XF6457850, and then the beauty camera application sends the camera application Send an access request.
  • the access request includes the identifier corresponding to voidAperture() 0XF6457850.
  • the camera application determines through the first version of the JAVA file 502 that the one that matches 0XF6457850 is void execAperture() ⁇ ... ⁇ , so the method object of this interface is executed and the execution result is generated.
  • Case 2 The beauty camera application calls the portrait service interface voidPortrait(), that is, the beauty camera determines through the first version of JAVA file 502 that the identifier corresponding to the portrait service interface voidPortrait() is 0X21153431, and then the beauty camera application sends the camera application Send an access request, the access request includes the identifier corresponding to void Portrait() 0XF6457850.
  • the camera application determines through the first version of the JAVA file 502 that the 0X21153431 match is void exec Portrait() ⁇ ... ⁇ , so the method object of this interface is executed and the execution result is generated.
  • the beauty camera application calls the night scene service interface void NightScape(), that is, the beauty camera determines through the first version JAVA file 502 that the identifier corresponding to the night scene service interface void NightScape() is 0X98342122, and then the beauty camera application sends the camera application Send an access request, the access request includes the identifier corresponding to void NightScape() is 0X98342122.
  • the camera application determines through the first version JAVA file 502 that the match 0X98342122 is void exec NightScape() ⁇ ... ⁇ , so the method object of the service interface is executed, and the execution result is generated.
  • the developer deletes the aperture service interface in the first version of the AIDL file, and generates the second version of the AIDL file.
  • the improved AIDL conversion tool in the device 100 performs the second version of the AIDL file in Figure 6 (601 in Figure 6) Convert to generate the second version of JAVA file (602 in Figure 6).
  • the device 100 does not send the JAVA file of the second version to the server 300, that is, the APK of the beauty camera application does not include the AIDL file of the second version, and is still the AIDL file of the first version.
  • Case 1 When the beauty camera application accesses the camera application’s voidPortrait(), the first version JAVA file 502 can still be used to determine that the identifier corresponding to the portrait service interface voidPortrait() is 0X21153431, and then the beauty camera application sends the camera application Send an access request, the access request includes the identifier corresponding to void Portrait() 0XF6457850.
  • the camera application determines through the second version of the JAVA file 602 that the one that matches 0X21153431 is void exec Portrait() ⁇ ... ⁇ , so the method object of the service interface is executed, and the execution result is generated.
  • Case 2 When the beauty camera application accesses the night scene service interface void NightScape() of the camera application, it can still be determined through the first version JAVA file 502 that the identifier corresponding to the night scene service interface void NightScape() is 0X98342122, and then the beauty camera application Send an access request to the camera application, the access request includes the identifier corresponding to void NightScape() 0X98342122.
  • the camera application determines through the second version of the JAVA file 602 that the match 0X98342122 is void exec NightScape() ⁇ ... ⁇ , so the method object of the service interface is executed, and the execution result is generated.
  • the improved AIDL conversion tool in the device 100 compares the second version of the AIDL file in Figure 7 (as shown in the figure). 701) in 7) is converted to generate the second version of JAVA file (702 in Figure 7). Assuming that the device 100 does not send the JAVA file of the second version to the server 300, that is, the APK of the beauty camera application does not include the AIDL file of the second version, and is still the AIDL file of the first version.
  • Case 1 The beauty camera application calls the aperture service interface void Aperture(), that is, the beauty camera uses the first version JAVA file 502 to determine that the identifier corresponding to the aperture service interface void Aperture() is 0XF6457850, and then the beauty camera application sends the camera application Send an access request.
  • the access request includes the identifier corresponding to voidAperture() 0XF6457850.
  • the camera application determines through the second version of the JAVA file 702 that the 0XF6457850 match is void execAperture() ⁇ ... ⁇ , so the method object of this interface is executed and the execution result is generated.
  • Case 2 The beauty camera application calls the portrait service interface voidPortrait(), that is, the beauty camera determines through the first version of JAVA file 502 that the identifier corresponding to the portrait service interface voidPortrait() is 0X21153431, and then the beauty camera application sends the camera application Send an access request, the access request includes the identifier corresponding to void Portrait() 0XF6457850.
  • the camera application determines through the second version of the JAVA file 702 that the 0X21153431 match is void exec Portrait() ⁇ ... ⁇ , so the method object of this interface is executed and the execution result is generated.
  • the beauty camera application calls the night scene service interface void NightScape(), that is, the beauty camera determines through the first version JAVA file 502 that the identifier corresponding to the night scene service interface void NightScape() is 0X98342122, and then the beauty camera application sends the camera application Send an access request, the access request includes the identifier corresponding to void NightScape() is 0X98342122.
  • the camera application determines through the second version of the JAVA file 702 that the match 0X98342122 is void exec NightScape() ⁇ ... ⁇ , so the method object of this interface is executed and the execution result is generated.
  • the improved AIDL conversion tool in the device 100 compares the second version of the AIDL file in Figure 8 (as shown in Figure 8).
  • Step 801) perform conversion to generate the second version of JAVA file (802 in Figure 8).
  • the device 100 does not send the JAVA file of the second version to the server 300, that is, the APK of the beauty camera application does not include the AIDL file of the second version, and is still the AIDL file of the first version.
  • Case 1 The beauty camera application calls the aperture service interface void Aperture(), that is, the beauty camera uses the first version JAVA file 502 to determine that the identifier corresponding to the aperture service interface void Aperture() is 0XF6457850, and then the beauty camera application sends the camera application Send an access request.
  • the access request includes the identifier corresponding to voidAperture() 0XF6457850.
  • the camera application determines through the second version of the JAVA file 802 that the one that matches 0XF6457850 is void execAperture() ⁇ ... ⁇ , so the method object of this interface is executed to generate the execution result.
  • Case 2 The beauty camera application calls the portrait service interface voidPortrait(), that is, the beauty camera determines through the first version of JAVA file 502 that the identifier corresponding to the portrait service interface voidPortrait() is 0X21153431, and then the beauty camera application sends the camera application Send an access request, the access request includes the identifier corresponding to void Portrait() 0XF6457850.
  • the camera application determines through the second version of the JAVA file 802 that the one that matches 0X21153431 is void execPortrait() ⁇ ... ⁇ , so the method object of this interface is executed and the execution result is generated.
  • the beauty camera application calls the night scene service interface void NightScape(), that is, the beauty camera determines through the first version JAVA file 502 that the identifier corresponding to the night scene service interface void NightScape() is 0X98342122, and then the beauty camera application sends the camera application Send an access request, the access request includes the identifier corresponding to void NightScape() is 0X98342122.
  • the camera application determines through the second version of the JAVA file 802 that the match 0X98342122 is void exec NightScape() ⁇ ... ⁇ , so the method object of this interface is executed and the execution result is generated.
  • the client can access the service in the server based on the identifier uniquely corresponding to the service interface.
  • Interface compatibility in the conventional sense in software means that the interface name and interface form remain unchanged, while the order and number of interfaces are allowed to change with the evolution of the version.
  • software designers can design and upgrade software interfaces according to conventional compatibility methods, instead of worrying about incompatibility caused by interface sequence changes and interface quantity changes The problem.
  • the method provided in the embodiments of the present application improves the reliability of calling services across processes to a certain extent.
  • an embodiment of the present application provides an AIDL file conversion device.
  • the device may be the improved AIDL conversion tool described above.
  • the device may be integrated in the device 100, and the device includes: an acquisition unit 901, a processing unit 902, and a conversion unit 903.
  • the obtaining unit 901 is used to obtain the attribute information of each service interface in the AIDL file of the first application program
  • the processing unit 902 is used to determine the identifier uniquely corresponding to each service interface according to the attribute information of each service interface
  • the unit 903 is configured to convert the AIDL file into a JAVA file according to the identifier uniquely corresponding to each service interface.
  • the attribute information includes at least one of an interface name and an interface parameter type; the processing unit 902 is specifically configured to: perform a hash operation on at least one of the interface name and interface parameter type of each service interface, A hash value corresponding to each service interface is generated, where the hash value of different service interfaces is different, and the hash value of the same service interface is the same.
  • the conversion unit 903 is specifically configured to: convert the AIDL file into a JAVA file according to the hash value corresponding to each service interface.
  • the memory 202 in FIG. 2 includes a computer program corresponding to the foregoing device, and the processor 201 is configured to execute the functions of the obtaining unit 901, the processing unit 902, and the conversion unit 903.
  • the terminal device 200 may be a portable device, such as a mobile phone, a tablet computer, a wearable device with wireless communication function (such as a smart watch), and so on.
  • portable devices include but are not limited to carrying Or portable devices with other operating systems.
  • FIG. 10 shows a block diagram of a partial structure of a terminal device 200 related to various embodiments of the present invention.
  • the terminal device 200 is a mobile phone, which includes: an RF (radio frequency) circuit 1001, a Wi-Fi system module 1002, a memory 1003, an input unit 1004, a display unit 1005, a processor 1006, and an audio circuit 1007 and power supply 1008 and other components.
  • RF radio frequency
  • the structure of the mobile phone shown in FIG. 10 does not constitute a limitation on the mobile phone, and may include more or less components than those shown in the figure, or combine some components, or arrange different components.
  • terminal device 200 The components of the terminal device 200 will be specifically introduced below in conjunction with FIG. 10:
  • the Wi-Fi system module 1002 is used to scan for Wi-Fi access points in the surrounding environment of the terminal device 200 to obtain relevant information, so that the terminal device 200 can access the Wi-Fi access point according to the relevant information.
  • the RF circuit 1001 is used to send and receive information or receive and send signals during a call. In particular, after receiving the downlink information of the base station, it is sent to the processor 1006 for processing. In addition, the uplink data is sent to the base station.
  • the RF circuit 1001 is connected to the Wi-Fi antenna of the Wi-Fi system module, and controls the Wi-Fi antenna to scan the Wi-Fi network.
  • the RF circuit 1001 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like.
  • the RF circuit 1001 can also communicate with the network and other devices through wireless communication.
  • the memory 1003 is used to store the software program of the terminal device 200.
  • the memory 1003 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the processor 1006 is the control center of the terminal device 200. It uses various interfaces and lines to connect the various parts of the entire mobile phone, and executes the terminal device by running or executing the software program stored in the memory 1003 and calling the data stored in the memory 1003. 200's various functions and data processing.
  • the above-mentioned processor 1006 may include one or more processing units; preferably, the processor 1006 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, and application programs, etc.
  • the modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 1006.
  • the input unit 1004 may be used to receive inputted numeric or character information, and generate key signal inputs related to user settings and function control of the terminal device 200.
  • the input unit 1004 may include a touch screen and other input devices.
  • the touch screen is also called a touch panel, which can collect user touch operations on or near it and drive the corresponding connection device according to a preset program.
  • Other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control button, a power switch button, etc.), a trackball, a mouse, and a joystick.
  • the display unit 1005 may be used to display information input by the user or information provided to the user and various menus of the mobile phone 200.
  • the display unit 1005 may include a display panel, and optionally, the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc.
  • LCD Liquid Crystal Display
  • OLED Organic Light-Emitting Diode
  • the audio circuit 1007 is connected to a speaker and a microphone, and can provide an audio interface between the user and the mobile phone 200.
  • the audio circuit 1007 can transmit the electric signal after the conversion of the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electric signal, which is converted into an electric signal after being received by the audio circuit
  • the audio data is then output to the RF circuit 1001 to be sent to, for example, another mobile phone, or the audio data is output to the memory 1003 for further processing.
  • the mobile phone 200 also includes a power source 1008 (such as a battery) for supplying power to various components.
  • a power source 1008 such as a battery
  • the power source can be logically connected to the processor 1006 through a power management system, so that functions such as charging, discharging, and power consumption management can be managed through the power management system.
  • the terminal device 200 may also include a Bluetooth module, a sensor, a GPS, etc., which will not be repeated here.
  • the software system of the terminal device 200 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
  • the embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the terminal device 200.
  • FIG. 11 is a software structure block diagram of a terminal device 200 according to an embodiment of the present invention.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • 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.
  • the application layer can include a series of application packages.
  • the application package can include local applications and third-party applications.
  • the local applications are camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the third-party application is Beauty Camera, Meitu Xiuxiu, WeChat, Weibo and other applications.
  • the application framework layer provides application programming interfaces (application programming interface, API) and programming frameworks for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer includes the method class corresponding to the aperture service interface (void Aperture) provided by the camera application, the method class corresponding to the portrait service interface (void Portrait), and the method class corresponding to the night scene service interface (void Nightscape).
  • the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, service manager, Binder interface based on Java language, etc. .
  • the Binder interface uses JNI to call the Binder runtime library in the system library to provide inter-process communication services for applications in the application layer.
  • the third-party application in the application layer sends access requests to the local application through the Binder interface
  • the Binder interface in the application framework layer uses JNI to call the Binder runtime library in the system library to serve as the third-party application in the application layer.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include video, image, audio, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text and controls that display pictures.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the terminal device 200. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can disappear automatically after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • 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.
  • the virtual machine executes the first JAVA file in the application software package of the third-party application and the second JAVA file in the system software package as binary files.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • 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.
  • the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes the camera operation into the original input event (including touch coordinates, time stamp of the touch operation, etc.).
  • the original input events are stored in the kernel layer.
  • the application framework layer obtains the original input events from the kernel layer.
  • the service manager calls the application framework layer to establish a binding relationship with the beauty camera application.
  • the service in the local camera application that is, the service manager sends an access request to the local camera application through the Binder interface, where the access request carries the command code uniquely corresponding to the target service interface obtained by the beauty camera application from the JAVA file, and Command parameters, etc.
  • the target service interface is a portrait service interface (void Portrait)
  • the service of the local camera application receives the access request, on the one hand, it starts the camera driver at the kernel layer to start capturing the original image; on the other hand, it enables the beauty of the portrait scene.
  • the color algorithm performs face detection on the image, and performs secondary processing and rendering according to the specified parameters.
  • the service of the local camera application passes the processed and synthesized image to the beauty camera application through a predefined callback interface (similar to the above Binder interface, but with the requester/receiver role exchange), and the beauty camera application will get The portrait image is displayed on the interface.
  • the embodiments of the present application disclose a terminal device.
  • the terminal device may include a touch screen 1201, where the touch screen 1201 includes a touch panel 1206 and a foldable display Screen 1207; one or more processors 1202; memory 1203; one or more application programs (not shown); and one or more computer programs 1204.
  • the aforementioned devices may be connected through one or more communication buses 1205.
  • the one or more computer programs 1204 are stored in the aforementioned memory 1203 and are configured to be executed by the one or more processors 1202.
  • the one or more computer programs 1204 include instructions, and the aforementioned instructions can be used for execution as shown in FIG. 4 Each step in the corresponding embodiment.
  • the embodiments of the present application also provide a computer storage medium that stores computer instructions, and when the computer instructions run on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method in the above-mentioned embodiment.
  • the embodiments of the present application also provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment.
  • the embodiments of the present application also provide a device.
  • the device may specifically be a chip, component or module.
  • the device may include a connected processor and a memory; wherein the memory is used to store computer execution instructions.
  • the processor can execute computer-executable instructions stored in the memory, so that the chip executes the interface calling methods in the foregoing method embodiments.
  • the electronic devices, computer storage media, computer program products, or chips provided in the embodiments of this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding methods provided above. The beneficial effects of the method are not repeated here.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only illustrative, for example, the division of modules or units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another device, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of software products, which are stored in a storage medium It includes several instructions to make a device (may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种跨进程通信方法、装置及设备,该方法应用于终端设备,该终端设备包括第一应用程序和至少一个第二应用程序,至少一个第二应用程序访问第一应用程序中的服务,该方法用以提高不同版本的AIDL文件的兼容性,改善跨进程调用服务的可靠性。该方法包括:至少一个第二应用程序通过跨进程通信向第一应用程序发送访问请求,因为访问请求包括与服务的目标服务接口唯一对应的标识,所以第一应用程序根据标识确定目标服务接口,并执行目标服务接口对应的方法对象,生成执行结果。

Description

一种跨进程通信方法、装置及设备
相关申请的交叉引用
本申请要求在2019年07月29日提交中国专利局、申请号为201910691548.8、申请名称为“一种跨进程通信方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种跨进程通信方法、装置及设备。
背景技术
Android(安卓)系统中的进程之间不能共享内存,因此,需要提供一些机制在不同进程之间进行数据通信。为了使其它的应用程序也可以访问本应用程序提供的服务,Android系统使用一种安卓接口定义语言(android interface definition language,AIDL)来开放本应用程序提供的服务的接口,并提供将开发人员通过AIDL编写的AIDL文件(一般是.AIDL文件)自动转换成中间文件(一般是.java文件)的AIDL工具。该AIDL工具被集成进Android Studio(安卓开发平台)工具链,编译时自动触发和执行。AIDL工具将该中间文件提供给其它的应用程序和本应用程序,其它的应用程序和本应用程序将该JAVA文件集成到自身的工程中,以便实现跨进程调用服务。
目前,如果其它的应用程序和本应用程序所使用的AIDL文件的版本不同,则很可能在跨进程服务调用过程中报错,出现功能不可用的问题。
发明内容
本申请实施例提供一种跨进程通信方法、装置及设备,用以提高不同版本的AIDL文件的兼容性,改善跨进程调用服务的可靠性。
第一方面,本申请实施例提供了一种跨进程通信方法,该方法适用于终端设备,该方法包括:至少一个第二应用程序通过跨进程通信向第一应用程序发送访问请求,访问请求用于请求访问第一应用程序的服务,访问请求包括与服务的目标服务接口唯一对应的标识。然后第一应用程序根据标识确定目标服务接口,并执行目标服务接口对应的方法对象,生成执行结果。
本申请实施例中,该方法基于新的AIDL文件转换方法实现跨进程通信,一定程度上可以改善跨进程调用服务的可靠性。
在一种可能的设计中,至少一个第二应用程序通过跨进程通信向所述第一应用程序发送访问请求之前,还包括:
至少一个第二应用程序通过第一JAVA文件确定出与目标服务接口的属性信息唯一对应的标识;其中,所述属性信息包括目标服务接口的接口名称和接口参数类型中的至少一个,第一JAVA文件与所述第一应用程序的第一版本的安卓接口定义语言AIDL文件相对应。然后第一应用程序根据所述标识确定所述目标服务接口,具体方式是:第一应用程序 通过第二JAVA文件确定出与标识对应的目标服务接口,第二JAVA文件与第一应用程序的第二版本的AIDL文件相对应。
本申请实施例中,因不同的服务接口对应的标识不同,相同的服务接口对应的标识相同。所以第二应用程序可以基于与服务接口唯一对应的标识访问第一应用程序中的服务。
在一种可能的设计中,与目标服务接口的属性信息唯一对应的标识是通过目标服务接口的接口名称和接口参数类型中的至少一个进行哈希运算得到的散列值。其中,所述第一JAVA文件是按照设定规则对第一版本的AIDL文件进行转换得到的;所述第二JAVA文件是按照设定规则对第二版本的AIDL文件进行转换得到的;所述设定规则包括:从第一应用程序的第一版本的AIDL文件中获取每个服务接口的属性信息,根据所述每个服务接口的属性信息确定与每个服务接口唯一对应的标识;根据所述与每个服务接口唯一对应的标识,将所述AIDL文件转换成JAVA文件。
第二方面,本申请实施例提供了一种AIDL文件转换方法,该方法应用于具有开发功能的设备,该方法包括:设备从第一应用程序的AIDL文件中获取服务接口的属性信息,设备根据服务接口的属性信息确定与服务接口唯一对应的标识,继而根据与服务接口唯一对应的标识,将AIDL文件转换成JAVA文件。
本申请实施例,该方法可以提高不同版本的AIDL文件的兼容性,一定程度上可以改善跨进程调用服务的可靠性。
在一种可能的设计中,属性信息包括接口名称和接口参数类型中的至少一个。设备根据所述服务接口的属性信息确定与服务接口唯一对应的标识,具体方式是:对服务接口的接口名称和接口参数类型中的至少一个进行哈希运算,生成与服务接口对应的散列值,其中,不同服务接口的散列值不同,相同服务接口的散列值相同。
设备根据所述与服务接口唯一对应的标识,将所述AIDL文件转换成JAVA文件,具体方式:根据与服务接口对应的散列值,将AIDL文件转换成JAVA文件。
本申请实施例中,设备通过上述方法可以确定出与接口唯一对应的散列值,从而保证第一应用程序中的服务可以被正常访问。
在一种可能的设计中,设备还将JAVA文件发送给至少一个第二应用程序对应地服务器,所述至少一个应用程序为访问第一应用程序中服务的应用程序。
本申请实施例中,设备将JAVA文件发送至第二应用程序,以便于第二应用程序访第一应用程序的服务。
第三方面,本申请实施例提供一种终端设备,包括处理器和存储器。其中,存储器用于存储一个或多个计算机程序;当存储器存储的一个或多个计算机程序被处理器执行时,使得该终端设备能够实现上述第一方面的任意一种可能的设计的方法。
第四方面,本申请实施例还提供一种装置,该装置包括执行上述第一方面的任意一种可能的设计的方法的模块/单元。这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。
第五方面,本申请实施例提供一种设备,包括处理器和存储器。其中,存储器用于存储一个或多个计算机程序;当存储器存储的一个或多个计算机程序被处理器执行时,使得该设备能够实现上述第二方面的任意一种可能的设计的方法。
第六方面,本申请实施例还提供一种装置,该装置包括执行上述第二方面的任意一种可能的设计的方法的模块/单元。这些模块/单元可以通过硬件实现,也可以通过硬件执行 相应的软件实现。
第七方面,本申请实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质包括计算机程序,当计算机程序在电子设备上运行时,使得所述电子设备执行上述任一方面的任意一种可能的设计的方法。
第八方面,本申请实施例还提供一种包含计算机程序产品,当所述计算机程序产品在终端上运行时,使得所述电子设备执行上述任一方面的任意一种可能的设计的方法。
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
图1为本申请实施例提供的一种通信系统示意图;
图2为本申请实施例提供的一种具有开发功能的设备的结构示意图;
图3为本申请实施例提供的一种AIDL文件转换方法流程示意图;
图4为本申请实施例提供的一种跨进程通信方法流程示意图;
图5为本申请实施例提供的另一种跨进程通信方法示意图;
图6为本申请实施例提供的另一种跨进程通信方法示意图;
图7为本申请实施例提供的另一种跨进程通信方法示意图;
图8为本申请实施例提供的另一种跨进程通信方法示意图;
图9为本申请实施例提供的一种AIDL文件转换方法流程示意图;
图10为本申请实施例提供的一种手机的结构示意图;
图11为本申请实施例提供的安卓操作系统结构示意图;
图12为本申请实施例提供的一种终端设备结构示意图。
具体实施方式
为了便于理解,示例的给出了部分与本申请实施例相关概念的说明以供参考。
跨进程通信,指的是同一终端设备安装的多个应用程序间的通信。也就是说,终端设备安装的一个或多个应用程序访问其安装的另外一个应用程序,下文中也会将被访问的第一应用程序表述为本地应用或服务端(Service),访问第一应用程序的第二应用程序表述为第三方应用或客户端(client)。
AIDL文件,是由开发人员手动编写的,操作系统通过AIDL转换工具可以将AIDL文件转换成JAVA文件。
系统软件包,指系统软件的安装包。系统软件是电脑硬件与用户交互的接口,最有代表性的系统软件是操作系统,比如Windows 7、Android6.0就是操作系统。
应用软件包,指的是运行在操作系统上的应用的安装包。应用安装包与特定的应用相关,是开发人员根据用户的具体需求定制开发的,比如美图秀秀、美颜相机。
IDE为用于程序开发环境的应用程序,一般包括代码编辑器、编译器、调整器和图形工具,如iOS系统上的Xcode编程软件和Android系统上的Eclipse编程软件均为典型的IDE。
现有的AIDL转换工具在将AIDL文件转换为JAVA文件时,为AIDL文件中的每个接口分配一个从1开始连续增长的序号,这些序号被定义在JAVA文件的常量中。举例来说,第一 版本的AIDL文件中定义有相机应用对外提供的三个服务接口,分别是光圈服务接口(void Aperture)、人像服务接口(void Portrait))和夜景服务接口(void Nightscape)。现有的AIDL转换工具在转换第一版本的AIDL文件时,会依次为光圈服务接口、人像服务接口和夜景服务接口分配序号1、2和3,转换生成第一版本的JAVA文件,即第一版本的JAVA文件中服务接口和序号的对应关系如表1所示。
表1
服务接口 序号
光圈服务接口(void Aperture) 1
人像服务接口(void Portrait)) 2
夜景服务接口(void Nightscape) 3
假设开发人员对相机应用的功能进行删减之后封装生成第二版本的AIDL文件,第二版本的AIDL文件中定义有相机应用对外提供的两个服务接口,分别是人像服务接口(void Portrait)和夜景服务接口(void Nightscape)。即开发人员在编写第二版本的AIDL文件时删除了光圈服务接口(void Aperture)。那么现有的AIDL转换工具在转换第二版本的AIDL文件时,会依次为人像服务接口和夜景服务接口分配序号1、2,转换生成第二版本的JAVA文件,即第二版本的JAVA文件中服务接口和序号的对应关系如表2所示。
表2
服务接口 序号
人像服务接口(void Portrait)) 1
夜景服务接口(void Nightscape) 2
若手机从第三方应用服务器(例如美颜相机应用服务器)获取的应用软件包中集成的是第一JAVA文件(第一JAVA文件是通过将第一版本的AIDL文件转换得到的),而手机的软件系统更新后,系统软件包中集成的是第二JAVA文件(第二JAVA文件是通过编译第二版本的AIDL文件转换得到的)。手机安装应用软件包并运行第三方应用,当第三方应用调用相机应用的夜景服务接口(void Nightscape)时,第三方应用通过第一JAVA文件确定出与夜景服务接口(void Nightscape)的接口名称对应的序号是3,然后第三方应用向相机应用发送的调用请求中包括序号3,而相机应用在收到该调用请求后,查找第二JAVA文件确定不存在与序号3对应的服务接口,所以相机应用向第三方应用反馈功能不可用的调用结果。导致第三方应用在手机的夜景功能实际可用的硬件环境下,因服务接口对接失败而导致无法正常使用,第三方应用只能向用户呈现较差的拍摄画质,严重影响用户的使用体验。
基于上述原因,本申请实施例提供一种AIDL文件转换方法,该方法可以应用于具有编译功能的设备侧,该方法包括:设备从第一应用程序的AIDL文件中获取服务接口的属性信息,服务接口为第一应用程序所提供的一个或多个服务接口。设备根据服务接口的属性信息确定与服务接口唯一对应的标识,然后设备根据与服务接口唯一对应的标识,将AIDL文件转换成JAVA文件。可见,因JAVA文件中的服务接口有唯一对应的标识,所以当该JAVA文件被集成到第三方应用的应用软件包中时,第三方应用可以通过JAVA文件确定出与调用的服务接口的属性信息唯一对应的标识,然后第三方应用向本地应用发送的调用请求中包括该唯一对应的标识。假设本地应用中集成的JAVA文件版本号比第三方应用集成的JAVA文件版本号高,那么本地应用可以通过本地应用所集成的JAVA文件,确定出与该标识对应的服务接口,然后执行服务接口对应的方法对象,并将执行结果反馈至第三方应用。
换句话说,本申请实施例对安卓自带的AIDL工具进行了改进,改进后的AIDL工具能够执行上述AIDL文件转换方法对应的软件程序,通过该改进后的AIDL工具将AIDL文件转换成的JAVA文件,该JAVA文件被集成在本地应用的系统软件包和第三方应用的应用软件包中。一般地,本地应用是系统自带的应用,而第三方应用由开发人员新创的应用程序,该应用程序的所有者不是系统生产商或运行该应用程序的设备制造商。本申请实施例中,即使第三方应用的应用软件包中的JAVA版本低于本地应用的系统软件包中的JAVA文件版本,换句话说,就是第三方应用使用的AIDL文件版本低于本地应用的AIDL文件版本,本地应用仍能够根据JAVA文件中服务接口和标识的对应关系,利用第三方应用发送的调用请求中的标识确定出对应的服务接口。所以该方法可以提高不同版本的AIDL文件的兼容性,一定程度上可以改善跨进程调用服务的可靠性。
如图1所示,本申请实施例提供一种通信系统,该通信系统包括设备100、终端设备200和服务器300,终端设备200和设备100可以通过数据线直连,也可以通过通信网络互相通信,设备100和服务器300通过网络进行通信。其中,设备100安装有集成开发环境(integrated development environment,IDE),用于编译生成终端设备200的系统软件包;服务器300为第三方应用服务器,用于编译生成第三方应用的应用软件包。
其中,通信网络可以是局域网,也可以是通过中继(relay)设备转接的广域网。当该通信网络为局域网时,示例性的,该通信网络可以是wifi热点网络、wifi直连网络、蓝牙网络、zigbee网络或近场通信(near field communication,NFC)网络等近距离通信网络。当该通信网络为广域网时,示例性的,该通信网络可以是第三代移动通信技术(3rd-generation wireless telephone technology,3G)网络、第四代移动通信技术(the 4th generation mobile communication technology,4G)网络、第五代移动通信技术(5th-generation mobile communication technology,5G)网络、未来演进的公共陆地移动网络(public land mobile network,PLMN)或因特网等。
具体来说,开发人员在设备100上编写好本地应用的AIDL文件之后,设备100利用所集成的上述改进后的AIDL转换工具,从本地应用的AIDL文件中获取服务接口的属性信息,根据服务接口的属性信息确定与服务接口唯一对应的标识,然后根据与服务接口唯一对应的标识,将AIDL文件转换成JAVA文件,设备100中的系统软件包中集成有该JAVA文件。同时设备100还将该JAVA文件提供给服务器300,服务器300将该JAVA文件集成到第三方应用的应用软件包中。
终端设备200从设备100下载更新后的系统软件包,然后保存至本地,并更新终端设备200上的已安装的本地应用。终端设备200从服务器300下载更新后的应用软件包,然后保存至本地,并更新终端设备200上的已安装的第三方应用,二者的版本更新可能不同时,第三方应用与本地应用相比,AIDL文件的版本更新存在一定的滞后性。
在本申请一些实施例中,设备100可以为具有编译功能的服务器或者云服务器。图2示出的是与本申请各实施例相关的设备100的部分结构的框图。
如图2所示,该设备100可以包括:包括处理器201、存储器202以及收发器203。其中该一个或多个计算机程序被存储在上述存储器201中并被配置为被该一个或多个处理器202执行。
处理器201,可以是中央处理单元(central processing unit,CPU),或者为数字处理单元等,处理器201是设备100的控制中心,利用各种接口和线路连接整个设备100的各个 部分,通过运行或执行存储在存储器202内的计算机程序,以及调用存储在存储器202内的数据,执行设备100的各种功能和数据处理。
存储器202,用于存储待运行的计算机程序,若该设备100是云服务器,则存储器202中还存储有从具有编译功能的服务器获取的安卓操作系统编译生成的编译结果,其中编译结果包括与JAVA文件,其中JAVA文件是改进后的AIDL工具对AIDL文件进行转换生成的。另外,若该设备100是具有编译功能的服务器,则存储器202中存储有安卓操作系统源码和该安卓操作系统源码编译生成的编译结果。其中编译结果包括与JAVA文件,其中JAVA文件是改进后的AIDL工具对AIDL文件进行转换生成的。
收发器203,用于将处理器201生成的JAVA文件发送至第三方应用对应的服务器300。
处理器201,用于将可执行文件集成在本地应用的安卓软件包中,收发器203,还用于将本地应用的安卓软件包中发送至终端设备200。
本申请实施例中不限定上述处理器201以及存储器202之间的具体连接介质。本申请实施例在图2中以存储器202、处理器201以及收发器203之间通过总线204连接,总线在图2中以粗线表示,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图2中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
其中,存储器202可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);存储器203也可以是非易失性存储器(non-volatile memory),例如只读存储器,快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)、或者存储器202是能够用于携带或存储具有指令或数据结构形式的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器203可以是上述存储器的组合。
如图3所示,为本申请实施例提供一种AIDL文件转换方法流程示意图,该方法可以由设备100执行,具体步骤如下。
步骤301,设备100从第一应用程序的AIDL文件中获取服务接口的属性信息。
其中,服务接口为所述第一应用程序所提供的一个或多个服务接口,终端设备安装的一个或多个应用可以访问其安装的另外一个应用,本申请实施例中的第一应用程序指被其它应用访问的应用程序,一般第一应用程序是指系统自带的应用。第一应用程序又可以被表述为本地应用或服务端(Service)。例如,第一应用程序可以是智能手机中的相机应用或者通话应用、短信应用等。属性信息可以是服务接口的接口名称、接口参数类型中的至少一个。接口参数类型可以是整型、字符型、字节型、布尔型等。例如相机应用中的光圈服务接口void execAperture(){&image}的接口名称是execAperture(),接口参数类型是&image(原图像地址)为字节型。
步骤302,设备100根据服务接口的属性信息确定与服务接口唯一对应的标识。
其中,与服务接口唯一对应的标识可以是字符串,散列值或者是随机数值等。具体地,方式一,设备100使用哈希函数对服务接口的接口名称和接口参数类型中的至少一个进行哈希运算,生成与服务接口对应的散列值,其中,不同服务接口的散列值不同,相同服务接口的散列值相同。方式二,设备100将服务接口的接口名称和接口参数类型中的至少一个作为随机种子,使用随机函数生成随机数值。
步骤303,设备100根据与服务接口唯一对应的标识,将AIDL文件转换成JAVA文件。
具体地,AIDL文件就是第一应用程序的服务接口和数据声明。设备100中的AIDL转换工具根据与服务接口唯一对应的标识,将AIDL文件生成JAVA文件。生成的JAVA文件会被打包到第一应用程序的系统软件包中。
假设,手机中的相机应用有光圈服务接口、人像服务接口和夜景服务接口这三个,设备100将相机应用的这三个服务接口定义到第一版本的AIDL文件中。第一版本的AIDL文件中如表3所示。
表3
Figure PCTCN2020103876-appb-000001
然后,AIDL转换工具将第一版本的AIDL文件转换成如表4所示的第一版本的JAVA文件。
表4
Figure PCTCN2020103876-appb-000002
设备100将该第一版本的JAVA文件打包到系统软件包中,若用户手机进行软件更新,则手机从设备100获取包括第一版本的JAVA文件的系统软件包,并保存到本地。进一步地,设备100还将生成的第一版本的JAVA文件发送给至少一个第二应用程序对应的服务器300,服务器300将该第一版本的JAVA文件打包到第二应用程序的应用软件包中。其中,第二应用程序指的是访问第一应用程序中服务的应用程序,又称第三方应用或客户端,例如,第一应用程序是手机中的相机应用,第二应用程序是美颜相机应用。
假设说,设备100将表4所示的第一版本的JAVA文件发送至美颜相机应用的服务器300,服务器300将该第一版本的JAVA文件打包到美颜相机应用的应用软件包中,若用户 对手机中的美颜相机应用进行更新,则手机从服务器300获取包括第一版本的JAVA文件的应用软件包,并保存到本地。
假设,美颜相机应用调用光圈服务接口,则美颜相机应用通过第一版本的JAVA文件确定与光圈服务接口的接口名称对应的散列值是0XF6457850,因此向相机应用发送包括散列值是0XF6457850的调用请求,相机应用通过第一版本的JAVA文件确定与散列值0XF6457850对应的服务接口是execAperture(),因此相机应用执行该execAperture()的方法对象,生成执行结果,并将执行结果发送至美颜相机应用。
在一种可能的实施例中,假设开发人员删除了第一版本AIDL文件中的部分服务接口,例如删除光圈服务接口,那么设备100将相机应用的剩余两个服务接口定义到第二版本的AIDL文件中。然后AIDL转换工具将第二版本的AIDL文件转换成如表5所示的第二版本的JAVA文件。设备100将该第二版本的JAVA文件打包到相机应用的APK中,若用户对手机中的相机应用进行更新,则手机从设备100获取包括第二版本的JAVA文件的APK,保存到本地。
表5
Figure PCTCN2020103876-appb-000003
进一步地,设备100还将生成的第二版本的JAVA文件发送给至少一个第二应用程序对应的服务器300,服务器300将该第二版本的JAVA文件打包到第二应用程序的APK中。
假设说,用户没有对手机中的美颜相机应用进行更新,即手机中的美颜相机应用的APK中的JAVA文件仍是第一版本的JAVA文件。那么当美颜相机应用调用夜景服务接口时,美颜相机应用通过第一版本的JAVA文件确定与夜景服务接口的接口名称对应的散列值是0X98342122,因此美颜相机应用向相机应用发送包括散列值是0X98342122的调用请求,相机应用通过第二版本的JAVA文件确定与散列值0X98342122对应的服务接口是execNightscape(),因此相机应用执行该execNightscape()的方法对象,生成执行结果,并将执行结果发送至美颜相机应用。
可见,本申请实施例提供的方法中虽然访问第一应用程序的第二应用程序使用的是低版本的JAVA文件,第二应用程序仍然可以正常访问具有高版本JAVA文件的第一应用程 序中的服务,本申请实施例所提供的方法可以提高不同版本的AIDL文件的兼容性,改善跨进程调用服务的可靠性。
基于上述AIDL文件转换方法,本申请实施例还提供一种跨进程通信方法流程示意图,如图4所示,该方法适用于包括至少两个应用程序的终端设备,具体步骤如下。
步骤401,第二应用程序通过跨进程通信向第一应用程序发送访问请求。
其中,访问请求用于请求访问第一应用程序的服务,访问请求包括与服务的目标服务接口唯一对应的标识。终端设备安装的一个或多个应用可以访问其安装的另外一个应用,本申请实施例中的第一应用程序指被其它应用访问的应用程序,一般第一应用程序是指系统自带的应用。第一应用程序又可以被表述为本地应用或服务端(Service)。例如,第一应用程序可以是智能手机中的相机应用或者通话应用、短信应用等。其中,第二应用程序指的是访问第一应用程序中服务的应用程序,又称第三方应用或客户端。
示例性地,假设第一应用程序是相机应用,第二应用程序是美颜相机应用,美颜相机应用通过跨进程通信相机应用发送访问光圈服务接口void execAperture()的访问请求,该访问请求中包括与光圈服务接口void execAperture()唯一对应的标识。标识可以是字符串,散列值或者是随机数值等。标识的生成方式可以参照步骤303的描述,该处不再重复赘述。
步骤402,第一应用程序根据标识确定目标服务接口,并执行目标服务接口对应的方法对象,生成执行结果。
示例性地,相机应用接收到访问请求后,根据访问请求中的标识确定出目标服务接口是void execAperture(),因此相机应用执行该服务接口的方法对象,生成执行结果。
在一种可能的实施例中,在第二应用程序通过跨进程通信向第一应用程序发送访问请求之前,第二应用程序先通过第一版本JAVA文件确定出与目标服务接口的属性信息唯一对应的标识。
示例性地,美颜相机应用先通过第一版本JAVA文件确定与光圈服务接口的属性信息唯一对应的标识。属性信息包括目标服务接口的接口名称和接口参数类型中的至少一个,例如目标服务接口是光圈服务接口void execAperture(){&image},光圈服务接口的接口名称是execAperture(),接口参数类型是&image(原图像地址)。美颜相机根据表4所示第一版本的JAVA文件确定出与光圈服务接口的属性信息唯一对应的标识是0XF6457850。
进一步地,第一应用程序通过第二版本JAVA文件确定出与该标识对应的目标服务接口,其中,第二版本JAVA文件是与第一应用程序的第二版本AIDL文件相对应的。示例性地,相机应用在接收到访问请求后,通过第二版本JAVA文件确定与标识0XF6457850对应的void execAperture。
具体地,以下将结合附图和不同的应用场景,对本申请实施例提供的跨进程通信方法进行举例说明。
场景一
假设第一应用程序是相机应用,第二应用程序是美颜相机应用,设备100中改进后的AIDL转换工具对图5中的第一版本AIDL文件(如表3所示的Icamera.aidl)501进行转换,生成第一版本JAVA文件(如表4所示的Icamera.java)502。
情况一,美颜相机应用调用光圈服务接口void Aperture(),即美颜相机通过第一版本JAVA文件502确定与光圈服务接口void Aperture()对应的标识是0XF6457850,然后美颜 相机应用向相机应用发送访问请求,该访问请求中包括与void Aperture()对应的标识是0XF6457850。相机应用通过第一版本JAVA文件502确定与0XF6457850匹配的是void execAperture(){...},因此执行该接口的方法对象,生成执行结果。
情况二,美颜相机应用调用人像服务接口void Portrait(),即美颜相机通过第一版本JAVA文件502确定与人像服务接口void Portrait()对应的标识是0X21153431,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void Portrait()对应的标识是0XF6457850。相机应用通过第一版本JAVA文件502确定与0X21153431匹配的是void exec Portrait(){...},因此执行该接口的方法对象,生成执行结果。
情况三,美颜相机应用调用夜景服务接口void NightScape(),即美颜相机通过第一版本JAVA文件502确定与夜景服务接口void NightScape()对应的标识是0X98342122,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void NightScape()对应的标识是0X98342122。相机应用通过第一版本JAVA文件502确定与0X98342122匹配的是void exec NightScape(){...},因此执行该服务接口的方法对象,生成执行结果。
场景二
假设开发人员删除了第一版本AIDL文件中的光圈服务接口,生成第二版本AIDL文件,设备100中改进后的AIDL转换工具对图6中的第二版本AIDL文件(如图6中601)进行转换,生成第二版本JAVA文件(如图6中602)。假设设备100未将第二版本JAVA文件发送至服务器300,即美颜相机应用的APK中不包括第二版本AIDL文件,仍是第一版本AIDL文件。
情况一:当美颜相机应用访问相机应用的void Portrait()时,仍然可以通过第一版本JAVA文件502确定与人像服务接口void Portrait()对应的标识是0X21153431,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void Portrait()对应的标识是0XF6457850。相机应用通过第二版本JAVA文件602确定与0X21153431匹配的是void exec Portrait(){...},因此执行该服务接口的方法对象,生成执行结果。
情况二:当美颜相机应用访问相机应用的夜景服务接口void NightScape()时,仍然可以通过第一版本JAVA文件502确定与夜景服务接口void NightScape()对应的标识是0X98342122,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void NightScape()对应的标识是0X98342122。相机应用通过第二版本JAVA文件602确定与0X98342122匹配的是void exec NightScape(){...},因此执行该服务接口的方法对象,生成执行结果。
场景三
假设开发人员更改第一版本AIDL文件中的人像服务接口和夜景服务接口的顺序,生成第二版本AIDL文件,设备100中改进后的AIDL转换工具对图7中的第二版本AIDL文件(如图7中701)进行转换,生成第二版本JAVA文件(如图7中702)。假设设备100未将第二版本JAVA文件发送至服务器300,即美颜相机应用的APK中不包括第二版本AIDL文件,仍是第一版本AIDL文件。
情况一,美颜相机应用调用光圈服务接口void Aperture(),即美颜相机通过第一版本JAVA文件502确定与光圈服务接口void Aperture()对应的标识是0XF6457850,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void Aperture()对应的标识是0XF6457850。相机应用通过第二版本JAVA文件702确定与0XF6457850匹配的是void  execAperture(){...},因此执行该接口的方法对象,生成执行结果。
情况二,美颜相机应用调用人像服务接口void Portrait(),即美颜相机通过第一版本JAVA文件502确定与人像服务接口void Portrait()对应的标识是0X21153431,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void Portrait()对应的标识是0XF6457850。相机应用通过第二版本JAVA文件702确定与0X21153431匹配的是void exec Portrait(){...},因此执行该接口的方法对象,生成执行结果。
情况三,美颜相机应用调用夜景服务接口void NightScape(),即美颜相机通过第一版本JAVA文件502确定与夜景服务接口void NightScape()对应的标识是0X98342122,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void NightScape()对应的标识是0X98342122。相机应用通过第二版本JAVA文件702确定与0X98342122匹配的是void exec NightScape(){...},因此执行该接口的方法对象,生成执行结果。
场景四
假设开发人员在第一版本AIDL文件中的夜景服务接口前面插入快门服务接口,生成第二版本AIDL文件,设备100中改进后的AIDL转换工具对图8中的第二版本AIDL文件(如图8中801)进行转换,生成第二版本JAVA文件(如图8中802)。假设设备100未将第二版本JAVA文件发送至服务器300,即美颜相机应用的APK中不包括第二版本AIDL文件,仍是第一版本AIDL文件。
情况一,美颜相机应用调用光圈服务接口void Aperture(),即美颜相机通过第一版本JAVA文件502确定与光圈服务接口void Aperture()对应的标识是0XF6457850,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void Aperture()对应的标识是0XF6457850。相机应用通过第二版本JAVA文件802确定与0XF6457850匹配的是void execAperture(){...},因此执行该接口的方法对象,生成执行结果。
情况二,美颜相机应用调用人像服务接口void Portrait(),即美颜相机通过第一版本JAVA文件502确定与人像服务接口void Portrait()对应的标识是0X21153431,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void Portrait()对应的标识是0XF6457850。相机应用通过第二版本JAVA文件802确定与0X21153431匹配的是void exec Portrait(){...},因此执行该接口的方法对象,生成执行结果。
情况三,美颜相机应用调用夜景服务接口void NightScape(),即美颜相机通过第一版本JAVA文件502确定与夜景服务接口void NightScape()对应的标识是0X98342122,然后美颜相机应用向相机应用发送访问请求,该访问请求中包括与void NightScape()对应的标识是0X98342122。相机应用通过第二版本JAVA文件802确定与0X98342122匹配的是void exec NightScape(){...},因此执行该接口的方法对象,生成执行结果。
本申请实施例中,因不同的服务接口对应的标识不同,相同的服务接口对应的标识相同。所以客户端可以基于与服务接口唯一对应的标识访问服务端中的服务。软件中常规意义上的接口兼容,就是指接口名、接口形式不变,而接口顺序、接口数量则允许随版本演进而变化的。软件设计人员基于本申请实施例中所提供的改进后的AIDL转换工具,软件设计人员可以按常规的兼容方法去设计和升级软件接口,而不用再担心接口顺序变化、接口数量变化所引发不兼容的问题。另外,即便客户端与服务端中的AIDL文件的版本不同,也可以一定程度上实现正常访问,所以本申请实施例所提供的方法一定程度上改善了跨进程调用服务的可靠性。
基于上述AIDL文件转换方法,本申请实施例提供一种AIDL文件转换装置,参见图9,该装置可以是上述改进后的AIDL转换工具,该装置可以集成在设备100中,该装置包括:获取单元901、处理单元902和转换单元903。其中,获取单元901,用于获取第一应用程序的AIDL文件中的各个服务接口的属性信息,处理单元902,用于根据各个服务接口的属性信息确定与每个服务接口唯一对应的标识;转换单元903,用于根据与每个服务接口唯一对应的标识,将AIDL文件转换成JAVA文件。
在一种可能的实现中,属性信息包括接口名称和接口参数类型中的至少一个;处理单元902具体用于:对每个服务接口的接口名称和接口参数类型中的至少一个进行哈希运算,生成与每个服务接口对应的散列值,其中,不同服务接口的散列值不同,相同服务接口的散列值相同。
转换单元903具体用于:根据与每个服务接口对应的散列值,将AIDL文件转换成JAVA文件。
应理解,图2中存储器202中包括上述装置对应的计算机程序,处理器201用于执行获取单元901、处理单元902和转换单元903的功能。
在本申请一些实施例中,终端设备200可以是便携式设备,诸如手机、平板电脑、具备无线通讯功能的可穿戴设备(如智能手表)等。便携式设备的示例性实施例包括但不限于搭载
Figure PCTCN2020103876-appb-000004
或者其它操作系统的便携式设备。
下面以终端为手机为例进行说明,图10示出的是与本发明各实施例相关的终端设备200的部分结构的框图。
如图10所示,终端设备200为手机,该手机包括:RF(radio frequency,射频)电路1001、Wi-Fi系统模块1002、存储器1003、输入单元1004、显示单元1005、处理器1006、音频电路1007以及电源1008等部件。本领域技术人员可以理解,图10中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图10对终端设备200的各个构成部件进行具体的介绍:
Wi-Fi系统模块1002用于扫描终端设备200周围环境存在的Wi-Fi接入点,获取相关信息,以便终端设备200根据所述相关信息接入所述Wi-Fi接入点。
RF电路1001用于收发信息或通话过程中信号的接收和发送,特别地,将基站的下行信息接收后,给处理器1006处理。另外,将上行的数据发送给基站。在本申请实施例中,所述RF电路1001与Wi-Fi系统模块的Wi-Fi天线相连,控制Wi-Fi天线对Wi-Fi网络的扫描。通常,RF电路1001包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(low noise amplifier,LNA)、双工器等。此外,RF电路1001还可以通过无线通信与网络和其他设备通信。
该存储器1003用于存储该终端设备200的软件程序。通常,该存储器1003可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
处理器1006是终端设备200的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1003内的软件程序,以及调用存储在存储器1003内的数据,执行终端设备200的各种功能和数据处理。
其中,上述处理器1006可包括一个或多个处理单元;优选的,处理器1006可集成应 用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1006中。
输入单元1004可用于接收输入的数字或字符信息,以及产生与终端设备200的用户设置以及功能控制有关的键信号输入。具体地,输入单元1004可包括触摸屏以及其他输入设备。触摸屏也称为触控面板,可收集用户在其上或附近的触摸操作并根据预先设定的程式驱动相应的连接装置。其他输入设备可以包括但不限于物理键盘、功能键(比如音量控制按键、电源开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元1005可用于显示由用户输入的信息或提供给用户的信息以及手机200的各种菜单。显示单元1005可包括显示面板,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。
音频电路1007连接扬声器和麦克风,可提供用户与手机200之间的音频接口。音频电路1007可将接收到的音频数据转换后的电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,麦克风将收集的声音信号转换为电信号,由音频电路接收后转换为音频数据,再将音频数据输出至RF电路1001以发送给比如另一手机,或者将音频数据输出至存储器1003以便进一步处理。
手机200还包括给各个部件供电的电源1008(比如电池),优选的,电源可以通过电源管理系统与处理器1006逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
尽管未示出,终端设备200还可以包括蓝牙模块,传感器、GPS等,在此不再赘述。
另一方面,终端设备200的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明终端设备200的软件结构。
图11是本发明实施例的终端设备200的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图11所示,应用程序包可以包括本地应用和第三方应用,例如本地应用是相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等,第三方应用是美颜相机、美图秀秀、微信、微博等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。例如,应用程序框架层包括相机应用所提供的光圈服务接口(void Aperture)对应的方法类、人像服务接口(void Portrait))对应的方法类、夜景服务接口(void Nightscape)对应的方法类。
如图11所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器、服务管理器(service manager)、基于Java语言的Binder接口等。
Binder接口是通过JNI来调用基于系统库中的Binder运行库来为应用程序层中的应用 程序提供进程间通信服务。例如,应用程序层中的第三方应用通过Binder接口向本地应用发送访问请求,应用程序框架层中Binder接口通过JNI来调用基于系统库中的Binder运行库来为应用程序层中的第三方应用程序提供进程间通信服务。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供终端设备200的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。本申请实施例中,虚拟机将第三方应用的应用软件包中的第一JAVA文件,和系统软件包中的第二JAVA文件执行为二进制文件。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合拍照场景,示例性说明终端设备200中软件以及硬件的工作流程。
当触摸传感器接收到用户作用于美颜相机应用中的拍照操作,相应的硬件中断被发给内核层。内核层将拍照操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,服务 管理器(service manager)从应用程序框架层接收到原始输入事件之后,服务管理器调用应用程序框架层中与美颜相机应用建立绑定关系的本地相机应用中的服务,也就是说,service manager通过Binder接口向本地相机应用发送访问请求,其中访问请求中携带有美颜相机应用从JAVA文件获取的与目标服务接口唯一对应的命令码,以及命令参数等。假设目标服务接口为人像服务接口(void Portrait),本地相机应用的服务收到该访问请求后,一方面,启动内核层的摄像头驱动,开始捕获原始图像;另一方面,启用人像场景对应的美颜算法对图像进行人脸检测、并按照指定的参数进行二次处理和渲染。最终,本地相机应用的服务将加工合成后的图像通过预先定义的回调接口(与上述Binder接口类似,但请求方/接收方角色互换)传递给美颜相机应用,美颜相机应用将得到的人像图像显示到界面上。
在本申请的另一些实施例中,本申请实施例公开了一种终端设备,如图12所示,该终端设备可以包括:触摸屏1201,其中,该触摸屏1201包括触控面板1206和可折叠显示屏1207;一个或多个处理器1202;存储器1203;一个或多个应用程序(未示出);以及一个或多个计算机程序1204、上述各器件可以通过一个或多个通信总线1205连接。其中该一个或多个计算机程序1204被存储在上述存储器1203中并被配置为被该一个或多个处理器1202执行,该一个或多个计算机程序1204包括指令,上述指令可以用于执行如图4相应实施例中的各个步骤。
本申请实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的方法。
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的接口调用方法。
其中,本申请实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其他的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其他的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件 可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (10)

  1. 一种跨进程通信方法,适用于包括第一应用程序和至少一个第二应用程序的终端设备,所述至少一个第二应用程序访问所述第一应用程序中的服务,其特征在于,该方法包括:
    所述至少一个第二应用程序通过跨进程通信向所述第一应用程序发送访问请求,所述访问请求用于请求访问所述第一应用程序的服务,所述访问请求包括与所述服务的目标服务接口唯一对应的标识,其中,所述目标服务接口为所述第一应用程序所提供的目标服务对应的接口;
    所述第一应用程序根据所述标识确定所述目标服务接口,并执行所述目标服务接口对应的方法对象,生成执行结果。
  2. 根据权利要求1所述的方法,其特征在于,所述至少一个第二应用程序通过跨进程通信向所述第一应用程序发送访问请求之前,还包括:
    所述至少一个第二应用程序通过第一JAVA文件确定出与目标服务接口的属性信息唯一对应的标识;其中,所述属性信息包括目标服务接口的接口名称和接口参数类型中的至少一个,所述第一JAVA文件与所述第一应用程序的第一版本的接口定义语言AIDL文件相对应;
    所述第一应用程序根据所述标识确定所述目标服务接口,包括:
    所述第一应用程序通过第二JAVA文件确定出与所述标识对应的目标服务接口,所述第二JAVA文件与所述第一应用程序的第二版本的AIDL文件相对应。
  3. 根据权利要求2所述的方法,其特征在于,所述与目标服务接口的属性信息唯一对应的标识是通过对所述目标服务接口的接口名称和接口参数类型中的至少一个进行哈希运算得到的散列值。
  4. 根据权利要求2所述的方法,其特征在于,所述第一JAVA文件是按照设定规则对第一版本的AIDL文件进行转换得到的;所述第二JAVA文件是按照设定规则对第二版本的AIDL文件进行转换得到的;所述设定规则包括:从第一应用程序的第一版本的AIDL文件中获取每个服务接口的属性信息,根据所述每个服务接口的属性信息确定与每个服务接口唯一对应的标识;根据所述与每个服务接口唯一对应的标识,将所述AIDL文件转换成JAVA文件。
  5. 一种终端设备,其特征在于,包括处理器和存储器;
    所述存储器用于存储一个或多个计算机程序,还存储有系统软件包和至少一个第二应用程序的应用软件包;
    当所述存储器存储的一个或多个计算机程序被所述处理器执行时,使得所述终端设备执行:
    所述至少一个第二应用程序通过跨进程通信向所述第一应用程序发送访问请求,所述访问请求用于请求访问所述第一应用程序中的服务,所述访问请求包括与所述服务的目标服务接口唯一对应的标识;
    所述第一应用程序根据所述标识确定所述目标服务接口,并执行所述目标服务接口对应的方法对象,生成执行结果。
  6. 根据权利要求5所述的终端设备,其特征在于,所述系统软件包包括第一版本JAVA文件,所述应用软件包包括第二版本JAVA文件;
    当所述存储器存储的一个或多个计算机程序被所述处理器执行时,还使得所述终端设备执行:
    所述至少一个第二应用程序通过第一版本JAVA文件确定出与目标服务接口的属性信息唯一对应的标识;其中,所述属性信息包括目标服务的接口名称和接口参数类型中的至少一个,所述第一版本JAVA文件与所述第一应用程序的第一版本的AIDL文件相对应;
    所述第一应用程序通过第二版本JAVA文件确定出与所述标识对应的目标服务接口,所述第二版本JAVA文件与所述第一应用程序的第二版本的AIDL文件相对应。
  7. 根据权利要求6所述的终端设备,其特征在于,所述与目标服务接口的属性信息唯一对应的标识是通过所述目标服务接口的接口名称和接口参数类型中的至少一个进行哈希运算得到的散列值。
  8. 根据权利要求6所述的终端设备,其特征在于,所述第一JAVA文件是按照设定规则对第一版本的AIDL文件进行转换得到的;所述第二JAVA文件是按照设定规则对第二版本的AIDL文件进行转换得到的;所述设定规则包括:从第一应用程序的第一版本的AIDL文件中获取每个服务接口的属性信息,根据所述每个服务接口的属性信息确定与每个服务接口唯一对应的标识;根据所述与每个服务接口唯一对应的标识,将所述AIDL文件转换成JAVA文件。
  9. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当所述计算机程序在终端设备上运行时,使得所述终端设备执行如权利要求1至4任一所述的方法。
  10. 一种芯片,其特征在于,所述芯片与存储器耦合,用于执行所述存储器中存储的计算机程序,以执行如权利要求1至4任一项所述的方法。
PCT/CN2020/103876 2019-07-29 2020-07-23 一种跨进程通信方法、装置及设备 WO2021018005A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20846960.1A EP3992796A4 (en) 2019-07-29 2020-07-23 INTER-PROCESS COMMUNICATION METHOD, APPARATUS AND DEVICE
US17/649,280 US11853820B2 (en) 2019-07-29 2022-01-28 Cross-process communication method, apparatus, and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910691548.8 2019-07-29
CN201910691548.8A CN110569130B (zh) 2019-07-29 2019-07-29 一种跨进程通信方法、装置及设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/649,280 Continuation US11853820B2 (en) 2019-07-29 2022-01-28 Cross-process communication method, apparatus, and device

Publications (1)

Publication Number Publication Date
WO2021018005A1 true WO2021018005A1 (zh) 2021-02-04

Family

ID=68773633

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/103876 WO2021018005A1 (zh) 2019-07-29 2020-07-23 一种跨进程通信方法、装置及设备

Country Status (4)

Country Link
US (1) US11853820B2 (zh)
EP (1) EP3992796A4 (zh)
CN (1) CN110569130B (zh)
WO (1) WO2021018005A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569130B (zh) * 2019-07-29 2021-12-14 华为技术有限公司 一种跨进程通信方法、装置及设备
CN111142979B (zh) * 2019-12-30 2023-09-22 广州酷狗计算机科技有限公司 应用程序运行方法、装置、计算机设备和存储介质
CN111443961B (zh) * 2020-03-24 2023-04-11 广州方硅信息技术有限公司 终端设备及其跨进程通信方法
CN113867977A (zh) * 2020-06-30 2021-12-31 华为技术有限公司 设备控制方法和设备
CN112181340B (zh) * 2020-09-29 2022-05-31 联想(北京)有限公司 一种ar图像的共享方法及电子设备
CN112379952B (zh) * 2020-12-09 2023-04-07 成都傲梅科技有限公司 一种跨进程回调的实现方法
US11544054B2 (en) * 2021-03-22 2023-01-03 Wind River Systems, Inc. Determination of API changes
CN115033396B (zh) * 2022-05-27 2023-05-02 荣耀终端有限公司 一种通信方法及相关设备
CN114942812B (zh) * 2022-05-31 2024-04-30 上海嘉车信息科技有限公司 多媒体信息共享方法、装置和电子设备
CN116737404A (zh) * 2022-09-28 2023-09-12 荣耀终端有限公司 用于应用接续的方法及终端设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140082117A1 (en) * 2012-09-14 2014-03-20 ConnectEDU Inc. Client device lockdown and control system
CN106547567A (zh) * 2016-11-25 2017-03-29 山东大学 一种安卓系统中多业务下进程间通信系统及其实现方法
CN108182121A (zh) * 2017-12-29 2018-06-19 广州小鹏汽车科技有限公司 一种Android中控大屏系统模块间通信方法及系统
CN110569130A (zh) * 2019-07-29 2019-12-13 华为技术有限公司 一种跨进程通信方法、装置及设备

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5815709A (en) * 1996-04-23 1998-09-29 San Microsystems, Inc. System and method for generating identifiers for uniquely identifying object types for objects used in processing of object-oriented programs and the like
US9397878B2 (en) * 2013-01-29 2016-07-19 Qualcomm Incorporated Cross-platform module that is shared by client applications for access to rich communications suite resources on a client device
CN103955482B (zh) * 2014-04-03 2018-10-12 北京百度网讯科技有限公司 一种在移动终端中调用服务的方法和设备
CN104184618B (zh) * 2014-08-12 2017-11-07 烽火通信科技股份有限公司 Android终端及其实现TR069网管代理的方法
CN105376174B (zh) * 2014-08-25 2018-10-30 阿尔卡特朗讯 执行lte/epc中基于服务链的策略的方法与设备
US10339303B2 (en) * 2015-01-22 2019-07-02 Mcafee, Llc Detection of malicious invocation of application program interface calls
CN105204951A (zh) * 2015-10-10 2015-12-30 上海斐讯数据通信技术有限公司 一种安卓系统中Activity间通信的方法和装置
CN106547634B (zh) * 2016-11-28 2020-07-31 武汉斗鱼网络科技有限公司 一种跨进程通信的方法及装置
CN108804236B (zh) * 2017-05-04 2022-05-03 Tcl科技集团股份有限公司 一种aidl文件的共享方法及系统
CN109766276B (zh) * 2018-12-29 2024-01-12 通力科技股份有限公司 开放式平台测试方法、装置、计算机可读存储介质及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140082117A1 (en) * 2012-09-14 2014-03-20 ConnectEDU Inc. Client device lockdown and control system
CN106547567A (zh) * 2016-11-25 2017-03-29 山东大学 一种安卓系统中多业务下进程间通信系统及其实现方法
CN108182121A (zh) * 2017-12-29 2018-06-19 广州小鹏汽车科技有限公司 一种Android中控大屏系统模块间通信方法及系统
CN110569130A (zh) * 2019-07-29 2019-12-13 华为技术有限公司 一种跨进程通信方法、装置及设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3992796A4 *

Also Published As

Publication number Publication date
EP3992796A4 (en) 2022-08-10
CN110569130B (zh) 2021-12-14
US11853820B2 (en) 2023-12-26
EP3992796A1 (en) 2022-05-04
US20220156133A1 (en) 2022-05-19
CN110569130A (zh) 2019-12-13

Similar Documents

Publication Publication Date Title
WO2021018005A1 (zh) 一种跨进程通信方法、装置及设备
CN113110941B (zh) 使用应用容器管理代码和依赖性数据的传递
US9619304B2 (en) Automatic connections between application components
US8832181B2 (en) Development and deployment of mobile and desktop applications within a flexible markup-based distributed architecture
JP4812337B2 (ja) フォームタイプを使用してフォームを生成する方法および装置
WO2022199111A1 (zh) 应用程序中功能的实现方法、装置、电子设备和存储介质
KR102193404B1 (ko) 상호작용 개발 환경으로부터의 소프트웨어 아티팩트의 점진적 컴파일링 기법
CN109408136B (zh) 信息处理方法、装置、存储介质及电子设备
WO2020014926A1 (zh) 一种补丁包生成方法及设备
CN109933381A (zh) 一种内核的加载方法及装置
WO2021027772A1 (zh) 一种应用切换运行的方法及设备
CN113435173B (zh) 文本生成方法、相关装置及系统
WO2022052766A1 (zh) 主题包适配方法及装置
WO2021057411A1 (zh) 一种组件加载方法、装置及系统
WO2021169379A1 (zh) 权限复用方法、基于权限复用的资源访问方法及相关设备
US20230139886A1 (en) Device control method and device
CN112235132A (zh) 动态配置服务的方法、装置、介质以及服务器
EP4216052A1 (en) Method for developing mvvm architecture-based application, and terminal
US11991040B2 (en) Network configuration method and device
WO2023202406A1 (zh) 显示方法及电子设备
WO2024032022A1 (zh) 一种应用图标的可视化方法和设备
WO2023051357A1 (zh) 一种虚拟设备运行方法
CN117992107A (zh) 一种应用程序获取系统以及方法
CN112764832A (zh) 一种应用程序安装、卸载方法及通信终端
CN117827228A (zh) 快应用部署方法及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20846960

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020846960

Country of ref document: EP

Effective date: 20220128