CN109274734B - Service process calling method and device based on Internet of things cloud platform - Google Patents

Service process calling method and device based on Internet of things cloud platform Download PDF

Info

Publication number
CN109274734B
CN109274734B CN201811043164.7A CN201811043164A CN109274734B CN 109274734 B CN109274734 B CN 109274734B CN 201811043164 A CN201811043164 A CN 201811043164A CN 109274734 B CN109274734 B CN 109274734B
Authority
CN
China
Prior art keywords
service process
service
information
list information
registration information
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
CN201811043164.7A
Other languages
Chinese (zh)
Other versions
CN109274734A (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.)
Hisense Co Ltd
Original Assignee
Hisense 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 Hisense Co Ltd filed Critical Hisense Co Ltd
Priority to CN201811043164.7A priority Critical patent/CN109274734B/en
Publication of CN109274734A publication Critical patent/CN109274734A/en
Application granted granted Critical
Publication of CN109274734B publication Critical patent/CN109274734B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Abstract

The invention discloses a service process calling method and device based on an Internet of things cloud platform, wherein the method comprises the following steps: when other service processes of the Internet of things cloud platform need to be called, the registration information of the relevant service process can be directly searched in the local global service list information of the equipment end where the service processes are located and written into a configuration file for calling, so that automatic registration and discovery functions of the service are realized, and the problem of configuration adding overhead required to be called by manual operation and maintenance service processes is solved.

Description

