CN113821325A - Application program calling method, device, equipment and medium - Google Patents

Application program calling method, device, equipment and medium Download PDF

Info

Publication number
CN113821325A
CN113821325A CN202111114094.1A CN202111114094A CN113821325A CN 113821325 A CN113821325 A CN 113821325A CN 202111114094 A CN202111114094 A CN 202111114094A CN 113821325 A CN113821325 A CN 113821325A
Authority
CN
China
Prior art keywords
application program
target application
normally
judging whether
target
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
CN202111114094.1A
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.)
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Beijing Guangqiyuan Digital 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 Guangqiyuan Digital Technology Co ltd filed Critical Beijing Guangqiyuan Digital Technology Co ltd
Priority to CN202111114094.1A priority Critical patent/CN113821325A/en
Publication of CN113821325A publication Critical patent/CN113821325A/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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Landscapes

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

Abstract

The embodiment of the specification discloses an application program calling method, which comprises the following steps: creating a function module in a source code of a target application program, wherein the function module is used for enabling the target application program to monitor whether a first port receives a preset inquiry message; before calling the target application program, judging whether the target application program operates normally; if the target application program is judged to be abnormal in operation, restarting the target application program, and judging whether the target application program is normal in operation again; after judging whether the target application program operates normally every time, if the target application program operates normally, calling the target application program; wherein, judging whether the target application program runs normally comprises: sending a preset inquiry message to the first port, and monitoring whether the second port receives a feedback message of the target application program to the preset inquiry message; and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message.

Description

