WO2021190469A1 - Appareil terminal et procédé de commande servant à appeler une interface de programme d'application pour celui-ci - Google Patents

Appareil terminal et procédé de commande servant à appeler une interface de programme d'application pour celui-ci Download PDF

Info

Publication number
WO2021190469A1
WO2021190469A1 PCT/CN2021/082260 CN2021082260W WO2021190469A1 WO 2021190469 A1 WO2021190469 A1 WO 2021190469A1 CN 2021082260 W CN2021082260 W CN 2021082260W WO 2021190469 A1 WO2021190469 A1 WO 2021190469A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
class
client process
application program
built
Prior art date
Application number
PCT/CN2021/082260
Other languages
English (en)
Chinese (zh)
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 广州华多网络科技有限公司
Publication of WO2021190469A1 publication Critical patent/WO2021190469A1/fr

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Definitions

  • the invention relates to the application development technology of the Android operating system, in particular to an application program interface call control method, and also to its corresponding terminal equipment.
  • AIDL is one of the IPC (Inter-Process Communication) methods in Android, and is an abbreviation of Android Interface definition language (Android interface definition language).
  • IPC Inter-Process Communication
  • Android Interface definition language Android interface definition language
  • the Client program needs to connect to the Service class of the Server program, obtain the proxy object of the Binder class in the onServiceConnected method, and call the Binder class through the proxy object Interface methods to obtain the functions provided by the Binder class; 7, the Client program needs to maintain its connection with the Service class, because the Service class is the carrier of its communication and interaction.
  • the primary purpose of the present invention is to provide an application program interface call control method for improving application program development efficiency.
  • a terminal device compatible with it is also provided based on the method of the previous object.
  • the present invention provides an application program interface call control method, which includes the following steps:
  • the service component After the service component pre-registered to the operating system of this application is started, the service component accepts the binding communication with the client process of the same application or a different application through the application;
  • This application creates an instance object of the implementation class corresponding to the interface class in response to the interface creation request initiated by the client process based on calling the interface class; the interface registration information corresponding to the implementation class is pre-registered to the interface by this application In the library, it is set in a one-to-one correspondence with the interface class;
  • This application responds to an interface call request for invoking the built-in method of the instance object initiated by the client process, and the request includes the attribute information for executing the built-in method determined according to the interface registration information of the interface library , Call and execute the built-in method of the instance object according to the attribute information to generate result data and feed it back to the client process.
  • the method further includes the following steps:
  • the interface registration information in the interface library includes:
  • Class table information that characterizes the corresponding relationship between the interface identifier of the interface, the implementation class, and the interface class, so as to determine the one-to-one correspondence between the interface class and the implementation class according to the interface identifier;
  • Method table information that characterizes the relationship between the implementation class and its built-in methods and the call operation information of these built-in methods, so as to execute method calls;
  • the instance table information that characterizes the correspondence between the implementation class instance objects that are providing services to the client process and the object identifiers with unique characteristics, so as to implement the invocation of the instance objects.
  • the attribute information includes the interface identifier or object identifier corresponding to the implementation class to which the built-in method belongs and the invocation operation information of the built-in method, and the invocation operation information includes the method identifier and operation of the built-in method. Parameters and return value types.
  • the application program when the application program responds to an interface creation request, it queries the class table information to determine the corresponding implementation class according to the interface identifier specified by the request, so as to create an instance object of the implementation class for it;
  • the built-in method is determined by querying the method table information to call it.
  • the service component of the application program is bound to multiple client processes in parallel, and the application program is suitable for starting one or more of the client processes.
  • the application program and the program to which the client process belongs shall comply with a predetermined agreement, the attribute information is encapsulated and unencapsulated in the first format, and the result data is encapsulated and unencapsulated in the second format.
  • the performance of the application in the memory and the client process construct functional modules corresponding to the functions according to mutual agreements, both of which include a parsing module and a transceiver module, wherein the parsing module is responsible for executing the first format and the first format.
  • the functions related to the second format are realized, and the transceiver module is used to perform communication transmission related to the first format and the second format.
  • the application program constructs an interface management module for uniformly executing the client process and the application program's own access to the interface library.
  • the client process is responsible for maintaining the communication state with the service process to ensure the stability of the cross-process communication between the client process and the service process.
  • the method further includes the following steps:
  • the instance table information generated by the call of the client process is cleared.
  • a terminal device provided by the present invention includes a central processing unit and a memory, and the central processing unit is used to call and run a computer program stored in the memory to execute the above-mentioned
  • the application program interface calls the steps of the control method.
  • the present invention has the following advantages:
  • the method of the present invention uses the interface library to store and manage the implementation classes of the application program, and register its built-in implementation classes in the interface library in advance when the application program is running, and then be called by the client process.
  • the interface identifier is associated with the interface class of the client process and the implementation class of the application, as well as the memory resources such as instance objects and proxy objects of the implementation class. It plays a role in centralized scheduling and management of calls between processes, making the application (Expressed as a service process)
  • the interface call between the client process is more flexible and efficient.
  • the interface library also configures storage and management mechanisms for it, so that the relevant attribute information required for the operation of the built-in method of the instance object can be interoperated across processes by querying the interface library. Therefore, the client process can communicate with each other through its The proxy object can pass parameters and call the built-in methods of the instance object of the service process. Therefore, the setting of the interface library and its protocol analysis mechanism makes it possible to communicate efficiently across processes.
  • the improvement of cross-process communication efficiency is reflected in the development process, especially in the development process of the Android operating system, which can greatly improve the efficiency of program development.
  • the implementation of the present invention makes it unnecessary to perform a completely consistent interface configuration process for a new interface based on AIDL when calling interfaces between different processes.
  • developers only need to create an API interface class and its implementation class for the cross-process communication interface, instead of repeating other well-known steps.
  • the API interface will be registered in the interface library, and the functions corresponding to other known steps are automatically implemented by the method of the present invention in a program process.
  • the present invention can greatly improve the efficiency of program development, help release development capabilities, and comprehensively reduce project development costs.
  • the service process of the present invention is equipped with service components, its interface calling mechanism can provide services for multiple client processes in parallel, regardless of whether these client processes belong to this application or other applications, which is a joint development Projects such as login module, authorization module, payment module, filter module, etc. provide a convenient basis for technical implementation.
  • it is the application program or the client process of a different application program, as long as it complies with the protocol regulated by the method of the present invention, it also has the ability to interact with the application program of the present invention, so as to realize the resource connection with the application program. Call each other and share memory resources with the service process represented by this application.
  • This basic technology is also conducive to ensuring the survival of service processes or client processes in memory, the mechanism of binding each other through service components, scheduling activities that implement class interfaces, and making it possible for processes to wake up each other, ensuring The activity of each process in the memory, to prevent each process from being terminated during the memory cleaning process, and even one process can be used to restart another process, so that these processes are always running in the system.
  • the service process realizes the ability of centralized maintenance and service of the interface, and the client process can simplify the development.
  • One or more client processes regardless of whether these processes belong to the same application or different programs, can be provided by the service process to provide interface services. For terminal programs related to joint development projects that focus on realizing some core functions, or for scenarios that require extended plug-ins, it is more efficient.
  • the present invention adopts a protocol analysis mechanism for the intermediate process data between the service process and the client process. Specifically, the first format is adopted at the call level and the second format is adopted at the result level.
  • the first format is adopted at the call level and the second format is adopted at the result level.
  • Develop some analysis modules with concentrated functions and configure them in the client process and service process so as to facilitate the modular development of the analysis and packaging functions corresponding to different formats, and further improve the development efficiency while ensuring the security of communication between different processes.
  • FIG. 1 is a schematic diagram of the realization structure of the client process and the service process in the principle on which the present invention is implemented;
  • FIG. 2 is a schematic flowchart of an application program interface calling control method in a typical embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a cross-process communication method in a typical embodiment of the present invention.
  • Fig. 4 is a schematic flow diagram of specific steps of step S23 in the cross-process communication method of the present invention.
  • client includes both wireless signal receiver devices, which only have wireless signal receiver devices without transmitting capabilities, and include A device for receiving and transmitting hardware, which has a device capable of receiving and transmitting hardware for two-way communication on a two-way communication link.
  • Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication) System), which can combine voice, data processing, fax and/or data communication capabilities; PDA (Personal Digital Assistant), which can include radio frequency receivers, pagers, Internet/Intranet access, web browsers, and notes Notebook, calendar, and/or GPS (Global Positioning System) receiver; conventional laptop and/or palmtop computer or other equipment, which has and/or includes a conventional laptop and/or radio frequency receiver Palm-size computer or other equipment.
  • cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays
  • PCS Personal Communications Service, personal communication) System
  • PDA Personal Digital Assistant
  • GPS Global Positioning System
  • the “client”, “terminal”, and “terminal device” used here may be portable, transportable, installed in vehicles (air, sea and/or land), or suitable and/or configured to be locally Operate, and/or in a distributed form, operate in any other location on the earth and/or space.
  • the “client”, “terminal”, and “terminal device” used here can also be communication terminals, internet terminals, music/video playback terminals, such as PDA, MID (Mobile Internet Device, mobile Internet device) and/or Mobile phones with music/video playback functions can also be devices such as smart TVs and set-top boxes.
  • terminal equipment and “mobile terminal” in the present invention is essentially a device with the equivalent capabilities of a personal computer, which has a central processing unit (including arithmetic unit and controller), memory, and input
  • the hardware devices of the necessary components disclosed by the Von Neumann principle, such as equipment and output devices, have computer programs stored in their memory, and the central processing unit transfers the programs stored in the external memory into the memory to run, executes the instructions in the programs, and
  • the input and output devices interact to complete specific functions.
  • the application program of the present invention runs in the form of a computer program in a terminal device such as a mobile terminal such as a mobile phone, a tablet, etc.
  • the terminal device runs Android or a forward compatible Android (for example, the "Hongmeng" recently developed by Huawei-Harmony OS) operating system.
  • the application program is scheduled to run in the memory by the central processing unit to implement the relevant method of the present invention.
  • each application program will run in a virtual machine of the system.
  • the operating system also supports a multi-process architecture. Therefore, the same application program may include multiple processes, for example, a process that provides service functions is run by registering a service component on the basis of the main process.
  • a protocol mechanism is established between the service process 2 and the client process 1, and the two have complied with the relevant development agreement in advance. Therefore, in scenarios where the data format is required, it includes encapsulation and decapsulation (analysis) in a specific data format.
  • This kind of agreement exists between each other, so the data encapsulated by the other party can be recognized by each other, and the content transmitted by the other party can be restored correctly. That is to say, between the client process 1 and the service process 2, the data format encapsulated by one party can be correctly parsed by the other party in accordance with the pre-agreement.
  • the agreement between service process 2 and client process 1 defines two formats, the first is the request format, and the second is the result format.
  • the request format is used to encapsulate and decapsulate various requests initiated by the client process 1.
  • the data involved is mainly the interface identifier and method identifier (and attribute information such as method operating parameters and return value types) obtained after the client process parses the interface class annotations.
  • the object identifier carried by the proxy object, etc., and the result format is used to encapsulate and decapsulate various result data generated by the execution of the service process 2.
  • the return value after the method is called and executed.
  • the request format is usually encapsulated by the client process 1 and parsed by the service process 2, and the result data is usually encapsulated by the service process 2 and parsed by the client process 1. For this reason, it will be revealed below that both the client process 1 and the service process 2 will construct specialized functional modules, namely, the parsing modules 13, 23 to implement the encapsulation and decapsulation functions related to these data formats.
  • the service process 2 is responsible for the registration of the interface and subsequently receives the interface creation and invocation request of the client process 1, and provides the interface creation and invocation service for the client process 1.
  • the service process 2 needs to register a service component 20 with the system, thereby realizing background operation.
  • the service process 2 mainly includes a business module 21, an execution module 22, a parsing module 23, a transceiver module 24, and the service component 20, and maintains an interface library 25 by performing registration after startup.
  • the business module 21 is responsible for the interface implementation class The registration function; its service component 20 is mainly provided to the client process 1 for binding, so as to ensure the communication between the service process 2 and the client process 1; on the one hand, the transceiver module 24 is responsible for receiving various requests from the client process 1, On the other hand, it is responsible for feeding back various result data to the client process 1, through its two-way service function to meet the communication transmission between the service process 2 and the client process 1.
  • Its analysis module 23 is mainly used to parse out the client process 1 in the first format (Request format) encapsulated various requests, and encapsulate various result data in the second format (result format) to send to the client process 1 through its transceiver module 24; its execution module 22 is mainly responsible for the response when the client process 1 requests an interface call.
  • the client process 1 is mainly responsible for interacting with the service process 2, serving the interface creation and invocation requirements of its business module 11, and maintaining the request process of interface creation and invocation. After the client process 1 is started, it seeks to bind with the service component 20 of the service process 2, and is responsible for maintaining the bound connection state. If the service process 2 is not started, the client process 1 can even be responsible for calling the service component 20 running the service process 2 to facilitate subsequent calls to related interfaces by itself.
  • client process 1 also has a transceiver module 14 and analysis module 13 corresponding to service process 2.
  • the transceiver module 14 is responsible for receiving various types of service process 2.
  • the result data is responsible for issuing various requests initiated by its own business module 11 to the service process 2; its parsing module 13 is mainly used to parse out the interface identifier from the programming annotations of the interface to be called by its business module 11 and use the first One format encapsulates it into an interface creation request, and is further used to parse the attribute information from the programming annotations of the implementation class built-in method to be called by its business module 11 and encapsulate it into an interface call request in the first format, so that it can be followed by the customer
  • the transceiving module 14 of process 1 sends these requests to the service process 2; the parsing module 13 analyzes various result data from the service process 2 in reverse, including the interface creation request and the result data corresponding to the interface call request for feedback Business module 11 for client process 1.
  • the interface library 3 of the present invention can realize the unified execution of the client process 1 and the service process 2 to access the interface library 3 by constructing a functionally relatively independent interface management module.
  • the interface management module can generally be constructed by the service process 2, or the service process 2 and the client process 1 can each construct their own required functions, and the implementation method is flexible.
  • the interface library 3 maintained by the interface management module is logically mainly maintained by the service process 2 for use by the client process 1, but in an interactive manner, both the service process 2 and the client process 1 will access the interface library 3 in order to implement relevant protocol analysis mechanism.
  • the interface library 3 is mainly used to record relevant data related to the interface, and its manifestation can be flexibly implemented by those skilled in the art.
  • the interface library 3 is mainly used to store the interface registration information formed by the registration of the service process 2 and the interface registration information related to the instance objects generated during the interaction between the service process 2 and the client process 1.
  • the interface registration information can be constructed as the following tables: class table, method table, and instance table.
  • the class table is used to store expression class table information.
  • the class table information is used to characterize the corresponding relationship between the interface identifier of the interface and the implementation class and interface class. Through this corresponding relationship, the client process 1 can query and determine the relevant interface identifier according to the interface class to be called by its business module 11, and the service process 2
  • the relevant implementation classes can be determined according to the parsed interface identification query, and they correspond to each other and can be uniquely determined.
  • the method table is used to store expression method table information.
  • the method table information is used to characterize the relationship between the implementation class and its built-in methods, and the call operation information of these built-in methods.
  • the characterization of the relationship between the implementation class and its built-in methods can be achieved by establishing a unique correspondence relationship between the call operation information of the built-in method in the method table information and the interface identifier.
  • the invoking operation information is the relevant information determined by the service process 2 for each built-in method when the implementation class is registered, including the method identifier assigned to the built-in method, the operating parameters required for the operation of the method, and the method The defined return value type.
  • the client process 1 clarifies the built-in method of a certain implementation class specified by its business module 11, it can query the interface registration information in the interface library 3, specifically the method table, to obtain the method Table information, more clearly, obtain the method ID related to the built-in method. Then, the client process 1 merges the operating parameters and return value types provided by the service module 11 corresponding to the built-in method, and transmits these invocation operating information to the service process 2. After the service process 2 parses out the calling operation information transmitted from the client process 1, and obtains the method identifier therein, it can query the interface library 25 based on the method identifier to determine the built-in method in the specific instance object for execution.
  • the instance table is used to store the information of the expression instance table.
  • the instance table information is used to characterize the information related to the implementation class instance objects that are providing services for the client process 1.
  • each instance object can be assigned a corresponding object identifier, and the proxy object can also carry the identifier.
  • the instance object is further associated with the proxy object, and the instance object can also be determined through the object identifier to be called.
  • other direct or indirect identifiers can also be given, and even further associated with the interface identifiers of related implementation classes. In short, as long as it is sufficient to ensure the uniqueness of subsequent calls to the instance object through the proxy object.
  • Those skilled in the art should be able to implement such things flexibly.
  • Interface registration information refers to the information related to the creation and invocation of the interface used to implement this method, including all kinds of information obtained by the service process 2 by parsing the programming annotations of the implementation class when it is started, and the running process of the service process 2 Instance information maintained in.
  • the business module 21 of the service process 2 will provide the implementation class of the API interface of the service, call the method of registering the service class to register, and the method of registering the service class internally calls the interface management module. After receiving the registration request, it obtains the relevant information of the registered implementation class. , Whether the parsing class is annotated with the interface identifier of the implementation class according to the use of the protocol, and when there is an interface identifier, it is stored as interface registration information for invocation.
  • the service process 2 completes the registration of the interface through this process, forms the basic data of the interface registration information, and provides a key foundation for subsequent cross-process interface calls.
  • the proxy object of the client process 1 needs to call the analysis mechanism of the client process 1 , Query the interface library 3, generally the method table information in it, determine the interface identifier or object identifier corresponding to the built-in method and its calling operation information, and form the attribute information required to run the built-in method, so as to finally provide it to the service process 2 Reverse analysis and use it to ensure that the built-in method of the instance object can be effectively invoked and executed by the service process 2.
  • the attribute is used to indicate the specific instance object by the interface identifier or the object identifier depends on the specific realization of the proxy object.
  • the following principles of the present invention disclose a situation in which the object identifier is used for realization, the original A person of ordinary skill in the art should also understand that the same effect can also be achieved through the interface identification, as long as it is ensured that there is a one-to-one correspondence with the proxy object and the instance object and that each process agrees with each other.
  • the proxy object referred to here is implemented using Java proxy technology.
  • Java proxy technology Those skilled in the art can use Java proxy technology to map the instance object of the corresponding implementation class created by the service process 2 in response to the interface creation request on the client process.
  • the corresponding proxy object The proxy object is generated by the response of the interface creation request.
  • the service process 2 allocates the corresponding object identifier after the instance object is generated, and provides the object identifier to the client process to generate the proxy object.
  • the proxy object also carries the object. Object ID.
  • the business module 11 of the client process 1 initiates a request service for a certain interface class, and the client process 1 responds with a request service method.
  • the method for requesting service uses an analysis mechanism to query the interface library 3 to determine the corresponding interface identifier of the interface class, encapsulate it into request format data, and transmit it to the service process 2.
  • the service process 2 parses the request format data after receiving it, and uses the interface identifier to query the interface registration information in the interface library 3, determines the corresponding implementation class, creates its instance object, and can generate a unique object identifier for the object at the same time ,
  • the corresponding relationship between the object identifier and the object is stored as instance table information, so the proxy object generated by the subsequent client process 1 should naturally carry the object identifier, so that the subsequent proxy object only needs to pass its object identifier to the service process 2, and the service Process 2 can determine the corresponding instance object based on its uniqueness.
  • the client process 1 After the client process 1 generates the proxy object, it is returned to the service module 11 of the client process 1 for further method calls.
  • the business module 11 of the client process 1 obtains the proxy object corresponding to its interface creation request, and further initiates an interface call request to call the relevant built-in method of the instance object pointed to by the proxy object.
  • the client process 1 invokes the analysis mechanism to obtain the method identifier, operating parameters, return value type, and object identifier related to the built-in method, and uses these information to form attribute information, which is formatted and encapsulated and sent to the service process 2.
  • the service process 2 calls the analysis mechanism to parse out the specific information in the attribute information. The service process then calls and executes the built-in method.
  • the instance object to be called can be determined, and the specific internal information can be determined according to the method identifier.
  • Build a method and then pass related operating parameters to the built-in method, and run as the passed parameters of the built-in method. After the built-in method runs, a result that meets the return value type is obtained. Then, the service process 2 can encapsulate the related result data in the second format and return it to the client process 1. After the proxy object in the client process 1 obtains the corresponding analysis of the data call analysis mechanism, it returns to the service module 11 of the client process 1 to complete the response to its interface call request.
  • a step of clearing memory can also be performed.
  • the interface management module clears the related objects in the instance table of the interface library 3 .
  • the client process 1 and the service process 2 can also start or wake up each other one-way or each other according to preset rules, such as timing and trigger conditions, so that both parties can Live in the memory, avoid being cleaned up by the operating system or the memory cleaning program of third-party security software.
  • the application program interface call control method of the present invention is implemented in the form of a computer program, and the application program of the present invention is provided. After the application program is installed and run in the operating system, the execution includes the following steps:
  • step S11 after the service component 20 pre-registered to the operating system of the application is started, the service component 20 accepts the binding communication of the client process 1 belonging to the same application or a different application with the application.
  • this application can declare a service component 20 in its installation configuration file Androidmanifest.xml file. After the service component 20 is started by the system, the application will play the role of service process 2 in the memory.
  • the service component 20 can communicate and interact with other client processes 1.
  • the client process 1 can be either the process where the service component of the application is located, or other applications, especially the client process 1 that is displayed when the application is running for some joint development projects that have agreed on a protocol scheme.
  • an application-related process will run in an independent virtual machine, but it is also allowed to exist in the same application to implement a multi-process architecture.
  • this application can declare service components The way to achieve multi-process architecture. From this, it can be understood that client process 1 and service process 2 can run in the same virtual machine or different virtual machines in parallel.
  • client process 1 does not belong to this application, it means that client process 1 and service process 2 belong to different Memory virtual machine, but due to the realization of the present invention, the development of the interface call between them becomes more convenient.
  • the client process 1 can be bound to it. According to the above-mentioned principle of the present invention, the client process 1 is also responsible for maintaining the connection state between it and the service component in order to determine the stable connection between the client process 1 and the application. After the client process 1 and the service process 2 are bound, the subsequent functions related to the interface call can be further completed.
  • Step S12 In response to the interface creation request initiated by the client process 1 based on calling the interface class, the application creates an instance object of the implementation class corresponding to the interface class; the interface registration information corresponding to the implementation class is used by the application It is registered in the interface library 3 in advance, and is set in a one-to-one correspondence with the interface class.
  • the client process 1 of the present invention will initiate an interface creation request to the application according to the needs of its own business module 11 to use related interfaces.
  • the service module 11 when its service module 11 runs to define or call an instruction of a related interface class, an interface call will occur.
  • the service module 11 first needs the system to create a related interface for it.
  • the client process 1 inquires the class table information in the interface library 3 according to the pre-protocol parsing mechanism, that is, calls its parsing module 13, and determines the interface identifier uniquely corresponding to the interface to be created based on the class table information, and uses the first format to pair
  • the query result is encapsulated, encapsulated into the requested format data, and sent to the application.
  • the transceiver module 24 of the service process 2 of this application will receive the request through the service component and pass it to the parsing module 23 for parsing.
  • the parsing module 23 can decapsulate the request format data to obtain the interface identifier, and then call its execution module 22 After determining the corresponding implementation class from the class table information of the interface library 3 according to the interface identifier, the execution module 22 executes the creation of an instance object of the implementation class.
  • this application has pre-registered the interface registration information related to the implementation class in the interface library 3. According to the corresponding relationship between the implementation class and the interface identifier, it is possible to avoid incorrectly calling the implementation class.
  • the instance object After the instance object is created, it is given an object identifier with unique characteristics. The one-to-one correspondence between the object identifier and the instance object will also be updated to the interface library 3 by this application, and the object identifier will also be used as
  • the result data is encapsulated into result format data in the second format by the parsing module 23 of the service process 2 of this application, and then fed back to the client process 1 via the transceiver module 24.
  • the transceiving module 14 of the client process 1 After receiving the result format data, the transceiving module 14 of the client process 1 passes it to the parsing module 13 of the client process 1 to parse the object identification, and then uses Java proxy technology to create a proxy object of the instance object, which naturally carries the object Logo.
  • the proxy object can communicate with the service process 2 based on its own object identifier, so that the service process 2 can correctly call the relevant instance object.
  • the instance object After the instance object is created, its related information is stored in the instance table of the interface library 3 as the instance table information to provide services. If the client process 1 and the service component 20 of the service process 2 are unbound, the instance table information will become the remaining redundant information. Therefore, a parallel step can be set up to implement the cleanup of the redundant information, specifically After the client process 1 and the service process 2 are unbound, the redundant information in the interface library 3 is deleted. This step can theoretically be implemented in the service process 2 in order to centrally manage the memory, or it can be set in the client process 1, which is implemented by the client process 1 before it determines to unbind.
  • the application program can further provide the client process 1 with a call service for the built-in method of the instance object.
  • Step S13 The application program responds to the interface call request for calling the built-in method of the instance object initiated by the client process 1, and the request includes the interface registration information determined according to the interface library 3 for executing the internal method. According to the attribute information of the method, the built-in method of the instance object is invoked and executed according to the attribute information to generate result data and fed back to the client process 1.
  • the client process 1 After the client process 1 successfully establishes the proxy object of the instance object, it returns to its service module 11 for further calls.
  • the service module 11 of the client process 1 will then initiate an interface call request to a built-in method of the instance object through the proxy object.
  • the proxy object can combine the calling operation information obtained by querying the method table information in the interface library 3, and combine the object identifier carried by itself, the internal
  • the parsing module 13 is encapsulated into the interface call request in the requested format,
  • the transceiver module 14 sends to the application program.
  • the transceiver module 24 of the application program receives the interface call request transmitted by the proxy object, calls the analysis module 23 to analyze the attribute information therein, and then calls the execution module 22 to execute the call to the built-in method.
  • the execution module 22 queries the interface library 3, the corresponding instance object can be determined from the instance table according to the object identifier in the attribute information, and the built-in method of the corresponding instance object can be determined from the method table according to the method identifier, and then Pass the operating parameter data in the attribute information to the target built-in method in the target instance object, call and execute it, so that the target built-in method returns result data that meets the return value type specification.
  • the result data obtained by running the built-in method is encapsulated by the parsing module 23 of the application program into a result format and then sent back to the proxy object of the client process 1.
  • the proxy object parses the result data in reverse and returns it to the business module 11.
  • the service module 11 then obtains the invoking operation result of the built-in method of the instance object generated by the implementation class corresponding to the invoking interface class, and completes the entire process of invoking the interface.
  • the return value type does not need to be added as attribute information. On the one hand, it is not necessary to record the item in the method table information of the interface library 3, and on the other hand, there is no need to interact with the client process 1 and the service process 2. If this item is used in the process, those skilled in the art should be aware of this alternative.
  • this application can independently build an interface management module to centrally manage access to the interface library 3, and provide a calling interface for the modules that need to access the interface library 3 for call execution. , This can improve memory efficiency.
  • the implementation of this exemplary embodiment helps to provide an application program with a cross-process service function at the application program level, and facilitates the access of other applications, thereby facilitating the development of joint program projects.
  • the application program embodied in this exemplary embodiment is installed on a mobile device such as a mobile terminal or a tablet, it can be embodied as another embodiment of the present invention, and this embodiment is embodied as a terminal device provided by the present invention. It includes a central processing unit and a memory, and the central processing unit is used to call and run a computer program stored in the memory to execute each specific step of the application program interface call control method as described above.
  • a cross-process communication method of the present invention includes the following steps:
  • step S21 the client process 1 queries the interface library 3 pre-registered with the interface registration information by the service process 2 to obtain the interface identifier of the interface class according to the invocation of the interface class by its service module 11, and encapsulates the interface class according to the pre-protocol request format.
  • Service process 2 initiates an interface creation request.
  • the interface library 3 has been pre-configured by the service process 2, and the service process 2 has registered class table information and method table information with the interface library 3, and is in the process of interacting with the client process 1.
  • the information of the maintenance instance table is also updated. Therefore, the client process 1 can directly use the interface registration information of the interface library 3 in this step.
  • the client process 1 and the service process 2 also implement their respective internal functional modules according to the principles of the present invention.
  • the business module 11 of the client process 1 first initiates a call to a specific interface class.
  • the client process 1 uses its parsing module 13 to query the interface registration information of the interface library 3, specifically through the interface
  • the class table in library 3 is queried to obtain the interface identifier corresponding to the interface class.
  • the parsing module 13 complies with the agreement with the service process 2 and encapsulates the interface identifier into a request format to form an interface creation request, which is sent to the service process 2 via the transceiver module 14 of the client process 1.
  • Step S22 the service process 2 receives the interface creation request, parses the request, uses the interface identifier therein to execute the creation operation of the corresponding implementation class, generates an instance object of the implementation class, and reversely encapsulates the backward client process in the pre-contracted result format 1 Feedback the result data generated by the creation operation;
  • the service process 2 After the service process 2 receives the interface creation request via its transceiver module 24, its parsing module 23 parses out the interface identifier therein, and then its execution module 22 queries the interface library 3 to determine the implementation class corresponding to the interface identifier After that, the action of creating an instance object of the implementation class is performed.
  • an object identifier is assigned to the instance object, and the object identifier can be used by the client process 1.
  • the service process 2 constructs the instance object, it encapsulates the object identifier of the instance object into the result data according to the second format of the pre-protocol, and returns it to the client process 1 through its transceiver module 24.
  • step S23 the client process 1 receives the result data, parses it into a proxy object of the instance object according to the protocol, and returns it to the business module 11 of the client process 1, so that the business module 11 can call the proxy object. Implement calling the instance object.
  • the client process 1 After the client process 1 receives the result data through its transceiving module 14, it will be handed over to its parsing module 13 to parse out the object identifier therein, and use Java proxy technology to construct a proxy object for the instance object pointed to by the object identifier.
  • the proxy object carries the object identifier, and then returns the proxy object to the service module 11 of the client process 1 for the next method call.
  • the service module 11 can call the instance object by calling the proxy object.
  • the business module 11 uses proxy objects to implement calls to its corresponding instance objects.
  • the client process 1 can follow the following specific steps Cooperate with service process 2 to call the proxy object to further implement the call to the built-in method of the instance object it points to:
  • step S231 the service module 11 of the client process 1 initiates an interface call request for calling the method of the proxy object.
  • the business module 11 of the client process 1 When the business module 11 of the client process 1 needs to call the built-in method of the interface class of the corresponding proxy object, it initiates the interface call request, and expects the returned result by calling the proxy object.
  • the proxy object For the acquisition, the proxy object is responsible for the execution of the intermediate process.
  • Step S232 The proxy object queries the interface library 3 to determine the corresponding attribute information of the method, forms the attribute information into a pre-protocol request format, and sends it to the service process 2.
  • the proxy object can combine the calling operation information obtained by querying the method table information in the interface library 3, and combine the object ID it carries, the method ID of the built-in method, and the built-in information passed by the business module 11.
  • the operating parameters (data) of the method and the attribute information such as the return value type of the built-in method are encapsulated by the calling analysis module 13 into an interface calling request in the request format, and then sent to the service process 2 via the transceiver module 14.
  • step S233 the service process 2 receives and queries the interface library 3 to parse out the attribute information, and calls the corresponding implementation class object to execute the corresponding method therein.
  • the transceiver module 24 of the service process 2 receives the interface call request transmitted by the proxy object, calls the analysis module 23 to analyze the attribute information therein, and then calls the execution module 22 to execute the call to the target method.
  • the execution module 22 queries the interface library 3, the corresponding instance object can be determined from the instance table according to the object identifier in the attribute information, and the built-in method of the corresponding instance object can be determined from the method table according to the method identifier, and then Pass the operating parameter data in the attribute information to the target built-in method in the target instance object, call and execute it, so that the target method returns result data that meets the return value type specification.
  • step S234 the service process 2 feeds back the result data after the execution of the method to the client process 1 in a pre-agreeed result format.
  • the result data obtained by the service process 2 calling the running target method is encapsulated into the result format by the parsing module 23 of the service process 2, and then sent back to the proxy object of the client process 1 through the transceiver module 24 of the service process 2 for internal transmission by the client process 1. Used by its business module 11.
  • step S235 the client process 1 receives the result data, analyzes and restores it, and returns it to its service module 11.
  • the proxy object After the client process 1 receives the result data returned by the service process 2 to the proxy object through its transceiving module 14, the proxy object calls the parsing module 13 to parse the result data in reverse, and returns the parsed result data directly to the business module 11. Then, the service module 11 obtains the calling operation result of the built-in method of the instance object generated by the implementation class corresponding to the calling interface class, and completes the whole process of calling the interface.
  • the return value type does not need to be added as attribute information.
  • the implementation of this exemplary embodiment provides a bottom-level implementation scheme for cross-process communication, so that the principles of the present invention can be applied to the bottom layer, and solve the technical obstacles in cross-process communication.
  • the application program embodied in this exemplary embodiment is further installed on a mobile device such as a mobile terminal or a tablet, it can be embodied as another embodiment of the present invention, and this embodiment is embodied as a method provided by the present invention.
  • the terminal device includes a central processing unit and a memory, and the central processing unit is used to invoke and run a computer program stored in the memory to execute the steps of the aforementioned cross-process communication method.
  • the present invention simplifies the development steps involved in the realization of communication interfaces in the application program development process, and provides a simpler and more efficient cross-process communication solution for jointly developed program projects.
  • the present invention includes equipment for performing one or more of the operations and methods described in the present invention.
  • These devices may be specially designed and manufactured for the required purpose, or may also include known devices in general-purpose computers.
  • These devices have computer programs stored in their memory, which are selectively activated or reconfigured.
  • Such a computer program may be stored in a device (for example, a computer) readable medium or in any type of medium suitable for storing electronic instructions and respectively coupled to a bus.
  • the computer readable medium includes, but is not limited to, any Types of disks (including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory) , Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the readable medium includes any medium that stores or transmits information in a readable form by a device (for example, a computer).
  • a device for example, a computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

