CN112988289A - Method and system for calling interface - Google Patents

Method and system for calling interface Download PDF

Info

Publication number
CN112988289A
CN112988289A CN202110384038.3A CN202110384038A CN112988289A CN 112988289 A CN112988289 A CN 112988289A CN 202110384038 A CN202110384038 A CN 202110384038A CN 112988289 A CN112988289 A CN 112988289A
Authority
CN
China
Prior art keywords
target interface
interface
calling
attribute information
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110384038.3A
Other languages
Chinese (zh)
Inventor
路绪光
彭帮
吴旺邦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202110384038.3A priority Critical patent/CN112988289A/en
Publication of CN112988289A publication Critical patent/CN112988289A/en
Pending legal-status Critical Current

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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

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

The embodiment of the disclosure provides a method and a system for calling an interface, comprising the following steps: obtaining the serialized data of the target interface, performing deserialization processing on the serialized data to obtain the attribute information of the target interface, calling and executing the target interface according to the attribute information of the target interface, generating and outputting feedback information, wherein the feedback information is used to indicate that the target interface has been called and/or executed, by obtaining serialized data, deserializing the serialized data to obtain attribute information of the target interface, executing interface calling and executing operation of the interface based on the attribute information of the target interface, through the combination of the serialization processing and the deserialization processing, the transmission format when each interface is called does not need to be defined, and the transmission formats do not need to be coded and decoded correspondingly on the basis, so that the complexity of calling the interface is reduced, the calling cost of the interface is reduced, and the flexibility of calling the interface is improved.

Description

