CN114221865B - Method, device, equipment and storage medium for realizing business function of Internet of things terminal - Google Patents

Method, device, equipment and storage medium for realizing business function of Internet of things terminal Download PDF

Info

Publication number
CN114221865B
CN114221865B CN202210155400.4A CN202210155400A CN114221865B CN 114221865 B CN114221865 B CN 114221865B CN 202210155400 A CN202210155400 A CN 202210155400A CN 114221865 B CN114221865 B CN 114221865B
Authority
CN
China
Prior art keywords
service
software
management system
framework
software package
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
CN202210155400.4A
Other languages
Chinese (zh)
Other versions
CN114221865A (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.)
Guangzhou Kunpeng Wulian Technology Co ltd
Original Assignee
Guangzhou Kunpeng Wulian Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kunpeng Wulian Technology Co ltd filed Critical Guangzhou Kunpeng Wulian Technology Co ltd
Priority to CN202210155400.4A priority Critical patent/CN114221865B/en
Publication of CN114221865A publication Critical patent/CN114221865A/en
Application granted granted Critical
Publication of CN114221865B publication Critical patent/CN114221865B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • 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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Abstract

The application provides a method for realizing service functions of an internet of things terminal, which comprises the following steps: the system comprises an equipment management system and a plurality of processes, wherein the processes are communicated through the equipment management system; each process corresponds to a service frame and comprises a plurality of service threads, and the service threads are communicated through the service frames; the method comprises the following steps: the method comprises the steps that an Internet of things terminal receives a target software package issued by a cloud end and registers the target software package to a starting configuration file of an equipment management system; distributing and starting a process for the target software package; each service is registered to a service framework; calling a subscription interface in a service framework for subscription; and calling a publishing interface in the service framework to publish the data. The method realizes the decoupling of the service function and the terminal of the Internet of things, improves the development efficiency, reduces the development cost and reduces the complexity of realizing the service function. In addition, a service function implementation device, equipment and a storage medium of the terminal of the Internet of things are also provided.

Description

