CN115002232A - Service framework, data processing method, device, equipment and storage medium - Google Patents

Service framework, data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115002232A
CN115002232A CN202210435748.9A CN202210435748A CN115002232A CN 115002232 A CN115002232 A CN 115002232A CN 202210435748 A CN202210435748 A CN 202210435748A CN 115002232 A CN115002232 A CN 115002232A
Authority
CN
China
Prior art keywords
service
sdk
interface
edge
edge application
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.)
Granted
Application number
CN202210435748.9A
Other languages
Chinese (zh)
Other versions
CN115002232B (en
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202210435748.9A priority Critical patent/CN115002232B/en
Publication of CN115002232A publication Critical patent/CN115002232A/en
Application granted granted Critical
Publication of CN115002232B publication Critical patent/CN115002232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/321Interlayer communication protocols or service data unit [SDU] definitions; Interfaces between layers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q9/00Arrangements in telecontrol or telemetry systems for selectively calling a substation from a main station, in which substation desired apparatus is selected for applying a control signal thereto or for obtaining measured values therefrom
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/502Proximity
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)
  • Communication Control (AREA)

Abstract

The application discloses a service framework, a data processing method, a data processing device, a service equipment and a storage medium, which relate to the technical field of computers, and the service framework comprises the following steps: an SDK layer and an adaptation layer which run in the same container; providing an SDK interface corresponding to the edge host service through an SDK layer; converting the SDK interface into an interface of a target protocol through an adaptation layer based on a preset edge frame; providing micro-services corresponding to the edge host services according to the interface of the target protocol, so that the edge application executes the edge host services by calling the micro-services; the target protocols include HTTP and/or MQTT protocols. The method and the device can realize the decoupling of different edge host services and improve the maintainability of the edge host services.

Description