Method and system for calling interface
Technical Field
The embodiment of the disclosure relates to the technical field of computer and network communication, in particular to a method and a system for calling an interface.
Background
With the development of cloud computing technology, scenes based on cloud computing are applied, such as game scenes. In a cloud computing-based scenario, a server may virtualize an operating system (e.g., android system) on a host through a virtualization technology, and a same Software Development Kit (SDK) is implemented in different languages on the virtual machine and the host.
In the prior art, when an Application program in a virtual machine needs to call an SDK, the call operation of the virtual machine may be put into a host to be implemented, and specifically, for each kind of call of the SDK, a transmission format is defined according to an Application Programming Interface (API, which may be simply referred to as an Interface) of the SDK, so that the virtual machine and the host perform corresponding encoding and decoding based on the transmission format.
However, with calls for each SDK (specifically for the interface), the transport format is defined and encoded and decoded accordingly, which may pose problems of high complexity and poor flexibility.
Disclosure of Invention
The embodiment of the disclosure provides a method and a system for calling an interface, so as to overcome the problem of high complexity of interface calling.
In a first aspect, an embodiment of the present disclosure provides a method for calling an interface, including:
acquiring serialized data of a target interface, wherein an interactive party completing the method for calling the interface adopts different interface calling languages;
performing deserialization processing on the serialized data to obtain attribute information of the target interface;
and calling and executing the target interface according to the attribute information of the target interface, and generating and outputting feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed.
In a second aspect, an embodiment of the present disclosure provides a method for calling an interface, including:
determining a target interface to be called according to the acquired interface calling requirement, and determining attribute information of the target interface, wherein an interactive party completing the method for calling the interface adopts different interface calling languages;
serializing the attribute information of the target interface to obtain and output serialized data, wherein the serialized data is used for indicating to call and execute the target interface;
receiving feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed.
In a third aspect, an embodiment of the present disclosure provides a terminal device, including:
the acquisition module is used for acquiring the serialized data of the target interface, wherein the interaction party completing the method for calling the interface adopts different interface calling languages;
the first processing module is used for performing deserialization processing on the serialized data to obtain attribute information of the target interface;
the first generation module is used for calling and executing the target interface according to the attribute information of the target interface and generating feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed;
and the first output module is used for outputting the feedback information.
In a fourth aspect, an embodiment of the present disclosure provides a server, including:
the second determining module is used for determining a target interface to be called according to the acquired interface calling requirement and determining attribute information of the target interface, wherein an interactive party completing the interface calling method adopts different interface calling languages;
the second processing module is used for carrying out serialization processing on the attribute information of the target interface to obtain and output serialized data, wherein the serialized data is used for indicating to call and execute the target interface;
a receiving module, configured to receive feedback information, where the feedback information is used to indicate that the target interface has been called and/or executed.
In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method as set forth in the first aspect above and in various possible designs of the first aspect; or cause the at least one processor to perform a method as set forth above for the second aspect and various possible designs of the second aspect.
In a sixth aspect, the disclosed embodiments provide a computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, implement the method as set forth in the first aspect and various possible designs of the first aspect; alternatively, the method as described above in the second aspect and various possible designs of the second aspect is implemented.
In a seventh aspect, a computer program product is provided, the program product comprising: a computer program stored in a readable storage medium, from which the computer program can be read by at least one processor of an electronic device, execution of the computer program by the at least one processor causing the electronic device to perform the method of the first aspect; alternatively, the first and second electrodes may be,
execution of the computer program by the at least one processor causes the electronic device to perform the second aspect and various possible designs of the method of the second aspect.
In an eighth aspect, a system for invoking an interface is provided, including:
the terminal device according to the third aspect and various possible designs of the third aspect;
a server as claimed in the fourth aspect and various possible designs of the fourth aspect.
The method and system for calling the interface provided by the embodiment comprise the following steps: obtaining serialized data of a target interface, wherein an interactive party completing a method for calling the interface adopts different interface calling languages, carries out deserialization processing on the serialized data to obtain attribute information of the target interface, calls and executes the target interface according to the attribute information of the target interface, and generates and outputs feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed, in the embodiment, the attribute information of the target interface is obtained by obtaining the serialized data (namely the serialized data obtained by serializing the attribute information of the target interface), carrying out deserialization processing (namely the reverse process of the serializing processing) on the serialized data, carrying out the operation of calling and executing the interface based on the attribute information of the target interface, and by the combination of the serializing processing and the deserializing processing, the transmission format of each interface when calling is not required to be defined, and coding and decoding of each transmission format respectively and correspondingly are not needed on the basis, so that the complexity of interface calling is reduced, the interface calling cost is reduced, and the flexibility of calling the interface is improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a method for calling an interface according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a method for invoking an interface according to another embodiment of the disclosure;
FIG. 3 is a flowchart illustrating a method for invoking an interface according to another embodiment of the disclosure;
fig. 4 is a schematic diagram of a terminal device according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a terminal device according to another embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a server according to one embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a server according to another embodiment of the present disclosure;
fig. 8 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
With the development of internet technology and big data technology, cloud computing (or grid computing) related technology has developed rapidly, and as it can complete the processing of tens of thousands of data in a very short time (e.g. several seconds), so as to achieve a strong network service, it is widely applied to different scenes, such as game scenes based on cloud computing, etc.
As can be seen from the above description of the background art, the same SDK is implemented by different languages in the virtual machine and the host, and if the transmission format is defined according to the application program interface of the SDK for each invocation of the SDK, so that the virtual machine and the host perform corresponding encoding and decoding based on the transmission format, the technical problems of higher complexity and lower flexibility are likely to be caused.
In order to solve the above technical problems, the inventors of the present disclosure have made creative efforts to obtain the inventive concept of the present disclosure: one of the interactive parties completing the method for calling the interface carries out serialization processing on the attribute information of any interface to obtain serialized data, the other interactive party carries out deserialization processing on the serialized data to obtain the attribute information of any interface, and the interface is called and executed based on the attribute information of any interface.
The following describes the technical solutions of the present disclosure and how to solve the above technical problems in specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for calling an interface according to an embodiment of the disclosure.
As shown in fig. 1, the method includes:
s101: serialized data of the target interface is obtained.
The interactive party which completes the method for calling the interface adopts different interface calling languages.
For example, the execution main body of this embodiment may be a device for calling an interface, and the device for calling the interface may be a terminal device, a processor, a chip, and the like, and this embodiment is not limited.
If the execution subject of the present embodiment is a terminal device, the terminal device may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem, which have wireless communication functions.
In particular, the terminal equipment may be mobile terminals such as mobile telephones (or so-called "cellular" telephones) and computers with mobile terminals, e.g. mobile devices which may be portable, pocket, hand-held, computer-included or vehicle-mounted, which exchange language and/or data with a radio access network; the terminal device may also be a Personal Communication Service (PCS) phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a tablet computer, a Wireless modem (modem), a handheld device (handset), a laptop computer (laptop computer), a Machine Type Communication (MTC) terminal, or the like; the Terminal Device may also be referred to as a system, a Subscriber Unit (Subscriber Unit), a Subscriber Station (Subscriber Station), a Mobile Station (Mobile), a Remote Station (Remote Station), a Remote Terminal (Remote Terminal), an Access Terminal (Access Terminal), a User Terminal (User Terminal), a User Agent (User Agent), a User Device or User Equipment, etc., and is not limited herein.
In some embodiments, if the execution subject of this embodiment is a terminal device, the terminal device includes a host that establishes a bidirectional full-duplex communication link with another party in the interacting party through an interprocess communication Domain Socket and is generated by using a desktop virtualization data transmission SPICE protocol.
That is, the host may be a party that completes the interaction of the method of the calling interface. Accordingly, the other party of the interacting party who completes the method of calling the interface may be a server, and the server includes a virtual machine that establishes a bidirectional full-duplex communication link with the other party of the interacting party through interprocess communication and that is generated using a desktop virtualization data transfer protocol.
That is to say, the interaction party for completing the method for calling the interface may include two parties, one party is a host (i.e. a terminal device), and on the one hand is a virtual machine (i.e. a server), the host and the virtual machine may manage a bidirectional duplex communication link through interprocess communication, the host may be a client using a desktop virtualization data transmission protocol as the desktop virtualization data transmission protocol, and the virtual machine may be a server using the desktop virtualization data transmission protocol and an event-driven selection mechanism Linux operating system interface.
On the basis of the above analysis, the present embodiment can be understood as follows: the terminal device (specifically, a host) receives serialized data of a target interface sent by a server (specifically, a virtual machine), and different interface calling languages are adopted between the terminal device and the server.
It should be understood that the target interface may be any interface in the interfaces, and in this embodiment, the currently called interface is referred to as the target interface in order to distinguish the currently called interface from the non-currently called interface, and therefore, the target interface should not be understood as a limitation on the interfaces (such as the types of the interfaces).
Serialization (Serialization) is understood to be the process of converting the property information of an object into a form that can be stored and/or transmitted.
Accordingly, in this embodiment, the serialized data may be understood as data obtained by serializing the attribute information of the target interface. The serialized data may be specifically understood as data of attribute information of the target interface in a transmission format.
S102: and performing deserialization processing on the serialized data to obtain attribute information of the target interface.
Wherein the deserialization process is the reverse of the serialization process. This step can be understood as: and the host machine is subjected to deserialization processing in an inverse process so as to obtain the attribute information of the target interface.
For example, the attribute information of the target interface may be understood as related information characterizing (or describing) a state or a feature of the target interface, such as a type of the target interface, and the like.
It should be noted that, in the embodiment of the present disclosure, attribute information of a target interface obtained by serialization and deserialization which are inverse processes to each other is introduced, as set forth in the above embodiment: the host machine receives serialized data of a target interface sent by the virtual machine (namely, the virtual machine carries out serialization processing on the attribute information of the target interface to obtain the serialized data), the host machine carries out deserialization processing (namely, the reverse process of the serialization processing) on the serialized data to obtain the attribute information of the target interface, so that subsequent S103 is carried out based on the attribute information of the target interface, namely, calling and execution of the target interface are carried out, the problems of high complexity and poor flexibility caused by the fact that a transmission format needs to be defined and correspondingly coded and decoded aiming at calling of each interface are avoided, the flexibility of interface calling is realized, and the technical effect of calling cost is reduced.
S103: and calling and executing the target interface according to the attribute information of the target interface, and generating and outputting feedback information.
Wherein the feedback information is used to indicate the called and/or executed target interface.
In one example, the feedback information may be used to indicate a target interface that has been invoked. For example, the device calling the interface may generate feedback information when completing calling the target interface, so as to indicate that the device calling the interface has completed calling the target interface through the feedback information.
In another example, feedback information may be used to indicate that a target interface has been executed. For example, the device calling the interface may generate feedback information when executing the target interface, so as to indicate, through the feedback information, that the device calling the interface has executed the target interface.
Of course, in yet another example, the feedback information may be used to indicate both that the device calling the interface has completed the call to the target interface and that the device calling the interface has executed the target interface.
For example, with reference to the foregoing embodiments, and taking the feedback information as both an indication of a target interface that has been called and an indication of a target interface that has been executed as an example, after performing deserialization processing on serialized data to obtain attribute information of the target interface, the host may execute an operation of calling the target interface according to the attribute information of the target interface, may execute an operation of the target interface, and generate feedback information based on the called and/or executed operation, thereby sending the feedback information to the virtual machine.
Based on the above analysis, an embodiment of the present disclosure provides a method for invoking an interface, including: obtaining serialized data of a target interface, wherein an interactive party completing a method for calling the interface adopts different interface calling languages, carries out deserialization processing on the serialized data to obtain attribute information of the target interface, calls and executes the target interface according to the attribute information of the target interface, and generates and outputs feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed, in the embodiment, the attribute information of the target interface is obtained by obtaining serialized data (serialized data obtained by serializing the attribute information of the target interface), carrying out deserialization processing on the serialized data (reverse process of the serializing processing), and executing the calling of the target interface and the operation of the target interface based on the attribute information of the target interface, and through the combination of the serializing processing and the deserialization processing, the definition of transmission formats of each interface call is not needed, and the encoding and decoding of the transmission formats corresponding to each other are not needed on the basis, so that the complexity of the interface call is reduced, the interface call cost is reduced, and the flexibility of the call interface is improved.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a method for invoking an interface according to another embodiment of the present disclosure.
As shown in fig. 2, the method includes:
s201: the terminal equipment and the server establish a bidirectional full-duplex communication link with each other through interprocess communication, the terminal equipment and the server determine to serve as a host machine for realizing the method of the calling interface based on the SPICE communication protocol, and the server serves as a virtual machine for realizing the method of the calling interface.
In some embodiments, the virtual machine may establish communication with the host through an Agent Interface (Agent Interface), and the Agent Interface may be mapped to a string device in the virtual machine.
S202: and the virtual machine determines the attribute information of the target interface according to the target interface to be called.
For example, the virtual machine may determine a target interface based on the service requirement, and after determining the target interface, obtain attribute information of the target interface.
Specifically, the virtual machine may determine an interface call requirement based on the service requirement, determine a target interface to be called based on the interface call requirement, and obtain attribute information of the target interface.
For example, if an application program in the virtual machine is using an audio/video interface, the operation of the virtual machine may be implemented by placing the virtual machine on a host to improve performance, and the service requirement may be understood as a service for audio/video push, and the interface calling requirement is a calling requirement for calling an interface that completes the service for audio/video push, and the determined target interface is an audio/video interface, that is, an interface that needs to call and execute audio/video.
S203: and the virtual machine carries out serialization processing on the attribute information of the target interface to obtain serialized data.
Wherein the serialized data is used to instruct the invocation and execution of the target interface.
In some embodiments, the same interface has the same attribute information in the interacting party, and the attribute information of the target interface includes a name and a parameter.
That is, the same interface has the same attribute information in the virtual machine and the host, and the attribute information may include a name and a parameter. For example, the target interface has the same name in the virtual machine and the host machine, and also has the same parameters.
Wherein the parameters may include: handle, structure, and string pointer type, etc., are not listed here.
Correspondingly, the attribute information of the target interface includes a name and a parameter, so that when the virtual machine performs serialization processing on the attribute information of the target interface, the name and the parameter in the attribute information of the target interface can be subjected to serialization processing to obtain serialized data.
S204: and the virtual machine sends the serialized data to the host machine.
Accordingly, the host receives the serialized data sent by the virtual machine.
By combining the above analysis, it can be known that communication can be established between the virtual machine and the host machine through the proxy interface, and the proxy interface can be mapped into the character string device in the virtual machine, so that the virtual machine can be realized by writing the character string device when sending the serialized data to the host machine, thereby improving the interaction efficiency between the virtual machine and the interactive machine.
Correspondingly, a plurality of receiving processes can be set in the host, a descriptor list can be set, and when serialized data sent by the virtual machine needs to be received, the descriptor of the corresponding character string device is added to the monitored descriptor list, the host can traverse the monitored descriptor list in a circular traversal mode, when the descriptor list is traversed, the receiving process corresponding to the character string device which is not in the descriptor list can be put into a sleep state for the character string device which is not in the descriptor list, and the receiving process corresponding to the character string device in the descriptor list can be woken up for the character string device in the descriptor list, so that the woken receiving process can execute a receiving task, namely receive the serialized data sent by the virtual machine.
It should be noted that, in this embodiment, different receiving threads execute respective corresponding receiving tasks, so that asynchronous calling in a non-blocking manner can be implemented, thereby achieving the technical effect of improving the efficiency of calling an interface.
S205: and the host machine carries out deserialization processing on the serialized data to obtain the attribute information of the target interface.
As can be seen from the foregoing embodiments, the serialization processing and the deserialization processing are inverse processes, and when the host receives the serialized data sent by the host after the serialization processing, the host can process the serialized data based on the inverse process of the serialization processing, that is, the deserialization processing, to obtain the attribute information of the target interface.
It should be noted that serialization and deserialization are inverse processes to each other, and therefore, the host machine and the virtual machine can preset the serialization and deserialization modes.
For example, if the virtual machine performs serialization processing in the Java manner to obtain serialized data, the host machine also performs deserialization processing in the Java manner to obtain attribute information of the target interface.
For another example, if the virtual machine performs serialization processing in a Json manner to obtain serialized data, the host machine also performs deserialization processing in the Json manner to obtain attribute information of the target interface.
S206: and the host machine determines a target interface corresponding to the attribute information of the target interface from the preset storage relation.
Wherein the storage relationship is used for representing the corresponding relationship between the attribute information and the interface.
It should be noted that the storage relationship is not limited in this embodiment, for example, the storage relationship may be a relational mapping table or a key-value pair.
This step can be understood as: after the host obtains the attribute information of the target interface through deserialization, the host may determine the attribute information of the target interface in the storage relationship based on the attribute information of the target interface, and determine the target interface corresponding to the attribute information of the target interface from the storage relationship.
The host machine determines the target interface corresponding to the attribute information of the target interface by combining the storage relation, so that the target interface can be quickly and conveniently determined, and the technical effect of improving the efficiency and the accuracy of determining the target interface is realized.
Based on the above analysis, it can be known that the target interface has the same attribute information in the host and the virtual machine, the attribute information of the target interface includes a name and a parameter, the storage relationship may be a relational mapping table or a key-value pair, and if the storage relationship is a key-value pair, S206 may include the following steps:
step 1: a key corresponding to the name is determined from the key-value pair store, and a value corresponding to the parameter is determined from the key-value pair store.
When the key value pair storage is performed on the attribute information of any interface, the name of the interface can be determined as a key in the key value pair, and the parameter can be determined as a value in the key value pair.
Step 2: and determining a target interface corresponding to the attribute information of the target interface according to the key corresponding to the name and the value corresponding to the parameter.
By way of example, this embodiment can be understood as: the host machine stores key value pairs, keys in the key value pairs correspond to names, values in the key value pairs correspond to parameters, if the host machine determines attribute information of a target interface, the host machine can judge whether the attribute information of the target interface hits the key value pairs, if the attribute information of the target interface hits the key value pairs, the target interface including the corresponding name and the corresponding parameter is shown in the host machine, the host machine can determine that the hit interface is the target interface, and subsequent operations such as calling and executing can be performed.
It should be noted that, in this embodiment, the host determines the target interface corresponding to the attribute information of the target interface information by combining the key value pair, so that the accuracy and reliability of determining the target interface can be achieved, and the technical effect of improving the efficiency of determining the target interface can be improved.
S207: and the host calls and executes the target interface to generate feedback information.
Wherein the feedback information is used to indicate the called and/or executed target interface.
It should be noted that, when the host calls the target interface, different results of calling the target interface may be generated according to different situations.
For example, if a network error occurs when the host calls the target interface, the call result of the host calling the target interface may be a call failure, and so on, which are not listed here.
Similarly, after the host calls the target interface, the host may also generate different results for executing the target interface according to different situations when executing the target interface.
For example, if an abnormal condition such as a network error occurs when the host executes the target interface, the execution result of the host calling the target interface may be an execution failure, and so on, which are not listed here.
In some embodiments, the feedback information comprises: the information obtained by serializing the calling result of the calling target interface and the information obtained by serializing the execution result generated by the executing target interface.
In combination with the above analysis, the serialized data sent by the virtual machine to the host machine is the attribute information of the target interface serialized by the virtual machine, accordingly, when the host machine determines the call result of the call target interface, the call result can be serialized to obtain serialized information corresponding to the call result, and similarly, when the host machine determines the execution result of the execution target interface, the host machine can serialize the execution result to obtain serialized information corresponding to the execution result, so as to obtain feedback information, so as to send the feedback information to the virtual machine.
In this embodiment, by generating the feedback information after the serialization processing, the recognition efficiency of the virtual machine on the feedback information can be improved, the reliability and efficiency of interface calling can be improved, and the game experience and video experience of the user can be improved.
Based on the above analysis, when the target interface is called and/or executed, a failure result may exist due to factors such as a network, and in some embodiments, if the execution result represents that the execution target interface fails, the execution result carries an exception code corresponding to the failure of executing the target interface, and the exception code is used to indicate a reason for the failure of executing the target interface.
It should be noted that, in this embodiment, if the host fails to execute the target interface, an execution result of the exception code carrying a reason for executing the target interface failure is generated, so that the virtual machine can quickly and accurately locate the failure to execute the target interface, so as to adjust the policy of subsequently executing the target interface, thereby achieving the technical effect of improving the accuracy and reliability of executing the target interface.
The exception code may be preset for the host and the virtual machine, so as to determine different failure types through different exception codes.
In some embodiments, the host may store a mapping of exception codes to failure causes. For example, when the host executes the target interface, if the target interface fails to be executed, the host determines the reason of the failure, determines the exception code corresponding to the reason of executing the target interface identification based on the mapping relationship between the stored exception code and the identification reason, carries the exception code in the execution result, and sends the exception code to the virtual machine.
Accordingly, the virtual machine may also store a mapping relationship between the exception code and the failure reason. For example, the virtual machine receives feedback information sent by the host, determines whether the feedback information includes an exception code, and if the feedback information includes the exception code, the virtual machine may determine a failure reason corresponding to the exception code according to a mapping relationship between the exception code and the failure reason, and may send a notification message to a caller (e.g., a user) of the target interface based on the failure reason.
It should be understood that the notification message may be generated for the virtual machine based on the feedback information and used to indicate a call result of the target interface and an execution result generated by the target interface executing the call, and when the exception code is included in the feedback information, a reason for a failure in executing the call interface may be included in the notification message.
S208: and the host machine sends feedback information to the virtual machine.
Accordingly, the virtual machine receives feedback information sent by the host machine.
S209: and the virtual machine generates a notification message according to the feedback information.
The notification message is used for indicating the calling result of the target interface and the execution result generated by the target interface for executing the calling.
That is, the notification message may include contents of two dimensions, where the contents of one dimension are a call interface for calling the target interface, and the contents of the other dimension are an execution result of the execution target interface.
In some embodiments, the virtual machine may output notification information to a client that initiated a call request to the virtual machine.
For example, it is analyzed and known in conjunction with the foregoing embodiment that, if the method for invoking an interface of this embodiment is applied to a game scenario, and the client may be a client for a game that is provided in a user terminal, the virtual machine may output a notification message to the client, and accordingly, the client may adaptively display the notification message, that is, the client may display corresponding content, such as a network anomaly, on a display of the user terminal based on the specific content of the notification message.
Similarly, if the method for invoking the interface of the embodiment is applied to an audio/video push scenario, and the client may be a client for pushing audio/video, which is disposed in the user terminal, the virtual machine may output a notification message to the client, and accordingly, the client may adaptively display the notification message, that is, the client may display corresponding content, such as network anomaly, on a display of the user terminal based on the specific content of the notification message.
It should be noted that the host may complete the call of the target interface and send feedback information to the virtual machine after executing the target interface, or the virtual machine may output a prompt message based on time when there is a failure in the host to call the target interface and if the host does not complete the call of the target interface.
Illustratively, if the virtual machine does not receive the feedback information within a preset time period, a prompt message is output.
Wherein, the prompt message is used for prompting the calling overtime.
The preset time period may be set by the virtual machine based on a requirement, a history, a test, and the like, which is not limited in this embodiment.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating a method for invoking an interface according to another embodiment of the present disclosure.
As shown in fig. 3, the method includes:
s301: and determining a target interface to be called according to the acquired interface calling requirement, and determining the attribute information of the target interface.
Illustratively, the execution subject of the embodiment may be a server, and the server includes a virtual machine that is generated by establishing a bidirectional full-duplex communication link with another party of the interacting parties through interprocess communication and adopting a desktop virtualization data transmission protocol.
The interactive party which completes the method for calling the interface adopts different interface calling languages.
S302: and carrying out serialization processing on the attribute information of the target interface to obtain and output serialized data.
Wherein the serialized data is used to instruct the invocation and execution of the target interface.
In some embodiments, the same interface has the same attribute information in the interacting party, and the attribute information of the target interface includes a name and a parameter; s302 may include: and carrying out serialization processing on the name and the parameter in the attribute information of the target interface to obtain serialized data.
S303: and receiving feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed.
In some embodiments, the feedback information comprises: the information obtained by serializing the calling result of the calling target interface and the information obtained by serializing the execution result generated by the executing target interface.
S304: and generating and outputting a notification message according to the feedback information.
The notification message is used for indicating the calling result of the target interface and the execution result generated by the target interface for executing the calling.
In some embodiments, if the feedback information is not received within the preset time period, a prompt message is output, where the prompt message is used to prompt that the call is timed out.
Referring to fig. 4, fig. 4 is a schematic diagram of a terminal device according to an embodiment of the disclosure.
As shown in fig. 4, the terminal device 400 includes:
the obtaining module 401 is configured to obtain serialized data of a target interface, where an interactive party that completes a method for calling the interface uses different interface calling languages.
The first processing module 402 is configured to perform deserialization processing on the serialized data to obtain attribute information of the target interface.
A first generating module 403, configured to invoke and execute the target interface according to the attribute information of the target interface, and generate feedback information, where the feedback information is used to indicate that the target interface has been invoked and/or executed.
A first output module 404, configured to output the feedback information.
Referring to fig. 5, fig. 5 is a schematic diagram of a terminal device according to another embodiment of the disclosure.
As shown in fig. 5, the terminal device 500 includes:
an obtaining module 501, configured to obtain serialized data of a target interface, where an interactive party that completes a method for calling an interface uses different interface calling languages.
In some embodiments, the terminal device includes a host machine that establishes a bidirectional full-duplex communication link with another one of the interacting parties through an interprocess communication Domain Socket and is generated using SPICE communication protocol.
The first processing module 502 is configured to perform deserialization processing on the serialized data to obtain attribute information of the target interface.
A first determining module 503, configured to determine a target interface corresponding to the attribute information of the target interface from a preset storage relationship, where the storage relationship is used to represent a corresponding relationship between the attribute information and the interface.
In some embodiments, the same interface has the same attribute information in the interacting party, the attribute information of the target interface includes a name and a parameter, and the first determining module 503 includes:
a first determining submodule for determining a key corresponding to the name from the key-value pair store and for determining a value corresponding to the parameter from the key-value pair store.
And the second determining submodule is used for determining the target interface corresponding to the attribute information of the target interface according to the key corresponding to the name and the value corresponding to the parameter.
The first generating module 504 is configured to invoke and execute the target interface according to the attribute information of the target interface, and generate feedback information, where the feedback information is used to indicate that the target interface has been invoked and/or executed.
In some embodiments, the feedback information comprises: the information obtained by serializing the calling result of the calling target interface and the information obtained by serializing the execution result generated by the executing target interface.
In some embodiments, if the execution result indicates that the execution target interface fails, the execution result carries an exception code corresponding to the failure of the execution target interface, and the exception code is used to indicate a reason for the failure of the execution target interface.
In some embodiments, the feedback information is used to generate notification information, where the notification information is used to indicate a calling result of the target interface and/or an execution result generated by the target interface executing the call.
And a first output module 505 for outputting the feedback information.
Referring to fig. 6, fig. 6 is a schematic diagram of a server according to an embodiment of the disclosure.
As shown in fig. 6, the server 600 includes:
the second determining module 601 is configured to determine a target interface to be called according to the acquired interface calling requirement, and determine attribute information of the target interface, where an interactive party completing the method for calling the interface adopts different interface calling languages.
The second processing module 602 is configured to perform serialization processing on the attribute information of the target interface, to obtain and output serialized data, where the serialized data is used to instruct to call and execute the target interface.
A receiving module 603, configured to receive feedback information, where the feedback information is used to indicate that the target interface has been called and/or executed.
Referring to fig. 7, fig. 7 is a schematic diagram of a server according to another embodiment of the disclosure.
As shown in fig. 7, the server 700 includes:
the second determining module 701 is configured to determine a target interface to be called according to the obtained interface calling requirement, and determine attribute information of the target interface, where an interactive party completing the method for calling the interface adopts different interface calling languages.
In some embodiments, the server includes a virtual machine that establishes a two-way full-duplex communication link with another one of the interacting parties through an interprocess communication Domain Socket and that is generated using SPICE communication protocol.
The second processing module 702 is configured to perform serialization processing on the attribute information of the target interface, to obtain and output serialized data, where the serialized data is used to instruct to call and execute the target interface.
In some embodiments, the same interface has the same attribute information in the interacting party, the attribute information of the target interface includes a name and a parameter, and the second processing module 702 is configured to perform serialization processing on the name and the parameter in the attribute information of the target interface to obtain serialized data.
A receiving module 703 is configured to receive feedback information, where the feedback information is used to indicate that the target interface has been called and/or executed.
In some embodiments, the feedback information comprises: the information obtained by serializing the calling result of the calling target interface and the information obtained by serializing the execution result generated by the executing target interface.
A second generating module 704, configured to generate a notification message according to the feedback information, where the notification message is used to indicate a calling result of the target interface and an execution result generated by the target interface that executes the calling.
A second output module 705, configured to output the notification message.
In some embodiments, the second output module 705 is further configured to output a prompt message if the feedback information is not received within a preset time period, where the prompt message is used to prompt that the call is timed out.
Referring to fig. 8, a schematic structural diagram of an electronic device 800 suitable for implementing an embodiment of the present disclosure is shown, where the electronic device 800 may be a terminal device or a server. Among them, the terminal Device may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Multimedia Player (PMP), a car terminal (e.g., car navigation terminal), etc., and a fixed terminal such as a Digital TV, a desktop computer, etc. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, an electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 801 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage device 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 807 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to another aspect of the embodiments of the present disclosure, a system for calling an interface is provided, including:
the terminal device according to any of the above embodiments, such as the terminal device shown in fig. 4 or fig. 5;
a server as in any of the above embodiments, such as the server shown in fig. 6 or fig. 7.
In a first aspect, according to one or more embodiments of the present disclosure, there is provided a method for calling an interface, including:
acquiring serialized data of a target interface, wherein an interactive party completing the method for calling the interface adopts different interface calling languages;
performing deserialization processing on the serialized data to obtain attribute information of the target interface;
and calling and executing the target interface according to the attribute information of the target interface, and generating and outputting feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed.
According to one or more embodiments of the present disclosure, before calling and executing the target interface according to the attribute information of the target interface, the method further includes:
and determining a target interface corresponding to the attribute information of the target interface from a preset storage relationship, wherein the storage relationship is used for representing the corresponding relationship between the attribute information and the interface.
According to one or more embodiments of the present disclosure, the same interface has the same attribute information in the interacting party, the attribute information of the target interface includes a name and a parameter, and the storage relationship includes key-value pair storage; determining a target interface corresponding to the attribute information of the target interface from a preset storage relationship, wherein the method comprises the following steps:
determining a key from the key-value pair store corresponding to the name and determining a value from the key-value pair store corresponding to the parameter;
and determining a target interface corresponding to the attribute information of the target interface according to the key corresponding to the name and the value corresponding to the parameter.
According to one or more embodiments of the present disclosure, the feedback information includes: the information obtained by serializing the calling result of calling the target interface and the information obtained by serializing the execution result generated by executing the target interface.
According to one or more embodiments of the present disclosure, if the execution result represents that the target interface fails to be executed, the execution result carries an exception code corresponding to the failure to execute the target interface, where the exception code is used to indicate a reason for the failure to execute the target interface.
According to one or more embodiments of the present disclosure, the feedback information is used to generate notification information, where the notification information is used to indicate a call result of the target interface and/or an execution result generated by the target interface executing the call.
According to one or more embodiments of the present disclosure, if one of the interacting parties includes a terminal device, the terminal device includes a host machine that establishes a bidirectional full-duplex communication link with the other of the interacting parties through an interprocess communication Domain Socket and is generated by using a SPICE communication protocol.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided a method of calling an interface, including:
determining a target interface to be called according to the acquired interface calling requirement, and determining attribute information of the target interface, wherein an interactive party completing the method for calling the interface adopts different interface calling languages;
serializing the attribute information of the target interface to obtain and output serialized data, wherein the serialized data is used for indicating to call and execute the target interface;
receiving feedback information, wherein the feedback information is used for indicating that the target interface is called and executed.
According to one or more embodiments of the present disclosure, the same interface has the same attribute information in the interacting party, and the attribute information of the target interface includes a name and a parameter; serializing the attribute information of the target interface to obtain serialized data, wherein the serializing comprises the following steps:
and carrying out serialization processing on the name and the parameter in the attribute information of the target interface to obtain the serialized data.
According to one or more embodiments of the present disclosure, the feedback information includes: and the information is obtained by serializing the calling result of calling the target interface and the information is obtained by serializing the execution result generated by executing the target interface.
According to one or more embodiments of the present disclosure, after receiving the feedback information, the method further includes:
and generating and outputting a notification message according to the feedback information, wherein the notification message is used for indicating a calling result of the target interface and an execution result generated by the target interface for executing calling.
According to one or more embodiments of the present disclosure, after outputting the serialized data, further comprising:
and if the feedback information is not received within the preset time period, outputting a prompt message, wherein the prompt message is used for prompting the calling overtime.
According to one or more embodiments of the present disclosure, if one of the interacting parties includes a server, the server includes a virtual machine that establishes a bidirectional full-duplex communication link with the other of the interacting parties through an interprocess communication Domain Socket and is generated using a SPICE communication protocol.
In a third aspect, according to one or more embodiments of the present disclosure, there is provided a terminal device including:
the acquisition module is used for acquiring the serialized data of the target interface, wherein the interaction party completing the method for calling the interface adopts different interface calling languages;
the first processing module is used for performing deserialization processing on the serialized data to obtain attribute information of the target interface;
the first generation module is used for calling and executing the target interface according to the attribute information of the target interface and generating feedback information, wherein the feedback information is used for indicating that the target interface is called and executed;
and the first output module is used for outputting the feedback information.
According to one or more embodiments of the present disclosure, further comprising:
the device comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining a target interface corresponding to the attribute information of the target interface from a preset storage relationship, and the storage relationship is used for representing the corresponding relationship between the attribute information and the interface.
According to one or more embodiments of the present disclosure, the same interface has the same attribute information in the interacting party, the attribute information of the target interface includes a name and a parameter, and the storage relationship includes key-value pair storage; the first determining module includes:
a first determining submodule configured to determine a key corresponding to the name from the key-value pair storage, and determine a value corresponding to the parameter from the key-value pair storage;
and the second determining submodule is used for determining the target interface corresponding to the attribute information of the target interface according to the key corresponding to the name and the value corresponding to the parameter.
According to one or more embodiments of the present disclosure, the feedback information includes: the information obtained by serializing the calling result of calling the target interface and the information obtained by serializing the execution result generated by executing the target interface.
According to one or more embodiments of the present disclosure, if the execution result represents that the target interface fails to be executed, the execution result carries an exception code corresponding to the failure to execute the target interface, where the exception code is used to indicate a reason for the failure to execute the target interface.
According to one or more embodiments of the present disclosure, the feedback information is used to generate notification information, where the notification information is used to indicate a call result of the target interface and/or an execution result generated by the target interface executing the call.
According to one or more embodiments of the present disclosure, if one of the interacting parties includes a terminal device, the terminal device includes a host machine that establishes a bidirectional full-duplex communication link with the other of the interacting parties through an interprocess communication Domain Socket and is generated by using a SPICE communication protocol.
In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a server including:
the second determining module is used for determining a target interface to be called according to the acquired interface calling requirement and determining attribute information of the target interface, wherein an interactive party completing the interface calling method adopts different interface calling languages;
the second processing module is used for carrying out serialization processing on the attribute information of the target interface to obtain and output serialized data, wherein the serialized data is used for indicating to call and execute the target interface;
and the receiving module is used for receiving feedback information, wherein the feedback information is used for indicating that the target interface is called and executed.
According to one or more embodiments of the present disclosure, the same interface has the same attribute information in the interacting party, and the attribute information of the target interface includes a name and a parameter; and the second processing module is used for carrying out serialization processing on the name and the parameter in the attribute information of the target interface to obtain the serialized data.
According to one or more embodiments of the present disclosure, the feedback information includes: and the information is obtained by serializing the calling result of calling the target interface and the information is obtained by serializing the execution result generated by executing the target interface.
According to one or more embodiments of the present disclosure, further comprising:
a second generating module, configured to generate a notification message according to the feedback information, where the notification message is used to indicate a call result of the target interface and an execution result generated by the target interface executing the call;
and the second output module is used for outputting the notification message.
According to one or more embodiments of the present disclosure, the second output module is configured to output a prompt message if no feedback information is received within a preset time period, where the prompt message is used to prompt for a call timeout.
According to one or more embodiments of the present disclosure, if one of the interacting parties includes a server, the server includes a virtual machine that establishes a bidirectional full-duplex communication link with the other of the interacting parties through an interprocess communication Domain Socket and is generated using a SPICE communication protocol.
In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method as set forth in the first aspect above and in various possible designs of the first aspect; alternatively, the first and second electrodes may be,
causing the at least one processor to perform the method as set forth above in the second aspect and various possible designs of the second aspect.
In a sixth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, implement the method as set forth in the first aspect above and in various possible designs of the first aspect; alternatively, the first and second electrodes may be,
the method as described above in the second aspect and in various possible designs of the second aspect is implemented.
A seventh aspect provides, according to one or more embodiments of the present disclosure, a computer program product comprising a computer program which, when executed by a processor, implements the method as described above in the first aspect and in various possible designs of the first aspect; alternatively, the first and second electrodes may be,
which when executed by a processor implements the method as described above in the second aspect and in various possible designs of the second aspect.
In an eighth aspect, according to one or more embodiments of the present disclosure, there is provided a system for calling an interface, including:
the terminal device according to the third aspect and various possible designs of the third aspect;
a server as described above in the fourth aspect and in various possible designs of the fourth aspect.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (17)