Method, device, equipment and storage medium for realizing business function of Internet of things terminal
Technical Field
The present application relates to the field of information processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for implementing a service function of an internet of things terminal.
Background
The existing internet of things terminal is often relatively fixed and single in function, for example, the internet of things terminal used for temperature and humidity acquisition can only acquire temperature and humidity information, and complete internet of things terminal equipment needs to be replaced when PM2.5 needs to be acquired. Therefore, the existing implementation mode of the terminal service function of the internet of things is rigid, and if the function needs to be replaced, the implementation mode is not only troublesome, but also the cost is greatly increased. Even if some internet of things terminals can realize online upgrade, the complexity of realizing the service functions is greatly increased along with diversification of the service functions, so that quick iterative update of the functions is not facilitated.
Therefore, a method for quickly implementing the terminal service function of the internet of things is needed.
Disclosure of Invention
Based on the method, the device, the equipment and the storage medium for realizing the service function of the terminal of the Internet of things are provided, and the method can be used for quickly realizing the addition or the update of the service function of the terminal of the Internet of things.
A method for realizing service functions of an Internet of things terminal comprises the following steps: the system comprises a device management system and a plurality of processes, wherein the processes are communicated with each other through the device management system; each process comprises a service framework, each process comprises a plurality of service threads, the plurality of service threads are communicated through the service framework, and a plurality of calling interfaces are provided in the service framework;
the method comprises the following steps:
the Internet of things terminal receives a target software package issued by a cloud and stores the target software package to the local, and after receiving an instruction for operating the target software package, a target software identifier corresponding to the target software package is registered in a starting configuration file of the equipment management system;
when the equipment management system is started, reading a target software identifier of the starting configuration file, distributing a process for the target software package according to the target software identifier and starting;
after the process is started, instantiating at least one service corresponding to the corresponding service framework and the target software package;
each instantiated service calls a registration interface in the service framework to register, the service framework is used for storing a pointer corresponding to the service when service registration is received, creating a service thread for each service, and calling a starting interface of the service in the service thread to realize that a corresponding service code runs in the service thread to realize a corresponding service function;
when the service has a data receiving requirement, calling a subscription interface in the service framework to subscribe the first type of data;
when the service has a data sending requirement, calling a publishing interface in the service framework to publish the second type data;
and when the service framework receives the published third type data, inquiring a target service subscribed to the third type data, and calling a receiving interface of the target service to push the third type data.
According to the function implementation method of the Internet of things terminal, the equipment management system is arranged on the Internet of things terminal, processes are communicated through the equipment management system, decoupling between the processes is achieved, and the service frames are arranged, so that service threads are communicated through the service frames, and decoupling between the service threads is achieved. Under the support of the equipment management system and the service framework, when the terminal of the Internet of things needs to be replaced or a new business function is added, the expansion of the function can be realized only by downloading the target software package from the cloud to the terminal of the Internet of things. Under the support of the equipment management system and the service framework, the business development only needs to be concentrated on the business software development, and does not need hardware equipment, so that the decoupling of the business function and the Internet of things terminal is realized, the business development efficiency is greatly improved, and the development cost is greatly reduced. In addition, because a service framework for realizing decoupling between service thread services is newly arranged in the method, when service functions are increased, the complexity of realizing the service functions is greatly reduced, thereby being beneficial to realizing the rapid iterative update of the functions.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
fig. 1 is a diagram illustrating an internal architecture of an internet of things terminal according to an embodiment;
fig. 2 is a flowchart of a function implementation method of an internet of things terminal in one embodiment;
fig. 3 is a sequence diagram of interaction between a device management system and a process in an internet of things terminal in one embodiment;
FIG. 4 is a timing diagram illustrating interaction between a business thread and a service framework in one embodiment;
fig. 5 is a diagram of an internal architecture in a terminal of the internet of things in another embodiment;
FIG. 6 is a timing diagram of log management in one embodiment;
FIG. 7 is a timing diagram of a software upgrade in one embodiment;
FIG. 8 is a timing diagram of configuration updates in one embodiment.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
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 a part of the embodiments of the present application, and not all of the 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 is noted that the terms "comprises," "comprising," and "having" and any variations thereof in the description and claims of this application and the drawings described above are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. In the claims, the description and the drawings of the specification of the present application, relational terms such as "first" and "second", and the like, may be used solely to distinguish one entity/action/object from another entity/action/object without necessarily requiring or implying any actual such relationship or order between such entities/actions/objects.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
As shown in fig. 1, which is an internal architecture diagram in an internet of things terminal in an embodiment, the internet of things terminal includes: the system comprises a device management system and a plurality of processes, wherein the processes are communicated with each other through the device management system; each process comprises a service framework, each process comprises a plurality of business threads, the business threads are communicated through the service framework, and a plurality of calling interfaces are provided in the service framework.
The Device Management System (DMS) is an independent process and can be independently upgraded, a service framework in the process is responsible for communication with the DMS, particularly, communication can be carried out in a UDP mode, business software does not need to care about all details, only needs to focus on business code development, and decoupling of the business software and the terminal of the Internet of things is achieved. The service framework can be essentially understood as a software library, a plurality of calling interfaces are provided, and the principle of realizing communication between business threads through the service framework is as follows: the receiving and the distribution of the message are realized by calling the corresponding interfaces. Due to the existence of the service framework, the service threads are decoupled, and the complexity of realizing the service function is greatly reduced. For example, when there are n services to send data to each other, the traditional method is that service threads are called with each other, there will be n × n (n-1) data interfaces, and after the service framework is used, only n + n interfaces are needed to call, and when there are more services, the service framework is adopted to greatly reduce the complexity of interaction, thereby avoiding the occurrence of system crash due to too high complexity.
As shown in fig. 2, in an embodiment, a method for implementing a function of an internet of things terminal is provided, which includes:
step 202, the internet of things terminal receives a target software package issued by the cloud and stores the target software package to the local, and after receiving an instruction for operating the target software package, a target software identifier corresponding to the target software package is registered in a starting configuration file of the equipment management system.
The cloud terminal is a server terminal, and when the internet of things terminal needs to run a new function or update the function, the software package of the corresponding function is developed according to a preset development rule, and the software package is issued to the internet of things terminal through the cloud terminal. When the terminal of the internet of things receives an instruction for operating a certain software package, whether the software package exists locally is searched, and when the software package exists, a corresponding software identifier is registered in a starting configuration file of the equipment management system. The software identifier is used to uniquely identify a software package. The software identification of the software package needing to be run is recorded in the starting configuration file. The equipment management system is used for managing all processes in a unified mode.
And step 204, when the equipment management system is started, reading the target software identification of the starting configuration file, distributing the process for the target software package according to the target software identification and starting.
When the terminal equipment of the Internet of things is started, the equipment management system is started firstly, then the target file identification of the starting configuration file is read, and a process is distributed and started for the running of the target software package.
In an embodiment, as shown in fig. 3, a process after the terminal of the internet of things is started is as follows, where a DMS is a device management system, procA and procB represent a process a and a process B, respectively, and one process corresponds to one software program:
1) a DMS (Device management System) is started first, then a start configuration file is read, and each business process is started according to the read start configuration file;
2) after each business process is started, a heartbeat packet is periodically sent to a DMS (Device management System) through a designated port number.
3) The heartbeat packet is timed out, and then is closed by a DMS (Device management System) and then pulled up again.
4) When the processes need to communicate, a data receiving side (DMS) subscribes the information, a data sending side (DMS) publishes the data, the DMS distributes the information according to the subscription condition, and when the DMS receives the information, the DMS distributes the data according to the subscription condition.
Step 206, after the process is started, instantiating at least one service corresponding to the corresponding service framework and the target software package.
After the process is started, a service framework instance and at least one service instance are created first, and instantiation refers to a process of creating an object by using classes in object-oriented programming.
And 208, each instantiated service calls a registration interface in the service framework to register, the service framework is used for storing a pointer corresponding to the service when the service registration is received, creating a service thread for each service, and calling a start interface of the service in the service thread to realize that a corresponding service code runs in the service thread to realize a corresponding service function.
After instantiation is carried out, each service registers itself at a service frame firstly, the registration mode is that the service frame registers itself by calling a register interface register () in the service frame, and then when the service frame receives service registration, a pointer corresponding to the service is stored, and the pointer is equivalent to the address of the service. The service framework is also used for creating a service thread, then calling a start interface start () of the service in the service thread, and realizing independent operation of the service thread by filling service codes in the start () interface.
Step 210, when the service has a data receiving requirement, a subscription interface in the service framework is called to subscribe the first type of data.
Step 212, when the service has a data sending requirement, a publishing interface in the service framework is called to publish the second type data.
The framework finds that the type of the DATA is subscribed, and then the framework sends the raw DATA of the publisher to the subscriber.
In one embodiment, as shown in fig. 4, when a service has a data receiving requirement, a service thread calls a subscribe () interface (subscription interface) of a service framework frame to subscribe to data of a specified type; when a service has a data sending requirement, a service thread calls a publish () interface (publish interface) of a service framework frame to publish data of a specified type; after receiving the published data, the service framework queries the registered service subscribed to the type, and calls a recvData () interface to the registered service to push the data of the type. The data between services adopts a message in a json format. Specifically, as shown in fig. 4, a service a (i.e., a service a thread) calls a subscribe () interface to subscribe to a type 1 message, a service B also calls a subscribe () interface to subscribe to a type 1 message, when a service C calls a publish () interface to publish a type 1 message, a service framework queries a subscription object of the type 1 message, and then calls a recvData () interface to push the subscription object to the service a and the service B, respectively.
In order to distinguish subscription data from published data, the types of subscription data are collectively referred to as first type data, the types of published data are collectively referred to as second type data, and the first type data and the second type data may be the same type of data or different types of data.
Step 214, when the service framework receives the published third type data, querying a target service subscribed to the third type data, and calling a receiving interface of the target service to push the third type data.
Referring to fig. 4, when receiving published data, querying a target service subscribed to the type of data, and then calling a recvData interface (receiving interface) to push the type of data. For the sake of distinction, the type of data received is collectively referred to as "third type data".
According to the function implementation method of the Internet of things terminal, the equipment management system is arranged on the Internet of things terminal, processes are communicated through the equipment management system, decoupling between the processes is achieved, and the service frames are arranged, so that service threads are communicated through the service frames, and decoupling between the service threads is achieved. Under the support of the equipment management system and the service framework, when the terminal of the Internet of things needs to be replaced or a new business function is added, the expansion of the function can be realized only by downloading the target software package from the cloud to the terminal of the Internet of things. Under the support of the equipment management system and the service framework, the business development only needs to be concentrated on the business software development without paying attention to hardware equipment, the decoupling of the business function and the internet of things terminal is realized, the business development efficiency is greatly improved, and the development cost is greatly reduced. In addition, because a service framework for realizing decoupling between service thread services is newly arranged in the method, when service functions are increased, the complexity of realizing the service functions is greatly reduced, thereby being beneficial to realizing the rapid iterative update of the functions.
As shown in fig. 5, in one embodiment, a device management system includes: a common base function module, the common base function module comprising: at least one of a log management module, a version upgrade management module (OTA), a configuration management module (configuration module), a process monitoring module (process management) and an authorization module (License management); the implementation of the common basic function module is realized by the communication between the business thread and the service framework and the communication between the service framework and the equipment management system.
The DMS extracts the common basic functions such as remote log query, OTA upgrade, software customized configuration and the like required by each service and independently becomes a system-level service, all service development only needs to be concentrated on the specific functions of the service under the support of the DMS and the service frame, and the common basic functions such as remote log query, OTA upgrade, software customized configuration and the like are completely completed by the service frame and the DMS, so that not only is the function expansion realized, but also the service development is simpler. Under the support of a service framework, service developers can smoothly access the terminal cloud management platform without knowing the details of terminal cloud cooperation, and simultaneously, because the OTA is supported by the system level of the equipment, a more flexible application scene is provided, and the equipment can load one or more appointed software according to the needs, so that the software-defined Internet of things terminal is realized.
In one embodiment, the common base function module comprises: a log management module; the implementation of the common basic function module is implemented by the service thread communicating with the service framework and the service framework communicating with the device management system, and comprises: the service issues log data to the equipment management system by calling an issuing interface in the service framework, and the equipment management system stores the log data to the log management module after receiving the log data; when the equipment management system receives a log query request sent by a server, the corresponding log is queried in the log management module according to query conditions contained in the log query request and returned to the server.
The device management system DMS provides log service for all business software, all log service is communicated with a cloud (server), and the cloud can dynamically call logs in the device management system as required to realize BUG positioning and tracking.
As shown in fig. 6, the device management system DMS manages logs of all services in a unified manner, and makes a function of cloud query. The service sends the log data to a DMS (Device management System) through a frame (i.e. a service frame), and the DMS receives the log data and stores the log data in an embedded database. And the cloud (cloud) issues a log query command, and the DMS queries the local log according to the query condition and returns the local log to the cloud query result.
In one embodiment, the common base function module comprises: a version upgrade management module; the implementation of the common basic function module is implemented by the service thread communicating with the service framework and the service framework communicating with the device management system, and comprises: the equipment management system inquires the latest version of the service software from a server, compares the latest version of the service software with the version of the local service software, if the latest version of the service software is inconsistent with the version of the local service software, downloads the latest version of the corresponding service software from the server, and issues the latest version of the service software to a corresponding service frame; and the service framework realizes the version upgrading of the service software by calling the interface of the service.
The version upgrading management module is used for managing version upgrading of various service software so as to achieve iterative updating of the service software, and the version upgrading management module is arranged in the equipment management system so that the terminal of the Internet of things can adapt to more service scenes.
As shown in fig. 7, in the drawing, the business software corresponds to a process, the DMS represents a device management system, and the cloud represents a cloud. The DMS device management system uniformly manages OTAs of all services, the DMS synchronizes software information with the cloud, after software versions needing to be loaded are inquired, local versions are compared, and if the software versions are inconsistent, corresponding latest software is actively pulled through the cloud. And after the software is downloaded, analyzing and checking the software package file, replacing the software file after the software package file passes the checking, updating the local software version information, reporting the successful result of the cloud platform OTA, starting new software, and reporting the failed result of the OTA if the software package file does not pass the checking.
In one embodiment, the common base function module comprises: configuring a management module; the implementation of the common basic function module is implemented by the service thread communicating with the service framework and the service framework communicating with the device management system, and comprises: the equipment management system inquires the latest configuration of the service software for a server, compares the configuration version of the service software with the configuration of the local service software, if the configuration version of the service software is inconsistent with the configuration version of the local service software, downloads the latest configuration of the corresponding service software from the server, and issues the latest configuration of the service software to a corresponding service frame; and the service framework realizes the configuration update of the service software by calling a configuration interface of the service.
The equipment management system is provided with a configuration management module for updating the configuration of the service software, and when the configuration parameters of the service software are changed, the configuration of the parameters can be conveniently realized through the configuration management module, so that the parameters can be flexibly adjusted.
As shown in fig. 8, the business software in the graph corresponds to a process, the DMS device management system performs unified management on the configuration of all the businesses, the DMS and the cloud synchronize configuration information, after querying the configuration that needs to be updated, the local configuration is compared, and if the configuration is inconsistent, the corresponding software configuration is actively pulled through the cloud. After receiving the configuration, the DMS sends the configuration to a service framework frame of the service through UDP, and the frame recalls a configGet () interface of the service to realize configuration updating.
In one embodiment, before the invoking the registration interface in the service framework for data subscription when the service has a data receiving need, the method further includes: when the service framework receives that service software calls a registration interface of the service framework for registration, a pointer corresponding to the service software is stored, a service thread is created, a start () interface of the service software is called, and the initialization of the service is realized through a service code filled in the start () interface.
On the other hand, in addition to the above-described improvements, there are also the following improvements in the present application:
traditional thing networking equipment sells for the customer after, the replacement of business function can't independently be realized to the customer, and in order to improve the flexibility of development business function in this scheme, provide the frame of programming to the customer, the customer only need program according to the rule in the programming frame that provides can realize the development of business, and need not to pay attention to thing networking equipment itself, this makes the customer expand or change the business in the thing networking equipment as required, not only make the development of business more convenient, and owing to need not change thing networking equipment, the cost is greatly saved.
In one embodiment, the following software rules are formulated, and software compiled according to the following rules specified by the invention can be issued to the terminal of the internet of things for installation under the support of the cloud platform. The process is as follows:
1. compiling software according to software rules of the invention
2. Software uploading on specified page of cloud platform
3. Issuing a software installation command to a specified Internet of things terminal to support batch upgrading
4. Cloud platform issuing installation software
5. And displaying the data of the Internet of things collected by the software at the client after the installation is finished.
Specifically, to implement the software defined internet of things, the business software must comply with the software rules of the present invention. Software is divided into 2 major classes: 1. service class: the class is realized by a user, so that the class can be discovered and controlled by a system; 2. the FrameWork class: the class is implemented in a service framework, which provides services to the user at the business software system level, such as data caching services, data routing services.
Service class description:
start (): the business software of the client can be executed in the business thread provided by the system, and the system calls the interface after distributing the business thread to the business software.
stop (), the system will call the interface before the business thread of the business execution software of the client is closed.
restart (): and when the business thread where the business software of the client is positioned needs to be restarted, the interface is called.
And (4) recvData (int type, string info). after the system receives the message of the service subscription of the client, the system transmits the data to the service software of the user through the interface.
version (): the system queries the version of the business software through the interface.
name (): the system queries the business software name through the interface.
The system issues service software configuration information through the interface.
FrameWork class description
getIns (). this interface provides the functionality of the business code acquisition system service instance.
register ser (string name, Service ser): the interface provides functionality for the service code to register the service instance with the system.
unregisterser (string name) that provides the functionality for the service code to unregister a service instance from the system.
The heartbeat monitoring system comprises a heartbeat interface, a heartbeat monitoring module, a heartbeat module and a system module, wherein the heartbeat interface provides a function of sending heartbeat by a service code, and the system can close the service thread of the service code and redistribute the service thread to the service code for use under the condition that the heartbeat information is not received in a heartbeat monitoring period.
updateStatus (string name, int status): the interface provides the function of the service code to prompt the system about the change of the service code state.
subscribe (string name, string type): the interface provides the functionality for the service code to subscribe to messages with the system.
unsubscribe (string name, string type): this interface provides the functionality for the service code to unsubscribe messages from the system.
publish (string name, string type, string info) interface provides the function of the service code to send messages to the system.
And (5) configuring a business code, wherein the interface provides a function for acquiring and configuring the business code.
And (5) cacheSet (string appName, string key, string value) provides the function of setting shared data by the service code.
cacheGet (string appName, string key, string & value): the interface provides the function of the service code to acquire the shared data.
In the embodiment, a set of service flow and software rule system of the software defined internet of things is designed, so that a user can customize the functions of the terminal equipment and dynamically switch the functions according to needs only under the condition that the user follows the software rules and flow of the invention. According to the scheme, the hardware equipment and the software of the Internet of things are decoupled, and one piece of Internet of things equipment can become the Internet of things equipment with different functions according to different loaded software. For example, when a user needs to monitor the temperature and humidity of a home environment and the PM2.5, two sets of devices need to be purchased, one set of devices only monitors the temperature and humidity, and the other set of devices only monitors the PM 2.5. However, with the support of the invention, the set-up switching software can be changed into equipment capable of collecting PM2.5 after the temperature and humidity are monitored, and a user can realize multiple functions only by one hardware device. Meanwhile, a user can write codes according to own needs, and the software can be installed on the Internet of things equipment through the platform as long as the software is in accordance with the software rule of the invention, so that various functional services of the user are realized, and a large amount of hardware purchasing cost is saved for the user.
In one embodiment, before the internet of things terminal receives the target software package delivered by the cloud and stores the target software package locally, the method further includes: after receiving a target software package, the cloud detects the target software package, detects whether the target software package is a software package developed according to predefined software rules, judges that the target software package is legal if yes, and judges that the target software package is illegal if not.
In order to ensure that the target software is legal software which can run at the terminal of the internet of things, when the target software package is received at the cloud, the target software package is subjected to validity detection, whether the target software package is a software package developed according to predefined software rules is detected, if yes, the target software package is judged to be legal, and only the legal software package is allowed to be issued to the terminal of the internet of things.
In one embodiment, the detecting whether the target software package is a software package developed according to predefined software rules includes: and acquiring a predefined software rule, detecting whether an interface of the detection software package meets the requirement according to the predefined software rule, and if so, judging that the interface meets the predefined software rule.
The predefined software rule refers to a programming rule for a user to obey, the predefined software rule includes meanings of different interfaces, the meanings of the different interfaces are different, and the service type interface is referred, so that whether the predefined software rule is met or not can be judged according to a result of detecting the interface, and the terminal of the internet of things cannot run on the terminal of the internet of things if the predefined software rule is not met. In the application, the functional software needs to be developed according to the given software rule, so that the uniqueness is realized during detection, and compared with the previous mode of judging whether the interface is legal or not by various encryption and decryption, the detection mode of the scheme only needs to pay attention to whether the interface meets the requirements or not, and the detection is more convenient.
Referring to fig. 1, in an embodiment, a service function implementation apparatus of an internet of things terminal is provided, where the apparatus includes: the system comprises a device management system and a plurality of processes, wherein the processes are communicated with each other through the device management system; each process comprises a service framework, each process comprises a plurality of service threads, the plurality of service threads are communicated through the service framework, and a plurality of calling interfaces are provided in the service framework;
the device management system is used for receiving a target software package issued by a cloud end and storing the target software package to the local, and after receiving an instruction for operating the target software package, registering a target software identifier corresponding to the target software package to a starting configuration file of the device management system;
the equipment management system is also used for reading a target software identifier of the starting configuration file when the equipment management system is started, distributing a process for the target software package according to the target software identifier and starting the process;
the process is used for instantiating at least one service corresponding to the service framework and the target software package after the process is started;
each service calls a registration interface in the service framework to register, and the service framework is used for storing a pointer corresponding to the service when service registration is received and creating a service thread for each service;
the service thread is used for calling the starting interface of the service to realize that the corresponding service code is operated in the service thread to realize the corresponding service function;
the service thread is also used for calling a subscription interface in the service frame to subscribe the first type of data when the service has a data receiving requirement, and calling a publishing interface in the service frame to publish the second type of data when the service has a data sending requirement;
and the service framework is used for inquiring a target service subscribed to the third type of data when receiving the published third type of data, and calling a receiving interface of the target service to push the third type of data.
In one embodiment, the device management system includes: a common base function module, the common base function module comprising: at least one of a log management module, a version upgrade management module, a configuration management module, a process monitoring module and an authorization module; the implementation of the common basic function module is realized by the communication between the business thread and the service framework and the communication between the service framework and the equipment management system.
In one embodiment, the common base function module comprises: a log management module;
the implementation of the common basic function module is implemented by the service thread communicating with the service framework and the service framework communicating with the device management system, and comprises: the service issues log data to the equipment management system by calling an issuing interface in the service framework, and the equipment management system stores the log data to the log management module after receiving the log data; when the equipment management system receives a log query request sent by a server, the corresponding log is queried in the log management module according to query conditions contained in the log query request and returned to the server.
In one embodiment, the common base function module comprises: a version upgrade management module; the implementation of the common basic function module is implemented by the service thread communicating with the service framework and the service framework communicating with the device management system, and comprises: the equipment management system inquires the latest version of the service software from a server, compares the latest version of the service software with the version of the local service software, if the latest version of the service software is inconsistent with the version of the local service software, downloads the latest version of the corresponding service software from the server, and issues the latest version of the service software to a corresponding service frame; and the service framework realizes the version upgrading of the service software by calling a receiving interface of the service.
In one embodiment, the common base function module comprises: configuring a management module; the implementation of the common basic function module is implemented by the communication between the business thread and the service framework and the communication between the service framework and the equipment management system, and comprises the following steps: the equipment management system inquires the latest configuration of the service software for a server, compares the configuration version of the service software with the configuration of the local service software, if the configuration version of the service software is inconsistent with the configuration version of the local service software, downloads the latest configuration of the corresponding service software from the server, and issues the latest configuration of the service software to a corresponding service frame; and the service framework realizes the configuration update of the service software by calling a configuration interface of the service.
In one embodiment, the above apparatus further comprises:
the cloud end is used for detecting the target software package after receiving the target software package, detecting whether the target software package is a software package developed according to predefined software rules, judging that the target software package is legal if the target software package is developed according to the predefined software rules, and judging that the target software package is illegal if the target software package is not developed according to the predefined software rules.
In one embodiment, the cloud is further configured to obtain a predefined software rule, where the predefined software rule includes a plurality of interfaces; and detecting whether the interface of the detection software package meets the requirement or not according to the predefined software rule, and if so, judging that the interface meets the predefined software rule.
An internet of things terminal comprises a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the steps of the service function implementation method of the internet of things terminal in the above embodiments.
A computer-readable storage medium is characterized by storing a computer program, and when the computer program is executed by a processor, the processor is enabled to execute the steps of the service function implementation method of the terminal of the internet of things in the foregoing embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for realizing service functions of an Internet of things terminal is characterized in that the Internet of things terminal comprises the following steps: the system comprises a device management system and a plurality of processes, wherein the processes are communicated with each other through the device management system; each process comprises a service framework, each process comprises a plurality of service threads, the plurality of service threads are communicated through the service framework, and a plurality of calling interfaces are provided in the service framework;
the method comprises the following steps:
the Internet of things terminal receives a target software package issued by a cloud end and stores the target software package to the local, and after receiving an instruction for operating the target software package, a target software identifier corresponding to the target software package is registered to a starting configuration file of the equipment management system;
when the equipment management system is started, reading a target software identifier of the starting configuration file, distributing a process for the target software package according to the target software identifier and starting;
after the process is started, instantiating at least one service corresponding to the corresponding service framework and the target software package;
each instantiated service calls a registration interface in the service framework to register, the service framework is used for storing a pointer corresponding to the service when service registration is received, creating a service thread for each service, and calling a starting interface of the service in the service thread to realize that a corresponding service code runs in the service thread to realize a corresponding service function;
when the service has a data receiving requirement, calling a subscription interface in the service framework to subscribe the first type of data;
when the service has a data sending requirement, calling a publishing interface in the service framework to publish the second type data;
and when the service framework receives the published third type data, inquiring a target service subscribed to the third type data, and calling a receiving interface of the target service to push the third type data.
2. The method of claim 1, wherein the device management system comprises: a common base function module, the common base function module comprising: at least one of a log management module, a version upgrade management module, a configuration management module, a process monitoring module and an authorization module;
the implementation of the common basic function module is realized by the communication between the business thread and the service framework and the communication between the service framework and the equipment management system.
3. The method of claim 2, wherein the common base function module comprises: a log management module;
the implementation of the common basic function module is implemented by the service thread communicating with the service framework and the service framework communicating with the device management system, and comprises:
the service issues log data to the equipment management system by calling an issuing interface in the service framework, and the equipment management system stores the log data to the log management module after receiving the log data;
when the equipment management system receives a log query request sent by a server, the corresponding log is queried in the log management module according to query conditions contained in the log query request and returned to the server.
4. The method of claim 2, wherein the common base function module comprises: a version upgrade management module;
the implementation of the common basic function module is implemented by the service thread communicating with the service framework and the service framework communicating with the device management system, and comprises:
the equipment management system inquires the latest version of the service software from a server, compares the latest version of the service software with the version of the local service software, if the latest version of the service software is inconsistent with the version of the local service software, downloads the latest version of the corresponding service software from the server, and issues the latest version of the service software to a corresponding service frame;
and the service framework realizes the version upgrading of the service software by calling a receiving interface of the service.
5. The method of claim 2, wherein the common base function module comprises: configuring a management module;
the implementation of the common basic function module is implemented by the service thread communicating with the service framework and the service framework communicating with the device management system, and comprises:
the equipment management system inquires the latest configuration of the service software for a server, compares the configuration version of the service software with the configuration of the local service software, if the configuration version of the service software is inconsistent with the configuration version of the local service software, downloads the latest configuration of the corresponding service software from the server, and issues the latest configuration of the service software to a corresponding service frame;
and the service framework realizes the configuration update of the service software by calling a configuration interface of the service.
6. The method of claim 1, before the internet of things terminal receives the target software package sent by a cloud and stores the target software package locally, further comprising:
after receiving a target software package, the cloud detects the target software package, detects whether the target software package is a software package developed according to predefined software rules, judges that the target software package is legal if yes, and judges that the target software package is illegal if not.
7. The method of claim 6, wherein detecting whether the software package is a software package developed according to predefined software rules comprises:
acquiring a predefined software rule, wherein the predefined software rule comprises a plurality of interfaces;
and detecting whether the interface of the detection software package meets the requirement or not according to the predefined software rule, and if so, judging that the interface meets the predefined software rule.
8. The utility model provides a business function realization device at thing networking terminal which characterized in that, the device includes: the system comprises a device management system and a plurality of processes, wherein the processes are communicated with each other through the device management system; each process comprises a service framework, each process comprises a plurality of service threads, the plurality of service threads are communicated through the service framework, and a plurality of calling interfaces are provided in the service framework;
the device management system is used for receiving a target software package issued by a cloud end and storing the target software package to the local, and after receiving an instruction for operating the target software package, registering a target software identifier corresponding to the target software package to a starting configuration file of the device management system;
the equipment management system is also used for reading a target software identifier of the starting configuration file when the equipment management system is started, distributing a process for the target software package according to the target software identifier and starting the process;
the process is used for instantiating at least one service corresponding to the service framework and the target software package after the process is started;
each service calls a registration interface in the service framework to register, and the service framework is used for storing a pointer corresponding to the service when service registration is received and creating a service thread for each service;
the service thread is used for calling the starting interface of the service to realize that the corresponding service code is operated in the service thread to realize the corresponding service function;
the service thread is also used for calling a subscription interface in the service frame to subscribe the first type of data when the service has a data receiving requirement, and calling a publishing interface in the service frame to publish the second type of data when the service has a data sending requirement;
and the service framework is used for inquiring a target service subscribed to the third type of data when receiving the published third type of data, and calling a receiving interface of the target service to push the third type of data.
9. An internet of things terminal, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the method for service functionality implementation of an internet of things terminal as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which, when executed by a processor, causes the processor to perform the steps of the service function implementation method of the internet of things terminal according to any one of claims 1 to 7.
CN202210155400.4A 2022-02-21 2022-02-21 Method, device, equipment and storage medium for realizing business function of Internet of things terminal Active CN114221865B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210155400.4A CN114221865B (en) 2022-02-21 2022-02-21 Method, device, equipment and storage medium for realizing business function of Internet of things terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210155400.4A CN114221865B (en) 2022-02-21 2022-02-21 Method, device, equipment and storage medium for realizing business function of Internet of things terminal