L'invention concerne un appareil terminal et un procédé de commande servant à appeler une interface de programme d'application pour celui-ci. Le procédé comprend les étapes suivantes : un programme d'application reçoit, après activation d'un composant de service de celui-ci, une communication de liaison d'un processus client au moyen du composant de service ; le programme d'application crée, en réponse à une demande de création d'interface déclenchée par le processus client sur la base de l'appel d'une classe d'interface, un objet d'instance d'une classe de mise en œuvre correspondante, dans lequel des informations d'enregistrement d'interface correspondant à la classe de mise en œuvre sont pré-enregistrées dans une bibliothèque d'interfaces par le programme d'application ; et le programme d'application appelle et exécute, en réponse à une demande d'appel d'interface déclenchée par le processus client pour appeler un procédé intégré de l'objet d'instance, le procédé intégré de l'objet d'instance servant à générer et à renvoyer des données résultantes au processus client, dans lequel la demande comprend des informations de propriétés déterminées en fonction des informations d'enregistrement d'interface dans la bibliothèque d'interfaces pour exécuter le procédé intégré. La présente invention simplifie les étapes de développement liées à la mise en œuvre d'une interface de communication au cours d'un processus de développement de programme d'application, et fournit une solution de communication entre processus qui est simple, pratique et efficace.
PCT/CN2021/082260 2020-03-24 2021-03-23 Appareil terminal et procédé de commande servant à appeler une interface de programme d'application pour celui-ci WO2021190469A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010212433.9A CN111338828B (zh) 2020-03-24 2020-03-24 终端设备及其应用程序接口调用控制方法
CN202010212433.9 2020-03-24