Service process calling method and device based on Internet of things cloud platform
Technical Field
The invention relates to the technical field of communication, in particular to a service process calling method and device based on an internet of things cloud platform.
Background
In the scene of the internet of things, massive terminal equipment needs to be accessed to an internet of things cloud platform, a plurality of service processes can be started when the terminal equipment runs, and when the started service processes run and need to call related service processes, the called service processes can be local and can also be on other terminal equipment under the internet of things cloud platform, so that thousands of service processes can run simultaneously under the internet of things cloud platform, and the dependency relationship among the service processes is very complex. For each terminal device, the calling between the service processes is based on the configuration file of the service processes, and when the service processes are started to be connected to the Internet of things cloud platform, relevant operation and maintenance personnel can store the registration information of the service processes in a service deployment table and maintain the registration information. And the operation and maintenance personnel write the IP addresses of the service processes correspondingly called by the service processes into the configuration file according to the service deployment table and the service processes started by the terminal equipment. And when the service process of the terminal equipment calls other service processes, sending a calling request according to the corresponding IP address in the configuration file to realize service process calling.
However, when such service processes based on the configuration file are called, relevant operation and maintenance personnel store the registration information of the service processes in the service deployment table and maintain the service processes, and in the process of writing the IP addresses of the service processes called by the service processes into the configuration file according to the service deployment table and the service processes started by the terminal device, very large labor overhead is brought to operation and maintenance management, the error rate is high, and the stability of the internet of things cloud platform is greatly influenced.
Disclosure of Invention
The invention provides a dynamic registration discovery method of Internet of things micro-services, which solves the problems of labor waste on operation and maintenance management and high error rate caused by configuring service process calling through a configuration file when a huge number of internal service processes are accessed in an Internet of things cloud platform.
In order to solve the technical problem, the invention provides a service process calling method based on an internet of things cloud platform, which specifically comprises the following steps:
according to a first aspect of the invention, a service process calling method based on an internet of things cloud platform is provided, and the method comprises the following steps:
for a server, receiving registration information of a service process reported when an equipment terminal starts the service process under an Internet of things cloud platform, wherein the registration information comprises a service process identifier and an equipment terminal address;
storing the registration information of the service process into global service list information, and indicating all equipment terminals under the cloud platform of the internet of things to synchronously update the local global service list information through first indication information;
and receiving a service process calling request carrying the equipment terminal address sent by the equipment terminal according to the local global service list information, and calling the service process according to the equipment terminal address carried by the service process calling request.
For an equipment end, reporting registration information of a service process to a server end when the service process is started, wherein the registration information comprises a service process identifier and an equipment end address;
receiving first indication information of a server side, and updating local global service list information to enable the local global service list information to be consistent with the global service list information of the server side;
and sending a service process calling request carrying the equipment terminal address according to the local global service list information so that the server terminal carries out process calling according to the equipment terminal address carried by the service process calling request.
According to a second aspect of the present invention, there is provided a service process invoking device based on an internet of things cloud platform, including:
for the server side, the method comprises the following steps:
the device comprises a registration information receiving unit, a service process starting unit and a service process starting unit, wherein the registration information receiving unit is used for receiving registration information of the service process reported when a device terminal starts the service process under the cloud platform of the Internet of things, and the registration information comprises a service process identifier and a device terminal address;
the first indication sending unit is used for storing the registration information of the service process into global service list information and indicating all equipment terminals under the cloud platform of the Internet of things to synchronously update the local global service list information through the first indication information;
and the service process calling unit is used for receiving a service process calling request which is sent by the equipment terminal according to the local global service list information and carries the equipment terminal address, and calling the service process according to the equipment terminal address carried by the service process calling request.
For the equipment side, the method comprises the following steps:
the service process starting unit is used for reporting the registration information of the service process to a server end when the service process is started, wherein the registration information comprises a service process identifier and an equipment end address;
the first indication receiving unit is used for receiving first indication information of the server side and updating the local global service list information so as to enable the local global service list information to be consistent with the global service list information of the server side;
and the service process calling request unit is used for sending a service process calling request carrying the equipment terminal address according to the local global service list information so as to enable the server terminal to carry out process calling according to the equipment terminal address carried by the service process calling request.
Compared with the prior art, the dynamic registration and discovery method of the Internet of things microservice provided by the invention has the following beneficial effects:
1. under the Internet of things cloud platform, each service process automatically uploads registration information to a server side and acquires registration information of other service processes when being started, and when the service processes call other service processes, the equipment side address of the called service process is directly searched from the local global service list information and calling is realized, so that the consumption of operation and maintenance manpower required when the service processes call target addresses is saved;
2. the method of the invention increases the calling success rate of the service process, and when the traditional service process is called, the configuration file is required to be manually modified by operation and maintenance personnel, and errors are easy to occur in the process of manually modifying the configuration file.
Drawings
Fig. 1 is a schematic diagram of a service process calling method based on an internet of things cloud platform according to an embodiment of the present invention;
fig. 2 is a schematic diagram of service process invocation according to a second embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a server-side service process invocation provided by a third embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a device side service process invocation provided by a third embodiment of the present invention;
fig. 5 is a device diagram of a service process invoking device based on an internet of things cloud platform according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
The first embodiment is as follows:
the invention provides a service process calling method based on an internet of things cloud platform, wherein the internet of things cloud platform comprises a server end and an equipment end, the embodiment describes a specific embodiment of the service process calling method based on the internet of things cloud platform from the perspective of matching of the server end and the equipment end, and as shown in fig. 1, the specific service process calling process comprises the following steps:
step 110, when any equipment terminal of the internet of things cloud platform starts a service process, reporting registration information of the started service process to a server terminal, wherein the registration information comprises a service process identifier and an equipment terminal address;
in an optional implementation, the device side starts a service process, may start multiple service processes simultaneously, or may start one service process, and when multiple service processes are started, the registration information of the started multiple service processes is reported simultaneously.
The registration information includes a service process identifier and an equipment end address, the service process identifier is used for uniquely identifying the service process, and the equipment end address is used for uniquely identifying an equipment end where the service process is located.
Step 120, a server receives registration information of a service process reported when a device side starts the service process under the cloud platform of the internet of things, wherein the registration information comprises a service process identifier and a device side address;
as an optional implementation manner, when receiving registration information of a service process reported when a device side starts the service process under an internet of things cloud platform, a server side receives registration information of the service process respectively reported when different device sides start the same service process under the internet of things cloud platform.
Step 130, the server side stores the registration information of the service process into global service list information, and instructs all equipment sides under the internet of things cloud platform to synchronously update the local global service list information through first indication information;
optionally, the server may store the registration information of the service process in global service list information in a service discovery storage database, etc, where the service discovery storage database, etc, is a key-value storage repository and is used for configuration sharing and service discovery.
Optionally, when the server indicates, through the first indication information, that all the device sides in the internet of things cloud platform update the local global service list information synchronously:
in the optional specific implementation process, for a device end which starts a service process, a server end sends first indication information carrying global service list information to indicate the device end to locally store registration information of all service processes in the global service list information;
in an optional embodiment, for the device end that starts a service process and has only one service process, the global service list information carried by the first indication information does not include registration information of the service process; for the device end with more than one service process for starting the service process, the global service list information carried by the first indication information contains the registration information of all the service processes;
in a specific implementation process that can be selected, for a device side except for a device side that starts a service process under the internet of things cloud platform, when a server side receives registration information reported by the service process, the server side stores the registration information in a service discovery storage database (ETCD) and creates a credit trigger event carrying the registration information of the started service process, and the server side notifies the device side except for the device side that starts the service process through the credit trigger event, and adds the registration information of the started service process in local global service list information. That is, when a certain service process is started, first indication information is detected in all other service processes on the internet of things cloud platform, and registration information of the started service process is added to the equipment end where the service process is respectively located.
Step 140, any device side of the internet of things platform receives the first indication information of the server side, and updates the local global service list information of the device side, so that the local global service list information is consistent with the global service list information of the server side;
optionally, in a specific implementation process, for an equipment end that starts a service process, receiving first indication information that is sent by a server end and carries the global service list information, and locally storing registration information of all service processes in the global service list information at the equipment end, that is, enabling the service process to report the registration information to the server end when starting, and apply for and obtain registration information of other service processes from the server end;
in a specific implementation process, for a device side except for a device side for starting a service process under the internet of things cloud platform, a credit trigger event which is sent by a server side and carries registration information of the started service process is received, and the registration information of the started service process is added to local global service list information according to the registration information of the started service process carried by the credit trigger event.
Step 150, any device side of the internet of things platform sends a service process calling request carrying a device side address according to the local global service list information, so that the server side carries out service process calling according to the device side address carried by the service process calling request;
optionally, any device side of the internet of things platform searches all device side addresses consistent with the service process identifier of the called service process in the local global service list information according to the service process identifier of the called service process, and selects any one of the device side addresses to write into a configuration file of the service process called by the device side for the service process;
executing the configuration file, and sending a service process calling request carrying the equipment end address to a server end;
as an optional implementation manner, the called service process may be placed at different device ends, in this case, the called service process having the same service process identifier has multiple different device ends, and when the called service process is called, if the called service process of a certain device end is abnormal and cannot be called or global service list information stored by the ETCD is damaged, the called service processes of other device ends may still be called, thereby effectively solving the single point load problem, ensuring that the called service process may be correctly called, and greatly improving the success rate of calling the service process.
And step 160, the server receives the service process calling request sent by the device side, and calls the service process according to the device side address carried by the service process calling request.
In the service process calling method based on the cloud platform of the internet of things, the device end stores the global service list information in the local, when the service process is called, the device end where the service process is located searches the device end address of the called service process from the local global service list information according to the service process identification of the called service process, automatically writes the device end address into the configuration file of the called service process, executes the configuration file, sends the service process calling request to the server end, and carries out correct service process calling, so that the waste of manually modifying the configuration file when the service is called based on the configuration file is solved.
In the process of calling the service process, the global service list information is automatically searched, and the equipment terminal address of the called service process is automatically written into the configuration file, so that the accuracy of calling the service process is improved.
In the process of calling the service process, the address of the equipment end of the service process of the internet of things cloud platform changes in some scenes, for example, when the equipment end where the service process is located is disconnected from the internet of things cloud platform due to re-registration or failure, an IP address is re-allocated, and the IP address of the service process on the equipment end changes. In this case, if a service process needs to be called, an operation and maintenance person needs to query a new address of the device side, and needs to manually modify the device side address of the called service process in a configuration file of the service process, and this way of manually modifying the configuration file brings a very large manpower overhead to operation and maintenance management, and has a high error rate, thereby greatly affecting the stability of the internet of things cloud platform.
In an optional implementation case, based on the content of the first embodiment, the registration information of the service process, which is reported when the device side starts the service process, is used as a possible optional implementation manner when the registration information includes the service process identifier and the device side address. Step 121, the equipment end which starts the service process sets a reporting period at intervals to report the state information of the started service process;
the state information is used for reporting the state of the started service process to the server side, the specific form and the carried content of the state information are not limited too much, and a person skilled in the art can set the state information according to actual requirements, wherein in an optional case, the state information in the embodiment is heartbeat;
the heartbeat sets a very small data packet sent to the server side for the started service process in a reporting period, and the server side judges whether communication links among the server side and the server side are disconnected or not through the data packet;
the set reporting period is not limited too much, and the set reporting period in this embodiment is a time interval of 1 time/20 milliseconds, which can be set by a person skilled in the art according to actual requirements.
Step 131, when the server receives the state information reported by the device, determines that the state information of any service process in the global service list information exceeds a set time and is not reported, deleting the registration information corresponding to the service process from the global service list information, and indicating all the device terminals under the internet of things cloud platform to synchronously update the local global service list information through second indication information;
the setting time is not particularly limited, and can be set by a person skilled in the art according to actual requirements;
in an optional real-time situation, the second indication information may be a credit update event carrying registration information of a service process with a lost heartbeat;
when the equipment end of the service process is in a power-off phenomenon and the address of the equipment end is changed, the address of the equipment end of the service process of the equipment end is changed, the corresponding state information is lost, and when the server end does not detect the heartbeat information within the set time, the registration information of the service process corresponding to the heartbeat information is deleted from the global service list; and creating a Creat update event carrying registration information of the service process with lost heartbeat information, and indicating the equipment terminal where other service processes on the Internet of things cloud platform are located to update local global service list information.
Step 141, when any device side of the internet of things platform receives the second indication information sent by the server side after deleting the registration information of the service process in the global service list, deleting the registration information of the corresponding service process in the local global service list information.
When any equipment end connected to the Internet of things cloud platform exits the Internet of things cloud platform due to network failure to re-log in the platform, or the equipment end fails to restart the login platform, or a user actively logs out the platform and then re-logs in the platform, the equipment end address of the service process of the equipment end is changed, and at the moment, the registration information of the service process of the equipment end needs to be deleted so as to be called by other service processes correctly.
Step 151, when other service processes of the internet of things cloud platform detect a credit update event carrying heartbeat loss, updating global service list information at the equipment end where the service processes are located, and deleting registration information of the service processes corresponding to the heartbeat;
the method in the embodiment also solves the problem of single-point load balancing, the same service process is respectively placed at different equipment ends, and when global service list information stored by the ETCD or global service information locally maintained by a certain service process is damaged, correct calling of other service processes can still be realized.
The following is an optional implementation of the above implementation of the correct invocation of other service processes:
in this embodiment, taking an example that after the device side where the service process 2 is located is restarted, the service process 3 calls the service process 2, a calling process of the service process after the device side address of the service process on the internet of things cloud platform changes is described.
In this embodiment, 3 identical service processes 2 are selected to be stored in different device ends, i.e., the device end 1, the device end 2 and the device end 3, the service process identifiers of the 3 service processes 2 are identical and are all the service processes 2, but the device end addresses are different, and the device end addresses of the service processes 2 in the device end 1, the device end 2 and the device end 3 are 192.168.1.119,192.168.2.34 and 192.168.3.25, respectively; the equipment end 4 runs the service process 3, and when the local service process is started, the equipment end 1, the equipment end 2, the equipment end 3 and the equipment end 4 report the registration information of the started service process to the server end, and the server end stores the received registration information of the service process in a global service list and synchronously updates all local service lists of each equipment end; the service processes 2 and 3 distributed on the device side 1, the device side 2 and the device side 3 and the service processes 3 on the device side 4 are started to maintain periodic heartbeat.
When the service process 3 stored on the device end 4 needs to call the service process 2, at this time, the device end 1 is powered off and restarted, and is reconnected to the internet of things cloud platform after being restarted, and the specific process of calling the service process 2 by the service process 3 stored on the device end 4 is as follows:
1) when the server determines that the heartbeat corresponding to the service process 2 stored on the equipment end 1 exceeds the set time and is not reported, the server deletes the registration information corresponding to the service process 2 stored on the equipment end 1 in the ETCD from the global service list;
when the device end 1 is shut down, the service process 2 stored on the device end 1 stops running and stops refreshing heartbeat information, at this time, the server end cannot detect the heartbeat information corresponding to the service process 2, the registration information corresponding to the service process 2 is deleted in a global service list maintained by the server end, namely, the deleted server end address 192.168.1.119 and the service process identification information corresponding to the deleted server end address are deleted, and a Creat update event is sent to indicate the device end where other service processes are located to update the global service list information;
2) the device end 4, the device end 2 and the device end 3 under the internet of things cloud platform detect a credit update event respectively, learn that the heartbeat corresponding to the service process 2 on the device end 1 is lost, and delete the registration information of the service process 2 stored on the device end 1 in the local global service list information of the respective device ends respectively, that is, delete the address 192.168.1.119 of the service end and the identification information of the service process corresponding to the address.
3) The device side 1 restarts the assigned new device side address 192.168.1.122, and when the service process 2 is started, registration information of the service process 2 of the device side 1 is reported to the server side, wherein the registration information comprises a device side address 192.168.1.122 and a service process identification service process 2 corresponding to the device side address 192.168.1.122;
4) the server side adds the registration information reported after the restart of the equipment side 1 to the global service list information, and sends a corresponding Creat trigger event to indicate the equipment side where other service processes are located to update the global service list information;
5) the device end 4 where the service process 3 under the platform is located detects the credit trigger event, and updates the new registration information of the service process 2 stored on the device end 1 into the local global service list information;
6) when the service process 3 on the device side 4 calls the service process 2, firstly, the device side 4 searches device side addresses of corresponding registration information of all the service processes 2 of the platform in the locally updated global service list information according to the service process identifier of the service 2;
the searched device side addresses are 192.168.1.122,192.168.2.34 and 192.168.3.25;
7) the equipment terminal 4 where the service process 3 is located selects any searched equipment terminal address to write into the corresponding position of the configuration file, executes the configuration file, and realizes calling of the service process 2;
in this embodiment, if the service process 2 stored in the device 1 is not reconnected after being offline, the service process 3 on the device 4 can still find the device addresses 192.168.2.34 and 192.168.3.25 of the available service process 2 in the local global service list when calling the service process 2, select any one of the service addresses to write in the configuration file, execute the configuration file to call the service process 2, and effectively solve the efficiency of calling the single-point deployment service process.
Example two:
in this embodiment, an ETCD service registration discovery center is provided in an Internet of things platform, where functions of the ETCD service registration discovery center are implemented by a server, each service process is started and reports registration information to the ETCD service registration discovery center, global service list information of registration information of all other service processes is simultaneously stored according to an instruction of the ETCD service registration discovery center, the global service list information is stored in a local cache of a device end where the started service process is located, and when other service processes need to be called, an device end address of the called service process is searched from the global service list information stored by the device end and is requested to be called, in this embodiment, a service process 1 is taken as an example, see fig. 2, and optional specific implementation steps are as follows:
step 210, starting a service process 1 of an equipment end, reporting registration information of the service process 1 to an ETCD service registration discovery center, and maintaining a heartbeat at a set interval time;
when the service process 1 is started, firstly, connection is established with an ETCD service registration discovery center, and own registration information is sent to the ETCD service registration discovery center, wherein the registration information comprises a service process identifier of the service process 1 and an equipment terminal address of the service process 1;
meanwhile, the service process 1 maintains heartbeat which is consistent with the ETCD service registration discovery center at a time interval of 1 time/20 milliseconds, the heartbeat regularly sends a very small data packet to the service registration discovery center for the service process, whether communication links among the service process and the service process are disconnected or not is judged through the reply of the ETCD service registration discovery center, and the heartbeat of the service process 1 is guaranteed to be refreshed again within the TTL time (survival time) of the ETCD service registration discovery center;
in this embodiment, a plurality of service processes 1 at different device ends may simultaneously initiate registration with the etc service registration discovery center as a highly available solution.
Step 220, the ETCD service registration discovery center reports the state of the service process 1 according to the registration information and the heartbeat, and instructs all equipment terminals to synchronously update the global service list when determining that the global service list needs to be updated;
the ETCD service registration discovery center receives registration information of a service process 1 reported when the service process is started, stores the registration information of the service process 1 into global service list information of the ETCD service registration discovery center, and indicates all equipment terminals under the Internet of things cloud platform to synchronously update the local global service list information through first indication information;
in the specific implementation process, for the equipment end where the service process 1 is located, the server end sends first indication information carrying registration information of other service processes (service processes 2,3 and 4) of the internet of things cloud platform, and notifies the equipment end to locally store global service list information;
for the device side where other service processes (service processes 2,3,4) than the service process 1 in the internet of things cloud platform are located, in this embodiment, when the ETCD service registration discovery center detects a registration heartbeat sent by the service 1, the ETCD service registration discovery center generates a Create trigger event corresponding to the service process 1, and the ETCD service registration discovery center instructs, according to the Create trigger event, the other service processes (service processes 2,3,4) in the internet of things cloud platform to store the registration information of the service process 1 in the global service list information of the device side where the other service processes are located.
When the ETCD service registration discovery center detects that the heartbeat corresponding to the service process 1 is lost, the ETCD service registration discovery center deletes the registration information of the service process 1 from the global service list information, and instructs all equipment terminals under the Internet of things cloud platform to synchronously update the local global service list information through a Creat update event;
in this embodiment, when the ETCD service registration detects that the heartbeat corresponding to the service process 1 is lost, the ETCD service registration discovery center generates a Create update event corresponding to the service process 1 with the lost heartbeat;
and the ETCD service registration discovery center instructs other service processes (service processes 2,3 and 4) of the Internet of things cloud platform to delete the registration information of the service process 1 with the lost heartbeat from respective local global service list information at the respective equipment end according to the Creat updating event.
Step 230, synchronously updating the locally cached global service list information by all the equipment terminals of the internet of things cloud platform according to the indication of the ETCD service registration discovery center;
for the equipment end where the service process 1 is located, receiving first indication information of a server end, and synchronizing global service list information of an ETCD service registration discovery center to a local cache;
for the device side where other service processes (service processes 2,3 and 4) of the internet of things cloud platform are located, detecting a Creat trigger event, and respectively adding registration information of the service process 1 in respective local global service list information;
all the equipment terminals update the local global service list information according to the received Creat update event so as to enable the local global service list information to be consistent with the global service list information of the server terminal;
all equipment terminals of the Internet of things cloud platform detect a Creat update event, and respectively delete the registration information of the service process 1 lost by heartbeat in respective local global service list information;
step 240, when the service process 2 calls the service process 1, the device side where the service process 2 is located sends a service process calling request carrying the device side address of the service process 1 to the ETCD service registration discovery center through the service process 2 according to the local global service list information;
the device side where the service process 2 is located searches for device side addresses of all available service processes 1 corresponding to the service process identifiers of the service process 1 in the local global service list information according to the service process 2, selects any one of the device side addresses, and writes the selected device side address into the configuration file of the service process 2;
executing the configuration file of the service process 2, and sending a service process calling request carrying the equipment terminal address to the ETCD service registration discovery center;
and step 250, the ETCD service registration discovery center receives the service process calling request, and calls the service process 1 according to the equipment terminal address of the service process 1 carried by the service process calling request.
Example three:
the embodiment describes a specific embodiment of a service process calling method based on an internet of things cloud platform from the perspective of a server side and an equipment side, and the specific service process calling process is as follows:
in the first aspect of this embodiment, for a service process invoking process at a server side, referring to fig. 3, specific steps are as follows:
step 3110, receiving registration information of a service process reported when a device side starts the service process under the internet of things cloud platform, wherein the registration information includes a service process identifier and a device side address;
optionally, after receiving a service process started by a device side under the cloud platform of the internet of things, reporting state information of the service process at intervals of a set reporting period, wherein the state information comprises the service process identifier and a device side address;
in an optional embodiment, when it is determined that the state information of any service process in the global service list information is not reported after exceeding a set time, the registration information corresponding to the service process is deleted from the global service list information;
in an optional embodiment, the second indication information indicates that all the device terminals in the internet of things cloud platform update local global service list information synchronously.
In an optional specific embodiment, the registration information of the service process is stored in the global service list information in the service discovery storage database, etc.
Optionally, the method further includes receiving registration information of the service processes respectively reported when different device terminals start the same service process under the internet of things cloud platform.
Step 3120, storing the registration information of the service process into global service list information, and indicating all the device terminals under the internet of things cloud platform to synchronously update the local global service list information through first indication information;
in a specific optional embodiment, for a device end which starts a service process, the device end is indicated by first indication information to locally store registration information of all service processes in global service list information;
and for the equipment terminals except the equipment terminal for starting the service process under the cloud platform of the Internet of things, indicating the registration information of the newly added service process in the locally stored global service list information of the equipment terminal through the first indication information.
Step 3130, receiving a service process call request carrying an equipment end address sent by the equipment end according to the local global service list information, and calling the service process according to the equipment end address carried by the service process call request.
In an optional specific implementation manner, for a service process calling process at a server side, refer to the steps related to the server side in the first embodiment.
In the second aspect of this embodiment, for the service process invoking procedure at the device side, referring to fig. 4, the specific steps are as follows:
step 3210, reporting registration information of the service process to a server when the service process is started, where the registration information includes a service process identifier and an equipment address;
optionally, after the service process is started, reporting state information of the service process at an interval set reporting period, where the state information includes the service process identifier and the device side address.
Step 3220, receiving the first indication information of the server, and updating the local global service list information to make the local global service list information consistent with the global service list information of the server;
in an optional specific embodiment, it is determined that the registration information of the service process carried by the first indication information is not in the local global service list information, and the registration information of the service process carried by the first indication information is added to the local global service list information;
and determining that the registration information of the service process carried by the first indication information is in the local global service list information, and updating the registration information of the service process carried by the first indication information into the local global service list information.
Optionally, when second indication information sent after the server side deletes the registration information of the service process in the global service list is received, deleting the registration information of the corresponding service process in the local global service list information.
Step 3230, sending a service process call request carrying the device side address according to the local global service list information, so that the server side performs process call according to the device side address carried by the service process call request.
In an optional specific embodiment, according to a service process identifier of an invoked service process carried by the service process invocation request, all device side addresses corresponding to the service process identifier of the invoked service process are searched in global service list information;
selecting any equipment terminal address corresponding to the service process identifier of the called service process and writing the equipment terminal address into a configuration file of the service process;
and sending a service process calling request carrying the equipment terminal address to a server terminal by executing the configuration file.
In an optional specific implementation manner, for a service process calling procedure of the device side, refer to the steps related to the device side in the first embodiment.
Example four:
the invention provides a service process calling device based on an internet of things cloud platform, as shown in fig. 5, comprising:
for the server side, the method comprises the following steps:
the registration information receiving unit 410 is configured to receive registration information of a service process reported when a device terminal 510 starts the service process on the internet of things cloud platform, where the registration information includes a service process identifier and a device terminal address;
in an optional specific embodiment, the method further includes reporting status information of the service process at an interval set reporting period after receiving that the device side starts the service process on the internet of things cloud platform, where the status information includes the service process identifier and the device side address.
The first indication sending unit 420 is configured to store the registration information of the service process into global service list information, and indicate, through first indication information, all device sides in the internet of things cloud platform to synchronously update the local global service list information;
in an optional specific embodiment, the registration information of the service process is stored in global service list information in a service discovery storage database, etc;
in an optional specific embodiment, for a device end which starts a service process, the device end is indicated by first indication information to locally store registration information of all service processes in global service list information;
for the equipment terminals except the equipment terminal for starting the service process under the Internet of things cloud platform, the registration information of the service process newly added in the global service list information stored locally by the equipment terminal is indicated through the first indication information.
Optional specific implementation, further including:
the second indication sending unit 430 is configured to report state information of the service process at an interval set reporting period after receiving a service process started by the device side on the internet of things cloud platform, where the state information includes the service process identifier and the device side address.
The service process calling unit 440 is configured to receive a service process calling request carrying an equipment end address sent by the equipment end according to the local global service list information, and call a service process according to the equipment end address carried by the service process calling request;
when determining that the state information of any service process in the global service list information is not reported after the set time is exceeded, deleting the registration information corresponding to the service process from the global service list information;
indicating all equipment terminals under the cloud platform of the Internet of things to synchronously update local global service list information through second indication information;
in an optional specific embodiment, registration information of the service processes respectively reported when different device terminals start the same service process under the internet of things cloud platform is received.
For the equipment side, the method comprises the following steps:
a service process starting unit 450, configured to report registration information of the service process to the server 520 when the service process is started, where the registration information includes a service process identifier and an equipment address;
optionally, the system further includes a periodic reporting status information unit 490, configured to report status information of the service process at an interval set reporting period after the service process is started, where the status information includes the service process identifier and the device side address.
A first indication receiving unit 460, which receives the first indication information of the server, and updates the local global service list information to make the local global service list information consistent with the global service list information of the server;
in an optional specific embodiment, it is determined that the registration information of the service process carried by the first indication information is not in the local global service list information, and the registration information of the service process carried by the first indication information is added to the local global service list information;
and determining that the registration information of the service process carried by the first indication information is in the local global service list information, and updating the registration information of the service process carried by the first indication information into the local global service list information.
Optionally, the method further comprises: the second indication receiving unit 470 deletes the registration information of the corresponding service process in the local global service list information when receiving the second indication information sent after the server deletes the registration information of the service process in the global service list.
A service process call request unit 480, which sends a service process call request carrying an equipment terminal address according to the local global service list information, so that the server terminal carries out process call according to the equipment terminal address carried by the service process call request;
in an optional specific embodiment, according to a service process identifier of a called service process carried by the service process calling request, all device end addresses corresponding to the service process identifier of the called service process are searched in the global service list information;
selecting any equipment terminal address corresponding to the service process identifier of the called service process and writing the equipment terminal address into a configuration file of the service process;
and sending a service process calling request carrying the equipment end address to a server end by executing the configuration file.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (12)

