CN112052105A - Interface calling method and device, electronic equipment and computer readable medium - Google Patents

Interface calling method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN112052105A
CN112052105A CN202010924008.2A CN202010924008A CN112052105A CN 112052105 A CN112052105 A CN 112052105A CN 202010924008 A CN202010924008 A CN 202010924008A CN 112052105 A CN112052105 A CN 112052105A
Authority
CN
China
Prior art keywords
interface
sub
logic
original
original interface
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
CN202010924008.2A
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.)
JD Digital Technology Holdings Co Ltd
Original Assignee
JD Digital Technology Holdings 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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN202010924008.2A priority Critical patent/CN112052105A/en
Publication of CN112052105A publication Critical patent/CN112052105A/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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer And Data Communications (AREA)

Abstract

The disclosure relates to a calling method and device of an interface, electronic equipment and a computer readable medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring a plurality of logic steps to be executed in an original interface, and acquiring a service type processed by the original interface; splitting the original interface into a plurality of independent sub-interfaces according to the service type, wherein each sub-interface at least comprises a logic step in the original interface; and sequentially calling the subinterfaces in a mode of sending asynchronous messages among the subinterfaces, and executing logic steps in the subinterfaces so as to realize the complete business process of the original interface. According to the method and the device, one interface with complex logic is split into the plurality of independent sub-interfaces, and the sub-interfaces are sequentially called in the asynchronous message sending mode, so that the problem of flow blocking caused by overtime of the interface can be reduced, the interface availability and the system throughput are improved, and the user experience is improved.

Description