Publications (2)

Publication Number Publication Date
CN114221865A CN114221865A (en) 2022-03-22
CN114221865B true CN114221865B (en) 2022-05-13

Family

ID=80709033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210155400.4A Active CN114221865B (en) 2022-02-21 2022-02-21 Method, device, equipment and storage medium for realizing business function of Internet of things terminal

Country Status (1)

Country Link
CN (1) CN114221865B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114915515B (en) * 2022-05-04 2024-01-26 中国第一汽车股份有限公司 CAN communication method and system based on SOC

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296199A (en) * 2008-06-27 2008-10-29 腾讯科技(深圳)有限公司 Method for instant communication tool scheduling task, and instant communication tool
CN103544102A (en) * 2013-09-02 2014-01-29 烟台中科网络技术研究所 Method and device for test and simulation of software performance
CN104239037A (en) * 2014-08-25 2014-12-24 中国电子科技集团公司第二十九研究所 Software framework with reconfigurable business function
CN108052396A (en) * 2017-11-27 2018-05-18 深圳市恒扬数据股份有限公司 A kind of resource allocation methods and system
CN112199105A (en) * 2020-10-15 2021-01-08 舟山网脉科技有限公司 Method, system, medium and electronic device for function combination type software development
CN113157337A (en) * 2021-04-19 2021-07-23 深圳市中科明望通信软件有限公司 Application program starting method and device, terminal equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080005026A1 (en) * 2006-06-30 2008-01-03 Microsoft Corporation Automatic software registration
US9229748B2 (en) * 2010-01-29 2016-01-05 Code Systems Corporation Method and system for improving startup performance and interoperability of a virtual application

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296199A (en) * 2008-06-27 2008-10-29 腾讯科技(深圳)有限公司 Method for instant communication tool scheduling task, and instant communication tool
CN103544102A (en) * 2013-09-02 2014-01-29 烟台中科网络技术研究所 Method and device for test and simulation of software performance
CN104239037A (en) * 2014-08-25 2014-12-24 中国电子科技集团公司第二十九研究所 Software framework with reconfigurable business function
CN108052396A (en) * 2017-11-27 2018-05-18 深圳市恒扬数据股份有限公司 A kind of resource allocation methods and system
CN112199105A (en) * 2020-10-15 2021-01-08 舟山网脉科技有限公司 Method, system, medium and electronic device for function combination type software development
CN113157337A (en) * 2021-04-19 2021-07-23 深圳市中科明望通信软件有限公司 Application program starting method and device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN114221865A (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN110493067B (en) Method and device for updating API gateway service
EP1803313A1 (en) Method and system for controlling software version updates
CN108540509B (en) Processing method and device of terminal browser, server and intelligent terminal
CN110543327B (en) Service component multiplexing method, device, computer equipment and storage medium
CN104750555A (en) Management method and device for progresses in Android program
CN115328529B (en) Application management method and related equipment
CN104699511A (en) Plug-in upgrading method and plug-in upgrading device
CN114221865B (en) Method, device, equipment and storage medium for realizing business function of Internet of things terminal
CN110851151B (en) Method, device, terminal, server and storage medium for pre-installing application
CN114003312A (en) Big data service component management method, computer device and storage medium
CN110750286B (en) Management method, device, system, equipment and medium for upgrading Mbn through OTA
CN111884834A (en) Zookeeper-based distributed system upgrading method and system and computer equipment
US20160378553A1 (en) Resource Management Method and Device for Terminal System
CN112199099A (en) Application updating method, device, server and storage medium
CN112748949A (en) Software package management method, device, equipment and storage medium of operating system
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN113296822B (en) Online upgrading method and system for database system based on dynamic library
CN112596780A (en) Service execution method and device
CN113050962A (en) Mobile service upgrading method, device and terminal
CN111651469A (en) Method and device for managing block chain system contract
CN112199104A (en) Software upgrading method and device, electronic equipment and storage medium
CN112882733B (en) Application updating method and device, electronic equipment and storage medium
CN111414181B (en) Service upgrading method and device for network product, server and storage medium
CN116541104B (en) Program management method, control device, platform, device, and storage medium
CN112486556B (en) Method, system, terminal and storage medium for server to be compatible with BMC

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