1. A service process calling method based on an Internet of things cloud platform is characterized by comprising the following steps:
receiving registration information of a service process reported when a device side starts the service process under an Internet of things cloud platform, wherein the registration information comprises a service process identifier and a device side address;
storing the registration information of the service process into global service list information, and indicating all equipment terminals under the cloud platform of the Internet of things to synchronously update the local global service list information through first indication information;
receiving a service process calling request carrying an equipment end address sent by an equipment end according to local global service list information, and calling the service process according to the equipment end address carried by the service process calling request;
the method further comprises the following steps:
after an equipment terminal starts a service process under an Internet of things cloud platform, reporting state information of the service process at intervals of a set reporting period, wherein the state information comprises a service process identifier and an equipment terminal address;
when determining that the state information of any service process in the global service list information is not reported after the set time is exceeded, deleting the registration information corresponding to the service process from the global service list information;
indicating all equipment terminals under the cloud platform of the Internet of things to synchronously update local global service list information through second indication information;
the second indication information is a Creat update event carrying registration information of the service process, the state information of which is not reported after exceeding a set time;
the service process calling request is sent by the equipment terminal in the following way:
searching all equipment terminal addresses corresponding to the service process identification of the called service process in the global service list information according to the service process identification of the called service process carried by the service process calling request; selecting any equipment terminal address corresponding to the service process identifier of the called service process and writing the equipment terminal address into a configuration file of the service process; and sending a service process calling request carrying the equipment terminal address to a server terminal by executing the configuration file.
2. The method of claim 1, wherein saving registration information for the service process to global service list information comprises:
and storing the registration information of the service process into global service list information in a service discovery storage database (ETCD).
3. The method of claim 1, wherein the step of instructing, through the first indication information, all device sides under the internet of things cloud platform to synchronously update local global service list information includes:
for a device end which starts a service process, indicating the device end to locally store the registration information of all service processes in the global service list information through first indication information;
and for the equipment terminals except the equipment terminal for starting the service process under the cloud platform of the Internet of things, indicating the registration information of the newly added service process in the locally stored global service list information of the equipment terminal through the first indication information.
4. The method of claim 1, wherein receiving registration information of the service process reported when a device side starts the service process under the cloud platform of the internet of things comprises:
and receiving registration information of the service processes respectively reported when different equipment terminals start the same service process under the cloud platform of the Internet of things.
5. A service process calling method based on an Internet of things cloud platform is characterized by comprising the following steps:
when a service process is started, reporting registration information of the service process to a server side, wherein the registration information comprises a service process identifier and an equipment side address;
receiving first indication information of a server side, and updating local global service list information to enable the local global service list information to be consistent with the global service list information of the server side; the global service list information of the server side comprises registration information of a service process reported when a device side starts the service process under the cloud platform of the Internet of things;
sending a service process calling request carrying an equipment terminal address according to the local global service list information so that the server terminal carries out process calling according to the equipment terminal address carried by the service process calling request;
after a service process is started, reporting state information of the service process at an interval set reporting period, wherein the state information comprises a service process identifier and an equipment terminal address;
when second indication information sent after the server side deletes the registration information of the service process in the global service list is received, deleting the registration information of the corresponding service process in the local global service list information;
the second indication information is a Creat update event carrying registration information of the service process, the state information of which is not reported after exceeding a set time;
the method for sending the service process call request carrying the equipment terminal address according to the local global service list information comprises the following steps:
searching all equipment terminal addresses corresponding to the service process identification of the called service process in the global service list information according to the service process identification of the called service process carried by the service process calling request;
selecting any equipment terminal address corresponding to the service process identifier of the called service process and writing the equipment terminal address into a configuration file of the service process;
and sending a service process calling request carrying the equipment terminal address to a server terminal by executing the configuration file.
6. The method of claim 5, wherein receiving first indication information of the server side, and updating the local global service list information comprises:
determining that the registration information of the service process carried by the first indication information is not in the local global service list information, and adding the registration information of the service process carried by the first indication information to the local global service list information;
and determining that the registration information of the service process carried by the first indication information is in the local global service list information, and updating the registration information of the service process carried by the first indication information into the local global service list information.
7. The utility model provides a device that service process called based on thing networking cloud platform which characterized in that includes:
the device comprises a registration information receiving unit, a service process starting unit and a service process judging unit, wherein the registration information receiving unit is used for receiving registration information of the service process reported when a device terminal starts the service process under the cloud platform of the Internet of things, and the registration information comprises a service process identifier and a device terminal address;
the first indication sending unit is used for storing the registration information of the service process into global service list information and indicating all equipment terminals under the cloud platform of the internet of things to synchronously update the local global service list information through the first indication information;
the service process calling unit is used for receiving a service process calling request which is sent by the equipment terminal according to the local global service list information and carries the equipment terminal address, and calling the service process according to the equipment terminal address carried by the service process calling request;
the second indication sending unit is used for receiving state information reported by the service process at intervals of a set reporting period after the equipment terminal starts the service process under the cloud platform of the internet of things, wherein the state information comprises the service process identifier and the equipment terminal address;
when determining that the state information of any service process in the global service list information is not reported after the set time is exceeded, deleting the registration information corresponding to the service process from the global service list information;
indicating all equipment terminals under the cloud platform of the Internet of things to synchronously update local global service list information through second indication information;
the second indication information is a Creat update event carrying registration information of the service process, the state information of which is not reported after exceeding a set time;
the service process calling request is sent by the equipment terminal in the following way:
searching all equipment terminal addresses corresponding to the service process identification of the called service process in the global service list information according to the service process identification of the called service process carried by the service process calling request; selecting any equipment terminal address corresponding to the service process identifier of the called service process and writing the equipment terminal address into a configuration file of the service process; and sending a service process calling request carrying the equipment terminal address to a server terminal by executing the configuration file.
8. The apparatus of claim 7, wherein the first indication sending unit to save the registration information of the service process to global service list information comprises:
and storing the registration information of the service process into global service list information in a service discovery storage database (ETCD).
9. The apparatus of claim 7, wherein the first indication sending unit indicates, through the first indication information, that all device sides in the internet of things cloud platform update local global service list information synchronously, and includes:
for a device end which starts a service process, indicating the device end to locally store the registration information of all service processes in the global service list information through first indication information;
and for the equipment terminals except the equipment terminal for starting the service process under the cloud platform of the Internet of things, indicating the registration information of the newly added service process in the locally stored global service list information of the equipment terminal through the first indication information.
10. The apparatus of claim 7, wherein the service process invoking unit receives registration information of a service process reported when a device side starts the service process under an internet of things cloud platform, and the registration information includes:
and receiving registration information of the service processes respectively reported when different equipment terminals start the same service process under the cloud platform of the Internet of things.
11. A device for calling service processes based on an Internet of things cloud platform is characterized by comprising
The service process starting unit is used for reporting the registration information of the service process to the server when the service process is started, wherein the registration information comprises a service process identifier and an equipment terminal address;
the first indication receiving unit is used for receiving first indication information of the server side and updating the local global service list information so as to enable the local global service list information to be consistent with the global service list information of the server side; the global service list information of the server side comprises registration information of a service process reported when a device side starts the service process under the cloud platform of the Internet of things;
the service process calling request unit is used for sending a service process calling request carrying an equipment terminal address according to the local global service list information so as to enable the server terminal to carry out process calling according to the equipment terminal address carried by the service process calling request;
a periodic reporting state information unit, configured to report state information of a service process at an interval set reporting period after the service process is started, where the state information includes the service process identifier and an equipment terminal address;
the second indication receiving unit is used for deleting the registration information of the corresponding service process in the local global service list information when receiving the second indication information sent by the server after deleting the registration information of the service process in the global service list;
the second indication information is a Creat update event carrying registration information of the service process, the state information of which is not reported after exceeding a set time;
the service process calling request unit sends a service process calling request carrying an equipment terminal address according to the local global service list information, and the service process calling request unit comprises the following steps:
searching all equipment terminal addresses corresponding to the service process identification of the called service process in the global service list information according to the service process identification of the called service process carried by the service process calling request;
selecting any equipment terminal address corresponding to the service process identifier of the called service process and writing the equipment terminal address into a configuration file of the service process;
and sending a service process calling request carrying the equipment terminal address to a server terminal by executing the configuration file.
12. The apparatus of claim 11, wherein the first indication receiving unit receives first indication information of a server side, and updates local global service list information, and includes:
determining that the registration information of the service process carried by the first indication information is not in the local global service list information, and adding the registration information of the service process carried by the first indication information to the local global service list information;
and determining that the registration information of the service process carried by the first indication information is in the local global service list information, and updating the registration information of the service process carried by the first indication information into the local global service list information.
CN201811043164.7A 2018-09-07 2018-09-07 Service process calling method and device based on Internet of things cloud platform Active CN109274734B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811043164.7A CN109274734B (en) 2018-09-07 2018-09-07 Service process calling method and device based on Internet of things cloud platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811043164.7A CN109274734B (en) 2018-09-07 2018-09-07 Service process calling method and device based on Internet of things cloud platform