1. A method of calling an interface, comprising:
acquiring serialized data of a target interface, wherein an interactive party completing the method for calling the interface adopts different interface calling languages;
performing deserialization processing on the serialized data to obtain attribute information of the target interface;
and calling and executing the target interface according to the attribute information of the target interface, and generating and outputting feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed.
2. The method of claim 1, wherein before calling and executing the target interface according to the attribute information of the target interface, further comprising:
and determining a target interface corresponding to the attribute information of the target interface from a preset storage relationship, wherein the storage relationship is used for representing the corresponding relationship between the attribute information and the interface.
3. The method of claim 2, wherein the same interface has the same attribute information in the interacting party, the attribute information of the target interface includes a name and a parameter, and the storage relationship includes a key-value pair storage; determining a target interface corresponding to the attribute information of the target interface from a preset storage relationship, wherein the method comprises the following steps:
determining a key from the key-value pair store corresponding to the name and determining a value from the key-value pair store corresponding to the parameter;
and determining a target interface corresponding to the attribute information of the target interface according to the key corresponding to the name and the value corresponding to the parameter.
4. The method of claim 1, wherein the feedback information comprises: the information obtained by serializing the calling result of calling the target interface and the information obtained by serializing the execution result generated by executing the target interface.
5. The method according to claim 4, wherein if the execution result indicates that the target interface fails to be executed, the execution result carries an exception code corresponding to the failure to execute the target interface, and the exception code is used to indicate a reason for the failure to execute the target interface.
6. The method according to any one of claims 1 to 5, wherein the feedback information is used for generating notification information, wherein the notification information is used for indicating a calling result of the target interface and/or an execution result generated by the target interface executing the calling.
7. A method of calling an interface, comprising:
determining a target interface to be called according to the acquired interface calling requirement, and determining attribute information of the target interface, wherein an interactive party completing the method for calling the interface adopts different interface calling languages;
serializing the attribute information of the target interface to obtain and output serialized data, wherein the serialized data is used for indicating to call and execute the target interface;
receiving feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed.
8. The method of claim 7, wherein the same interface has the same attribute information in the interacting party, and the attribute information of the target interface includes a name and a parameter; serializing the attribute information of the target interface to obtain serialized data, wherein the serializing comprises the following steps:
and carrying out serialization processing on the name and the parameter in the attribute information of the target interface to obtain the serialized data.
9. The method of claim 7, the feedback information comprising: and the information is obtained by serializing the calling result of calling the target interface and the information is obtained by serializing the execution result generated by executing the target interface.
10. The method of any of claims 7 to 9, further comprising, after receiving the feedback information:
and generating and outputting a notification message according to the feedback information, wherein the notification message is used for indicating a calling result of the target interface and an execution result generated by the target interface for executing calling.
11. The method of any of claims 7 to 9, further comprising, after outputting the serialized data:
and if the feedback information is not received within the preset time period, outputting a prompt message, wherein the prompt message is used for prompting the calling overtime.
12. A terminal device, comprising:
the acquisition module is used for acquiring the serialized data of the target interface, wherein the interaction party which completes the method for calling the interface adopts different interface calling languages;
the first processing module is used for performing deserialization processing on the serialized data to obtain attribute information of the target interface;
the first generation module is used for calling and executing the target interface according to the attribute information of the target interface and generating feedback information, wherein the feedback information is used for indicating that the target interface is called and/or executed;
and the first output module is used for outputting the feedback information.
13. A server, comprising:
the second determining module is used for determining a target interface to be called according to the acquired interface calling requirement and determining attribute information of the target interface, wherein an interactive party completing the method for calling the interface adopts different interface calling languages;
the second processing module is used for carrying out serialization processing on the attribute information of the target interface to obtain and output serialized data, wherein the serialized data is used for indicating to call and execute the target interface;
a receiving module, configured to receive feedback information, where the feedback information is used to indicate that the target interface has been called and/or executed.
14. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of any one of claims 1 to 6; alternatively, the first and second electrodes may be,
causing the at least one processor to perform the method of any one of claims 7 to 11.
15. A computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a processor, implement the method of any one of claims 1 to 6; alternatively, the first and second electrodes may be,
implementing the method of any one of claims 7 to 11.
16. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6; alternatively, the first and second electrodes may be,
the computer program, when executed by a processor, implements the method of any one of claims 7 to 11.
17. A system for invoking an interface, comprising:
the terminal device of claim 12;
the server of claim 13.
CN202110384038.3A 2021-04-09 2021-04-09 Method and system for calling interface Pending CN112988289A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110384038.3A CN112988289A (en) 2021-04-09 2021-04-09 Method and system for calling interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110384038.3A CN112988289A (en) 2021-04-09 2021-04-09 Method and system for calling interface