Service framework, data processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service framework, a data processing method, an apparatus, a device, and a storage medium.
Background
With the rapid development of the internet of things, edge calculation is more and more widely applied. Edge computing refers to an open platform integrating network, computing, storage and application core capabilities at one side close to an object or a data source to provide nearest-end services nearby. The edge application based on edge calculation is initiated at the edge side, so that a faster network service response can be generated, and the basic requirements of the industry in the aspects of real-time business, application intelligence, safety, privacy protection and the like are met.
At present, when edge applications are developed, edge host services are generally integrated into one edge application for development, so that the coupling degree of different edge host services in the edge applications is high, and the edge applications are not easy to maintain.
Disclosure of Invention
In order to solve the above problems in the prior art, that is, to decouple different edge host services in an edge application, the present application provides a service framework, a data processing method, an apparatus, a device, and a storage medium.
In a first aspect, the present application provides a business framework, including: a Software Development Kit (SDK) layer and an adaptation layer running in the same container; wherein the content of the first and second substances,
the SDK layer is used for providing an SDK interface corresponding to the edge host service;
the adaptation layer is used for converting the SDK interface into an interface of a target protocol based on a preset edge frame; providing micro-services corresponding to the edge host services according to the interface of the target protocol, so that the edge application executes the edge host services by calling the micro-services; the target protocols include hypertext Transport Protocol (HTTP) and/or Message Queue Telemetry Transport (MQTT) protocols.
In one possible implementation, the adaptation layer includes: the interface protocol conversion unit is used for converting the SDK interface into an HTTP interface if the interface of the target protocol is the HTTP interface; if the interface of the target protocol is an MQTT interface, converting the SDK interface into the MQTT interface through a callback function registered in an SDK layer so as to release an MQTT message; the data flow management unit is used for recording call request information of an interface of a target protocol and sending response data corresponding to the call request information to the edge application according to the call request information, wherein the call request information at least comprises an identifier and a serial number of the edge application; the virtualization service management unit is used for virtualizing the SDK interface into a micro service, and the information of the micro service comprises at least one of a service name, a service type, a service state or service information; and the authentication unit is used for determining whether the edge application has the authority to use the micro service.
In a second aspect, the present application provides a data processing method, including:
in response to a request message for acquiring service data from an edge application, calling a callback function registered in an adaptation layer of a service frame to an SDK layer through the SDK layer of the service frame according to the request message, wherein the callback function is a function registered in the SDK layer by the adaptation layer according to a service type supported by the edge application when the edge application is started, and the service frame is a service frame adopting the first aspect of the present application;
and issuing an MQTT message through a callback function, wherein the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and the MQTT message carries the identifier of the edge application and the sequence number corresponding to the request message.
In one possible implementation, issuing the MQTT message through the callback function includes: reading a callback function through an interface protocol conversion unit of an adaptation layer to obtain registration information of the edge application, wherein the registration information at least comprises an identifier and a service type supported by the edge application; and according to the registration information, issuing the MQTT message to the management unit through the data flow of the adaptation layer.
In a possible implementation manner, after the MQTT message is issued through the callback function, the data processing method further includes: receiving a response message aiming at the MQTT message by the edge application corresponding to the identification through an adaptation layer, wherein the response message carries a sequence number and target service data; and calling an SDK interface of the SDK layer through the adaptation layer according to the sequence number, and outputting the target service data.
In a third aspect, the present application provides a data processing method, including:
responding to a request message for acquiring service data by an edge application, and calling an SDK interface contained in an SDK layer of a service frame through an adaptation layer of the service frame according to the request message, wherein the request message carries an identifier of the edge application and a serial number corresponding to the request message, and the service frame adopts the service frame according to the first aspect of the application;
acquiring target service data corresponding to the request message through an SDK interface;
calling a callback function registered to the SDK layer by the adaptation layer according to the target service data through the SDK interface, wherein the callback function is a function registered to the SDK layer by the adaptation layer according to the service type supported by the edge application when the edge application is started;
and issuing an MQTT message through a callback function, wherein the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and the MQTT message carries the identifier of the edge application and the sequence number corresponding to the request message.
In a possible implementation manner, before the adapting layer of the service framework calls the SDK interface included in the SDK layer of the service framework according to the request message, the data processing method further includes: and responding to a request message for acquiring the micro-service list by the edge application, and sending the micro-service list to the edge application through a virtualization service management unit of the adaptation layer.
In a possible implementation manner, after sending the micro-service list to the edge application, the data processing method further includes: responding to a request message for acquiring service data by the edge application, and determining whether the edge application has the permission to use the micro service corresponding to the service data through an authentication unit of an adaptation layer; if the edge application is determined to have the authority to use the micro-service corresponding to the service data, the SDK interface is called through an interface protocol conversion unit of the adaptation layer according to the request message.
In a possible implementation manner, after obtaining the target service data corresponding to the request message through the SDK interface, the data processing method further includes: and sending the target service data to the edge application through the adaptation layer according to the SDK interface.
In a fourth aspect, the present application provides a data processing apparatus comprising:
a first calling module, configured to respond to a request message for acquiring service data from an edge application, and call, by an SDK layer of a service framework, a callback function that an adaptation layer of the service framework registers in the SDK layer according to the request message, where the callback function is a function that the adaptation layer registers in the SDK layer according to a service type supported by the edge application when the edge application is started, and the service framework is a service framework that employs the service framework described in the first aspect of the present application;
and the publishing module is used for publishing the MQTT message through a callback function, the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and the MQTT message carries the identification of the edge application and the sequence number corresponding to the request message.
In a possible implementation manner, the publishing module is specifically configured to: reading a callback function through an interface protocol conversion unit of an adaptation layer to obtain registration information of the edge application, wherein the registration information at least comprises an identifier and a service type supported by the edge application; and according to the registration information, issuing the MQTT message to the management unit through the data flow of the adaptation layer.
In a possible implementation manner, the data processing apparatus further includes a receiving module, configured to receive, by an adaptation layer, a response message for the MQTT message by identifying a corresponding edge application after the MQTT message is issued by a callback function, where the response message carries a sequence number and target service data; the data processing device also comprises a second calling module which is used for calling the SDK interface of the SDK layer through the adaptation layer according to the serial number and outputting the target service data.
In a fifth aspect, the present application provides a data processing apparatus comprising:
a first calling module, configured to respond to a request message for obtaining service data from an edge application, and call, by an adaptation layer of a service framework, an SDK interface included in an SDK layer of the service framework according to the request message, where the request message carries an identifier of the edge application and a serial number corresponding to the request message, and the service framework is a service framework according to a first aspect of the present application;
the acquisition module is used for acquiring target service data corresponding to the request message through the SDK interface;
the second calling module is used for calling a callback function registered by the adaptation layer to the SDK layer according to the target service data through the SDK interface, wherein the callback function is a function registered by the adaptation layer to the SDK layer according to the service type supported by the edge application when the edge application is started;
and the publishing module is used for publishing the MQTT message through a callback function, wherein the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and the MQTT message carries the identifier of the edge application and the sequence number corresponding to the request message.
In a possible implementation manner, the data processing apparatus further includes a sending module, configured to send the micro service list to the edge application through a virtualized service management unit of the adaptation layer in response to a request message for obtaining the micro service list by the edge application before the first invoking module invokes, according to the request message, an SDK interface included in an SDK layer of the service framework through the adaptation layer of the service framework.
In a possible implementation manner, the data processing apparatus further includes an authentication module, configured to determine, by an authentication unit of an adaptation layer, whether the edge application has an authority to use the micro service corresponding to the service data in response to a request message for acquiring the service data by the edge application after sending the micro service list to the edge application; and if the edge application is determined to have the permission to use the micro service corresponding to the service data, the first calling module calls the SDK interface through the interface protocol conversion unit of the adaptation layer according to the request message.
In one possible implementation manner, the sending module is further configured to: and after the acquisition module acquires the target service data corresponding to the request message through the SDK interface, the target service data is sent to the edge application through the adaptation layer according to the SDK interface.
In a sixth aspect, the present application provides a computer-readable storage medium, which includes a stored program, where the program executes the business framework described in the first aspect of the present application and the data processing method described in the second and third aspects of the present application.
In a seventh aspect, the present application provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the service framework according to the first aspect of the present application and the data processing method according to the second aspect and the third aspect of the present application through the computer program.
In an eighth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the business framework as described in the first aspect of the present application and the data processing methods as described in the second and third aspects of the present application.
The service framework, the data processing method, the data processing device, the equipment and the storage medium provided by the application are characterized in that the service framework comprises an SDK layer and an adaptation layer which operate in the same container; providing an SDK interface corresponding to the edge host service through an SDK layer; converting the SDK interface into an interface of a target protocol through an adaptation layer based on a preset edge frame; providing micro-services corresponding to the edge host services according to the interface of the target protocol, so that the edge application executes the edge host services by calling the micro-services; the target protocols include HTTP and/or MQTT protocols. Because the edge host business is micro-serviced by the adaptation layer based on the preset edge frame and abstracted into an interface of an independent target protocol, the decoupling of different edge host businesses can be realized, the maintainability of the edge host business is improved, and then developers can be enabled not to be concerned about data and service dependence of a bottom layer and can be concentrated in development and deployment of respective edge applications.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic diagram of a current edge host service according to an embodiment of the present application;
fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of a business framework provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a business framework provided by another embodiment of the present application;
FIG. 5 is a schematic diagram of a business framework provided by yet another embodiment of the present application;
fig. 6 is a flowchart of a data processing method according to an embodiment of the present application;
FIG. 7 is a flow chart of a data processing method according to another embodiment of the present application;
FIG. 8 is a flow chart of a data processing method according to another embodiment of the present application;
FIG. 9 is a flow chart of a data processing method according to another embodiment of the present application;
FIG. 10 is a diagram illustrating a procedure call according to an embodiment of the present application;
FIG. 11 is a diagram illustrating a system architecture according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a data processing apparatus according to another embodiment of the present application;
fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the technical scheme of the application, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the related information such as financial data or user data and the like all accord with the regulations of related laws and regulations and do not violate the good custom of the public order.
The edge host service includes at least one of a device access service, a device management service, an edge scene service, an information push service, an audio/video service, and an Artificial Intelligence (AI) service, which are coupled to each other and independent of each other, and need to be developed by different developers. Different edge host services are respectively integrated with corresponding service SDKs, and independent operation of respective processes may cause port conflict or program conflict among services, and network resource utilization redundancy may also occupy more memory resources; the maintenance and upgrading of different edge host services are inconvenient and have great dependence on programming languages.
At present, all edge host services are usually integrated into one edge application for development, and all the edge host services depend on a device access SDK corresponding to a device access service. Exemplarily, fig. 1 is a schematic diagram of a current edge host service provided in an embodiment of the present invention, and as shown in fig. 1, the edge host service includes a device access service, a device management service, an edge scene service, a message push service, an audio/video service, and an AI service, different edge host services have corresponding edge applications, and different edge applications call corresponding edge host services SDK. The message pushing service needs to complete the remote pushing of the message by means of a remote channel of the device access SDK, and the message pushing application also needs the integrated device access SDK; the execution of the scene engine of the edge scene service depends on the downloading of the device access channel configuration of the device access SDK and also depends on the channel of the device management SDK, and the edge scene application also needs the integrated device access SDK; the development of the AI application and the audio and video application depends on a remote channel of the device access SDK, and the integrated device access SDK is also needed.
Because all edge host services are integrated into an edge application, the services of the edge application are huge and the coupling degree is high, and the following main disadvantages exist: (1) all the edge host services need one application developer, and if the edge host services are multiple different application developers, the multiple different application developers cannot be integrated on one edge application; (2) all edge host services are coupled together, and are not easy to split and operate; (3) the service expansibility of the edge host is not high; (4) the support development language is single; (5) the update maintenance of the edge application is complicated.
Based on the above problems, the present application provides a service framework, a data processing method, an apparatus, a device, and a storage medium, which provide micro services corresponding to different edge host services by using a preset edge framework and a message publishing and message subscribing mechanism, so that an application developer develops corresponding edge applications by calling the micro services, each edge application can run in its own container, thereby implementing decoupling of different edge host services and improving maintainability of the edge host services.
First, an application scenario of the solution provided in the present application will be described below.
Fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application. As shown in fig. 2, in the application scenario, the edge host 201 collects data of the access control camera 203 in real time, obtains current setting information of the air conditioner 202 according to the data, for example, what the temperature and humidity of the air conditioner 202 are, and issues an execution command to the air conditioner 202 through a network to set the current setting information as target setting information. The edge host 201, the air conditioner 202 and the access control camera 203 are in the same network and can be mutually connected.
It should be noted that fig. 2 is only a schematic diagram of an application scenario provided in the embodiment of the present application, and the application scenario may be applied to an intelligent home, and the embodiment of the present application does not limit the devices included in fig. 2, nor limits the positional relationship between the devices in fig. 2.
Next, a service framework provided by the embodiment of the present application is described by a specific embodiment.
Fig. 3 is a schematic diagram of a service framework according to an embodiment of the present application. The service framework 300 of the embodiment of the present application can be applied to an electronic device, and the electronic device can be a server or a server cluster. As shown in fig. 3, the service framework 300 of the embodiment of the present application includes an SDK layer 310 and an adaptation layer 320 that operate in the same container. Wherein:
and an SDK layer 310 for providing an SDK interface corresponding to the edge host service.
The adaptation layer 320 is used for converting the SDK interface into an interface of a target protocol based on a preset edge frame; providing micro-services corresponding to the edge host services according to the interface of the target protocol, so that the edge application executes the edge host services by calling the micro-services; the target protocol includes HTTP and/or MQTT protocols.
In the embodiment of the present application, the SDK layer 310 can provide an SDK interface corresponding to the edge host service, for example, an interface implemented in C language. It will be appreciated that for different edge host services, the SDK layer 310 is provided with a corresponding SDK interface. The edge host service is, for example, a device access service, the SDK layer 310 can provide an SDK interface corresponding to the device access service.
For example, the preset edge frame is a kubenge frame, containerization management of the functional modules can be realized through the kubenge frame, and for how to use the kubenge frame specifically, reference may be made to the related art, which is not described herein again. The MQTT protocol is a publish/subscribe paradigm-based messaging protocol that can provide one-to-many message publishing. Illustratively, the adaptation layer 320 converts the SDK interface into an HTTP interface or an MQTT interface according to different edge host services based on the kubbeedge framework, and further provides micro services corresponding to the edge host services according to the HTTP interface or the MQTT interface. The HTTP Interface may be understood as a presentation layer transfer Application Programming Interface (RestAPI). The edge application may perform the corresponding edge host traffic by invoking different microservices. It can be understood that an edge application developer can develop corresponding edge applications through microservices, each edge application runs in a container of the edge application developer, and data synchronization and processing flows among edge services can realize communication through an HTTP interface and an MQTT message subscription and release mechanism; since each edge application runs in a separate container, the coupling between edge applications is greatly reduced. As to how the adaptation layer 320 specifically converts the SDK interface into an interface of a target protocol based on a preset edge frame; the micro service corresponding to the edge host service is provided according to the interface of the target protocol, which may refer to the subsequent embodiments and will not be described herein again.
The service framework provided by the embodiment of the application comprises an SDK layer and an adaptation layer which operate in the same container; providing an SDK interface corresponding to the edge host service through an SDK layer; converting the SDK interface into an interface of a target protocol through an adaptation layer based on a preset edge frame; providing micro-services corresponding to the edge host services according to the interface of the target protocol, so that the edge application executes the edge host services by calling the micro-services; the target protocols include HTTP and/or MQTT protocols. According to the method and the device, the edge host business is subjected to micro-service through the adaptation layer based on the preset edge frame and abstracted into an interface of an independent target protocol, so that decoupling of different edge host businesses can be realized, maintainability of the edge host business is improved, developers can pay attention to data and service dependence of a bottom layer, and development and deployment of respective edge applications can be concentrated.
On the basis of the foregoing embodiment, fig. 4 is a schematic diagram of a service framework provided in another embodiment of the present application. As shown in fig. 4, the adaptation layer 320 of the service framework 300 includes an interface protocol conversion unit 321, a data stream management unit 322, a virtualization service management unit 323, and an authentication unit 324. The interface protocol conversion unit 321 is configured to convert the SDK interface into an HTTP interface if the interface of the target protocol is an HTTP interface; if the interface of the target protocol is an MQTT interface, converting the SDK interface into the MQTT interface through a callback function registered in an SDK layer so as to release an MQTT message; a data flow management unit 322, configured to record call request information for an interface of a target protocol, and send response data corresponding to the call request information to an edge application according to the call request information, where the call request information at least includes an identifier and a sequence number of the edge application; the virtualization service management unit 323 is configured to virtualize the SDK interface as a micro service, where information of the micro service includes at least one of a service name, a service type, a service state, or service information; an authentication unit 324 for determining whether the edge application has the right to use the microservice.
Exemplarily, taking an operation of reading attribute information of the device a by an edge application as an example, specifically, the edge application calls an HTTP interface, and parameters of the HTTP interface at least include a device Identity (ID) and an attribute name of the device a; the interface protocol conversion unit 321 converts the HTTP interface into a corresponding SDK interface call, and transmits parameters; the SDK layer 310 sends a request for obtaining attribute information to the device a according to the parameter, after receiving the request, the device a registers to a callback function of the SDK layer via the interface protocol conversion unit 321, and recalls the attribute information to the interface protocol conversion unit 321, and issues MQTT messages to the management unit 322 through the data stream, and the edge application obtains the attribute information of the device a by subscribing to the messages.
For the data flow management unit 322, such as an HTTP interface where multiple edge applications call attribute information of the reading device a at the same time, the data flow management unit 322 records call request information of which edge application, where the call request information is, for example, an edge application ID and a Serial Number (SN), and when data is returned, response data can be returned to the corresponding edge application according to the call request information.
For example, after the adaptation layer 320 calls the SDK interface, the service functions of the edge hosts of the SDK are started (for example, the service functions of the edge scenes are started), and the services of the edge hosts can be virtualized into the micro services, for example, the micro services of the edge scenes, by the virtualization service management unit 323. After the adaptation layer 320 successfully invokes the edge scene initialization of the SDK, the device interface, the execution interface, and the like of the edge scene service are mapped with the HTTP interface, and then name the edge scene micro service, for example, the edge scene micro service is represented by a sceneService, where the edge scene micro service includes at least one of a scene type (sceneType), a scene state (sceneState), and scene basic information (sceneBaseInfo). Each edge application may also call a method for obtaining a list of all micro services (e.g., represented by getAllServiceInfo) to obtain all currently running micro services, and information of the micro services specifically includes a state or a method of the current micro service.
Illustratively, whether the edge application has the right to use the microservice provided by the adaptation layer 320 may be managed by the authentication unit 324, such as by a certificate or key mechanism.
The service framework provided by the embodiment of the application micro-services the edge host service through the interface protocol conversion unit, the data flow direction management unit, the virtualization service management unit and the authentication unit which are included in the adaptation layer, and abstracts the edge host service into an interface of an independent target protocol, so that decoupling of different edge host services can be realized, maintainability of the edge host service is improved, developers can be enabled to concentrate on development and deployment of respective edge applications without concerning dependence of data and services of a bottom layer.
On the basis of the foregoing embodiment, fig. 5 is a schematic diagram of a service framework provided in another embodiment of the present application, and as shown in fig. 5, a container includes an SDK layer and an adaptation layer, and the container is scheduled and operated in a POD (container group) manner. The SDK layer includes, for example, a device access SDK, a device management SDK, an edge scene SDK, an audio/video SDK, and an AI SDK corresponding to the edge host service. The SDK interface is converted into an HTTP interface or an MQTT interface through the adaptation layer, and micro services corresponding to the edge host business, namely equipment access micro services, equipment management micro services, edge scene micro services and audio and video micro services, are provided according to the HTTP interface or the MQTT interface. Accordingly, edge applications such as host applications may invoke device access microservices, edge scene applications may invoke device management microservices and edge scene microservices, and AI applications may invoke audio-video microservices. Various edge applications developed based on microservices may run in other containers separately.
Based on the service framework of the foregoing embodiment, fig. 6 is a flowchart of a data processing method provided in an embodiment of the present application. The method of the embodiment of the application can be applied to electronic equipment, and the electronic equipment can be a server or a server cluster and the like. As shown in fig. 6, the method of the embodiment of the present application includes:
s601, responding to a request message for acquiring service data from the edge application, and calling a callback function registered in an adaptation layer of a service frame to an SDK layer through the SDK layer of the service frame according to the request message.
The callback function is a function that the adaptation layer registers to the SDK layer according to the service type supported by the edge application when the edge application is started, and the service framework is obtained by using any one of the above-mentioned embodiments of the service framework.
In this embodiment, the request message for acquiring the service data from the edge application is, for example, sent by another device, such as a mobile phone, to the electronic device executing the embodiment of the present method. The request message is, for example, a message for reading device attributes, and when the edge application starts, the edge application registers a callback function for reading device attributes in the SDK layer through an adaptation layer of the service framework. The attribute of the reading device may be understood as a service type, and the service type may further include, for example, alarm, status report, and the like, and different edge applications support different service types. Illustratively, in response to a request message for reading device attributes from the edge application, a callback function of the read device attributes registered by the adaptation layer to the SDK layer is invoked by the SDK layer in accordance with the request message.
And S602, issuing the MQTT message through a callback function.
The MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and carries the identifier of the edge application and the sequence number corresponding to the request message.
In this step, the edge application subscribes to MQTT messages according to the supported service types when being started. After the adaptation layer is called to register a callback function of the SDK layer through the SDK layer according to the request message, the adaptation layer can perform callback processing, and then MQTT messages are issued.
Further, optionally, issuing the MQTT message through the callback function may include: reading a callback function through an interface protocol conversion unit of an adaptation layer to obtain registration information of the edge application, wherein the registration information at least comprises an identifier and a service type supported by the edge application; and according to the registration information, issuing the MQTT message to the management unit through the data flow of the adaptation layer.
Illustratively, the callback function is, for example, a function corresponding to the attribute of the read device, and when the SDK layer calls the callback function, the device ID and the SN corresponding to the attribute information of which device is read will be passed to the adaptation layer. And reading the callback function through an interface protocol conversion unit of the adaptation layer to obtain registration information of the edge application, wherein the registration information comprises read equipment attributes, application IDs, equipment IDs and SNs of service types. And according to the registration information, issuing an MQTT message corresponding to the attribute of the reading equipment to a management unit through the data flow of the adaptation layer.
The data processing method provided by the embodiment of the application calls the adaptation layer of the service framework to register to the callback function of the SDK layer according to the request message by responding to the request message for acquiring the service data from the edge application; and issuing the MQTT message through a callback function. According to the embodiment of the application, the micro-service of the edge host business is realized based on a message publishing/subscribing mechanism, namely, the micro-service is provided in an asynchronous callback mode, so that the decoupling of different edge host businesses can be realized, and the maintainability of the edge host business is improved.
On the basis of the foregoing embodiment, optionally, after the adaptation layer issues the MQTT message through the callback function, the data processing method may further include: receiving a response message aiming at the MQTT message by the edge application corresponding to the identification through an adaptation layer, wherein the response message carries a sequence number and target service data; and calling an SDK interface of the SDK layer through the adaptation layer according to the serial number, and outputting the target service data.
Illustratively, for example, after receiving the MQTT message corresponding to the attribute of the reading device, the edge application calls a response HTTP interface of the adaptation layer according to the device ID and the SN to respond to the MQTT message corresponding to the attribute of the reading device. Correspondingly, a response message (corresponding to a response HTTP interface) aiming at the MQTT message by the edge application is received through the adaptation layer, and the response message carries SN and equipment attributes; and calling an SDK interface of the SDK layer through the adaptation layer according to the SN, and outputting the device attribute. And if the request message for acquiring the service data from the edge application is sent by the mobile phone, outputting the equipment attribute to the mobile phone so as to display the equipment attribute on the mobile phone.
On the basis of the foregoing embodiment, fig. 7 is a flowchart of a data processing method according to another embodiment of the present application. As shown in fig. 7, taking an edge application as a host application as an example, the method in the embodiment of the present application may include:
701. and calling the HTTP interface by the host application, and registering the equipment access service to realize the equipment access function.
702. And converting the HTTP interface into an SDK interface of the SDK layer through the adaptation layer, namely calling the equipment of the SDK layer to access the SDK interface, and finishing equipment registration.
703. After the device registration is completed, the device ID is returned to the adaptation layer through the SDK layer.
704. The device ID is returned to the host application through the HTTP interface of the adaptation layer.
705. The host application subscribes to the message according to the host application ID and the service type, such as read-write operation.
706. And registering a callback function corresponding to the service type supported by the host application to the SDK layer through the adaptation layer.
707. And calling an SDK interface of the SDK layer to read the device attribute through an application on the mobile phone according to the device ID and the SN.
708. And the device access SDK of the SDK layer calls a callback function corresponding to the device reading attribute according to the device ID and the SN.
709. And issuing MQTT messages of the read device attributes through the adaptation layer according to the device ID, the host application ID and the SN, namely the MQTT messages of the read device attributes are triggered.
710. And the host application calls an HTTP interface of the adaptation layer to respond to the read device attribute according to the device ID and the SN, namely responding to the read device attribute.
711. And calling the device of the SDK layer by the adaptation layer to access the SDK interface to respond the read device attribute.
712. And the device attribute is responded to the application on the mobile phone by accessing the device of the SDK layer into the SDK interface.
Based on the service framework of the foregoing embodiment, fig. 8 is a flowchart of a data processing method according to another embodiment of the present application. As shown in fig. 8, the method of the embodiment of the present application includes:
s801, responding to a request message for acquiring service data by the edge application, and calling an SDK interface contained in an SDK layer of the service framework according to the request message through an adaptation layer of the service framework.
The request message carries an identifier of the edge application and a sequence number corresponding to the request message, and the service framework is obtained by using any one of the service framework embodiments.
In this step, the request message for the edge application to acquire the service data may be understood as a request message for the edge host application to actively initiate to acquire the service data. Illustratively, the edge application is, for example, a device management application, and in response to a request message for the device management application to read the attribute of the air conditioner device, the adaptation layer of the service framework may invoke, according to the request message, an SDK interface included in the SDK layer of the service framework. The request message carries the device management application ID and the SN corresponding to the request message.
S802, obtaining the target service data corresponding to the request message through the SDK interface.
Illustratively, the air conditioner properties are obtained from the air conditioner, such as through an SDK interface.
And S803, calling a callback function registered to the SDK layer by the adaptation layer through the SDK interface according to the target service data.
The callback function is a function that the adaptation layer registers to the SDK layer according to the service types supported by the edge application when the edge application is started.
In this step, after the target service data is obtained through the SDK interface, a callback function registered by the adaptation layer to the SDK layer may be called through the SDK interface according to the target service data. For example, if the air conditioner attribute is obtained from the air conditioner through the SDK interface, the corresponding callback function may be answered by calling the air conditioner attribute registered in the SDK layer by the adaptation layer through the SDK interface.
S804, the MQTT message is issued through the callback function.
The MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and carries the identifier of the edge application and the sequence number corresponding to the request message.
In this step, referring to the related description in step S602, after the callback function registered in the SDK layer by the adaptation layer is called through the SDK interface, the MQTT message is issued after callback processing is performed by the adaptation layer. Illustratively, for example, the adaptation layer issues an MQTT message of an attribute response of the air conditioning equipment, that is, an attribute response message of the air conditioning equipment is triggered, according to the service type of the device management application ID initiating the invocation request, the SN corresponding to the invocation request, and the attribute of the air conditioning equipment. Accordingly, the device management application subscribes to the attribute response message of the air conditioner, and therefore can receive the attribute response message of the air conditioner, that is, obtain the attribute of the air conditioner.
According to the data processing method provided by the embodiment of the application, the request message of the service data is acquired by responding to the edge application, and the SDK interface contained in the SDK layer of the service frame is called through the adaptation layer of the service frame according to the request message; acquiring target service data corresponding to the request message through an SDK interface; calling a callback function registered to the SDK layer by the adaptation layer through the SDK interface according to the target service data; and issuing the MQTT message through a callback function. Because the embodiment of the application provides the micro-service through the message publishing/subscribing mechanism, the decoupling of different edge host services can be realized, and the maintainability of the edge host services is improved.
On the basis of the foregoing embodiment, optionally, before the adapting layer of the service framework invokes, according to the request message, the SDK interface included in the SDK layer of the service framework, the data processing method may further include: and responding to a request message for acquiring the micro-service list by the edge application, and sending the micro-service list to the edge application through a virtualization service management unit of the adaptation layer.
Illustratively, based on the above description of the virtualized service management unit, in response to a request message for the edge application to obtain the micro service list, the micro service list is sent to the edge application by a method for obtaining all micro service lists provided by the virtualized service management unit of the adaptation layer. The micro-service list includes at least one of a device access micro-service, a device management micro-service, an edge scene micro-service and an audio-video micro-service. Accordingly, the edge application may display the micro-service list upon receiving the micro-service list.
On the basis of the foregoing embodiment, optionally, after sending the micro service list to the edge application, the data processing method may further include: responding to a request message for acquiring service data by the edge application, and determining whether the edge application has the right to use the micro service corresponding to the service data through an authentication unit of an adaptation layer; if the edge application is determined to have the authority to use the micro-service corresponding to the service data, the SDK interface is called through an interface protocol conversion unit of the adaptation layer according to the request message.
It can be appreciated that when an edge application uses a microservice, it is necessary to determine whether the edge application has permission to use the microservice. If the edge application is determined to have the permission to use the micro service, the SDK interface corresponding to the micro service can be called through the interface protocol conversion unit of the adaptation layer according to the request message.
On the basis of the foregoing embodiment, in a possible implementation manner, after obtaining the target service data corresponding to the request message through the SDK interface, the data processing method may further include: and sending the target service data to the edge application through the adaptation layer according to the SDK interface.
For example, after the air conditioner attribute is acquired from the air conditioner through the SDK interface, the air conditioner attribute may be directly sent to the device management application through the adaptation layer according to the SDK interface in a message synchronization manner without using a message publish/subscribe mechanism.
On the basis of the foregoing embodiment, fig. 9 is a flowchart of a data processing method according to another embodiment of the present application, and as shown in fig. 9, taking an edge application as an example of a device management application, the method according to the embodiment of the present application may include:
901. and the equipment management application calls an equipment management HTTP interface of the adaptation layer to register the equipment management service.
902. And converting the HTTP interface into an SDK interface of the SDK layer through the adaptation layer, namely calling an equipment management SDK interface of the SDK layer to complete equipment registration.
903. The device management application subscribes to the message based on the device management application ID and the service type (e.g., read-write attributes).
904. And registering a callback function corresponding to the service type supported by the equipment management application to the SDK layer through the adaptation layer.
905. The device management application calls a device management HTTP interface of the adaptation layer to read device attributes, such as read air conditioner device attributes, where the parameters include SNs.
906. And calling a device management SDK interface of the SDK layer through the adaptation layer to read the device attributes.
907. The air conditioner attributes are read from the air conditioner via the SDK interface.
908. Calling a callback function corresponding to the attribute response of the air conditioning equipment registered to the SDK layer by the adaptation layer through the SDK interface;
909. the adaptation layer issues an MQTT message of air conditioner attribute response according to the service type of the equipment management application ID, the SN and the attribute of the air conditioner reading equipment, namely, the air conditioner attribute response message is triggered. Accordingly, the device management application may receive the air conditioner property answer message.
Based on the foregoing embodiment, fig. 10 is a schematic diagram of a program call provided in an embodiment of the present application, and as shown in fig. 10, an edge application layer is an edge application developed by a developer, and may use an HTTP interface and a message publish/subscribe mechanism to implement data interaction with each microservice. The HTTP service in the adaptation layer is used for the HTTP interface which is used for converting service data commands, analyzing parameters, analyzing protocols and the like of the edge host service and providing micro-services for the outside; and performing interface secondary packaging and interface combined calling on an SDK interface of the SDK layer through the adaptation layer, and converting the SDK interface into an HTTP interface, wherein the SDK interface is an interface realized through C language. And the MQTT service contained in the adaptation layer is used for providing an MQTT interface for publishing/subscribing micro-service to the outside based on callback processing of the adaptation layer.
Based on the above embodiments, fig. 11 is a schematic diagram of a system architecture provided in an embodiment of the present application, and as shown in fig. 11, the system architecture diagram includes a mobile phone application, a cloud end, and an edge device side (not shown in fig. 11). The edge device side comprises an edge application layer, a micro service layer, a basic service layer and a system bottom layer. Based on the edge frame kubbeegde and the container technology, the SDK of the edge host service is packaged into each micro-service, and a RestAPI interface and a message subscription/publishing interface are provided for developers to develop and use. The mobile phone application in the system architecture diagram is used for service management of a mobile terminal and locally manages each service function of an edge host through network interaction with the edge host. The cloud in the system architecture diagram is used for managing various service functions of the edge host, such as edge application management, edge application starting, edge application stopping or edge application upgrading and the like. Edge applications (such as device access applications, edge scene applications, audio and video applications, and the like) in the edge application layer are local applications running on an edge host, and developers can develop application functions required by themselves based on micro-services of the edge host. The micro-services (such as device access micro-services) in the micro-service layer are services encapsulated by SDKs based on different edge host services, and may provide an HTTP interface for developers to directly call, or may use a publish/subscribe mechanism (corresponding to MQTT interface) to complete subscription and publication notification of messages. It will be appreciated that the function of the microservice layer is similar to that of the SDK layer and adaptation layer in the above-described embodiment. The basic service in the basic service layer is a basic business service of the system layer. The bottom layer of the system mainly comprises an edge frame, a container technology, an operating system, a driver and the like.
Fig. 12 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application. As shown in fig. 12, the data processing apparatus 1200 according to the embodiment of the present application includes: a first calling module 1201 and a publishing module 1202. Wherein:
a first calling module 1201, configured to, in response to a request message for acquiring service data from an edge application, call, by an SDK layer of a service framework, a callback function that an adaptation layer of the service framework registers in the SDK layer according to the request message, where the callback function is a function that the adaptation layer registers in the SDK layer according to a service type supported by the edge application when the edge application is started, and the service framework is obtained by using any one of the service framework embodiments described above.
The publishing module 1202 is configured to publish, through a callback function, an MQTT message, where the MQTT message is a message subscribed by an edge application according to a service type when the edge application is started, and the MQTT message carries an identifier of the edge application and a sequence number corresponding to a request message.
In one possible implementation, the publishing module 1202 may be specifically configured to: reading a callback function through an interface protocol conversion unit of an adaptation layer to obtain registration information of the edge application, wherein the registration information at least comprises an identifier and a service type supported by the edge application; and according to the registration information, issuing an MQTT message to a management unit through a data flow of the adaptation layer.
In a possible implementation manner, the data processing apparatus 1200 may further include a receiving module 1203, configured to receive, by the adaptation layer, a response message for the MQTT message, which identifies the corresponding edge application, after the issuing module 1202 issues the MQTT message through the callback function, where the response message carries the sequence number and the target service data; the data processing apparatus 1200 may further include a second invoking module 1204, configured to invoke, by the adaptation layer, the SDK interface of the SDK layer according to the sequence number, and output the target service data.
The apparatus of this embodiment may be configured to implement the technical solution of the data processing method for acquiring service data from an edge application in any one of the above illustrated method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 13 is a schematic structural diagram of a data processing apparatus according to another embodiment of the present application. As shown in fig. 13, a data processing apparatus 1300 according to an embodiment of the present application includes: a first calling module 1301, an obtaining module 1302, a second calling module 1303 and a publishing module 1304. Wherein:
the first invoking module 1301 is configured to, in response to a request message for acquiring service data by an edge application, invoke an SDK interface included in an SDK layer of a service framework according to the request message through an adaptation layer of the service framework, where the request message carries an identifier of the edge application and a sequence number corresponding to the request message, and the service framework is obtained by using any one of the service framework embodiments.
An obtaining module 1302, configured to obtain the target service data corresponding to the request message through the SDK interface.
And a second calling module 1303, configured to call, through the SDK interface and according to the target service data, a callback function that the adaptation layer registers to the SDK layer, where the callback function is a function that the adaptation layer registers to the SDK layer according to a service type supported by the edge application when the edge application is started.
The publishing module 1304 is configured to publish an MQTT message through a callback function, where the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and the MQTT message carries an identifier of the edge application and a sequence number corresponding to the request message.
In a possible implementation manner, the data processing apparatus 1300 may further include a sending module 1305, configured to send the micro-service list to the edge application through a virtualized service management unit of the adaptation layer in response to a request message for obtaining the micro-service list by the edge application before the first invoking module 1301 invokes, according to the request message, an SDK interface included in the SDK layer of the service framework through the adaptation layer of the service framework.
In a possible implementation manner, the data processing apparatus 1300 may further include an authentication module 1306, configured to determine, by an authentication unit of the adaptation layer, after the sending module 1305 sends the micro service list to the edge application, in response to a request message for the edge application to acquire the service data, whether the edge application has permission to use the micro service corresponding to the service data; if it is determined that the edge application has the right to use the micro service corresponding to the service data, the first invoking module 1301 invokes the SDK interface according to the request message through the interface protocol conversion unit of the adaptation layer.
In one possible implementation, the sending module 1305 may further be configured to: after the obtaining module 1302 obtains the target service data corresponding to the request message through the SDK interface, the target service data is sent to the edge application through the adaptation layer according to the SDK interface.
The apparatus of this embodiment may be configured to implement the technical solution of the data processing method for acquiring service data by an edge application in any one of the above illustrated method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the application. Illustratively, the electronic device may be provided as a server or a computer. Referring to fig. 14, an electronic device 1400 includes a processing component 1401 that further includes one or more processors and memory resources, represented by memory 1402, for storing instructions, such as application programs, that are executable by the processing component 1401. The application programs stored in memory 1402 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1401 is configured to execute instructions to perform embodiments of the above-described business framework and data processing method.
The electronic device 1400 may also include a power component 1403 configured to perform power management of the electronic device 1400, a wired or wireless network interface 1404 configured to connect the electronic device 1400 to a network, and an input output (I/O) interface 1405. The electronic device 1400 may operate based on an operating system, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like, stored in the memory 1402.
The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the above business framework and data processing method are implemented.
The present application also provides a computer program product, including a computer program, which when executed by a processor implements the above aspects of the business framework and the data processing method.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may reside as discrete components in a data processing apparatus.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (14)