Interface calling method and device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an interface calling method, an interface calling apparatus, an electronic device, and a computer-readable medium.
Background
In the implementation process of various business processes, the calling of an interface is often required. An interface may contain a plurality of logic steps, including, for example, Remote Procedure Call (RPC) Remote requests and Data Management Language (DML) operations.
In the prior art, the calling of the interface is a synchronous and serial calling mode, namely, all logic steps are packaged into one interface, and the mode can lead the time consumption of the whole interface to be prolonged, the probability of the interface being unavailable due to overtime is higher, so that the utilization rate of the interface is reduced, and the user experience is poor.
In view of the above, there is a need in the art for a method for improving interface utilization.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to an interface calling method, an interface calling device, an electronic device, and a computer-readable medium, so as to improve the utilization rate of an interface at least to a certain extent.
According to a first aspect of the present disclosure, there is provided a method for calling an interface, including:
acquiring a plurality of logic steps to be executed in an original interface, and acquiring a service type processed by the original interface;
splitting the original interface into a plurality of independent sub-interfaces according to the service type, wherein each sub-interface at least comprises a logic step in the original interface;
and sequentially calling the subinterfaces in a mode of sending asynchronous messages among the subinterfaces, and executing logic steps in the subinterfaces so as to realize the complete business process of the original interface.
In an exemplary embodiment of the present disclosure, the splitting the original interface into a plurality of independent sub-interfaces according to the service type includes:
determining an interface type of the original interface according to the service type, and determining a splitting rule corresponding to the original interface according to the interface type;
and splitting the original interface into a plurality of independent sub-interfaces according to a splitting rule corresponding to the original interface.
In an exemplary embodiment of the present disclosure, the splitting the original interface into a plurality of independent sub-interfaces according to a splitting rule corresponding to the original interface includes:
determining one or more corresponding logic steps in each sub-interface according to a plurality of logic steps to be executed in the original interface and a splitting rule corresponding to the original interface;
and splitting the original interface into a plurality of independent sub-interfaces according to the corresponding logic steps in each sub-interface.
In an exemplary embodiment of the present disclosure, the determining, according to a plurality of logic steps to be executed in the original interface and a splitting rule corresponding to the original interface, one or more logic steps corresponding to each sub-interface includes:
determining the integral logic of the original interface according to a plurality of logic steps to be executed in the original interface;
determining each sub logic in the overall logic of the original interface according to the overall logic of the original interface and a splitting rule corresponding to the original interface;
and determining one or more corresponding logic steps in each sub-interface according to each sub-logic in the overall logic.
In an exemplary embodiment of the disclosure, the determining, according to each sub-logic in the overall logic, one or more corresponding logic steps in each sub-interface includes:
determining logic steps associated with the sub-logics in a plurality of logic steps to be executed in the original interface;
and taking one or more logic steps associated with each sub-logic as corresponding logic steps in the sub-interface.
In an exemplary embodiment of the present disclosure, the sequentially invoking the subinterfaces and executing the logic steps in the subinterfaces by sending asynchronous messages between the subinterfaces includes:
responding to the asynchronous message sent by the previous subinterface, and determining the current subinterface called by the previous subinterface;
executing the logic steps in the current subinterface;
and if the execution of the logic step in the current sub-interface is finished, sending the asynchronous message to the next sub-interface through the current sub-interface.
In an exemplary embodiment of the present disclosure, the method further comprises:
if the subinterface is a terminal subinterface in the original interface, responding to an asynchronous message sent by the last subinterface of the terminal subinterface, and executing the logic step of the terminal subinterface;
and if the execution of the logic steps in the terminal sub-interface is finished, ending the whole service process of the original interface.
In an exemplary embodiment of the present disclosure, the asynchronous message includes start information and stop information, where the start information is used to prompt the sub-interface to start receiving the asynchronous message, and the stop information is used to prompt the sub-interface to stop receiving the asynchronous message.
In an exemplary embodiment of the present disclosure, the method further comprises:
determining an initial sub-interface in the original interface;
and responding to the calling request of the initial sub-interface, and sending a feedback message of service acceptance to a calling party of the initial sub-interface.
According to a second aspect of the present disclosure, there is provided an interface calling apparatus, including:
the interface logic acquisition module is used for acquiring a plurality of logic steps to be executed in an original interface and acquiring the service type processed by the original interface;
an original interface splitting module, configured to split the original interface into multiple independent sub-interfaces according to the service type, where each sub-interface at least includes one logic step in the original interface;
and the subinterface calling module is used for sequentially calling the subinterfaces in a mode of sending asynchronous messages among the subinterfaces and executing logic steps in the subinterfaces so as to realize the complete service flow of the original interface.
In an exemplary embodiment of the present disclosure, the original interface splitting module includes:
a splitting rule determining unit, configured to determine an interface type of the original interface according to the service type, and determine a splitting rule corresponding to the original interface according to the interface type;
and the original interface splitting unit is used for splitting the original interface into a plurality of independent sub-interfaces according to the splitting rule corresponding to the original interface.
In an exemplary embodiment of the present disclosure, the original interface splitting unit includes:
a logic step determining unit, configured to determine one or more logic steps corresponding to each sub-interface according to multiple logic steps to be executed in the original interface and a splitting rule corresponding to the original interface;
and the sub-interface splitting unit is used for splitting the original interface into a plurality of independent sub-interfaces according to the corresponding logic steps in each sub-interface.
In an exemplary embodiment of the present disclosure, the logic step determination unit includes:
the overall logic determining unit is used for determining the overall logic of the original interface according to a plurality of logic steps to be executed in the original interface;
the sub-logic determining unit is used for determining each sub-logic in the overall logic of the original interface according to the overall logic of the original interface and the splitting rule corresponding to the original interface;
and the sub logic step determining unit is used for determining one or more corresponding logic steps in each sub interface according to each sub logic in the whole logic.
In an exemplary embodiment of the present disclosure, the sub-interface calling module includes:
a current sub-interface determining unit, configured to determine, in response to an asynchronous message sent by a previous sub-interface, a current sub-interface called by the previous sub-interface;
a current logic step execution unit, configured to execute the logic step in the current sub-interface;
and the subinterface message sending unit is used for sending the asynchronous message to the next subinterface through the current subinterface if the execution of the logic step in the current subinterface is finished.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the calling method of the interface of any one of the above via execution of the executable instructions.
According to a fourth aspect of the present disclosure, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method of invoking an interface of any of the above.
The exemplary embodiments of the present disclosure may have the following advantageous effects:
in the method for calling the interface according to the exemplary embodiment of the present disclosure, the original interface is split into a plurality of sub-interfaces, and the sub-interfaces are sequentially called by sending asynchronous messages, so that the entire flow of the original interface is completed. On one hand, according to the interface calling method in the disclosed example embodiment, one interface with complex logic is split into a plurality of sub-interfaces capable of running independently, and interactive communication is performed between the sub-interfaces by sending asynchronous messages, so that the problem of flow blocking caused by interface timeout can be reduced, the interface availability and the system throughput are improved, and the user experience is improved; on the other hand, when the service data is rapidly increased, the distributed system can be rapidly split, and the working efficiency of the system is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 shows a flow diagram of a method of invoking an interface of an example embodiment of the present disclosure;
FIG. 2 schematically illustrates a schematic diagram of logical steps in an original interface, according to a specific embodiment of the present disclosure;
FIG. 3 illustrates a flow diagram of raw interface splitting of an example embodiment of the present disclosure;
FIG. 4 schematically illustrates a schematic diagram of logical steps in splitting a raw interface, according to a specific embodiment of the present disclosure;
FIG. 5 illustrates a flow diagram of a call subinterface of an example embodiment of the present disclosure;
FIG. 6 illustrates a flow diagram of an initial subinterface call of an example embodiment of the present disclosure;
FIG. 7 is a flow diagram illustrating a method for invoking an interface in accordance with one embodiment of the present disclosure;
FIG. 8 shows a block diagram of a calling device of an interface of an example embodiment of the present disclosure;
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The present example embodiment first provides a method for invoking an interface. Referring to fig. 1, the method for calling the interface may include the following steps:
step S110, a plurality of logic steps to be executed in the original interface are obtained, and the service type processed by the original interface is obtained.
Step S120, splitting the original interface into a plurality of independent sub-interfaces according to the service type, wherein each sub-interface at least comprises one logic step in the original interface.
And S130, sequentially calling the subinterfaces in a mode of sending asynchronous messages among the subinterfaces, and executing logic steps in the subinterfaces to realize a complete service process of the original interface.
In some common business processes, such as a repayment process, a loan process, an e-commerce purchase process, and the like, an interface is often called. An interface may contain a number of logical steps including, for example, RPC remote requests and local database DML operations. Because the response time of the remote RPC call is influenced by the application of the interface caller, the processing speed of the network environment of the interface provider and the processing speed of the public network environment, if a synchronous and string-type calling mode is used and all logic steps are packaged into one interface, the probability of interface timeout is higher, and particularly under the condition of centralized operation, the processing time of a certain sub-process (such as RPC remote request) is prolonged as long as the time is long at one place, so that when the sub-processes of a certain interface are more and more complicated, the probability of the whole interface that the flow operation timeout is increased gradually, the interface utilization rate is reduced, and the user experience is poor.
In the method for calling the interface according to the exemplary embodiment of the present disclosure, the original interface is split into a plurality of sub-interfaces, and the sub-interfaces are sequentially called by sending asynchronous messages, so that the entire flow of the original interface is completed. On one hand, according to the interface calling method in the disclosed example embodiment, one interface with complex logic is split into a plurality of sub-interfaces capable of running independently, and interactive communication is performed between the sub-interfaces by sending asynchronous messages, so that the problem of flow blocking caused by interface timeout can be reduced, the interface availability and the system throughput are improved, and the user experience is improved; on the other hand, when the service data is rapidly increased, the distributed system can be rapidly split, and the working efficiency of the system is improved.
Next, the above steps of the present exemplary embodiment will be described in more detail with reference to fig. 2 to 6.
In step S110, a plurality of logic steps to be executed in the original interface are obtained, and a service type processed by the original interface is obtained.
For some interfaces with complex service logic, multiple logic steps may be included, and there may be logic differences between interfaces processing different service types, so that each logic step in an interface needs to be reasonably split according to the specific service logic of each service type.
Fig. 2 schematically illustrates a schematic diagram of logic steps in an original interface according to an embodiment of the present disclosure, and it can be seen that the interface mainly includes steps of RPC (Remote Procedure Call) Remote request and Data Management Language (DML) operation of a local database, and a specific interface service code executes the following steps:
and S210, receiving client submission data.
And S220, checking the data entry parameters.
Step S230. Table 1 data insert operation.
Step S240. data update operation of the table 2.
Step S250, the remote RPC interface 1 calls the request.
And S260, calling the request by the remote RPC interface 2.
Step S270, data insert operation of the table 3.
Step S280. data updte operation of the table 1.
The remote RPC interface 1 and the remote RPC interface 2 are external interfaces for calling, the tables 1, 2, and 3 are data tables, and different types of data tables, such as an order table, can be represented in different service types. The original interface shown in fig. 2 provides a uniform interface to the outside, and each sub-logic is executed by a synchronous serial call mode.
In step S120, the original interface is split into a plurality of independent sub-interfaces according to the service type, where each sub-interface at least includes one logic step in the original interface.
A sub-interface refers to a sub-interface that includes one or more logical steps in the original interface after the original interface is split. The original interface and the sub-interface in this exemplary embodiment may be considered equivalent in the execution level, and the difference is only how much and little business logic is executed, which may be considered as the smallest execution unit.
In this exemplary embodiment, as shown in fig. 3, splitting the original interface into a plurality of independent sub-interfaces according to the service type may specifically include the following steps:
and S310, determining the interface type of the original interface according to the service type, and determining a splitting rule corresponding to the original interface according to the interface type.
Because there may be a logical difference between different types of interfaces, different types of interfaces correspond to different splitting rules.
In this exemplary embodiment, first, an interface type of an original interface is determined according to a service type processed by the original interface, for example, in some common http request interfaces, including a get type interface, a post type interface, a put type interface, a delete type interface, and the like, services processed by each different type of interface are different, and logic steps therein are also different, so that a splitting rule corresponding to the original interface needs to be determined according to the interface type.
In this exemplary embodiment, the splitting rule may be configured in advance according to the corresponding relationship of the interface types and stored in the server, and when the interface splitting is performed, the splitting rule may be invoked according to different interface types.
Step S320, splitting the original interface into a plurality of independent sub-interfaces according to the splitting rule corresponding to the original interface.
In this example embodiment, one or more corresponding logic steps in each sub-interface may be determined according to a plurality of logic steps to be executed in the original interface and a splitting rule corresponding to the original interface, and then the original interface may be split into a plurality of independent sub-interfaces according to the corresponding logic steps in each sub-interface.
Each sub-interface should at least include a logic step to be executed in the original interface, so as to complete the function of the corresponding part in the original interface. For example, as shown in step S250 of fig. 2, the remote interface calling function can be completed as a single sub-interface, that is, the remote RPC interface 1 calling request is received.
In this example embodiment, the overall logic of the original interface may be determined according to a plurality of logic steps to be executed in the original interface, each sub-logic in the overall logic of the original interface is determined according to the overall logic of the original interface and a splitting rule corresponding to the original interface, and finally, one or more logic steps corresponding to each sub-interface are determined according to each sub-logic in the overall logic, so as to determine one or more logic steps corresponding to each sub-interface.
The original interface can realize various different overall logics according to different logic steps. The whole logic of the original interface may include a plurality of same or different sub-logics, which respectively perform different functions. For example, the original interface shown in fig. 2 mainly completes the calling and processing of data, and therefore, the original interface shown in fig. 2 may include a data processing sub-logic and a data calling sub-logic, and the corresponding one or more logic steps in the sub-interface may be determined according to different sub-logics. When determining the corresponding one or more logic steps in each sub-interface, the logic step associated with each sub-logic may be determined among the plurality of logic steps to be executed in the original interface, and then the one or more logic steps associated with each sub-logic may be used as the corresponding logic steps in the sub-interface.
For example, the original interface shown in fig. 2 may be split into four sub-interfaces, i.e., interface a, interface B, interface C, and interface D, where each interface corresponds to different sub-logic. As shown in fig. 4, the logic of the split specific sub-interface is: the logic in interface a includes steps S210 to S240; the logic in interface B includes step S250; the logic in interface C includes step S260; the logic in interface D includes step S270 and step S280.
In step S130, the subinterfaces are sequentially called by sending asynchronous messages between the subinterfaces, and the logic steps in the subinterfaces are executed, so as to implement the complete service flow of the original interface.
After the original interface is split, all the sub-interfaces are sequentially called by sending asynchronous messages. Asynchronous messages may be sent in the form of message queues.
Synchronous means that two or more time-varying quantities maintain a certain relative relationship during the variation process, and asynchronous parties do not need a common clock, that is, the receiving party does not know when the sending party sends, so that the sending asynchronous message contains information prompting the receiving party to start receiving, such as a start bit, and a stop bit when the sending party ends. Therefore, in the present exemplary embodiment, the asynchronous message includes start information and stop information, where the start information is used to prompt the sub-interface to start receiving the asynchronous message, and the stop information is used to prompt the sub-interface to stop receiving the asynchronous message.
In this exemplary embodiment, as shown in fig. 5, sequentially invoking the subinterfaces in a manner of sending asynchronous messages between the subinterfaces, and executing logic steps in the subinterfaces, may specifically include the following steps:
step s510, in response to the asynchronous message sent by the previous subinterface, determining the current subinterface called by the previous subinterface.
First, it is necessary to determine the current subinterface that is processing the current flow. When the current sub-interface receives the asynchronous message sent by the previous sub-interface, the message is analyzed.
And S520, executing the logic steps in the current subinterface.
And after the current sub-interface analyzes the received asynchronous message, starting to execute the logic steps in the current sub-interface.
Step S530, if the logic step in the current sub-interface is completed, the asynchronous message is sent to the next sub-interface through the current sub-interface.
If the execution of the logic steps in the current subinterface is finished, the next subinterface is called by sending asynchronous messages, and the steps are repeated until all subinterfaces are called, namely the whole process is finished.
In this exemplary embodiment, if the subinterface is an end subinterface in the original interface, the logic step of the end subinterface is executed in response to an asynchronous message sent by a previous subinterface of the end subinterface; and if the execution of the logic steps in the terminal sub-interface is finished, ending the whole business process of the original interface.
The end sub-interface refers to a sub-interface which performs the last logic step in the original interface after splitting the original interface, for example, interface D in fig. 4. After the terminal subinterface is called and the logic steps in the terminal subinterface are executed, the whole logic of the original interface is executed, so that the whole process is finished directly without sending asynchronous messages.
In summary, the method for calling among the subinterfaces shown in fig. 4 is as follows: after the interface A finishes executing, sending an asynchronous mq (Message Queue) Message; before the interface B executes, the mq message sent by the interface A needs to be received; after the interface B finishes executing, sending asynchronous mq information; before the interface C executes, the mq message sent by the interface B needs to be received; after the execution of the interface C is finished, sending an asynchronous mq message; before the interface D is executed, the mq message sent by the interface C needs to be received; and the interface D completes execution and the process is ended.
After splitting the original interface into a plurality of independent sub-interfaces, as shown in fig. 6, the method in this example embodiment may further include:
and S610, determining an initial sub-interface in the original interface.
The initial sub-interface refers to a sub-interface which performs the first logic step in the original interface after the original interface is split, for example, interface a in fig. 4.
And S620, responding to the calling request of the initial sub-interface, and sending a feedback message of service acceptance to the calling party of the initial sub-interface.
When sending an application request for interface flow calling to an interface, an interface calling party firstly calls an initial subinterface. After the initial sub-interface completes the steps from receiving data, executing logic step to sending asynchronous message, etc., it needs to send a service acceptance feedback message to the interface caller to inform the interface caller that the request is accepted and is in the process.
Fig. 7 is a complete flowchart of the call relationship between the subinterfaces after the original interface is split according to an embodiment of the present disclosure, and the specific steps of the flowchart are as follows:
step S702, the calling party sends a flow application request.
When a caller or a user (i.e., a client) of an interface needs to call the interface, an interface flow application request is first sent.
Step S704, the interface A checks parameters.
The interface A acquires data submitted by an interface calling party, and firstly, data entry verification is carried out.
Step S706, the interface A carries out logic processing.
Step S708, the interface A sends a message queue to the interface B.
After the interface A executes the logic steps, the asynchronous message queue is sent to the interface B.
Step S710, the interface A feeds back the caller to accept successfully.
Since the interface a is an initial sub-interface, it is also necessary to send a feedback message of service acceptance to the interface caller.
Step S712, the interface B receives the message queue sent by the interface A.
And step S714, the interface B carries out message analysis and logic processing.
Step S716, interface B sends message queue to interface C.
After the interface B executes the logic steps, the asynchronous message queue is sent to the interface C.
Step S718, interface C receives the message queue sent by interface B.
And S720, carrying out message analysis and logic processing by the interface C.
Step S722, the interface C sends a message queue to the interface D.
After the interface C executes the logic steps, it sends asynchronous message queue to the interface D.
Step S724, the interface D receives the message queue sent by the interface C.
Step S726, the interface D carries out message analysis and logic processing.
And step 728, ending the process.
And the interface D is a terminal sub-interface, and the whole process is directly finished after the execution is finished.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Furthermore, the disclosure also provides a calling device of the interface. Referring to fig. 8, the interface calling device may include an interface logic acquiring module 810, an original interface splitting module 820, and a sub-interface calling module 830. Wherein:
the interface logic obtaining module 810 may be configured to obtain a plurality of logic steps to be executed in the original interface, and obtain a service type processed by the original interface;
the original interface splitting module 820 may be configured to split the original interface into a plurality of independent sub-interfaces according to the service type, where each sub-interface at least includes one logic step in the original interface;
the subinterface calling module 830 may be configured to sequentially call subinterfaces by sending asynchronous messages between the subinterfaces, and execute logic steps in the subinterfaces, so as to implement a complete service flow of the original interface.
In some exemplary embodiments of the present disclosure, the original interface splitting module 820 may include a splitting rule determination unit and an original interface splitting unit. Wherein:
the splitting rule determining unit may be configured to determine an interface type of the original interface according to the service type, and determine a splitting rule corresponding to the original interface according to the interface type;
the original interface splitting unit may be configured to split the original interface into a plurality of independent sub-interfaces according to a splitting rule corresponding to the original interface.
In some exemplary embodiments of the present disclosure, the original interface splitting unit may include a logic step determination unit and a sub-interface splitting unit. Wherein:
the logic step determining unit may be configured to determine one or more logic steps corresponding to each sub-interface according to a plurality of logic steps to be executed in the original interface and a splitting rule corresponding to the original interface;
the sub-interface splitting unit may be configured to split the original interface into a plurality of independent sub-interfaces according to corresponding logic steps in each sub-interface.
In some exemplary embodiments of the present disclosure, the logic step determination unit may include an overall logic determination unit, a sub-logic determination unit, and a sub-logic step determination unit. Wherein:
the overall logic determining unit may be configured to determine an overall logic of the original interface according to a plurality of logic steps to be executed in the original interface;
the sub logic determining unit may be configured to determine each sub logic in the overall logic of the original interface according to the overall logic of the original interface and a splitting rule corresponding to the original interface;
the sub-logic step determination unit may be configured to determine, according to each sub-logic in the overall logic, one or more corresponding logic steps in each sub-interface.
In some exemplary embodiments of the present disclosure, the sub logic step determination unit may include an association logic step determination unit and a sub interface logic step determination unit. Wherein:
the associated logic step determining unit may be configured to determine a logic step associated with each of the sub-logics in a plurality of logic steps to be executed in the original interface;
the sub-interface logic step determination unit may be configured to use one or more logic steps associated with the respective sub-logics as corresponding logic steps in the sub-interface.
In some exemplary embodiments of the present disclosure, the sub-interface calling module 830 may include a current sub-interface determining unit, a current logic step performing unit, and a sub-interface message transmitting unit. Wherein:
the current sub-interface determining unit may be configured to determine, in response to the asynchronous message sent by the previous sub-interface, a current sub-interface called by the previous sub-interface;
the current logic step execution unit may be configured to execute a logic step in the current sub-interface;
the subinterface message sending unit may be configured to send the asynchronous message to the next subinterface through the current subinterface if the execution of the logic step in the current subinterface is completed.
In some exemplary embodiments of the present disclosure, the sub-interface calling module 830 may further include an end sub-interface determining unit and a business process ending unit. Wherein:
the end sub-interface determining unit may be configured to, if the sub-interface is an end sub-interface in the original interface, execute a logic step of the end sub-interface in response to an asynchronous message sent by a previous sub-interface of the end sub-interface;
the service flow ending unit may be configured to end the entire service flow of the original interface if the execution of the logic step in the terminal sub-interface is completed.
In some exemplary embodiments of the present disclosure, the calling device of an interface provided by the present disclosure may further include a unit and a unit. Wherein:
the initial sub-interface determining unit may be configured to determine an initial sub-interface in the original interface;
the feedback message sending unit may be configured to send a feedback message of service acceptance to the caller of the initial sub-interface in response to the call request of the initial sub-interface.
The details of each module/unit in the calling apparatus of the interface are already described in detail in the corresponding method embodiment section, and are not described herein again.
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
It should be noted that the computer system 900 of the electronic device shown in fig. 9 is only an example, and should not bring any limitation to the function and the scope of the application of the embodiment of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for system operation are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to an embodiment of the present invention, the processes described below with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention 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 section 909, and/or installed from the removable medium 911. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media 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 include a propagated data signal with computer-readable program code embodied therein, for example, 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: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the embodiments below.
It should be noted that although in the above detailed description several modules of the device for action execution are mentioned, this division is not mandatory. Indeed, the features and functionality of two or more of the modules described above may be embodied in one module, in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module described above may be further divided into embodiments by a plurality of modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (16)