Application program calling method, device, equipment and medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for calling an application program.
Background
In the prior art, various applications may be called to use their corresponding functions. But the application program may have abnormal operation, thereby causing call failure.
In view of the foregoing, there is a need for a more efficient application invocation scheme.
Disclosure of Invention
The present specification provides an application program calling method, apparatus, device, and medium, which are used to solve the technical problem of how to efficiently call an application program.
In order to solve the above technical problem, the embodiments of the present specification provide the following technical solutions:
an embodiment of the present specification provides a first application program calling method, including:
creating a functional module in a source code of a target application program, wherein the functional module is used for enabling the target application program to monitor whether a first port receives a preset inquiry message;
before the target application program is called, judging whether the target application program operates normally; if the target application program is judged to be abnormally operated, restarting the target application program, and judging whether the target application program is normally operated again;
after judging whether the target application program operates normally every time, if the target application program operates normally, calling the target application program;
wherein, judging whether the target application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the target application program to the preset inquiry message;
and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message.
Optionally, determining whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message, including:
if the second interface receives a feedback message of the target application program to the preset inquiry message, judging that the target application program normally operates;
and/or the presence of a gas in the gas,
and if the second interface does not receive the feedback message of the target application program to the preset inquiry message, judging that the target application program is abnormal in operation.
Optionally, determining whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message, including:
and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message within a preset time period after the inquiry message is sent.
Optionally, the method is applied to a host application program, and the host application program is an application program that needs to call the target application program.
Optionally, the source code of the host application includes a functional module, where the functional module is configured to: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program;
wherein, judging whether the first application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message;
and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
Optionally, the functional module is configured to enable the target application program to send a feedback message to the preset query message to the second port after monitoring that the first port receives the preset query message.
Optionally, before creating a functional module in the source code of the target application, the method further includes:
determining a functional module to be created in source code of a target application program according to the type of the target application program.
Optionally, the method further includes:
and pre-storing various types of function modules and establishing a corresponding relation between the function modules and the application program.
An embodiment of the present specification provides a second application program calling method, including:
creating a first function module in a source code of a first application program, wherein the first function module is used for enabling the first application program to monitor whether a first port receives a preset inquiry message;
if a call request of a second application program to the first application program is acquired, judging whether the first application program operates normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, allowing the second application program to call the first application program; or, creating a second functional module in the source code of the second application, the second functional module being configured to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program;
wherein, judging whether the first application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message;
and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
An embodiment of the present specification provides an application calling apparatus, including:
the system comprises a setting module, a first port and a second port, wherein the setting module is used for creating a function module in a source code of a target application program, and the function module is used for enabling the target application program to monitor whether a first port receives a preset inquiry message;
the inquiry module is used for judging whether the target application program operates normally or not before calling the target application program; if the target application program is judged to be abnormally operated, restarting the target application program, and judging whether the target application program is normally operated again;
the execution module is used for calling the target application program if the target application program is judged to run normally after judging whether the target application program runs normally every time;
wherein, judging whether the target application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the target application program to the preset inquiry message;
and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message.
An embodiment of the present specification provides an application calling apparatus, including:
the system comprises a setting module, a first application program and a second application program, wherein the setting module is used for creating a first functional module in a source code of the first application program, and the first functional module is used for enabling the first application program to monitor whether a first port receives a preset inquiry message; or, creating a second functional module in the source code of the second application, the second functional module being configured to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program;
the execution module is used for judging whether the first application program runs normally or not if a call request of a second application program to the first application program is acquired; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, allowing the second application program to call the first application program;
wherein, judging whether the first application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message;
and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
An embodiment of the present specification provides an application calling device, including:
at least one processor;
and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the first or second application calling methods described above.
The embodiment of the specification provides a computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the computer-executable instructions implement the first or second application calling method.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
before the application program is called, whether the application program normally runs or not can be determined, and the application program is called under the condition that the application program normally runs. And if the application program is abnormally operated, restarting the application program so as to ensure that the application program is normally operated. Therefore, the successful calling of the application program is ensured, and the calling efficiency of the application program is improved.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the description of the embodiments of the present specification or the prior art will be briefly described below. It should be apparent that the drawings described below are only some of the drawings to which the embodiments described in the present specification may relate, and that other drawings may be derived from those drawings by those of ordinary skill in the art without inventive effort.
Fig. 1 is a schematic diagram of an execution body of an application calling method in the first embodiment of the present specification.
Fig. 2 is a flowchart illustrating an application calling method in the first embodiment of the present specification.
Fig. 3 is a flowchart illustrating an application calling method in the second embodiment of the present specification.
Fig. 4 is a schematic structural diagram of an application calling apparatus in a third embodiment of the present specification.
Fig. 5 is a schematic structural diagram of an application calling device in a fourth embodiment of this specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings of the embodiments of the present specification. It is to be understood that the embodiments described herein are only some embodiments of the application and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present disclosure, shall fall within the scope of protection of the present application.
In the prior art, various applications may be called to use their corresponding functions. But the application program may have abnormal operation, thereby causing call failure.
A first embodiment (hereinafter, referred to as "embodiment one") of this specification provides an application calling method, an execution subject of the embodiment one may be a terminal (including but not limited to a mobile phone, a computer, a pad, a television) or a server or an operating system or an application, or an application calling platform or an application calling system, and the like, that is, the execution subject may be various and may be set, used, or transformed as needed. In addition, a third party application may assist the execution principal in executing embodiment one. For example, as shown in fig. 1, the application calling method in the first embodiment may be executed by a server, and an application corresponding to the server (held by a user) may be installed on a terminal (held by the user), and data transmission may be performed between the terminal or the application and the server, and data collection or input or output or page or information processing may be performed by the terminal or the application or (to the user), so as to assist the server in executing the application calling method in the first embodiment.
As shown in fig. 2, an application calling method according to an embodiment includes:
s101: creating a function module in source code of a target application program (an execution main body), wherein the function module is used for enabling the target application program to monitor whether a first port receives a preset inquiry message;
in the first embodiment, if the execution main body wants to call any application program, the application program is used as the target application program. The target application may be a variety of applications, such as a payment application, a shopping application, an instant messaging application, an office application, a product development application, and the like, and the type of the target application is not particularly limited in the embodiments. The execution subject of embodiment one may determine the application that needs to be invoked.
The execution main body of the first embodiment may create a function module in the source code of the target application, where the target application runs the function module, where the function module is configured to enable the target application to listen whether the first port receives the preset inquiry message, that is, the function module is configured to enable the target application to listen to the message received by the first port, and to enable the target application to recognize the preset inquiry message (the preset inquiry message is generally a character string). Wherein, the functional module can be a written code segment or a script, and the first port can be defined or limited by the functional module. The first port is a virtual port (process communication can be realized through the virtual port) of the computer and other devices, and the first port can be selected or changed according to actual conditions, for example, the first port can be 8000 ports or other ports.
Due to differences in different applications, for example, differences in the programming languages used, different target applications may have different applicable functional modules.
The execution main body of the first embodiment may pre-store various types of function modules, and establish a corresponding relationship between the function modules and the application programs, including a corresponding relationship between the function modules and the types of the application programs. The type of the functional module may be distinguished by using a writing language (the same as a programming language) used by the functional module, the type of the application program may be distinguished by using a programming language used by the application program, or the type of the functional module or the application program may be distinguished by using other manners. The correspondence between the function modules and the application programs may be determined in various ways, for example, the function modules and the application programs using the same writing language are determined to have a correspondence.
Before creating the function module in the source code of the target application, the execution main body of the first embodiment may determine the function module to be created in the source code of the target application according to the type of the target application, that is, create the function module corresponding to the target application in the source code of the target application according to the correspondence between the function module and (the type of) the application, for example, insert the function module into the source code of the target application. The function module corresponding to the target application is hereinafter referred to as a target function module.
The preset inquiry message may be defined or limited by a target function module, and for any target application program, a target function module corresponding to the target application program may be created in the source code of the target application program, and the target function module corresponding to the target application program defines or limits the preset inquiry message corresponding to the target application program. In one embodiment, different target applications may correspond to different preset inquiry messages. The "preset inquiry message" described below refers to a preset inquiry message corresponding to a target application, unless otherwise specified.
S103: before the target application program is called, judging whether the target application program operates normally or not; if the target application program is judged to be abnormally operated, restarting the target application program, and judging whether the target application program is normally operated again; wherein, judging whether the target application program runs normally comprises: sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the target application program to the preset inquiry message; and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message.
The execution main body of the first embodiment may determine whether the target application program operates normally before calling the target application program each time. Of course, the target application program called by the execution main body of the first embodiment may be different, but no matter what application program the target application program called by each time is, the execution main body of the first embodiment may determine whether the target application program is operating normally.
The determining, by the execution main body, whether the target application program operates normally may include:
s1031: sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the target application program to the preset inquiry message;
for any target application program, the execution main body in the first embodiment may send a preset inquiry message corresponding to the target application program to the first port, and monitor whether the second port receives a feedback message of the target application program to the preset inquiry message. The second port is a virtual port of a computer or other equipment, and the second port can be selected or changed according to the actual situation, for example, the second port can be an 8001 port or other ports.
S1033: and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message.
Since the target application monitors whether the first port receives the preset inquiry message, after the preset inquiry message is sent to the first port, if the target application runs normally, the target application monitors that the first port receives the preset inquiry message (hereinafter referred to as "monitoring the preset inquiry message"). And part of the target application program may have a message reply function, and after monitoring the preset inquiry message, the target application program sends a feedback message for the preset inquiry message to a second port defined in the target kinetic energy module. Some target applications may not have a message reply function, or the target applications themselves may not have a function of feeding back the preset inquiry message because the preset inquiry message is a message additionally defined or defined by the target function module. In a first embodiment, the target function module may be further configured to enable the target application to monitor that the first port receives the preset inquiry message, and then send a feedback message for the preset inquiry message to the second port. Wherein the second port may be defined in a target function module of the target application.
In addition, for any target application program, its feedback message to the preset inquiry message (in form or content) can be defined or limited by its corresponding target function module.
The execution main body according to the first embodiment may determine whether the target application program operates normally according to whether the second port receives a feedback message of the target application program to the preset inquiry message. Determining whether the target application program operates normally according to whether the second port receives a feedback message of the target application program to the preset inquiry message, may include: if the second interface receives a feedback message of the target application program to the preset inquiry message, judging that the target application program normally operates; and/or if the second interface does not receive the feedback message of the target application program to the preset inquiry message, judging that the target application program is abnormal in operation.
Generally, after the execution main body of the first embodiment sends the preset inquiry message to the first port, it is not monitored indefinitely whether the second port receives a feedback message of the target application program to the preset inquiry message. In the first embodiment, the determining whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message may include: and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message within a preset time period after the inquiry message is sent. Specifically, if the second interface receives a feedback message of the target application program to the preset inquiry message within a preset time period after the inquiry message is sent, it is determined that the target application program is normally operated; and/or if the second interface does not receive the feedback message of the target application program to the preset inquiry message within a preset time period after the inquiry message is sent, judging that the target application program is abnormal in operation.
Generally, before the executing main body actually calls the target application program, the target application program is in background operation (that is, there is a background process corresponding to the target application program), so that determining whether the target application program is operating normally is equivalent to determining whether the target application program can respond to the preset inquiry message (that is, send a feedback message to the preset inquiry message).
If it is determined that the target application program is abnormal in operation, the execution main body of the first embodiment may restart the target application program, and after the target application program is restarted, determine whether the target application program is normal in operation again as described above.
S105: after judging whether the target application program operates normally or not, if the target application program operates normally, calling the target application program;
after the target application program is judged to be normally operated every time, if the target application program is judged to be abnormally operated, the target application program can be restarted as above, and whether the target application program is normally operated is judged again as above.
After judging whether the target application program operates normally every time, if the target application program operates normally, the target application program can be called to use the function corresponding to the target application program.
And before any target application program is called next time, whether the target application program to be called runs normally is judged continuously as above. If the target application program is judged to be abnormal in operation, the target application program can be restarted as above, and whether the target application program is normal in operation is judged again as above; after judging whether the target application program operates normally every time, if the target application program operates normally, the target application program can be called to use the function corresponding to the target application program.
For example, if the execution subject of the first embodiment calls any application program a, a function module is created in the source code of the application program a, where the function module is used to enable the application program a to monitor whether the first port receives a preset inquiry message; before calling the application program A, judging whether the application program A normally operates; if the application program A is judged to be abnormal in operation, restarting the application program A, and judging whether the application program A is normal in operation again; after judging whether the application program A runs normally every time, if the application program A runs normally, calling the application program A, and before calling the application program A next time, judging whether the application program A runs normally is not needed.
In addition, because the source code of the application program A has the function module, before the application program A is called next time, the function module is not required to be created in the source code of the application program A unless the application program A is subjected to preset change, and whether the application program A normally operates is judged according to the function module created in the source code of the application program A before; if the application program A is judged to be abnormal in operation, restarting the application program A, and judging whether the application program A is normal in operation again; and after judging whether the application program A normally operates every time, if judging that the application program A normally operates, calling the application program A.
If the execution agent of the first embodiment calls the application program B next, the call to the application program a is referred to.
In particular, a call to any application may be initiated by another application, and thus the execution subject of embodiment one may be the application that needs to call the application. The called application is a target application, and the application that needs to call the target application is called a host application, that is, the execution subject of embodiment one may be the host application, and the host application may be any application. For example, if the main application is a shopping application and the payment function of a payment application needs to be called, the shopping application is the main application and the payment application is the target application. Typically, the host application is installed on the same device as the target application.
In an embodiment one, the source code of the main application may include a functional module, which is not called a second functional module (the second functional module may be a written code segment or a script), and the second functional module may define or limit the first port and preset query messages corresponding to various applications; (in the case where the second functional module is run by the primary application) the second functional module is operable to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program; wherein, judging whether the first application program runs normally comprises: sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message; and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
Since any application may call other applications or be called by other applications, that is, any application may serve as both a main application and a target application, a target function module and/or a second function module may exist in the source code of any application.
In one embodiment, before the application program is called, it may be determined whether the application program to be called is normally running, and the application program is called when the application program is normally running. And if the application program is abnormally operated, restarting the application program so as to ensure that the application program is normally operated. The first embodiment realizes calling of the application program under the condition that the application program runs normally, ensures successful calling of the application program, and can improve calling efficiency of the application program.
A second embodiment (hereinafter, referred to as "embodiment two") of this specification provides an application calling method, and an execution subject of embodiment two may be a terminal (including but not limited to a mobile phone, a computer, a pad, and a television), or a server, or an operating system, or an application calling platform, or an application calling system, or the like, that is, the execution subject may be various, and may be set, used, or changed as needed. In addition, a third party application may also assist the execution principal in executing embodiment two. For example, as shown in fig. 1, the application calling method in the second embodiment may be executed by a server, and an application corresponding to the server (held by a user) may be installed on a terminal (held by the user), so that data transmission may be performed between the terminal or the application and the server, and data collection or input or output or page or information processing may be performed by the terminal or the application or (to the user), thereby assisting the server in executing the application calling method in the second embodiment.
As shown in fig. 3, the application program calling method according to the second embodiment includes:
s202: creating a first function module in source code of a first application program (an execution main body), wherein the first function module is used for enabling the first application program to monitor whether a first port receives a preset inquiry message;
the first application may be any application, and even if the execution subject of the second embodiment or another application does not need to call the first application, the execution subject of the second embodiment may create a first function module (corresponding to the function module in the first embodiment) in the source code of the first application, that is, the first application is not limited to the target application of the first embodiment.
The process of creating a first functional module in the source code of a first application refers to embodiment one.
S204: if a call request of a second application program to the first application program is acquired, judging whether the first application program operates normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, allowing the second application program to call the first application program; or, creating a second functional module in the source code of the second application, the second functional module being configured to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program; wherein, judging whether the first application program runs normally comprises: sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message; and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
The following is described in each case:
the first condition is as follows: the second application program sends a call request for the first application program to the execution main body of embodiment one
In the first case, if an arbitrary second application (corresponding to the main application in the first embodiment) needs to call the first application, the second application may send a call request for the first application to the execution main body in the second embodiment. If the execution main body of the second embodiment acquires a call request of a second application program to a first application program, referring to the content of the first embodiment, the execution main body of the second embodiment judges whether the first application program operates normally; and if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again. In the second embodiment, after the execution main body determines whether the first application program operates normally each time, if it is determined that the first application program operates normally, the second application program is allowed to call the first application program. Allowing the second application to invoke the first application may include: and sending a notification to the second application program, wherein the notification is used for indicating that the first application program can be called, so that the second application program calls the first application program after acquiring the notification.
Case two: the second application sends a notification of the call to the first application to the execution agent of embodiment one
In the second case, if an arbitrary second application (corresponding to the host application in the first embodiment) needs to call the first application (the first application assumes the role of the target application in the first embodiment), the second application may send a call notification to the execution body in the second embodiment to the first application. If the execution main body according to the second embodiment acquires the call notification of the second application to the first application, the execution main body according to the second embodiment creates a second function module in the source code of the second application (that is, the call notification is used to cause the execution main body according to the second embodiment to create the second function module in the source code of the second application), where the second function module is used to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; and after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program.
In the first case, the execution main body of the second embodiment determines whether the first application program operates normally; in the second case, the second application program with the second functional module is used for judging whether the first application program operates normally, namely, judging whether the first application program operates normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; and after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program to be executed by a second application program.
In general, the first application program and the second application program are installed on the execution body of the second embodiment.
In the first or second case, the execution main body of the second embodiment may create the first function module in the source code of the first application program after acquiring the call request or the call notification of the second application program to the first application program, or may create the first function module in the source code of the first application program by using all the application programs as the first application program, regardless of whether the call request or the call notification is acquired.
Referring to the first embodiment, in the second embodiment, the determining whether the first application program operates normally includes:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message; and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
In the second embodiment, the contents not described in detail refer to the first embodiment.
In one embodiment, before the application program is called, it may be determined whether the application program to be called is normally running, and the application program is called when the application program is normally running. And if the application program is abnormally operated, restarting the application program so as to ensure that the application program is normally operated. The first embodiment realizes calling of the application program under the condition that the application program runs normally, ensures successful calling of the application program, and can improve calling efficiency of the application program.
As shown in fig. 4, a third embodiment of the present specification provides an application calling apparatus corresponding to the method in the first embodiment, including:
a setting module 301, configured to create a function module in a source code of a target application, where the function module is configured to enable the target application to monitor whether a first port receives a preset inquiry message;
the inquiry module 303 is configured to determine whether the target application program operates normally before the target application program is called; if the target application program is judged to be abnormally operated, restarting the target application program, and judging whether the target application program is normally operated again;
the executing module 305 is configured to, after each time whether the target application program operates normally is determined, if it is determined that the target application program operates normally, call the target application program;
wherein, judging whether the target application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the target application program to the preset inquiry message;
and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message.
Optionally, determining whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message, including:
if the second interface receives a feedback message of the target application program to the preset inquiry message, judging that the target application program normally operates;
and/or the presence of a gas in the gas,
and if the second interface does not receive the feedback message of the target application program to the preset inquiry message, judging that the target application program is abnormal in operation.
Optionally, determining whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message, including:
and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message within a preset time period after the inquiry message is sent.
Optionally, the device is installed with a main application program, and the main application program is an application program that needs to call the target application program.
Optionally, the source code of the main application includes a function module, where the function module is configured to enable the query module 303 to determine whether the first application runs normally before the second application calls the first application; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again;
after determining whether the first application program operates normally each time, the execution module 305 allows the second application program to call the first application program if the first application program operates normally;
wherein, judging whether the first application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message;
and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
Optionally, the functional module is configured to enable the target application program to send a feedback message to the preset query message to the second port after monitoring that the first port receives the preset query message.
Optionally, the setting module 301 is further configured to: before creating a function module in source code of a target application program, determining the function module to be created in the source code of the target application program according to the type of the target application program.
Optionally, the setting module 301 is further configured to: and pre-storing various types of function modules and establishing a corresponding relation between the function modules and the application program.
As shown in fig. 5, a fourth embodiment of the present disclosure provides an application calling apparatus corresponding to the method in the first embodiment, including:
a setting module 402, configured to create a first functional module in a source code of a first application, where the first functional module is configured to enable the first application to monitor whether a first port receives a preset inquiry message; or, creating a second functional module in the source code of the second application, the second functional module being configured to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program;
an execution module 404, configured to determine whether the first application program operates normally if a call request of a second application program to the first application program is obtained; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, allowing the second application program to call the first application program;
wherein, judging whether the first application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message;
and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
A fifth embodiment of the present specification provides an application calling apparatus including:
at least one processor;
and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of embodiment one or embodiment two.
A sixth embodiment of the present specification provides a computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, perform the method of the first or second embodiment.
The above embodiments may be used in combination, and the modules having the same name between different embodiments or within the same embodiment may be the same or different modules.
While certain embodiments of the present disclosure have been described above, other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily have to be in the particular order shown or in sequential order to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device, and non-volatile computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some portions of the description of the method embodiments.
The apparatus, the device, the nonvolatile computer readable storage medium, and the method provided in the embodiments of the present specification correspond to each other, and therefore, the apparatus, the device, and the nonvolatile computer storage medium also have similar advantageous technical effects to the corresponding method.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (13)