Publications (2)

Publication Number Publication Date
CN109274734A CN109274734A (en) 2019-01-25
CN109274734B true CN109274734B (en) 2021-10-15

Family

ID=65188726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811043164.7A Active CN109274734B (en) 2018-09-07 2018-09-07 Service process calling method and device based on Internet of things cloud platform

Country Status (1)

Country Link
CN (1) CN109274734B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955460B (en) * 2019-11-15 2023-10-03 北京金山云网络技术有限公司 Service process starting method and device, electronic equipment and storage medium
CN113296967A (en) * 2020-02-21 2021-08-24 西安诺瓦星云科技股份有限公司 Process management method, device and system based on embedded operating system
CN112671913B (en) * 2020-12-25 2022-11-08 珠海金山数字网络科技有限公司 Service registration method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101686244A (en) * 2008-09-23 2010-03-31 阿里巴巴集团控股有限公司 Method and system for transmitting service information
CN105515759A (en) * 2015-11-27 2016-04-20 国网信息通信产业集团有限公司 Micro service registration method and micro service registration system
CN105872110A (en) * 2016-06-17 2016-08-17 深圳纽博时代科技有限公司 Cloud platform service management method and cloud platform service management device
CN106941508A (en) * 2016-01-05 2017-07-11 阿里巴巴集团控股有限公司 Service calling method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101686244A (en) * 2008-09-23 2010-03-31 阿里巴巴集团控股有限公司 Method and system for transmitting service information
CN105515759A (en) * 2015-11-27 2016-04-20 国网信息通信产业集团有限公司 Micro service registration method and micro service registration system
CN106941508A (en) * 2016-01-05 2017-07-11 阿里巴巴集团控股有限公司 Service calling method, device and system
CN105872110A (en) * 2016-06-17 2016-08-17 深圳纽博时代科技有限公司 Cloud platform service management method and cloud platform service management device