1. A business framework, comprising: the software development kit SDK layer and the adaptation layer run in the same container; wherein the content of the first and second substances,
the SDK layer is used for providing an SDK interface corresponding to the edge host service;
the adaptation layer is used for converting the SDK interface into an interface of a target protocol based on a preset edge frame; providing a micro service corresponding to the edge host service according to the interface of the target protocol, so that an edge application executes the edge host service by calling the micro service; the target protocol comprises a hypertext transport protocol (HTTP) and/or a Message Queue Telemetry Transport (MQTT) protocol.
2. The business framework of claim 1, wherein the adaptation layer comprises:
an interface protocol conversion unit, configured to convert the SDK interface into an HTTP interface if the interface of the target protocol is the HTTP interface; if the interface of the target protocol is an MQTT interface, converting the SDK interface into the MQTT interface through a callback function registered in the SDK layer so as to release an MQTT message;
a data flow management unit, configured to record call request information for an interface of the target protocol, and send response data corresponding to the call request information to the edge application according to the call request information, where the call request information at least includes an identifier and a sequence number of the edge application;
the virtualization service management unit is used for virtualizing the SDK interface into a micro service, and the information of the micro service comprises at least one of a service name, a service type, a service state or service information;
and the authentication unit is used for determining whether the edge application has the authority to use the micro service.
3. A data processing method, comprising:
in response to a request message for acquiring service data from an edge application, calling, by an SDK layer of a service framework according to the request message, a callback function of an adaptation layer of the service framework registered to the SDK layer, where the callback function is a function of the adaptation layer registered to the SDK layer according to a service type supported by the edge application when the edge application is started, and the service framework is the service framework according to claim 1 or 2;
and telemetering and transmitting an MQTT message through the callback function release message queue, wherein the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and the MQTT message carries the identifier of the edge application and the sequence number corresponding to the request message.
4. The data processing method of claim 3, wherein the telemetry transmission of the MQTT message through the callback function publish message queue comprises:
reading the callback function through an interface protocol conversion unit of the adaptation layer to obtain registration information of the edge application, wherein the registration information at least comprises the identifier and the service type supported by the edge application;
and according to the registration information, issuing an MQTT message to a management unit through the data flow of the adaptation layer.
5. The data processing method of claim 3, wherein after said telemetry transmission of the MQTT message via said callback function publish message queue, further comprising:
receiving a response message aiming at the MQTT message by the edge application corresponding to the identification through the adaptation layer, wherein the response message carries the sequence number and target service data;
and calling an SDK interface of the SDK layer through the adaptation layer according to the serial number, and outputting the target service data.
6. A data processing method, comprising:
responding to a request message of an edge application for acquiring service data, calling an SDK interface contained in an SDK layer of a Software Development Kit (SDK) of a service framework according to the request message through an adaptation layer of the service framework, wherein the request message carries an identifier of the edge application and a sequence number corresponding to the request message, and the service framework is the service framework according to claim 1 or 2;
acquiring target service data corresponding to the request message through the SDK interface;
calling a callback function registered by the adaptation layer to the SDK layer through the SDK interface according to the target service data, wherein the callback function is a function registered by the adaptation layer to the SDK layer according to the service type supported by the edge application when the edge application is started;
and telemetering and transmitting an MQTT message through the callback function release message queue, wherein the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and the MQTT message carries the identifier of the edge application and the sequence number corresponding to the request message.
7. The data processing method according to claim 6, wherein before the invoking, by the adaptation layer of the service framework, the SDK interface included in the SDK layer of the software development kit of the service framework according to the request message, the method further comprises:
responding to a request message for acquiring a micro-service list by an edge application, and sending the micro-service list to the edge application through a virtualization service management unit of the adaptation layer.
8. The data processing method of claim 7, wherein after sending the micro-service list to the edge application, further comprising:
responding to a request message for acquiring service data by the edge application, and determining whether the edge application has the right to use the micro service corresponding to the service data through an authentication unit of the adaptation layer;
if the edge application is determined to have the authority to use the micro service corresponding to the service data, the SDK interface is called through an interface protocol conversion unit of the adaptation layer according to the request message.
9. The data processing method according to any one of claims 6 to 8, wherein after the obtaining, by the SDK interface, the target service data corresponding to the request message, further comprises:
and sending the target service data to the edge application through the adaptation layer according to the SDK interface.
10. A data processing apparatus, comprising:
a calling module, configured to, in response to a request message for acquiring service data from an edge application, call, by an SDK layer of a service framework, a callback function that an adaptation layer of the service framework registers in the SDK layer according to the request message, where the callback function is a function that the adaptation layer registers in the SDK layer according to a service type supported by the edge application when the edge application is started, and the service framework is the service framework according to claim 1 or 2;
and the publishing module is used for telemetering and transmitting an MQTT message through the callback function publishing message queue, wherein the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and the MQTT message carries the identifier of the edge application and the sequence number corresponding to the request message.
11. A data processing apparatus, comprising:
a first calling module, configured to respond to a request message for obtaining service data by an edge application, and call, according to the request message, an SDK interface included in an SDK layer of a software development kit of a service framework through an adaptation layer of the service framework, where the request message carries an identifier of the edge application and a sequence number corresponding to the request message, and the service framework is the service framework according to claim 1 or 2;
an obtaining module, configured to obtain, through the SDK interface, target service data corresponding to the request message;
a second calling module, configured to call, through the SDK interface, a callback function that the adaptation layer registers to the SDK layer according to the target service data, where the callback function is a function that the adaptation layer registers to the SDK layer according to a service type supported by the edge application when the edge application is started; a publishing module used for telemetering and transmitting MQTT messages through the message queue published by the callback function,
the MQTT message is a message subscribed by the edge application according to the service type when the edge application is started, and carries the identifier of the edge application and the sequence number corresponding to the request message.
12. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the business framework of claim 1 or 2 and the data processing method of any one of claims 3 to 9.
13. An electronic device, comprising a memory having a computer program stored therein and a processor arranged to execute the business framework of claim 1 or 2 and the data processing method of any one of claims 3 to 9 by the computer program.
14. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the business framework of claim 1 or 2 and the data processing method of any one of claims 3 to 9.
CN202210435748.9A 2022-04-24 2022-04-24 Service framework, data processing method, device, equipment and storage medium Active CN115002232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210435748.9A CN115002232B (en) 2022-04-24 2022-04-24 Service framework, data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210435748.9A CN115002232B (en) 2022-04-24 2022-04-24 Service framework, data processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115002232A true CN115002232A (en) 2022-09-02
CN115002232B CN115002232B (en) 2024-03-22

