Search

CN-116360737-B - Plug-in service framework for reconfigurable integrated terminal

CN116360737BCN 116360737 BCN116360737 BCN 116360737BCN-116360737-B

Abstract

The invention discloses a plug-in service framework for a reconfigurable integrated terminal, which comprises an application layer, a forwarding layer, a primary support layer and a plug-in service layer, wherein the application layer is a front-end page of an H5 standard and is responsible for interaction with a user and display and update of an interface, the forwarding layer is mainly used for receiving and forwarding a user request and a service response, the primary support layer mainly comprises two components, namely a rendering engine and an eTS engine, and the service layer mainly comprises a plug-in service engine and various peripheral services. The plug-in service engine is constructed between the application program and the operating system, supports the HTML5 standard, can shield the difference of the bottom operating system, and provides the peripheral service which is stably available for the upper application.

Inventors

  • DING LINJUN
  • ZHANG ZHANG
  • LI XINJIANG
  • LI HANG
  • YAN KEDONG
  • TAI XIANQING

Assignees

  • 苏州空天信息研究院

Dates

Publication Date
20260505
Application Date
20230324

Claims (7)

  1. 1. The plug-in service framework is characterized by comprising an application layer, a forwarding layer, a primary supporting layer and a plug-in service layer, wherein the plug-in service framework is used for supporting a terminal with reconfigurable hardware to carry out peripheral access, and cross-layer and cross-language calling from the application layer to the service layer is realized through a packaged websocket interface, and the plug-in service framework comprises the following components: the application layer is a front-end page of the H5 standard and is responsible for interaction with a user and display and update of an interface; The forwarding layer is mainly used for receiving and forwarding user requests and service responses; the native support layer mainly comprises a rendering engine and an eTS engine, and has UI component rendering and eTS interface access capability; the service layer mainly comprises a plug-in service engine and various peripheral services, wherein, The plug-in service engine uses C++ language to develop, analyzes the service of the service suffix to carry out service access authentication, loads peripheral service through dlopen functions, receives the request of a forwarding layer through a communication server constructing a Websocket protocol, distributes the request to the request peripheral service or an eTS engine of a primary supporting layer according to the request type, and receives the request response of the peripheral service or the request response of an eTS engine interface through a signal slot mechanism; The peripheral service is developed by a back-end function expansion library which is independently developed by a user, is developed by using a C++ language, receives and processes a request distributed by the plug-in service engine through inheritance OnMessage functions, and finally returns a result to the plug-in service engine in a signal slot mode.
  2. 2. The plug-in service framework for the reconfigurable integrated terminal according to claim 1, wherein in the application layer, a WebStorm development tool is used to complete the construction of a graphic rendering page based on an HTML5 or front end framework VUE to generate a file VUE or HTML, page styles are controlled through CSS3, particularly an inline style sheet, an embedded style sheet or an inline style sheet can be used to generate a cs style file, business logic is controlled through JavaScript of an ES6 standard, a corresponding peripheral service request is initiated by using a JavaScript API packaged by the plug-in service framework, the peripheral service request comprises a request callback function, the receiving of peripheral access and request response is realized, and the js script file comprising the control logic is generated.
  3. 3. The plug-in service framework for the reconfigurable integrated terminal according to claim 1, wherein the forwarding layer uses JavaScript language to build a communication client based on Websocket protocol, monitors service access requests of front-end pages of the application layer, completes request analysis, stores the analyzed callback functions of the requests in a callback pool and forwards the requests to a plug-in service engine of the service layer, and the communication client based on Websocket is also used for monitoring service request results returned by the plug-in engine of the service layer and returns the service request results to a front-end user through the callback functions stored in the callback pool.
  4. 4. The plug-in service framework for the reconfigurable integrated terminal according to claim 3, wherein the service access request comprises a request ID, a peripheral service name, a peripheral interface, a service flag bit and an access parameter, wherein the request ID is designed into a character String type, the length is fixed to 10 bytes, the peripheral service name is a character String type, the length is indefinite, the maximum length is 256 bytes, the peripheral interface is indefinite, the maximum length is 256 bytes, the service access flag is a String type, the value "eTS" indicates that the service access request is a primary interface request, the value null indicates that the service access is a bottom interface request, and the access parameter is a JSON character String, and the maximum length is 65536 bytes; The service access request analyzer analyzes the front-end page request according to the standard, if the request is analyzed without errors, the request callback function is cached, meanwhile, the request is forwarded to a plug-in service engine of a service layer through a Websocket communication client, and if the request is analyzed with errors, the corresponding error type is returned to the front-end user through the callback function.
  5. 5. The plug-in service framework for the reconfigurable integrated terminal according to claim 3, wherein the service response comprises a response ID, a call state flag bit, a response maintenance flag bit and a call result, wherein the response ID is designed into a character string type, the length is fixed to 10 bytes, the call state flag bit is of a Boolean type, a value true flag is successfully called, a value false flag is failed to call, the response state flag bit is of a value type, a value 999999 indicates that the service response is currently of an open source hong Monte system, the response maintenance flag bit is of a Boolean type, the value true indicates that the service response is a long-term response, the value false indicates that the service response is a one-time response, the call result is a JSON character string, and the maximum length is 65536 bytes, and indicates data returned by the service; And the service response analyzer analyzes the back-end response according to the standard, if the response analysis is correct, the stored callback function is called, the result is returned to the front-end user, and if the analysis is incorrect, the corresponding error type is returned to the front-end user through the callback function.
  6. 6. The plug-in service framework for a reconfigurable integrated terminal according to claim 1, wherein in the native support layer, the rendering engine is a rendering process of OpenHarmony native ArkUI framework, is developed using an ett language, renders a front-end page of an application layer by using a Web component provided by the rendering engine and delivers a service port to a forwarding layer to start a Websocket client, and the ett engine is used for parsing a native ArkUI framework.
  7. 7. A development flow of a plug-in service framework for a reconfigurable integrated terminal according to any one of claims 1 to 6, comprising the steps of: Step S10, constructing OpenHarmony system application project by using open source hong Mongolian system development software DevEcoStudio, wherein the project is used for compiling equipment software installation packages, the catalog structure of the project comprises a front-end page file, a peripheral service file, a frame file and a configuration file, the front-end page file stores H5 page source codes and resource files of users and compiled camera front-end operation logic files, the peripheral service file stores compiled drive service files of external cameras, the frame file stores SDKs of service frames, and the configuration file stores access files for peripheral services; Using a front-end frame VUE to develop a front-end page, completing page layout, page navigation, page operation and page data request, and completing the development of the page interacted by the application and the user, wherein the page data request is JavaScript development, and the development is completed by compiling a logic file according to plug-in development requirements by using a fixed interface, and copying the logic file into an S10 project structure catalog; Step S20, under the project newly created in the step S10, creating an external camera service module, writing a processing interface of Native operation codes corresponding to the page data request in the step S10, storing specific function codes related to the external camera under a CPP catalog of the external camera service module, returning the request result to the front end through a fixed interface interacted with a plug-in frame, compiling the camera module code by using IDE to generate a SO dynamic library file of the service, and copying the SO dynamic library file into the project structure catalog of the step S10; And step S30, copying the service library file generated in the external camera service module in the step S20 into the project structure catalog in the step S10, newly creating a configuration file to configure an accessed peripheral service path and service name, analyzing and rendering a front-end page file by using the function of the frame, packaging the project by using DevEcoStudio software, and installing the project on equipment of the OpenHarmony system to finish the project.