Publications (1)

Publication Number Publication Date
WO2021190469A1 true WO2021190469A1 (fr) 2021-09-30

Family

ID=71184553

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/082260 WO2021190469A1 (fr) 2020-03-24 2021-03-23 Appareil terminal et procédé de commande servant à appeler une interface de programme d'application pour celui-ci

Country Status (2)

Country Link
CN (1) CN111338828B (fr)
WO (1) WO2021190469A1 (fr)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020498A (zh) * 2022-01-04 2022-02-08 深圳市明源云科技有限公司 不同部署场景的远程调用方法、装置、设备及存储介质
CN114564954A (zh) * 2022-03-01 2022-05-31 天元大数据信用管理有限公司 一种维护指标唯一性的指标管理方法及系统
CN116048744A (zh) * 2022-08-19 2023-05-02 荣耀终端有限公司 一种图像获取方法及相关电子设备
CN116483328A (zh) * 2023-06-19 2023-07-25 广州信位通讯科技有限公司 在ThreadX嵌入式软件平台上运行鸿蒙APP的系统及方法
CN117076160A (zh) * 2023-10-16 2023-11-17 腾讯科技(深圳)有限公司 组件调用方法、装置、设备和存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338828B (zh) * 2020-03-24 2022-04-08 广州方硅信息技术有限公司 终端设备及其应用程序接口调用控制方法
CN111880866B (zh) * 2020-07-30 2024-03-12 广州方硅信息技术有限公司 跨进程回调执行方法、装置、设备及存储介质
CN112099795A (zh) * 2020-09-28 2020-12-18 广州华多网络科技有限公司 界面通知消息构造方法、装置、设备及存储介质
CN112817779A (zh) * 2021-01-29 2021-05-18 京东方科技集团股份有限公司 组件化应用程序通信方法、装置、设备及介质
CN117056317B (zh) * 2023-10-11 2024-01-26 腾讯科技(深圳)有限公司 数据处理方法、装置、设备及计算机可读存储介质

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110258611A1 (en) * 2010-04-20 2011-10-20 Microsoft Corporation Visualization of runtime analysis across dynamic boundaries
CN104618437A (zh) * 2014-12-31 2015-05-13 成都卓影科技有限公司 一种与android终端设备系统设置接口的适配方法
CN105827672A (zh) * 2015-01-05 2016-08-03 阿里巴巴集团控股有限公司 远程调用方法及装置
CN106547567A (zh) * 2016-11-25 2017-03-29 山东大学 一种安卓系统中多业务下进程间通信系统及其实现方法
CN109729149A (zh) * 2018-12-03 2019-05-07 国云科技股份有限公司 一种基于注解的微服务框架实现方法
CN109933443A (zh) * 2019-03-07 2019-06-25 腾讯科技(深圳)有限公司 进程间通信方法、装置、计算机设备及可读存储介质
CN111338828A (zh) * 2020-03-24 2020-06-26 广州华多网络科技有限公司 终端设备及其应用程序接口调用控制方法
CN111400070A (zh) * 2020-03-24 2020-07-10 广州华多网络科技有限公司 终端设备及其跨进程接口调用实现和执行方法
CN111443961A (zh) * 2020-03-24 2020-07-24 广州华多网络科技有限公司 终端设备及其跨进程通信方法
CN111880866A (zh) * 2020-07-30 2020-11-03 广州华多网络科技有限公司 跨进程回调执行方法、装置、设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7543300B2 (en) * 2004-11-16 2009-06-02 International Business Machines Corporation Interface for application components
CN108055248B (zh) * 2017-11-30 2020-12-25 平安科技(深圳)有限公司 基于dubbo框架的远程调用方法、服务器及存储介质
CN109213611B (zh) * 2018-08-01 2021-07-02 天津字节跳动科技有限公司 跨进程通讯方法、装置、终端及存储介质
CN110275790A (zh) * 2019-06-26 2019-09-24 北京金山安全软件有限公司 应用程序中的进程间通信同步回调方法、系统及相关设备

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110258611A1 (en) * 2010-04-20 2011-10-20 Microsoft Corporation Visualization of runtime analysis across dynamic boundaries
CN104618437A (zh) * 2014-12-31 2015-05-13 成都卓影科技有限公司 一种与android终端设备系统设置接口的适配方法
CN105827672A (zh) * 2015-01-05 2016-08-03 阿里巴巴集团控股有限公司 远程调用方法及装置
CN106547567A (zh) * 2016-11-25 2017-03-29 山东大学 一种安卓系统中多业务下进程间通信系统及其实现方法
CN109729149A (zh) * 2018-12-03 2019-05-07 国云科技股份有限公司 一种基于注解的微服务框架实现方法
CN109933443A (zh) * 2019-03-07 2019-06-25 腾讯科技(深圳)有限公司 进程间通信方法、装置、计算机设备及可读存储介质
CN111338828A (zh) * 2020-03-24 2020-06-26 广州华多网络科技有限公司 终端设备及其应用程序接口调用控制方法
CN111400070A (zh) * 2020-03-24 2020-07-10 广州华多网络科技有限公司 终端设备及其跨进程接口调用实现和执行方法
CN111443961A (zh) * 2020-03-24 2020-07-24 广州华多网络科技有限公司 终端设备及其跨进程通信方法
CN111880866A (zh) * 2020-07-30 2020-11-03 广州华多网络科技有限公司 跨进程回调执行方法、装置、设备及存储介质

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114020498A (zh) * 2022-01-04 2022-02-08 深圳市明源云科技有限公司 不同部署场景的远程调用方法、装置、设备及存储介质
CN114564954A (zh) * 2022-03-01 2022-05-31 天元大数据信用管理有限公司 一种维护指标唯一性的指标管理方法及系统
CN114564954B (zh) * 2022-03-01 2024-04-12 天元大数据信用管理有限公司 一种维护指标唯一性的指标管理方法及系统
CN116048744A (zh) * 2022-08-19 2023-05-02 荣耀终端有限公司 一种图像获取方法及相关电子设备
CN116048744B (zh) * 2022-08-19 2023-09-12 荣耀终端有限公司 一种图像获取方法及相关电子设备
CN116483328A (zh) * 2023-06-19 2023-07-25 广州信位通讯科技有限公司 在ThreadX嵌入式软件平台上运行鸿蒙APP的系统及方法
CN116483328B (zh) * 2023-06-19 2023-09-12 广州信位通讯科技有限公司 在ThreadX嵌入式软件平台上运行鸿蒙APP的系统及方法
CN117076160A (zh) * 2023-10-16 2023-11-17 腾讯科技(深圳)有限公司 组件调用方法、装置、设备和存储介质
CN117076160B (zh) * 2023-10-16 2024-01-26 腾讯科技(深圳)有限公司 组件调用方法、装置、设备和存储介质