Family

ID=83025264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210435748.9A Active CN115002232B (en) 2022-04-24 2022-04-24 Service framework, data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115002232B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542537A (en) * 2018-11-15 2019-03-29 江苏东洲物联科技有限公司 A kind of edge calculations gateway based on micro services framework
CN111756626A (en) * 2020-06-03 2020-10-09 西安交通大学 Production line edge equipment longitudinal integrated gateway based on OPC UA and implementation method thereof
CN112764835A (en) * 2021-01-22 2021-05-07 国网宁夏电力有限公司信息通信公司 Electric power Internet of things sensing equipment configuration micro-service system and method based on edge calculation
CN112799786A (en) * 2021-02-02 2021-05-14 微民保险代理有限公司 Exit method, device, equipment and storage medium of micro-service instance
CN113868081A (en) * 2021-09-22 2021-12-31 山东电力研究院 Edge computing frame for power grid internet of things management platform and working method thereof
CN114153605A (en) * 2021-11-29 2022-03-08 中国电力科学研究院有限公司 Power edge computing intelligent framework adaptive to autonomous controllable chip and deployment method thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542537A (en) * 2018-11-15 2019-03-29 江苏东洲物联科技有限公司 A kind of edge calculations gateway based on micro services framework
CN111756626A (en) * 2020-06-03 2020-10-09 西安交通大学 Production line edge equipment longitudinal integrated gateway based on OPC UA and implementation method thereof
CN112764835A (en) * 2021-01-22 2021-05-07 国网宁夏电力有限公司信息通信公司 Electric power Internet of things sensing equipment configuration micro-service system and method based on edge calculation
CN112799786A (en) * 2021-02-02 2021-05-14 微民保险代理有限公司 Exit method, device, equipment and storage medium of micro-service instance
CN113868081A (en) * 2021-09-22 2021-12-31 山东电力研究院 Edge computing frame for power grid internet of things management platform and working method thereof
CN114153605A (en) * 2021-11-29 2022-03-08 中国电力科学研究院有限公司 Power edge computing intelligent framework adaptive to autonomous controllable chip and deployment method thereof

