CN111930365B - Qt-based application program rapid development framework, development method and operation method - Google Patents

Qt-based application program rapid development framework, development method and operation method Download PDF

Info

Publication number
CN111930365B
CN111930365B CN202010987485.3A CN202010987485A CN111930365B CN 111930365 B CN111930365 B CN 111930365B CN 202010987485 A CN202010987485 A CN 202010987485A CN 111930365 B CN111930365 B CN 111930365B
Authority
CN
China
Prior art keywords
service
data
request
layer
class
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.)
Active
Application number
CN202010987485.3A
Other languages
Chinese (zh)
Other versions
CN111930365A (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202010987485.3A priority Critical patent/CN111930365B/en
Publication of CN111930365A publication Critical patent/CN111930365A/en
Application granted granted Critical
Publication of CN111930365B publication Critical patent/CN111930365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

The invention discloses a quick development framework, a development method and an operation method of an application program based on Qt. The development framework includes: the device driver layer is used for realizing communication connection with external hardware equipment, data acquisition and control instruction issuing; the storage layer is used as a data storage library of the application program; the core layer is used for providing a plurality of bottom-layer basic services required by the application program; the model layer is used for providing a service model required by realizing a specific service function; the service layer is used for realizing specific business function processing; the scheduling layer is used for collecting and storing logs and providing thread scheduling and algorithm execution service; and the interaction layer is used for receiving a request initiated by the client to the server, performing non-service function processing on the request data, and forwarding a response made by the server to the client. The invention shortens the development period of the application software and improves the quality of the intercommunicated multi-node application software.

Description

Qt-based application program rapid development framework, development method and operation method
Technical Field
The invention relates to the field of application program development, in particular to a quick application program development framework, a development method and an operation method based on Qt.
Background
Qt is an open-source C + + application program development library supporting cross-platform support, and has the characteristics of wide support platform, complete functions, open source, high execution efficiency, simple interface development, complete development tools and the like. The Qt library provides multi-directional support for the development of the current application, and covers hundreds of object-oriented well-packaged classes such as core non-graphics, graphic components, multimedia functions and graphic components, network programming, database operation, concurrency, XML support, chart and data visualization components, 2D/3D graphic rendering support, Bluetooth hardware support, sensor hardware, near field communication hardware, CAN and Modbus protocol serial industrial bus support and the like.
The following problems mainly exist in the current Qt framework for developing application software: qt has hundreds of classes with complete functions, developers want to get on the hands quickly and grasp the use skills in all directions for development, and the difficulty is not low. Meanwhile, when a developer develops each service, the developer usually needs to start from bottom-layer services such as data communication, database access and the like, and further considers the basic services such as development guarantee cache, affairs, logs, safety, authority and the like, while the application development of multi-node communication relates to bottom-layer services such as Socket programming, protocol design, data packet unpacking, serialization deserialization and the like, and even though the development of the communication bottom-layer services can be avoided, the service interfaces still need to be packaged and shared according to specific requirements. Because of having to face the basic non-service functions, developers are difficult to focus on the development of core services, the workload of development, testing and maintenance of application software is greatly increased, the development efficiency is reduced, the development, testing and maintenance difficulty is increased, and the requirement on the skills of the developers is correspondingly improved.
Disclosure of Invention
The invention mainly aims to provide a quick development framework, a development method and an operation method of an application program based on Qt, and aims to solve the technical problems that the existing application program based on Qt is low in development efficiency and difficult to realize.
In order to achieve the above object, the present invention provides a Qt-based application rapid development framework, where the development framework employs a client-side and a server-side architecture, and the development framework includes:
the device driver layer is packaged with a plurality of device driver libraries and uniform access interfaces and is used for realizing communication connection with external hardware devices, data acquisition and control instruction issuing;
the storage layer is packaged with a relational database and a cache database and used as a data storage library of an application program, wherein the relational database is used for storing business data and historical data, and the cache database is used for data caching and real-time data storage;
the core layer is packaged with a plurality of non-business basic service class libraries and used for providing a plurality of bottom basic services required by the application program;
the model layer is packaged with service model classes required by the application program and service rules and verification rules corresponding to the service model classes and used for providing service models required for realizing specific service functions;
the service layer is packaged with service classes corresponding to the service model classes and used for realizing specific service function processing;
the scheduling layer is used for providing a lightweight message queue to realize asynchronous log collection and storage and also providing thread scheduling and algorithm execution service;
and the interaction layer is used for receiving a request initiated by the client to the server, performing non-service function processing on the request data and forwarding a response made by the server to the client.
Optionally, the underlying base services include any one or more of the following base services:
caching services, messaging services, remote interface services, exception services, security services, transaction services, persistence services, data transformation services, data verification services, web services, threading services, timed task services, internationalization services, logging services.
Optionally, the server is configured to communicate with an external hardware device through an ethernet, and perform data processing, operation, and storage; the client is used for man-machine interaction, data collection and field state display are carried out, and operation requests can be carried out on the field state.
Optionally, the non-service function processing of the interaction layer includes: verifying the validity, correctness and operation authority of a service request initiated by a client, and executing cache to obtain and record an operation log;
if the business service request initiated by the client hits the cache, returning the hit cache result, otherwise, decomposing the request, performing transaction management, distributing the business service request to the scheduling layer, logging the request processing result into the cache, and returning the logged cache result to the client.
Optionally, the support environment of the development framework is composed of an operating system and a language framework, and the language framework adopts a C + + language and a Qt library.
Further, to achieve the above object, the present invention further provides an application development method using any one of the development frameworks, where the development method includes:
acquiring an engineering copy of the development framework and taking the engineering copy as a basic engineering of new application development;
compiling a service model class according to a design document of new application, and packaging the service model class into a development frame model layer corresponding to the engineering copy;
writing a business service class according to a design document of the new application, and packaging the business service class into a development framework service layer corresponding to the engineering copy;
editing a graphical user interface according to a newly applied design document, wherein the graphical user interface acquires a user request through a Qt signal and a slot mechanism, transfers an interaction layer interface to transmit request data, acquires response data from a business service class and presents the response data to a user through the graphical user interface;
and packaging and compiling the engineering copy of the development frame encapsulated with the written business model class and the business service class and the edited graphical user interface into an executable file, and testing the executable file, and deploying the executable file as a new intercommunicating multi-node application to a target node for running.
Further, to achieve the above object, the present invention further provides an operating method of an application program developed by using the above development framework, which is applied to a multi-node communication network, and the operating method includes:
the client collects data and constructs an operation model object, and a data conversion service class of the core layer is called to convert the operation model object into a request data object;
the client informs a corresponding observer to process according to the request data object, and calls a client proxy class to transmit the request data;
after receiving the request data, the client agent class calls a QtRO module to serialize the request data and transmits the serialized request data to the server agent class through a network;
after receiving serialized request data through a network, a server agent class calls a QtRO module to deserialize the request data and transmits the deserialized request data to a non-service core processing class of a server interaction layer;
after receiving the request data, the non-service core processing class of the server interaction layer completes operation log recording, user security check, permission check, parameter check and cache acquisition in sequence, if the cache is hit, the hit cache result is returned, otherwise, a resource class is constructed, and a transaction service class of the core layer is called to perform transaction management and a service routing class of the scheduling layer is called to transmit the request data;
after receiving the request data, the service routing class of the server scheduling layer acquires metadata of a service class interface to be called in the request data, calls a data conversion service class of the core layer, converts parameter data in the request data into a specific service model object of the service class interface to be called according to the metadata, and calls a specific service class of the server scheduling layer for processing;
after receiving the parameters transmitted by the scheduling layer, the specific business service class of the server service layer performs specific business function processing, wherein the parameters comprise resource objects and specific business model objects;
the service end interaction layer takes the metadata of the service interface and the request key parameter as key words, records the service processing result into a cache, generates response data and returns the response data to the client through the network.
Optionally, the request data specifically includes: metadata of the service interface, user security information, data query parameters and request parameters;
wherein the metadata comprises a service name and an interface method name; the user safety information comprises a user name and an encryption key; the data query parameters comprise instruction filtering conditions, sorting fields, output fields and paging information; the request parameter is an array type, and each array element is single parameter data with extensible attributes.
Optionally, the response data includes normal response data and abnormal response data;
the normal response data comprise metadata of the service interface, the total number of response data, the total number of the current return data and single response data; the single piece of response data is of an array type, and each array element is attribute extensible data;
the abnormal response data comprises metadata of the service class interface, an error code and specific error description information, wherein the metadata comprises a service name and an interface method name.
Optionally, the processing, by the non-service core processing class of the server interaction layer, the request data specifically includes:
analyzing the request data by the non-service core processing class of the interaction layer of the server side to obtain request analysis result data;
taking the metadata, request parameters, user names, date and time and other related information of the service interfaces in the request analysis result data as operation logs, and calling a lightweight message queue of a scheduling layer to asynchronously complete the recording of the operation logs;
calling a security service class of a core layer to verify the user security information in the request analysis result data, if the user security information passes the verification, continuing the subsequent steps, and if the user security information does not pass the verification, returning abnormal response data;
invoking a security service class of a core layer to carry out authority check on metadata of a service class interface in the request analysis result data, if the metadata passes the check, continuing the subsequent steps, and if the metadata does not pass the check, returning abnormal response data;
calling a data verification service class of a core layer to execute verification rule check of a specific business model object on request parameters in the request analysis result data, if the request parameters pass the check, continuing the subsequent steps, and if the request parameters do not pass the check, returning abnormal response data;
calling a cache service class of a core layer to obtain corresponding cache data according to metadata and request parameters of a service class interface in the request analysis result data, if the cache is hit, returning the hit cache result as normal response data to the client, and otherwise, continuing the subsequent steps;
and constructing a resource class, calling a transaction service class of the core layer to perform transaction management, and calling a service routing class of the scheduling layer to transmit the request data.
The rapid development framework which is based on the Qt framework and is suitable for developing and communicating multi-node application software provided by the invention adopts a layered framework and comprises an interaction layer, a scheduling layer, a service layer, a model layer, a core layer, an equipment driving layer and a storage layer. When specific intercommunicating multi-node application software is developed, only the functions of a service layer and a model layer need to be developed, and the functions of the rest five layers are provided by the framework. The development framework of the invention encapsulates the non-service basic functions of data communication, database access, cache, affairs, logs, safety, authority and the like among multiple nodes, avoids the development work of the non-service basic functions, and developers can submit intercommunicated multi-node application software customized as required only by focusing on the development of model classes and service classes of core services, thereby reducing the technical threshold of the developers, improving the development, test and maintenance efficiency, shortening the development period of the application software and improving the quality of the intercommunicated multi-node application software.
Drawings
FIG. 1 is an architecture diagram of an embodiment of the Qt-based application rapid development framework of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of a development framework-based application development method according to the present invention;
FIG. 3 is a flowchart illustrating an embodiment of a method for operating an application developed based on a development framework according to the present invention;
fig. 4 is a schematic flowchart of non-business core processing of an interaction layer in an embodiment of an operation method of an application developed based on a development framework according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is an architecture diagram of an embodiment of a Qt-based application rapid development framework according to the present invention, and the embodiment is specifically a rapid development framework applied to interworking multi-node application software.
The application rapid development framework disclosed in this embodiment adopts a layered architecture, which is mainly divided into seven layers, namely, an interaction layer, a scheduling layer, a service layer, a model layer, a core layer, a device driver layer, and a storage layer. When the specific interworking multi-node application software is developed, only developers are required to develop functions of a service layer and a model layer, and the functions of the rest five layers are provided by the framework. The functional role of the various layers built into the frame will be briefly described below.
(1) Device driver layer
In this embodiment, the device driver layer is packaged with multiple device driver libraries and unified access interfaces, and is used to implement communication connection, data acquisition, and control instruction issue with external hardware devices.
The equipment driving layer realizes connection with equipment facilities, data acquisition and control instruction issuing by packaging an equipment facility driving library and uniformly accessing the interface, and can shield the differences of physical networks and communication protocols required by different equipment facilities, improve the control stability and shorten the application development and debugging period by the driving library access mode.
(2) Storage layer
In this embodiment, the storage layer is packaged with a relational database and a cache database, and is used as a data repository of an application program, where the relational database is used for storing business data and historical data, and the cache database is used for data caching and real-time data storage.
The storage layer adopts two kinds of storage libraries, namely a relational database and a cache database. The relational database has the characteristics of high running speed, strong portability, support of various storage engines, rich and easy-to-use management functions, and is used for storing business data and historical data in specific application. The cache database adopts a Key-Value type high-performance non-relational memory database, has high speed, abundant data types and operation atomicity, and is used for data caching and real-time data storage in specific application.
(3) Core layer
In this embodiment, the core layer is encapsulated with a plurality of non-business basic service class libraries for providing a plurality of underlying basic services required by the application program.
The core layer is a multi-azimuth basic tool service class library, and realizes the necessary bottom layer functions in the aspects of caching, information, remote interfaces, abnormity, safety, transaction, persistence, data conversion, data verification, network, thread, timing, internationalization, log and the like.
Optionally, in a specific embodiment, the underlying basic service includes any one or more of the following basic services:
caching services, messaging services, remote interface services, exception services, security services, transaction services, persistence services, data transformation services, data verification services, web services, threading services, timed task services, internationalization services, logging services.
(4) Model layer
In this embodiment, the model layer encapsulates the service model classes required by the application program and the service rules and the validation rules corresponding to the service model classes, and is used to provide the service models required for implementing specific service functions.
The model layer mainly focuses on the service field of the system, establishes a corresponding service model object, and provides service rules and verification rules.
(5) Service layer
In this embodiment, the service layer encapsulates service classes corresponding to the service model classes, so as to implement specific service function processing.
The service layer provides service processing functions of various service models respectively from various service scenes.
(6) Scheduling layer
In this embodiment, the scheduling layer is configured to provide a lightweight message queue to implement asynchronous log collection and storage, and also provide thread scheduling and algorithm execution service.
The scheduling layer provides a lightweight message queue, and is mainly used for asynchronously collecting and storing logs at a high speed. And meanwhile, the functions of thread scheduling and algorithm execution service are provided, the utilization rate of system resources is improved, and more request processing is efficiently and concurrently executed.
(7) Interaction layer
In this embodiment, the interaction layer is configured to receive a request initiated by the client to the server, perform non-service function processing on the request data, and forward a response sent by the server to the client.
Optionally, in a specific embodiment, the non-service function processing of the interaction layer includes: verifying the validity, correctness and operation authority of a service request initiated by a client, and executing cache to obtain and record an operation log;
if the business service request initiated by the client hits the cache, returning the hit cache result, otherwise, decomposing the request, performing transaction management, distributing the business service request to the scheduling layer, logging the request processing result into the cache, and returning the logged cache result to the client.
The interaction layer receives all requests sent from the client to the server, sends a response made by the server to the client, and simultaneously checks the legality, the operation authority and the correctness of the requests and records operation logs; if the cache is hit, returning a cache result; otherwise, the request is decomposed, the transaction management is provided, the service request is distributed to the scheduling layer, the result is recorded in the cache, and the result is returned.
Optionally, in a specific embodiment, the support environment of the development framework is composed of an operating system and a language framework, the entire system is developed and designed by using a C + + language and a Qt library, and by using the cross-platform characteristic of the Qt library, an application system on a specific target operating system can be obtained only by recompiling in the target operating system without modifying a code.
In addition, the development framework of the embodiment adopts a client/server architecture. The server communicates with the hardware equipment through the Ethernet, and performs data processing, operation and storage. The client is used for man-machine interaction such as user information collection and field state display, and can carry out operation requests on-site switching and states.
The client of the embodiment specifically comprises an event layer, a model layer and a service layer, and the client is also developed and designed based on a C + + language or a Qt library. The server and the client together make requests and responses in the Ethernet through an interface layer.
The application development framework disclosed by the embodiment encapsulates non-business basic functions such as data communication, database access, cache, transaction, log, security, authority and the like among multiple nodes, and shields the development work of the non-business basic functions. Because the necessary non-service basic functions are built in the framework, developers can easily and simply focus on the development of core services, and can submit intercommunicated multi-node application software customized as required, so that the technical threshold of the developers is reduced, the development, test and maintenance efficiency is improved, the development period of the application software is shortened, and the quality of the intercommunicated multi-node application software is improved.
Referring to fig. 2, fig. 2 is a schematic flowchart of an embodiment of an application development method based on a development framework according to the present invention.
In this embodiment, the development method for implementing application development based on the development framework in the above embodiments includes the following steps:
s101, acquiring a project copy of the development framework and using the project copy as a basic project of new application development;
in this embodiment, because the engineering copy of the development framework already includes the underlying non-business basic function library and mechanism necessary for developing the application program, the development of a large number of non-business modules can be reduced by using the engineering copy of the development framework as the basic engineering for new application development. The development framework has been described in detail in the above embodiments, and thus, the description thereof is omitted.
Step S102, writing a service model class according to a design document of new application, and packaging the service model class into a development frame model layer corresponding to the engineering copy;
in this embodiment, the service model class is written according to the design document of the new application, and then the written service model class is encapsulated into the development frame model layer corresponding to the engineering copy.
The writing method of the service model class in this embodiment is not limited, and may be developed by a developer based on software development application, or may be a method in which writing scripts for writing various different service model classes are designed in advance, and then a plurality of writing scripts are called in a batch task manner to write different service model classes respectively.
In this embodiment, after the business model class is compiled, the persistent service of the development framework core layer may also automatically provide basic functions of database addition, deletion, modification and check according to the metadata of the business model class, so as to be called by the business service class.
Step S103, compiling a business service class according to the design document of the new application, and packaging the business service class into a development framework service layer corresponding to the engineering copy;
the writing mode of the business service class is not limited in this embodiment, and may be developed by a developer based on software development application, or may be a writing script that is designed in advance to write various different business service classes, and then different business service classes are written by calling a plurality of writing scripts in a batch task mode.
The service class of the embodiment may directly call other local service class interfaces, or call an interaction layer interface to call a specific service class interface from a specific external node. The framework will automatically register the local interface as an interactive interface according to the uniform interface label in the business service class.
Step S104, editing a graphical user interface according to a newly applied design document, wherein the graphical user interface acquires a user request through a Qt signal and a slot mechanism, calls an interaction layer interface to transmit request data, acquires response data from a business service class and presents the response data to a user through the graphical user interface;
the present embodiment is not limited to the writing method of the graphical user interface, and may be developed by a developer based on software development application, or may be a writing script that is designed in advance to write various graphical user interfaces, and then calls a plurality of writing scripts to write different graphical user interfaces respectively in a batch task manner.
In this embodiment, the written graphical user interface specifically realizes the human-computer interaction function in the following manner: and acquiring a user request by adopting a Qt signal and slot mechanism, transferring an interaction layer interface to transfer request data, acquiring response data from a business service class, and presenting the response data to a user through a graphical user interface.
And S105, packaging and compiling the engineering copy of the development frame encapsulated with the written business model class and the business service class and the edited graphical user interface into an executable file, testing, and deploying the executable file as a new intercommunicated multi-node application to a target node for running.
In this embodiment, after steps S102 to S104 are completed, the engineering copy of the development framework in which the written business model class and the business service class are encapsulated and the edited graphical user interface are packaged and compiled into an executable file, and then the executable file is tested, and the test is performed to meet the design requirements, and then the executable file can be deployed to a target node for operation.
According to the development process, the development work of the new application program only needs to be based on the framework to complete the compiling and packaging of the business model class, the business service class and the graphical user interface, the whole process only relates to the core business, and non-business basic functions such as data communication among multiple nodes, database access, cache, affairs, log, safety, authority and the like are all packaged by the framework, the realization of the non-business basic functions is not needed to be concerned in the development process, the development workload is reduced, and the development efficiency is improved.
Referring to fig. 3, fig. 3 is a flowchart illustrating an embodiment of an operation method of an application program developed based on a development framework according to the present invention.
In this embodiment, the application program developed based on the development framework in the above embodiments is specifically applied to the server, that is, the application is used as a server to perform business interaction with the client.
In this embodiment, the method for running the application developed based on the development framework in the above embodiment specifically includes the following steps:
step S201, a client collects data and constructs an operation model object, and a data conversion service class of a core layer is called to convert the operation model object into a request data object;
in this embodiment, the client collects data, then constructs an operation model object OperationObject, and converts the operation model object into a request data object qjsonnoobject by using a core layer data conversion service class jsonnessage.
Step S202, the client notifies a corresponding observer to process according to the request data object, and calls a client proxy class to transmit the request data;
in this embodiment, the client-side JsonData class notifies the corresponding watcher to process according to the request data object, and calls the service proxy class to send out the request data object QJsonObject, that is, the request data.
Optionally, in a specific embodiment, the request data specifically includes: metadata of the service interface, user security information, data query parameters and request parameters;
wherein the metadata comprises a service name and an interface method name; the user safety information comprises a user name and an encryption key; the data query parameters comprise instruction filtering conditions, sorting fields, output fields and paging information; the request parameter is an array type, and each array element is single parameter data with extensible attributes.
Step S203, after the client agent class receives the request data, calling a QtRO module to serialize the request data, and transmitting the request data to a server agent class through a network;
in this embodiment, the client clientrepica class is a client agent class developed by the development framework depending on the QtRO module, and after receiving the request data object, sends the request data object QJsonObject to the server by means of the serialization and network transmission functions of the QtRO module.
The QtRO module (Qt Remote Object QtRO) is dedicated to inter-process communication (IPC). The QtRO is essentially a point-to-point communication network, and each process accesses the QtRO network through QRemoteObjectNode.
Step S204, after receiving serialized request data through a network, a service end proxy class calls a QtRO module to deserialize the request data and transmits the deserialized request data to a non-service core processing class of a service end interaction layer;
in this embodiment, the service interaction layer service class is also a service agent class developed by the framework based on the QtRO module, receives the request data object QJsonObject through the network, deserializes the request data object QJsonObject, and transmits the request data object QJsonObject to the service interaction layer non-service core processing class.
Step S205, after receiving the request data, the non-service core processing class of the server interaction layer completes operation log record, user security check, permission check, parameter check and cache acquisition in sequence, if the cache is hit, the hit cache result is returned, otherwise, a resource class is constructed, and a transaction service class of the core layer is called to perform transaction management and a service routing class of the scheduling layer is called to transmit the request data;
in this embodiment, after receiving the request data object qjsonnobject, the service-side interaction layer non-service core processing class DataAccess sequentially completes operation log recording, user security check, permission check, parameter check, cache acquisition, resource class construction, unified transaction management, calls a service routing execution function of the scheduling layer, and returns and caches a result.
Step S206, after receiving the request data, the service routing class of the service end scheduling layer acquires metadata of a service class interface to be called in the request data, calls the data conversion service class of the core layer, converts the parameter data in the request data into a specific service model object of the service class interface to be called according to the metadata, and calls the specific service class of the service end service layer for processing;
in this embodiment, after receiving the request data object QJsonObject, the service routing class Dispatch of the server scheduling layer obtains metadata to invoke a service interface from the request data object QJsonObject; and meanwhile, the parameter data in the request data object QJsonObject is converted into a specific business model object of the service class interface by using a frame core layer data conversion function, and finally, the operation of dynamically calling the specific business service class interface is completed.
Step S207, after receiving the parameters transmitted by the scheduling layer, the specific service class of the service layer of the server performs specific service function processing, wherein the parameters comprise a resource object and a specific service model object;
in this embodiment, the specific service class receives the parameters transmitted by the scheduling layer, including the Resource object Resource and the specific service model object, and performs specific service function processing, and if necessary, the function of the Resource object Resource may be used to complete the persistence operation.
And step S208, the service end interaction layer takes the metadata of the service interface and the request key parameter as key words, records the service processing result into a cache, generates response data and returns the response data to the client through the network.
In this embodiment, after the service class of the service layer performs specific service function processing on a request initiated by the client, the interaction layer uses metadata of the service class interface and a request key parameter as a key word, records a service processing result into a cache, generates response data corresponding to the request, and returns the response data to the client through a network, thereby completing the whole process of requesting, executing and responding the service once.
Optionally, in a specific embodiment, the response data includes:
(1) normal response data
The normal response data specifically comprises metadata of the service interface, the total number of response data, the total number of the current return data and single response data; the single piece of response data is of an array type, and each array element is attribute extensible data;
(2) abnormal response data
The abnormal response data specifically comprises metadata of the service class interface, an error code and specific error description information, wherein the metadata comprises a service name and an interface method name.
Fig. 4 is a schematic flowchart of non-business core processing of an interaction layer in an embodiment of an operation method of an application developed based on a development framework according to the present invention.
In this embodiment, the processing of the request data by the non-service core processing class of the server interaction layer specifically includes:
step S301, the non-service core processing class of the interaction layer of the server analyzes the request data to obtain request analysis result data;
in this embodiment, after receiving the request data transmitted by the client, the server interaction layer invokes the non-service core processing class to analyze the request data, so as to obtain request analysis result data.
In this embodiment, based on the basic design flow of the interaction between the client and the server, the interaction layer needs to perform operation log recording, user security verification, permission check, request parameter verification on the request data in sequence, and finally obtain the cache.
Step S302, using the metadata, request parameters, user name, date and time and other related information of the service interface in the request analysis result data as an operation log, and calling a lightweight message queue of a scheduling layer to asynchronously complete the recording of the operation log;
in this embodiment, after the information such as the metadata, the request parameter, the user name, the date and time, and other related information of the service interface is analyzed, the information is used as an operation log, and the recording of the operation log is asynchronously completed through a lightweight message queue in the framework.
Step S303, invoking a security service class of a core layer to verify the user security information in the request analysis result data, if the user security information passes the verification, continuing the subsequent steps, and if the user security information does not pass the verification, returning abnormal response data;
in this embodiment, after the user security information is analyzed, a user security verification operation, such as an account password verification, is completed through a core layer security service in the framework. If the verification is passed, continuing the subsequent steps; otherwise, directly returning an abnormal response result.
Step S304, invoking a security service class of a core layer to perform permission check on the metadata of the service class interface in the request analysis result data, if the metadata passes the permission check, continuing the subsequent steps, otherwise, returning abnormal response data;
in this embodiment, after the metadata of the service interface is analyzed, the authority check of the current service interface request of the user is completed through the core layer security service in the framework, and different service names and interface method names have different authorities, so that authentication is required before the request is actually processed. If the check is passed, continuing the subsequent steps; otherwise, directly returning an abnormal response result.
Step S305, invoking a data verification service class of a core layer to execute verification rule check of a specific business model object on the request parameter in the request analysis result data, if the request parameter passes the check, continuing the subsequent steps, otherwise, returning abnormal response data;
in this embodiment, after the request parameter is parsed, the check rule in the service model object is executed through the core layer check service in the framework, so as to check the request parameter, such as data type check, value interval check, and the like. If the check is passed, continuing the subsequent steps; otherwise, directly returning an abnormal response result.
Step S306, according to the metadata and request parameters of the service interface in the request analysis result data, calling the cache service class of the core layer to obtain corresponding cache data, if the cache is hit, returning the hit cache result as normal response data to the client, otherwise continuing the subsequent steps;
in this embodiment, after the metadata and the request parameter of the service interface are analyzed, the cache data in the database in the storage layer is obtained through the core layer cache service in the framework. If the cache is hit, directly returning the hit cache result as normal response data, otherwise, continuing the subsequent steps.
Step S307, a resource class is constructed, a transaction service class of the core layer is called to perform transaction management, and a service routing class of the scheduling layer is called to transmit the request data.
In this embodiment, if the requested data does not hit the cache, it indicates that the server does not have corresponding response data, and therefore, the interaction layer needs to construct a resource class, then obtains a database link, an equipment link and a unified management link through the persistence service of the core layer in the framework, and further invokes the transaction service class of the core layer to perform transaction management.
Transaction management is to manage a series of database operations, one transaction contains one or more SQL statements and is a unit of work for logical management, and one transaction is a sequence of reading and writing to a database. By constructing the resource class and performing transaction management, a new resource object and new cache data can be generated in the storage layer database so as to realize subsequent specific business function processing.
In this step, after completing the transaction management, the interaction layer further calls the service routing class of the scheduling layer to transmit the request data of the client, so that the scheduling layer uses the data conversion function of the framework core layer, converts the parameter data in the request data into the specific service model object of the service class interface, and finally completes the operation of dynamically calling the specific service class interface, and finally the specific service class performs specific service function processing according to the parameters transmitted by the scheduling layer, including the Resource object Resource and the specific service model object, and if necessary, can also use the function of the Resource object Resource to complete the persistence operation. And finally, the service end interaction layer takes the metadata of the service interface and the request key parameters as key words, records the service processing result into a cache, generates response data and returns the response data to the client through the network.
It will be apparent to those skilled in the art that the present invention, if implemented as a software functional unit and sold or used as a stand-alone product, can be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A development method of an application program developed by adopting a development framework is characterized in that the development framework adopts a client-side and server-side framework, and comprises the following steps:
the device driver layer is packaged with a plurality of device driver libraries and uniform access interfaces and is used for realizing communication connection with external hardware devices, data acquisition and control instruction issuing;
the storage layer is packaged with a relational database and a cache database and used as a data storage library of an application program, wherein the relational database is used for storing business data and historical data, and the cache database is used for data caching and real-time data storage;
the core layer is packaged with a plurality of non-business basic service class libraries and used for providing a plurality of bottom basic services required by the application program;
the model layer is packaged with service model classes required by the application program and service rules and verification rules corresponding to the service model classes and used for providing service models required for realizing specific service functions;
the service layer is packaged with service classes corresponding to the service model classes and used for realizing specific service function processing;
the scheduling layer is used for providing a lightweight message queue to realize asynchronous log collection and storage and also providing thread scheduling and algorithm execution service;
the interaction layer is used for receiving a request initiated by the client to the server, carrying out non-service function processing on the request data and forwarding a response made by the server to the client;
the development method comprises the following steps:
acquiring an engineering copy of the development framework and taking the engineering copy as a basic engineering of new application development;
compiling a service model class according to a design document of new application, and packaging the service model class into a development frame model layer corresponding to the engineering copy;
writing a business service class according to a design document of the new application, and packaging the business service class into a development framework service layer corresponding to the engineering copy;
editing a graphical user interface according to a newly applied design document, wherein the graphical user interface acquires a user request through a Qt signal and a slot mechanism, transfers an interaction layer interface to transmit request data, acquires response data from a business service class and presents the response data to a user through the graphical user interface;
and packaging and compiling the engineering copy of the development frame encapsulated with the written business model class and the business service class and the edited graphical user interface into an executable file, and testing the executable file, and deploying the executable file as a new intercommunicating multi-node application to a target node for running.
2. The development method of claim 1, wherein the underlying base services include any one or more of the following base services:
caching services, messaging services, remote interface services, exception services, security services, transaction services, persistence services, data transformation services, data verification services, web services, threading services, timed task services, internationalization services, logging services.
3. The development method of claim 1, wherein the server is configured to communicate with an external hardware device via ethernet, and perform data processing, computation, and storage; the client is used for man-machine interaction, data collection and field state display are carried out, and operation requests can be carried out on the field state.
4. The development method of claim 1, wherein the non-business function processing of the interaction layer comprises: verifying the validity, correctness and operation authority of a service request initiated by a client, and executing cache to obtain and record an operation log; if the business service request initiated by the client hits the cache, returning the hit cache result, otherwise, decomposing the request, performing transaction management, distributing the business service request to the scheduling layer, logging the request processing result into the cache, and returning the logged cache result to the client.
5. The development method according to any one of claims 1 to 4, wherein a support environment of the development framework is composed of an operating system and a language framework, and the language framework employs a C + + language and a Qt library.
6. An operation method of an application program developed by using a development framework, which is applied to a multi-node communication network, and is characterized by comprising the following steps:
the client collects data and constructs an operation model object, and a data conversion service class of the core layer is called to convert the operation model object into a request data object;
the client informs a corresponding observer to process according to the request data object, and calls a client proxy class to transmit the request data;
after receiving the request data, the client agent class calls a QtRO module to serialize the request data and transmits the serialized request data to the server agent class through a network;
after receiving serialized request data through a network, a server agent class calls a QtRO module to deserialize the request data and transmits the deserialized request data to a non-service core processing class of a server interaction layer;
after receiving the request data, the non-service core processing class of the server interaction layer completes operation log recording, user security check, permission check, parameter check and cache acquisition in sequence, if the cache is hit, the hit cache result is returned, otherwise, a resource class is constructed, and a transaction service class of the core layer is called to perform transaction management and a service routing class of the scheduling layer is called to transmit the request data;
after receiving the request data, the service routing class of the server scheduling layer acquires metadata of a service class interface to be called in the request data, calls a data conversion service class of the core layer, converts parameter data in the request data into a specific service model object of the service class interface to be called according to the metadata, and calls a specific service class of the server scheduling layer for processing;
after receiving the parameters transmitted by the scheduling layer, the specific business service class of the server service layer performs specific business function processing, wherein the parameters comprise resource objects and specific business model objects;
the service end interaction layer takes the metadata of the service interface and the request key parameter as key words, records the service processing result into a cache, generates response data and returns the response data to the client through the network.
7. The operating method of claim 6, wherein the requesting data specifically comprises: metadata of the service interface, user security information, data query parameters and request parameters;
wherein the metadata comprises a service name and an interface method name; the user safety information comprises a user name and an encryption key; the data query parameters comprise instruction filtering conditions, sorting fields, output fields and paging information; the request parameter is an array type, and each array element is single parameter data with extensible attributes.
8. The method of operation of claim 6, wherein the response data includes normal response data and abnormal response data;
the normal response data comprise metadata of the service interface, the total number of response data, the total number of the current return data and single response data; the single piece of response data is of an array type, and each array element is attribute extensible data;
the abnormal response data comprises metadata of the service class interface, an error code and specific error description information, wherein the metadata comprises a service name and an interface method name.
9. The operating method according to any one of claims 6 to 8, wherein the processing of the request data by the non-service core processing class of the server interaction layer specifically includes:
analyzing the request data by the non-service core processing class of the interaction layer of the server side to obtain request analysis result data;
taking the metadata, request parameters, user names and date times of service interfaces in the request analysis result data as operation logs, and calling a lightweight message queue of a scheduling layer to asynchronously complete the recording of the operation logs;
calling a security service class of a core layer to verify the user security information in the request analysis result data, if the user security information passes the verification, continuing the subsequent steps, and if the user security information does not pass the verification, returning abnormal response data;
invoking a security service class of a core layer to carry out authority check on metadata of a service class interface in the request analysis result data, if the metadata passes the check, continuing the subsequent steps, and if the metadata does not pass the check, returning abnormal response data;
calling a data verification service class of a core layer to execute verification rule check of a specific business model object on request parameters in the request analysis result data, if the request parameters pass the check, continuing the subsequent steps, and if the request parameters do not pass the check, returning abnormal response data;
calling a cache service class of a core layer to obtain corresponding cache data according to metadata and request parameters of a service class interface in the request analysis result data, if the cache is hit, returning the hit cache result as normal response data to the client, and otherwise, continuing the subsequent steps;
and constructing a resource class, calling a transaction service class of the core layer to perform transaction management, and calling a service routing class of the scheduling layer to transmit the request data.
CN202010987485.3A 2020-09-18 2020-09-18 Qt-based application program rapid development framework, development method and operation method Active CN111930365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010987485.3A CN111930365B (en) 2020-09-18 2020-09-18 Qt-based application program rapid development framework, development method and operation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010987485.3A CN111930365B (en) 2020-09-18 2020-09-18 Qt-based application program rapid development framework, development method and operation method

Publications (2)

Publication Number Publication Date
CN111930365A CN111930365A (en) 2020-11-13
CN111930365B true CN111930365B (en) 2021-02-26

Family

ID=73333960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010987485.3A Active CN111930365B (en) 2020-09-18 2020-09-18 Qt-based application program rapid development framework, development method and operation method

Country Status (1)

Country Link
CN (1) CN111930365B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506485A (en) * 2020-12-14 2021-03-16 苏州华兴源创科技股份有限公司 Business processing system
CN112395117B (en) * 2021-01-21 2021-04-27 武汉中科通达高新技术股份有限公司 Data processing method, system and storage medium
CN115174659B (en) * 2022-06-30 2023-08-29 重庆长安汽车股份有限公司 Vehicle-mounted service container, service calling method, device and medium
CN115147094B (en) * 2022-09-01 2022-12-27 中国电子科技集团公司信息科学研究院 Development method and construction method of heterogeneous integrated microsystem process library development platform
CN115934043B (en) * 2023-01-04 2024-03-15 广州佰瑞医药有限公司 PHP-based high-efficiency MVC framework

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266545A (en) * 2008-04-30 2008-09-17 武汉科兴达软件股份有限公司 Electric power industry integral supporting platform
CN109358847A (en) * 2018-09-26 2019-02-19 中国海洋石油集团有限公司 A kind of Business Management Platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2959528C (en) * 2014-09-02 2023-03-07 Ab Initio Technology Llc Specifying components in graph-based programs

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266545A (en) * 2008-04-30 2008-09-17 武汉科兴达软件股份有限公司 Electric power industry integral supporting platform
CN109358847A (en) * 2018-09-26 2019-02-19 中国海洋石油集团有限公司 A kind of Business Management Platform

Also Published As

Publication number Publication date
CN111930365A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
CN111930365B (en) Qt-based application program rapid development framework, development method and operation method
Balsamo et al. Model-based performance prediction in software development: A survey
US7779036B2 (en) Integration functionality for a test tool for application programming interfaces
CN108427631A (en) A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN104954453A (en) Data mining REST service platform based on cloud computing
CN103795749A (en) Method and device used for diagnosing problems of software product operating in cloud environment
Marzolla Simulation-based performance modeling of UML software architectures.
CN112256406B (en) Operation flow platformization scheduling method
WO2016178661A1 (en) Determining idle testing periods
CN113238739A (en) Plug-in development and data acquisition method, device, electronic equipment and medium
Herbold et al. Combining usage-based and model-based testing for service-oriented architectures in the industrial practice
CN111274144A (en) Unit testing method and system based on network file system operation word interface
Hendriks et al. A systematic approach for interfacing component-based software with an active automata learning tool
Wannipurage et al. A Framework to capture and reproduce the Absolute State of Jupyter Notebooks
CN113835904A (en) Remote procedure call control method, device, equipment and storage medium
CN113742408A (en) Data interaction method based on Protobuf protocol dynamic analysis
Rover et al. Software tools for complex distributed systems: Toward integrated tool environments
CN110928705B (en) Communication characteristic analysis method and system for high-performance computing application
Wood et al. Triton: a domain specific language for cyber-physical systems
CN116781591B (en) Pressure testing system, pressure testing terminal and storage medium based on flow dyeing and transparent transmission technology
Wang et al. MicroCM: A cloud monitoring architecture for microservice invocation
Catrina A Comparative Analysis of Spring MVC and Spring WebFlux in Modern Web Development
WO2024046458A1 (en) Hierarchical system, operation method and apparatus, and electronic device and storage medium
Coggeshall et al. Zend Enterprise PHP Patterns
Peng et al. The Scheduling Analysis Method of Embedded Real-Time System Based on AADL-IO Annex

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