1. A method for invoking an interface, comprising:
acquiring a plurality of logic steps to be executed in an original interface, and acquiring a service type processed by the original interface;
splitting the original interface into a plurality of independent sub-interfaces according to the service type, wherein each sub-interface at least comprises a logic step in the original interface;
and sequentially calling the subinterfaces in a mode of sending asynchronous messages among the subinterfaces, and executing logic steps in the subinterfaces so as to realize the complete business process of the original interface.
2. The method for invoking the interface according to claim 1, wherein the splitting the original interface into a plurality of independent sub-interfaces according to the service type comprises:
determining an interface type of the original interface according to the service type, and determining a splitting rule corresponding to the original interface according to the interface type;
and splitting the original interface into a plurality of independent sub-interfaces according to a splitting rule corresponding to the original interface.
3. The method for invoking the interface according to claim 2, wherein the splitting the original interface into a plurality of independent sub-interfaces according to the splitting rule corresponding to the original interface comprises:
determining one or more corresponding logic steps in each sub-interface according to a plurality of logic steps to be executed in the original interface and a splitting rule corresponding to the original interface;
and splitting the original interface into a plurality of independent sub-interfaces according to the corresponding logic steps in each sub-interface.
4. The method for invoking the interface according to claim 3, wherein the determining one or more logic steps corresponding to each sub-interface according to the plurality of logic steps to be executed in the original interface and the splitting rule corresponding to the original interface comprises:
determining the integral logic of the original interface according to a plurality of logic steps to be executed in the original interface;
determining each sub logic in the overall logic of the original interface according to the overall logic of the original interface and a splitting rule corresponding to the original interface;
and determining one or more corresponding logic steps in each sub-interface according to each sub-logic in the overall logic.
5. The method for calling the interface according to claim 4, wherein the step of determining, according to each sub-logic in the overall logic, one or more corresponding logics in each sub-interface comprises:
determining logic steps associated with the sub-logics in a plurality of logic steps to be executed in the original interface;
and taking one or more logic steps associated with each sub-logic as corresponding logic steps in the sub-interface.
6. The method for invoking the interface according to claim 1, wherein said sequentially invoking said subinterfaces by sending asynchronous messages between each of said subinterfaces and executing the logic steps in said subinterfaces comprises:
responding to the asynchronous message sent by the previous subinterface, and determining the current subinterface called by the previous subinterface;
executing the logic steps in the current subinterface;
and if the execution of the logic step in the current sub-interface is finished, sending the asynchronous message to the next sub-interface through the current sub-interface.
7. The method for invoking an interface according to claim 6, wherein said method further comprises:
if the subinterface is a terminal subinterface in the original interface, responding to an asynchronous message sent by the last subinterface of the terminal subinterface, and executing the logic step of the terminal subinterface;
and if the execution of the logic steps in the terminal sub-interface is finished, ending the whole service process of the original interface.
8. The interface calling method according to claim 1, wherein the asynchronous message comprises start information and stop information, the start information is used to prompt the subinterface to start receiving the asynchronous message, and the stop information is used to prompt the subinterface to stop receiving the asynchronous message.
9. The method for invoking an interface according to claim 1, wherein said method further comprises:
determining an initial sub-interface in the original interface;
and responding to the calling request of the initial sub-interface, and sending a feedback message of service acceptance to a calling party of the initial sub-interface.
10. An apparatus for invoking an interface, comprising:
the interface logic acquisition module is used for acquiring a plurality of logic steps to be executed in an original interface and acquiring the service type processed by the original interface;
an original interface splitting module, configured to split the original interface into multiple independent sub-interfaces according to the service type, where each sub-interface at least includes one logic step in the original interface;
and the subinterface calling module is used for sequentially calling the subinterfaces in a mode of sending asynchronous messages among the subinterfaces and executing logic steps in the subinterfaces so as to realize the complete service flow of the original interface.
11. The calling device of the interface according to claim 10, wherein the original interface splitting module comprises:
a splitting rule determining unit, configured to determine an interface type of the original interface according to the service type, and determine a splitting rule corresponding to the original interface according to the interface type;
and the original interface splitting unit is used for splitting the original interface into a plurality of independent sub-interfaces according to the splitting rule corresponding to the original interface.
12. The apparatus for invoking the interface according to claim 11, wherein the original interface splitting unit comprises:
a logic step determining unit, configured to determine one or more logic steps corresponding to each sub-interface according to multiple logic steps to be executed in the original interface and a splitting rule corresponding to the original interface;
and the sub-interface splitting unit is used for splitting the original interface into a plurality of independent sub-interfaces according to the corresponding logic steps in each sub-interface.
13. The interface invoking device according to claim 12, wherein the logic step determining unit comprises:
the overall logic determining unit is used for determining the overall logic of the original interface according to a plurality of logic steps to be executed in the original interface;
the sub-logic determining unit is used for determining each sub-logic in the overall logic of the original interface according to the overall logic of the original interface and the splitting rule corresponding to the original interface;
and the sub logic step determining unit is used for determining one or more corresponding logic steps in each sub interface according to each sub logic in the whole logic.
14. The interface calling device according to claim 10, wherein the sub-interface calling module comprises:
a current sub-interface determining unit, configured to determine, in response to an asynchronous message sent by a previous sub-interface, a current sub-interface called by the previous sub-interface;
a current logic step execution unit, configured to execute the logic step in the current sub-interface;
and the subinterface message sending unit is used for sending the asynchronous message to the next subinterface through the current subinterface if the execution of the logic step in the current subinterface is finished.
15. An electronic device, comprising:
a processor; and
memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a calling method of an interface as claimed in any one of claims 1 to 9.
16. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method of invocation of the interface of any one of claims 1 to 9.
CN202010924008.2A 2020-09-04 2020-09-04 Interface calling method and device, electronic equipment and computer readable medium Pending CN112052105A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010924008.2A CN112052105A (en) 2020-09-04 2020-09-04 Interface calling method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010924008.2A CN112052105A (en) 2020-09-04 2020-09-04 Interface calling method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN112052105A true CN112052105A (en) 2020-12-08