Also Published As

Publication number Publication date
CN115002232B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
US11290537B1 (en) Discovery of device capabilities
US9450783B2 (en) Abstracting cloud management
US9100345B2 (en) Systems and/or methods for supporting a generic framework for integration of on-premises and SaaS applications with security, service mediation, administrative, and/or monitoring capabilities
AU2018365860B2 (en) Code module selection for device design
CN102868736B (en) A kind of cloud computing Monitoring framework design basis ground motion method and cloud computing treatment facility
US20110055396A1 (en) Methods and systems for abstracting cloud management to allow communication between independently controlled clouds
US20110055377A1 (en) Methods and systems for automated migration of cloud processes to external clouds
CN112583898B (en) Business process arrangement method, device and readable medium
CN108833510B (en) Message processing method and device
US20180020057A1 (en) Method and System for Connecting Heterogeneous Internet of Things Devices for Workflow Automation
CN111221630B (en) Business process processing method, device, equipment, readable storage medium and system
CN111258723B (en) Transaction processing method, device, system, medium and equipment of distributed system
CN112883011A (en) Real-time data processing method and device
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN115002232B (en) Service framework, data processing method, device, equipment and storage medium
CN115941704A (en) Mirror image synchronization method and device, electronic equipment and storage medium
CN115237481A (en) Method, device and equipment for driving external equipment and storage medium
CN116560756B (en) Service orchestration method, electronic device, computer-readable storage medium
CN114936098B (en) Data transfer method, device, back-end equipment and storage medium
US11941385B1 (en) Transforming data between cloud entities in an event architecture
US11836545B1 (en) Integration of cloud entities in an event architecture
US11928044B1 (en) Batching event data in an event-driven architecture
US20220070015A1 (en) Device subcomponent representations
CN117032624A (en) Method and device for virtualizing audio equipment, storage medium and electronic equipment
CN115237540A (en) Data processing method, device, equipment and storage medium

Legal Events

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