Also Published As

Publication number Publication date
CN111338828B (zh) 2022-04-08
CN111338828A (zh) 2020-06-26

Similar Documents

Publication Publication Date Title
WO2021190469A1 (fr) Appareil terminal et procédé de commande servant à appeler une interface de programme d'application pour celui-ci
CN111400070B (zh) 终端设备及其跨进程接口调用实现和执行方法
CN111443961B (zh) 终端设备及其跨进程通信方法
WO2021109735A1 (fr) Procédé de traitement de ressource basé sur un réseau inter-chaînes, et dispositif
CN111880866B (zh) 跨进程回调执行方法、装置、设备及存储介质
US10318358B2 (en) System and method for extending a web service environment to support scalable asynchronous clients
US7665096B2 (en) DDS-assisted CORBA discovery
CN110336871A (zh) 一种文件处理方法、装置、存储介质及电子设备
CA2511912A1 (fr) Systeme et procede permettant de construire et d'executer des applications client de services generiques neutres quant a la plate-forme
CN105094922A (zh) 应用程序免安装运行控制方法及其装置
WO2015135221A1 (fr) Procédé de communication inter-processus basé sur une couche d'application d'android et système de communication d'applications de base
WO2012122884A1 (fr) Plate-forme de gestion ouverte de modules d'extension et procédé de gestion de modules d'extension mis en œuvre dans un navigateur
JP2015537307A (ja) コンポーネント指向ハイブリッドクラウドオペレーティングシステムのアーキテクチャ及びその通信方法
US9037695B2 (en) Management of networked resources on different platforms with a common interface
CN113032166B (zh) 核间通信的方法、处理器、核间通信系统及计算机可读存储介质
JP2014528116A (ja) ポータブルコンピューティングデバイスにおける分散リソース管理
WO2019085780A1 (fr) Système de stockage en nuage et procédé de réalisation d'un traitement de données défini par l'utilisateur dans un système de stockage en nuage
US11411812B2 (en) Dynamic service creation for microservice-based integration service
CN111582824A (zh) 云资源同步方法、装置、设备及存储介质
KR100833494B1 (ko) 임베디드 단말의 OSGi 미들웨어 환경에서 이원화된애플리케이션 관리를 통한 애플리케이션 경량화를 위한장치 및 그 방법
CN116820527B (zh) 程序升级方法、装置、计算机设备和存储介质
US11929933B2 (en) Ephemeral data stream routing service
WO2022121492A1 (fr) Procédé et appareil de transmission de fichiers, dispositif informatique et support d'enregistrement
WO2021057351A1 (fr) Appareil et procédé de commande de système bluetooth android dans un environnement glibc, et dispositif terminal
WO2023035777A1 (fr) Procédé de configuration de réseau, composant mandataire, contrôleur, dispositif électronique et support de stockage

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: 21774968

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21774968

Country of ref document: EP

Kind code of ref document: A1