Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In an internet of things edge computing scenario, an application is generally required to be issued to an edge device through a cloud device for deployment. In some scenarios, the calling condition of the application on the edge device needs to be monitored, some applications have the function of calling condition statistics, and after the deployment of the application on the edge device is completed, corresponding calling information can be acquired by accessing a specified port or path of the application. However, some applications do not have the function of call condition statistics, so that the call conditions of the applications cannot be acquired smoothly.
The embodiment of the present disclosure provides an application call information obtaining method, device and storage medium, which aim to solve at least one of the above technical problems in the prior art.
Fig. 1 shows an architecture diagram of an acquisition system for application invocation information, which includes a cloud device and at least one edge device according to an embodiment of the present disclosure. The cloud device can configure deployment parameter information of the target application and send the target application and the deployment parameter information to the edge device. The edge device can configure an agent capable of counting the calling information for the target application, deploy the target application based on the deployment parameter information, then obtain the calling information of the target application based on the agent, and send the calling information to the cloud device. The cloud device may be a cloud server, and the types of the edge device and the target application may be determined based on an actual application scenario. For example, the edge device may be a monitoring device and the target application may be a target detection model; alternatively, the edge device may be an industrial production device and the target application may be an application that may provide data computing services.
Fig. 2 shows a schematic flowchart of a method for acquiring application invocation information according to an embodiment of the present disclosure, and as shown in fig. 2, the method mainly includes the following steps:
s210: and the cloud equipment configures the deployment parameter information of the target application.
The application to be deployed to the edge device is defined as the target application, the target application may be uploaded to the cloud device first, and the deployment parameter information is configured for the target application, where the deployment parameter information may include a parameter and the like that are required to be used when the target application is deployed, and for example, the deployment parameter information may indicate a node to which the target application belongs and an effective mode of the target application.
S220: and the cloud equipment sends the target application and the deployment parameter information to the edge equipment.
After the configuration of the deployment parameter information of the target application is completed, the cloud device can send the target application and the deployment parameter information to the edge device needing to deploy the target application, so that the edge device can deploy the target application based on the deployment parameter information. Here, the timing of sending the target application and the deployment parameter information by the cloud device may be determined based on an actual scene. For example, the cloud device may send the target application and the deployment parameter information to the edge device in response to a deployment request of a user for the target application; or the cloud device may send the target application and the deployment parameter information to the edge device at a preset time point.
Optionally, before step S220, the cloud device may configure a preset identifier for the target application based on the monitoring request for the target application. The preset identifier is used for indicating that calling information of the target application needs to be monitored.
S230: and the edge equipment receives the target application and deployment parameter information sent by the cloud equipment.
S240: and when determining that the calling information of the target application needs to be monitored, the edge device configures an agent capable of counting the calling information for the target application.
In the embodiment of the present disclosure, an evaluation condition whether the call information for the target application needs to be monitored may be set in advance, and the edge device may determine whether the call information of the target application needs to be monitored based on the evaluation condition. For example, the evaluation condition may be whether the type of the target application is a preset type. The edge device may detect the type of the target application, and determine that the call information of the target application needs to be monitored when determining that the type of the target application is a preset type. For another example, the evaluation condition may be whether the detection target application has a preset identification. The edge device may detect whether the target application has a preset identifier, and determine that the call information of the target application needs to be monitored when the target application has the preset identifier. Other types of evaluation conditions are not listed here.
An agent refers to a class that can be an interface to anything else, an agent can be an interface to anything: web connections, applications, large objects in memory, files, or other expensive or irreproducible resources. In some cases, one object may not fit or directly reference another object, and the proxy object may act as an intermediary between the client and the target object. In the embodiment of the present disclosure, the proxy is used to control access to the target application, that is, call requests for the target application are all routed through the proxy, and the proxy is also configured with statistical call information, which can record the call information of the target application.
Optionally, before step S240, the edge device may deploy a dynamic admission controller, and the edge device may inject an agent capable of counting call information into the target application based on a callback mechanism of the dynamic admission controller, and configure port information of the target application and the agent.
S250: and the edge device deploys the target application based on the deployment parameter information.
As described above, the deployment parameter information may include parameters indicating the target application to be deployed, and the like, based on which the edge device may deploy the target application.
S260: the edge device obtains the calling information of the target application based on the agent and sends the calling information to the cloud device.
The statistical calling information is configured for the proxy, so that the proxy can record the calling information of the target application, and the edge device obtains the calling information of the target application based on the proxy.
Optionally, in this embodiment of the present disclosure, the edge device may receive, through a port of the proxy, a call request for the target application, route the call request to the port of the target application, and record call information corresponding to the call request responded by the target application.
S270: and the cloud equipment receives and displays the calling information of the target application returned by the edge equipment, wherein the calling information is acquired based on the agent corresponding to the target application.
According to the method for acquiring the application calling information, after the cloud device issues the application to the edge device, the edge device can automatically configure the agent capable of counting the calling information for the application and complete deployment, and the calling information of the application is acquired based on the agent. The method for acquiring the call information has high universality, and can meet the acquisition requirement of the call information of any type of application under the condition that the application does not have the function of call condition statistics, so that the functional requirement on the application can be reduced, and the development cost of the application can be saved.
Fig. 3 shows a schematic flowchart of another method for acquiring application invocation information according to an embodiment of the present disclosure, and as shown in fig. 3, the method mainly includes the following steps:
s301: and the cloud equipment configures the deployment parameter information of the target application.
The application to be deployed to the edge device is defined as the target application, the target application may be uploaded to the cloud device first, and the deployment parameter information is configured for the target application, where the deployment parameter information may include a parameter and the like that are required to be used when the target application is deployed, and for example, the deployment parameter information may indicate a node to which the target application belongs and an effective mode of the target application.
S302: the cloud device configures a preset identifier for the target application based on the monitoring request for the target application.
In the embodiment of the present disclosure, an evaluation condition whether the call information for the target application needs to be monitored may be set in advance, and the edge device may determine whether the call information of the target application needs to be monitored based on the evaluation condition. For example, the evaluation condition may be whether the type of the target application is a preset type. The evaluation condition may be to detect whether the target application has a preset identifier, where the preset identifier is used to indicate that the call information of the target application needs to be monitored.
S303: and the cloud equipment sends the target application and the deployment parameter information to the edge equipment.
After the configuration of the deployment parameter information of the target application is completed, the cloud device can send the target application and the deployment parameter information to the edge device needing to deploy the target application, so that the edge device can deploy the target application based on the deployment parameter information. Here, the timing of sending the target application and the deployment parameter information by the cloud device may be determined based on an actual scene. For example, the cloud device may send the target application and the deployment parameter information to the edge device in response to a deployment request of a user for the target application; or the cloud device may send the target application and the deployment parameter information to the edge device at a preset time point.
S304: the edge device deploys a dynamic admission controller.
The dynamic admission controller has an HTTP callback mechanism for receiving and processing admission requests, which can be used for authentication and authorization.
S305: and the edge equipment receives the target application and deployment parameter information sent by the cloud equipment.
It should be noted that the execution sequence of step S304 and step S305 is not sequential. Step S304 may be performed first, and then step S305 may be performed; step S305 may be executed first, and then step S304 may be executed.
S306: the edge device detects whether the target application has a preset identifier.
S307: and when the edge device detects that the target application has the preset identification, determining that the calling information of the target application needs to be monitored.
As described above, the preset identifier is used to indicate that the call information of the target application needs to be monitored, and when the target application has the preset identifier, the call information of the target application needs to be monitored. The monitored requirement of the calling information of the target application is verified in a mode of detecting the preset identifier, and therefore verification efficiency can be improved.
S308: and the edge equipment injects the agent capable of counting the calling information into the target application based on a callback mechanism of the dynamic admission controller, and configures the port information of the target application and the agent.
As described above, the dynamic admission controller may be used for authentication and authorization, and when the call information of the target application needs to be monitored, it may determine to authorize the event injected into the agent, thereby allowing the agent to be injected into the target application. The information security of the target application may be ensured based on the dynamic admission controller authorizing the event of injection into the agent.
In the embodiment of the disclosure, the edge device may map the original port configuration information of the target application to the proxy, and regenerate the port configuration information of the target application based on the parameters of the proxy. That is, the port provided externally by the edge device for calling the target application is not changed, and the user of the target application is not aware of the process of configuring the proxy, and does not need to change the port configuration.
An agent refers to a class that can be an interface to anything else, an agent can be an interface to anything: web connections, applications, large objects in memory, files, or other expensive or irreproducible resources. In some cases, one object may not fit or directly reference another object, and the proxy object may act as an intermediary between the client and the target object. In the embodiment of the present disclosure, the proxy is used to control access to the target application, that is, call requests for the target application are all routed through the proxy, and the proxy is also configured with statistical call information, which can record the call information of the target application.
In the disclosed embodiment, the agent may be a Sidecar (Sidecar), which is a design mode of a distributed architecture, and the Sidecar mode achieves the purpose of separation of control and logic by adding a "Sidecar" to an application. For example, log recording, monitoring, flow control, service registration, service discovery, service flow limitation, service fusing and the like do not need to realize control plane functions in the service, and can be handed to a side car, the service only needs to focus on realizing service logic, the service logic is perfectly matched with a distributed and micro-service architecture, and separation and decoupling of control and logic are really realized.
S308: and the edge device deploys the target application based on the deployment parameter information.
As described above, the deployment parameter information may include parameters indicating the target application to be deployed, and the like, based on which the edge device may deploy the target application.
S309: the edge device receives a call request for the target application through the port of the proxy and routes the call request to the port of the target application.
In the embodiment of the present disclosure, the proxy is used to control access to the target application, that is, all the invocation requests for the target application are routed through the proxy, so that the invocation requests for the target application can be received by the port of the proxy first, and then the proxy routes the invocation requests to the port of the target application.
S310: and the edge device records the calling information corresponding to the target application responding to the calling request based on the proxy and sends the calling information to the cloud device.
The agent in the edge device configures the statistical call information and can record the call information of the target application, so that the agent can record the call information of the target application, and the edge device obtains the call information of the target application based on the agent.
S311: and the cloud equipment receives and displays the calling information of the target application returned by the edge equipment.
The cloud device can be connected with a monitoring visual platform, calling information of the target application is displayed on the monitoring visual platform by using a visual monitoring tool (such as Prometous and the like), application calling information of all edge devices can be conveniently checked, the use threshold of a user is greatly reduced, and the operation efficiency of the user is improved.
The method is used for performing format conversion and data processing on the calling condition statistical data of all the edge terminals received by the cloud, and then performing monitoring interface display on the calling condition of the edge application on open source or self-research monitoring tools such as Prometheus and the like.
According to the method for acquiring the application call information, after the cloud device issues the application to the edge device, the edge device can complete operations such as injection of the agent and port configuration through a dynamic access control technology, and therefore full-automatic deployment of the application is achieved. In the edge device, a call request for an application is routed by a proxy, thereby acquiring call information of the application. The method for acquiring the calling information has high universality, can meet the requirement for acquiring the calling information of any type of application under the condition that the application does not have the function of calling condition statistics, simultaneously reduces the functional requirement on the application, and reduces the development cost of the application without developing the function of calling condition statistics of the application by a developer. In addition, the cloud equipment can be connected with a monitoring visual platform in a butt joint mode, application calling information of all edge equipment can be conveniently checked, the use threshold of a user is greatly reduced, and the operation efficiency of the user is improved.
Based on the same principle as the above-mentioned method for acquiring application call information, fig. 4 shows one of the schematic structural diagrams of the cloud device provided in the embodiment of the present disclosure, and fig. 5 shows the second of the schematic structural diagrams of the cloud device provided in the embodiment of the present disclosure. As shown in fig. 4, the cloud device 400 includes a parameter configuration module 410, an application issuing module 420, and an information receiving module 430.
The parameter configuration module 410 is used for configuring deployment parameter information of the target application.
The application delivery module 420 is configured to send the target application and the deployment parameter information to the edge device, so that the edge device deploys the target application based on the deployment parameter information.
The information receiving module 430 is configured to receive and display call information of the target application returned by the edge device, where the call information is obtained based on an agent corresponding to the target application.
Optionally, as shown in fig. 5, the cloud device of the embodiment of the present disclosure further includes an identification configuration module 440, where the identification configuration module 440 is configured to: and configuring a preset identifier for the target application based on the monitoring request aiming at the target application, wherein the preset identifier is used for indicating that the calling information of the target application needs to be monitored.
It can be understood that each module of the cloud device in the embodiment of the present disclosure has a function of implementing a corresponding step of the method for acquiring the application call information. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the cloud device, reference may be specifically made to the corresponding description of the method for acquiring the application invocation information, which is not described herein again.
Based on the same principle as the above-mentioned method for acquiring application call information, fig. 6 shows one of the schematic structural diagrams of an edge device provided by the embodiment of the present disclosure, and fig. 7 shows the second of the schematic structural diagrams of an edge device provided by the embodiment of the present disclosure. As shown in fig. 6, the edge device 600 includes an application receiving module 610, a proxy configuration module 620, an application deployment module 630, and an information upload module 640.
The application receiving module 610 is configured to receive target application and deployment parameter information sent by the cloud device.
The agent configuration module 620 is configured to configure an agent capable of counting call information for the target application when it is determined that the call information of the target application needs to be monitored, and the agent is configured to control access to the target application.
The application deployment module 630 is configured to deploy the target application based on the deployment parameter information.
The information uploading module 640 is configured to obtain the call information of the target application based on the proxy, and send the call information to the cloud device.
In the embodiment of the present disclosure, the agent configuration module 620 determines that the invocation information of the target application needs to be monitored by the following steps: detecting whether the target application has a preset identifier; and when the target application has the preset identification, determining that the calling information of the target application needs to be monitored.
Optionally, as shown in fig. 7, the edge device 600 of the embodiment of the present disclosure further includes a controller deployment module 640, where the controller deployment module 640 is configured to deploy a dynamic admission controller.
The agent configuration module 620, when configured to configure an agent capable of counting call information for a target application, is specifically configured to: and based on a callback mechanism of the dynamic admission controller, injecting the proxy capable of counting the call information into the target application, and configuring port information of the target application and the proxy.
In this embodiment of the present disclosure, when the agent configuration module 620 is configured to configure port information of a target application and an agent, it is specifically configured to:
mapping original port configuration information of a target application to an agent;
and regenerating the port configuration information of the target application based on the parameters of the proxy.
In the embodiment of the present disclosure, when the information uploading module 640 is configured to obtain the call information of the target application based on the proxy, specifically, the information uploading module is configured to:
receiving a calling request aiming at a target application through a port of an agent, and routing the calling request to the port of the target application;
and recording the calling information corresponding to the target application responding to the calling request.
It can be understood that each of the modules of the edge device in the embodiments of the present disclosure has a function of implementing a corresponding step of the method for acquiring application call information. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the edge device, reference may be specifically made to the corresponding description of the method for acquiring the application call information, which is not described herein again.
According to the cloud device and the edge device provided by the embodiment of the disclosure, after the cloud device issues the application to the edge device, the edge device can automatically configure an agent capable of counting call information for the application and complete deployment, and the call information of the application is acquired based on the agent. The method for acquiring the call information has high universality, and can meet the acquisition requirement of the call information of any type of application under the condition that the application does not have the function of call condition statistics, so that the functional requirement on the application can be reduced, and the development cost of the application can be saved.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
Fig. 8 shows a schematic block diagram of an example electronic device that may be used to implement the method for obtaining application invocation information provided by the embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic apparatus 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the electronic device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 801 executes the respective methods and processes described above, such as the acquisition method of the application call information. For example, in some embodiments, the method of obtaining application invocation information may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto the electronic device 800 via the ROM 802 and/or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the above-described acquisition method of application call information may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the obtaining method of the application invocation information in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.