Family

ID=73607792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010924008.2A Pending CN112052105A (en) 2020-09-04 2020-09-04 Interface calling method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112052105A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204396A (en) * 2021-05-21 2021-08-03 珠海金山网络游戏科技有限公司 Service processing system, method and device
CN113204395A (en) * 2021-05-21 2021-08-03 珠海金山网络游戏科技有限公司 Service processing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003005167A2 (en) * 2001-07-06 2003-01-16 Computer Associates Think, Inc. Business process policy object
US20140229900A1 (en) * 2013-01-17 2014-08-14 Tencent Technology (Shenzhen) Company Limited Method and apparatus for interface presentation, method and apparatus for user interface interaction, and computer readable storage medium
CN104932932A (en) * 2014-03-20 2015-09-23 腾讯科技(深圳)有限公司 Asynchronous business processing method, device and system
JP2015197810A (en) * 2014-04-01 2015-11-09 キヤノン株式会社 Server device, information processing method and program
CN108595177A (en) * 2018-04-28 2018-09-28 广东电网有限责任公司 interface development method and device
CN109361606A (en) * 2018-09-28 2019-02-19 新华三技术有限公司 A kind of message handling system and the network equipment
CN110245029A (en) * 2019-05-21 2019-09-17 中国平安财产保险股份有限公司 A kind of data processing method, device, storage medium and server

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003005167A2 (en) * 2001-07-06 2003-01-16 Computer Associates Think, Inc. Business process policy object
US20140229900A1 (en) * 2013-01-17 2014-08-14 Tencent Technology (Shenzhen) Company Limited Method and apparatus for interface presentation, method and apparatus for user interface interaction, and computer readable storage medium
CN104932932A (en) * 2014-03-20 2015-09-23 腾讯科技(深圳)有限公司 Asynchronous business processing method, device and system
JP2015197810A (en) * 2014-04-01 2015-11-09 キヤノン株式会社 Server device, information processing method and program
CN108595177A (en) * 2018-04-28 2018-09-28 广东电网有限责任公司 interface development method and device
CN109361606A (en) * 2018-09-28 2019-02-19 新华三技术有限公司 A kind of message handling system and the network equipment
CN110245029A (en) * 2019-05-21 2019-09-17 中国平安财产保险股份有限公司 A kind of data processing method, device, storage medium and server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204396A (en) * 2021-05-21 2021-08-03 珠海金山网络游戏科技有限公司 Service processing system, method and device
CN113204395A (en) * 2021-05-21 2021-08-03 珠海金山网络游戏科技有限公司 Service processing method and device