Publications (1)

Publication Number Publication Date
CN112988289A true CN112988289A (en) 2021-06-18

Family

ID=76339694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110384038.3A Pending CN112988289A (en) 2021-04-09 2021-04-09 Method and system for calling interface

Country Status (1)

Country Link
CN (1) CN112988289A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113783743A (en) * 2021-11-11 2021-12-10 阿里云计算有限公司 Communication method, circuit board and optical transmission equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050091672A1 (en) * 2003-10-24 2005-04-28 Microsoft Corporation Facilitating presentation functionality through a programming interface media namespace
CN105573758A (en) * 2015-12-16 2016-05-11 福建星网智慧科技股份有限公司 Dynamic byte-code compilation technology-based codejson frame
CN109976761A (en) * 2019-02-27 2019-07-05 平安科技(深圳)有限公司 Generation method, device and the terminal device of Software Development Kit
CN110324169A (en) * 2018-03-30 2019-10-11 北京京东尚科信息技术有限公司 A kind of method and apparatus of interface management
CN111367685A (en) * 2020-02-28 2020-07-03 平安医疗健康管理股份有限公司 Interface calling method and device, computer equipment and storage medium
CN111722947A (en) * 2020-06-28 2020-09-29 深圳壹账通智能科技有限公司 Service calling method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050091672A1 (en) * 2003-10-24 2005-04-28 Microsoft Corporation Facilitating presentation functionality through a programming interface media namespace
CN105573758A (en) * 2015-12-16 2016-05-11 福建星网智慧科技股份有限公司 Dynamic byte-code compilation technology-based codejson frame
CN110324169A (en) * 2018-03-30 2019-10-11 北京京东尚科信息技术有限公司 A kind of method and apparatus of interface management
CN109976761A (en) * 2019-02-27 2019-07-05 平安科技(深圳)有限公司 Generation method, device and the terminal device of Software Development Kit
CN111367685A (en) * 2020-02-28 2020-07-03 平安医疗健康管理股份有限公司 Interface calling method and device, computer equipment and storage medium
CN111722947A (en) * 2020-06-28 2020-09-29 深圳壹账通智能科技有限公司 Service calling method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113783743A (en) * 2021-11-11 2021-12-10 阿里云计算有限公司 Communication method, circuit board and optical transmission equipment