1. An application calling method comprising:
creating a functional module in a source code of a target application program, wherein the functional module is used for enabling the target application program to monitor whether a first port receives a preset inquiry message;
before the target application program is called, judging whether the target application program operates normally; if the target application program is judged to be abnormally operated, restarting the target application program, and judging whether the target application program is normally operated again;
after judging whether the target application program operates normally every time, if the target application program operates normally, calling the target application program;
wherein, judging whether the target application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the target application program to the preset inquiry message;
and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message.
2. The method of claim 1, wherein determining whether the target application program operates normally according to whether the second port receives a feedback message of the target application program to the preset inquiry message comprises:
if the second interface receives a feedback message of the target application program to the preset inquiry message, judging that the target application program normally operates;
and/or the presence of a gas in the gas,
and if the second interface does not receive the feedback message of the target application program to the preset inquiry message, judging that the target application program is abnormal in operation.
3. The method of claim 1, wherein determining whether the target application program operates normally according to whether the second port receives a feedback message of the target application program to the preset inquiry message comprises:
and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message within a preset time period after the inquiry message is sent.
4. The method of claim 1, applied to a host application, the host application being an application that needs to invoke the target application.
5. The method of claim 4, wherein the source code of the host application includes a functional module that is operable to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program;
wherein, judging whether the first application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message;
and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
6. The method of claim 1, wherein the functional module is configured to enable the target application to send a feedback message to the second port after the first port receives the preset query message.
7. The method of any of claims 1 to 6, prior to creating a functional module in source code of a target application, the method further comprising:
determining a functional module to be created in source code of a target application program according to the type of the target application program.
8. The method of claim 7, further comprising:
and pre-storing various types of function modules and establishing a corresponding relation between the function modules and the application program.
9. An application calling method comprising:
creating a first function module in a source code of a first application program, wherein the first function module is used for enabling the first application program to monitor whether a first port receives a preset inquiry message;
if a call request of a second application program to the first application program is acquired, judging whether the first application program operates normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, allowing the second application program to call the first application program; or, creating a second functional module in the source code of the second application, the second functional module being configured to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program;
wherein, judging whether the first application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message;
and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
10. An application calling device comprising:
the system comprises a setting module, a first port and a second port, wherein the setting module is used for creating a function module in a source code of a target application program, and the function module is used for enabling the target application program to monitor whether a first port receives a preset inquiry message;
the inquiry module is used for judging whether the target application program operates normally or not before calling the target application program; if the target application program is judged to be abnormally operated, restarting the target application program, and judging whether the target application program is normally operated again;
the execution module is used for calling the target application program if the target application program is judged to run normally after judging whether the target application program runs normally every time;
wherein, judging whether the target application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the target application program to the preset inquiry message;
and judging whether the target application program normally operates according to whether the second port receives a feedback message of the target application program to the preset inquiry message.
11. An application calling device comprising:
the system comprises a setting module, a first application program and a second application program, wherein the setting module is used for creating a first functional module in a source code of the first application program, and the first functional module is used for enabling the first application program to monitor whether a first port receives a preset inquiry message; or, creating a second functional module in the source code of the second application, the second functional module being configured to cause: before the second application program calls the first application program, judging whether the first application program runs normally; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, calling the first application program;
the execution module is used for judging whether the first application program runs normally or not if a call request of a second application program to the first application program is acquired; if the first application program is judged to be abnormally operated, restarting the first application program, and judging whether the first application program is normally operated again; after judging whether the first application program runs normally every time, if the first application program runs normally, allowing the second application program to call the first application program;
wherein, judging whether the first application program runs normally comprises:
sending the preset inquiry message to the first port, and monitoring whether a second port receives a feedback message of the first application program to the preset inquiry message;
and judging whether the first application program operates normally according to whether the second port receives a feedback message of the first application program to the preset inquiry message.
12. An application calling device comprising:
at least one processor;
and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the application calling method of any one of claims 1 to 9.
13. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the application calling method of any of claims 1 to 9.
CN202111114094.1A 2021-09-23 2021-09-23 Application program calling method, device, equipment and medium Pending CN113821325A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111114094.1A CN113821325A (en) 2021-09-23 2021-09-23 Application program calling method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111114094.1A CN113821325A (en) 2021-09-23 2021-09-23 Application program calling method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN113821325A true CN113821325A (en) 2021-12-21