Also Published As

Publication number Publication date
CN109274734A (en) 2019-01-25

Similar Documents

Publication Publication Date Title
CN105099988B (en) Method, access method and device and system for supporting gray scale to issue
CN109274734B (en) Service process calling method and device based on Internet of things cloud platform
WO2020147331A1 (en) Micro-service monitoring method and system
CN110611603B (en) Cluster network card monitoring method and device
US9594801B2 (en) Systems and methods for allocating work for various types of services among nodes in a distributed computing system
WO2019153488A1 (en) Service configuration management method, apparatus, storage medium and server
CN107357571B (en) Maintenance method and system for equipment component program
KR20140055489A (en) Distributed database managing method and composition node thereof supporting dynamic sharding based on the metadata and data transaction quantity
CN108183971B (en) Node election method in distributed system
CN107231400B (en) Data synchronization method and device
WO2014067254A1 (en) Method, device and database system for detecting database data consistency
CN104301990B (en) A kind of method and device of data syn-chronization
CN105450682A (en) Method, device, and system for data synchronous storage and synchronizing data to client
CN104954482A (en) Configuration management system and method
CN111352716B (en) Task request method, device and system based on big data and storage medium
CN110213359B (en) Internet of vehicles networking data pushing system and method based on D2D
CN110275793B (en) Detection method and equipment for MongoDB data fragment cluster
CN115048188A (en) Network isolation control system and method for container, electronic device and storage medium
CN113535262B (en) Proxy node start control method, device, equipment and storage medium
CN105323271B (en) Cloud computing system and processing method and device thereof
US10387887B2 (en) Bloom filter driven data synchronization
CN104536785A (en) Method and device for updating real-time system
CN112069152A (en) Database cluster upgrading method, device, equipment and storage medium
CN116346834A (en) Session synchronization method, device, computing equipment and computer storage medium
CN114201458B (en) Information updating method, micro-service system and computer readable storage medium

Legal Events

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