Similar Documents

Publication Publication Date Title
US8639749B2 (en) Platform independent information handling system, communication method, and computer program product thereof
US11184314B2 (en) Method and apparatus for prompting message reading state, and electronic device
CN110933075B (en) Service calling method and device, electronic equipment and storage medium
KR102133514B1 (en) Status message service providing method of electronic apparatus and electronic apparatus thereof
US11818491B2 (en) Image special effect configuration method, image recognition method, apparatus and electronic device
CN114089920A (en) Data storage method and device, readable medium and electronic equipment
CN112835632B (en) Method and equipment for calling end capability and computer storage medium
CN110377273B (en) Data processing method, device, medium and electronic equipment
CN109697034B (en) Data writing method and device, electronic equipment and storage medium
CN112988289A (en) Method and system for calling interface
CN112835615B (en) Plug-in processing method and device for software development kit and electronic equipment
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN111355784B (en) Method, device, medium and electronic equipment for processing request information
WO2020207083A1 (en) Information sharing method and apparatus, and electronic device and computer-readable storage medium
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN113905040B (en) File transmission method, device, system, equipment and storage medium
CN113407044B (en) Method, device, equipment and storage medium for simulating terminal handle input
CN113518183B (en) Camera calling method and device and electronic equipment
CN113724711A (en) Method, device, system, medium and equipment for realizing voice recognition service
CN111813407B (en) Game development method, game running device and electronic equipment
CN113778566A (en) Native application calling method and device, electronic equipment and computer readable medium
CN112230986A (en) Project file generation method and device, electronic equipment and computer readable medium
CN112306317A (en) Unread message notification method and device and electronic equipment
CN112688863B (en) Gateway data processing method and device and electronic equipment
CN117215730B (en) Data transmission method, device, equipment and storage medium

Legal Events

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