Family

ID=78915198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111114094.1A Pending CN113821325A (en) 2021-09-23 2021-09-23 Application program calling method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113821325A (en)

Similar Documents

Publication Publication Date Title
CN107368507B (en) Block chain-based consensus method and device
CN107038041B (en) Data processing method, error code dynamic compatibility method, device and system
CN107832099B (en) Method and device for client version compatibility and storage medium
CN113259224B (en) Method and device for sending customer service data
CN111708655A (en) Application crash processing method, device and system
CN111475142B (en) Method, device and equipment for generating applet file package
CN107479868B (en) Interface loading method, device and equipment
CN110782253B (en) Transaction processing method, device and equipment based on block chain
CN111768303A (en) Transaction processing method, device, equipment and system
CN111861454B (en) Method and device for displaying unique identifier of digital object
CN114547024A (en) SQL statement risk detection method, device, equipment and medium
CN109144600B (en) Application program running method and device and computer readable medium
CN110046052B (en) Service calling method and device
CN111008044A (en) Application program recovery method and system and electronic equipment
CN111078435A (en) Service processing method and device and electronic equipment
CN110022351B (en) Service request processing method and device
CN112015817A (en) Processing method, device and equipment of block chain data
CN108881367B (en) Service request processing method, device and equipment
CN113342376B (en) Method and device for upgrading operating system of Internet of things equipment
CN113821325A (en) Application program calling method, device, equipment and medium
CN114625410A (en) Request message processing method, device and equipment
CN108628615B (en) Method, device and equipment for detecting abandoned codes
CN110737524B (en) Task rule management method, device, equipment and medium
CN114238934A (en) Equipment information acquisition method, device, equipment and medium
CN108255667B (en) Service monitoring method and device and electronic equipment

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220713

Address after: 100190 Beijing Haidian District Zhichun Road 49 No. 3 West 309

Applicant after: TENCENT CLOUD COMPUTING (BEIJING) Co.,Ltd.

Address before: 100102 Room 203, 14 and 19, floor 2, building 19, Wangjing Dongyuan seventh district, Chaoyang District, Beijing

Applicant before: Beijing Guangqiyuan Digital Technology Co.,Ltd.