Similar Documents

Publication Publication Date Title
CN110601952A (en) Multi-channel message notification sending method and device
CN111277639B (en) Method and device for maintaining data consistency
US11341443B2 (en) Prioritizing sequential application tasks
CN111127181B (en) Voucher accounting method and device
CN112052105A (en) Interface calling method and device, electronic equipment and computer readable medium
CN111786939B (en) Method, device and system for testing management platform of Internet of things
CN114979295B (en) Gateway management method and device
CN113472687B (en) Data processing method and device
CN109271259B (en) Enterprise service bus system, data processing method, terminal and storage medium
CN112084042A (en) Message processing method and device
CN112019596B (en) Message pushing method and device based on message routing configuration and electronic equipment
CN113742389A (en) Service processing method and device
CN113923130B (en) Multi-tenant open interface resource configuration method, device and terminal
CN115410580A (en) Voice recognition method, device, equipment and medium for command scheduling system
CN110995725B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN113553206A (en) Data event execution method and device, electronic equipment and computer readable medium
CN113760487A (en) Service processing method and device
CN117201577B (en) Communication method and system of cross-platform API and SPI based on PISA
CN115062595A (en) Push information generation method and device, electronic equipment and storage medium
CN113947434A (en) Business processing method and device for multi-business component combination scene
CN116012158A (en) Service processing method, device, equipment and storage medium
CN117119041A (en) Service flow limiting method, device, electronic equipment and computer readable medium
CN116204586A (en) Data processing method, device, electronic equipment and storage medium
CN112732417A (en) Method and device for processing application request
CN114444064A (en) Account processing method and device, electronic equipment and computer readable 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
CB02 Change of applicant information

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: Jingdong Digital Technology Holding Co., Ltd

CB02 Change of applicant information