Description

Plug-in service framework for reconfigurable integrated terminal Technical Field The invention relates to a hardware module driving technology of OpenHarmony operating systems, in particular to a plug-in service framework for a reconfigurable integrated terminal. Background OpenHarmony the operating system is an open source project hatched and operated by an open atom open source foundation (OpenAtomFoundation), and aims to face the full scene, full connection and full intelligent age, and based on an open source mode, a framework and a platform of the operating system of the intelligent terminal equipment are built, so that the prosperous development of the everything interconnection industry is promoted. A plurality of peripheral devices are connected in a wired and wireless mode to form a super virtual terminal with a reconfigurable hardware module and a reconfigurable software function, and the super virtual terminal is called a reconfigurable comprehensive terminal for short. At present, peripheral components are various, standards are not uniform, and quick access of hardware components cannot be guaranteed. The lack of authentication means also further increases the security risk of the system when peripheral components are accessed. A plug-in service framework oriented to a reconfigurable integrated terminal is introduced, and flexible reconfiguration of hardware modules and software functions is realized. Compared with front-end and back-end integrated template (template) type website programming, front-end and back-end separated development modes are the main trend. The current popular cross-platform application development frames mainly comprise lonic developed based on AngularJS, REACTNATIVE constructed based on JavaScript, NATIVESCRIPT constructed based on JavaScript and the like, but the main stream frames are not adaptive to OpenHarmony operating systems, and a plug-in service frame developed based on front-end and back-end separation cannot be constructed. Disclosure of Invention The invention aims to provide a plug-in service framework for a reconfigurable integrated terminal based on OpenHarmony operating systems. The technical scheme for realizing the aim of the invention is that a plug-in service framework oriented to a reconfigurable comprehensive terminal is used for supporting a hardware reconfigurable terminal to carry out peripheral access and specifically comprises an application layer, a forwarding layer, a primary supporting layer and a plug-in service layer, wherein the plug-in service framework realizes cross-layer (application layer to service layer) and cross-language (JavaScript to C++/eTS) calling through a packaged websocket interface, wherein the plug-in service framework comprises the following components: the application layer is a front-end page of the H5 standard and is responsible for interaction with a user and display and update of an interface; The forwarding layer is mainly used for receiving and forwarding user requests and service responses; the native support layer mainly comprises a rendering engine and an eTS engine, and has UI component rendering and eTS interface access capability; the service layer mainly comprises a plug-in service engine and various peripheral services, wherein the plug-in service engine is developed by using a C++ language and performs service access authentication through analyzing services of a service suffix; the method comprises the steps of loading peripheral services through dlopen functions, receiving requests of a forwarding layer through a communication server of a Websocket protocol, distributing the requests to the requested peripheral services or eTS engines of a primary supporting layer according to request types, and receiving peripheral service request responses or eTS engine interface request responses through a signal slot mechanism; The peripheral service is developed by a back-end function expansion library which is independently developed by a user, is developed by using a C++ language, receives and processes a request distributed by the plug-in service engine through inheritance OnMessage functions, and finally returns a result to the plug-in service engine in a signal slot mode. Furthermore, in the application layer, a WebStorm development tool is used for completing the construction of a graphic rendering page based on an HTML5 or front end frame VUE to generate a file VUE or HTML, page styles can be controlled through CSS3, in particular, inline style sheets, embedded style sheets or externally connected style sheets can be used for producing cs style files, business logic is controlled through the JavaScript of an ES6 standard, corresponding peripheral service requests are initiated by using a plug-in service frame package JavaScriptAPI, the service requests comprise corresponding request callback functions, peripheral access and request response receiving are realized, and a js script file comprising control l