CN115473809B - Configuration processing method and device based on micro-service architecture and storage medium - Google Patents

Configuration processing method and device based on micro-service architecture and storage medium Download PDF

Info

Publication number
CN115473809B
CN115473809B CN202211036075.6A CN202211036075A CN115473809B CN 115473809 B CN115473809 B CN 115473809B CN 202211036075 A CN202211036075 A CN 202211036075A CN 115473809 B CN115473809 B CN 115473809B
Authority
CN
China
Prior art keywords
micro
service application
configuration file
service
cloud server
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
CN202211036075.6A
Other languages
Chinese (zh)
Other versions
CN115473809A (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.)
Shenzhen Kaidisi Intelligent Technology Co ltd
Original Assignee
Shenzhen Kaidisi Intelligent Technology Co ltd
Filing date
Publication date
Application filed by Shenzhen Kaidisi Intelligent Technology Co ltd filed Critical Shenzhen Kaidisi Intelligent Technology Co ltd
Priority to CN202211036075.6A priority Critical patent/CN115473809B/en
Publication of CN115473809A publication Critical patent/CN115473809A/en
Application granted granted Critical
Publication of CN115473809B publication Critical patent/CN115473809B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the application discloses a configuration processing method, a device and a storage medium based on a micro-service architecture, which are used for determining that a first micro-service application needs to be updated, wherein the first micro-service application is one micro-service application of at least two micro-service applications configured for a first device, the first micro-service application and the second micro-service application are respectively configured for the first device and the second device, the first micro-service application and the second micro-service application belong to the micro-service application updated in the same batch, and in any batch of micro-service applications updated, the first device and the second device only have one micro-service application; the configuration processing method can enable the micro-service application on the intelligent furniture equipment to update the configuration file under the condition of ensuring the normal operation of the equipment.

Description

Configuration processing method and device based on micro-service architecture and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a storage medium for processing configuration based on a micro-service architecture.
Background
Along with the continuous progress of science and technology, the intelligent furniture has been a trend, it has not only changed the use mode of original furniture household electrical appliances, has brought convenience for the user more, along with the development of software architecture gradually evolves into distributed, micro-serviceization, single system can split into a plurality of micro-services, every micro-service has own configuration, corresponds to on the intelligent furniture equipment, every intelligent furniture equipment has a plurality of micro-service application to support self normal operation, but with the increasing complexity of software system and the frequent change of user's demand, the update of micro-service application is also more frequent.
The micro-service configuration update in the related art is to suspend the original micro-service application in the running equipment and then load the latest configuration file to the original micro-service application, so that the micro-service application is in a stopped state in the update process.
In the field of intelligent furniture, the micro-service application is in a stop state due to configuration updating, so that the equipment cannot be used normally, and experience of a user can be greatly damaged no matter how long or short, so that how to enable the micro-service application on the intelligent furniture equipment to perform configuration updating under the condition of ensuring normal operation of the equipment is a problem to be solved by a person skilled in the art.
Disclosure of Invention
The embodiment of the application provides a configuration processing method, a configuration processing device and a storage medium based on a micro-service architecture, which can enable micro-service application on intelligent furniture equipment to update a configuration file under the condition of ensuring normal operation of the equipment.
In a first aspect, an embodiment of the present application provides a configuration processing method based on a micro-service architecture, where the method is applied to a cloud server, and the cloud server is used for managing and issuing configuration files of a plurality of micro-service applications, and the method includes:
Determining that a first micro-service application needs to be updated, wherein the first micro-service application is one micro-service application of at least two micro-service applications configured for a first device, the plurality of micro-service applications comprise the first micro-service application and a second micro-service application, the first micro-service application and the second micro-service application are respectively configured on the first device and the second device, the first micro-service application and the second micro-service application belong to the micro-service application updated in the same batch, and in any micro-service application updated in any batch, the first device and the second device only have one micro-service application;
and sending the latest configuration file to the first micro-service application.
In particular, in the internet micro-service scenario, application services are increasingly complex, and various types of configuration information are contained in the program: middleware configuration, framework configuration, application configuration, black and white lists, gray switches, etc. In the prior art, the micro-service configuration update is realized by suspending the original micro-service application in the running equipment, loading the latest configuration file to the original micro-service application, and refreshing the configuration after loading is finished, wherein the micro-service application can be normally used, especially when updating a large version; in the field of intelligent furniture, normal operation of one device is supported by a plurality of micro-service applications, and intermediaries exist among the plurality of micro-service applications, so that the micro-service applications are loosely coupled, on the basis, if one micro-service application performs large-version updating, only the micro-service application in the one device needs to perform restarting refreshing configuration, normal operation of the device is not affected, but if a plurality of micro-service applications in the one device perform updating, the situation that the micro-service applications restart refreshing configuration simultaneously can occur, and finally the device cannot normally operate is caused. In other fields, equipment cannot normally run in a short time, and the experience of a user can not be influenced, but in the field of intelligent furniture, intelligent furniture equipment is closely related to the life of the user, for example, when the user uses fingerprints to unlock a door, the door cannot be opened, or when the user washes out clothes and uses an intelligent clothes hanger, the clothes hanger cannot be normally started or retracted, and the experience of the user can be seriously influenced only once.
In the scheme, the configuration files of the plurality of micro-service applications in the managed equipment are centrally managed through the cloud server, namely one or more configuration centers, the configuration files are managed and issued through the cloud server, a technician is not required to manually deploy the configuration files, and thermal updating can be achieved.
Further, in this solution, a first micro-service application and a second micro-service application are mentioned, where the first micro-service application and the second micro-service application belong to different intelligent furniture devices, and the first micro-service application and the second micro-service application belong to a same lot of micro-service applications that need to be updated, which represent the situation that when the micro-service application performs configuration updating, a plurality of micro-service applications in a plurality of devices are updated at the same time, but in any micro-service application that performs updating in a batch, the first device and the second device only perform updating in one micro-service application, which also represent that the micro-service applications in the same device do not simultaneously appear in the same lot, for example, the plurality of micro-service applications in the first device need to be updated, and only after the configuration file of the first micro-service application is updated, the other micro-service applications in the first device need to be updated need to update the service applications do not perform the updating in the same lot, which can avoid that the micro-service applications do not perform the configuration updating in the same batch, and the micro-service applications can not perform normal operation.
Further, in the process of updating the micro-service application, the cloud server sends the latest configuration file of the first micro-service application, wherein the latest configuration file comprises configuration file content and identification information of the configuration file, and the identification information comprises a name space, a group, a configuration file name, a configuration format, configuration file content, a configuration description, a version number and an MD5 value.
With reference to the first aspect, in an optional implementation manner, the determining that the first micro service application needs to be updated includes:
Receiving a request message from the first micro service application, wherein the request message is used for requesting the identification information of the latest configuration file of the first micro service application;
transmitting identification information of the configuration file, wherein the identification information comprises a version number and an MD5 value, and the version number and the MD5 value are used for determining whether the configuration file backed up by the first micro-service application comprises the latest configuration file or not;
A configuration update request is received from the first micro service application.
Specifically, the method and the device check whether the configuration file is updated or not in a long polling mode, so that hot update can be realized, in the process, the first device cannot know whether the configuration file is updated or not, so that the cloud server is required to receive the identification information of the latest configuration file of the first micro-service application, the request information is used for requesting the identification information of the latest configuration file of the first micro-service application, the cloud server identifies the identification information after receiving the identification information, the source of the identification information is determined, the source comprises the device type and the micro-service type, but the cloud server cannot acquire the configuration file use state of the first device, the request information does not contain the identification information of the configuration file used by the first device, the cloud server only needs to send the identification information of the latest configuration file consistent with the source of the identification information to the first device, the configuration file is the configuration file which is newly increased or changed in a preset time, thus the blocking thread is avoided, the service management of the cloud server is more processed, the number of the configuration file is more huge, and the cloud server can save a lot of the cloud server can be saved to a certain extent.
After the cloud server sends the identification information of the configuration file, in an optional implementation manner, under the condition that the threads are sufficient, a main thread which takes over the identification information of the configuration file temporarily suspends the configuration file with the latest version number corresponding to the identification information, waits for a response from the first micro-service application, namely waits for a configuration update request from the first micro-service application, and when receiving the response from the first device, the main thread can return the configuration file to the first device at the first time, so that the waste of time is reduced; in another alternative embodiment, in case of insufficient threads, the main thread taking over the identification information of the profile directly ends the task.
When the first device completes the identification work and determines that the identification information of the configuration file sent by the cloud server belongs to the latest configuration file, the first micro-service application sends a configuration update request to the cloud server, and when the cloud server receives the configuration update request, the cloud server performs the step of sending the latest configuration file to the first micro-service application in order to determine that the first micro-service application needs to be updated.
With reference to the first aspect, in an optional aspect, after the receiving the request message from the first micro service application, before the sending the identification information of the configuration file, the method includes:
Establishing communication connection with the first micro-service application, and suspending the request message within a preset time limit;
And if the configuration file of the first micro service application is updated, executing the step of sending the identification information of the configuration file.
Specifically, in this solution, after receiving a request message from the first micro service application, the cloud server suspends the request message, waits for configuration update, and then responds to the request message.
However, the processing mode of suspending the request message by using a common long polling mode and responding after waiting for new data update can reduce the request times of the first micro-service application and bring instantaneity, but if the processing mode of synchronously processing the request is used, after the request message arrives at the cloud server, a thread is acquired from a main thread pool, the service is processed, the request is responded, then the thread is returned to the thread pool, the whole process is executed by the same main thread, the suspending request represents the blocking of the main thread, and how many long polling requests do not respond represents how many main threads need to be blocked, so the long polling must use an asynchronous processing mode, the main thread is prevented from being consumed after a large number of requests are received, and the new request message cannot be processed.
Therefore, in the method, the main thread can transfer the request to other threads for processing, such as a developer self-defining one thread, then the main thread transfers the request message to the self-defining thread, the main thread recovers, the request is processed in the self-defining thread, the isolation of a thread pool is realized, and the blocking of the main thread is avoided, so that the problem that the cloud server cannot respond in time when the number of the request messages is large is avoided.
And when the configuration file corresponding to the first micro-service application is updated within the preset time limit, responding to the request message, namely, the cloud server sends the identification information of the configuration file to the first micro-service application.
With reference to the first aspect, in an alternative aspect, the method further includes:
And if the configuration file of the first micro-service application is not updated, disconnecting the cloud server from the first micro-service application after a preset time limit is reached.
Specifically, in the scheme, the configuration file of the first micro service application is not updated, that is, the configuration file of the first micro service application is not newly added or changed within a preset time, and after a preset time limit is reached, the cloud server is disconnected from communication with the first micro service application, but the preset time is not too short in consideration of factors of network fluctuation, and optionally, the preset time is 30 seconds, so that the request times are reduced, thread waste is avoided, and the configuration file can be updated timely.
With reference to the first aspect, in an optional implementation manner, the determining that the first micro service needs to be updated includes:
Receiving a subscription request from the first microservice application;
determining that a configuration file of the first micro-service application has been updated.
In particular, in the present solution, a method of issuing a configuration file by using a message queue is used to implement hot update, but in the related art, a frequently used method in the current micro service architecture scenario is a message bus, where the message bus is applied to a micro service architecture system, a lightweight message agent is generally used to construct a common message theme, and all micro service instances in the system are connected, and a message generated in the theme is monitored and consumed by all instances, so that the message is called a message queue. The method comprises the steps that all examples on a bus can conveniently broadcast messages which need to be known by other examples connected to the theme, but the carrying capacity and throughput of the messages are insufficient to bear huge message quantity generated by a plurality of micro-service applications of intelligent furniture equipment, the peak value of throughput of message queue middleware is quite large, and the messages are more suitable for being used in the field of intelligent furniture.
Therefore, the cloud server should firstly receive the subscription request from the micro service application, configure the micro service application to subscribe the theme related to the configuration file of the micro service application, and when the configuration file of the micro service application is determined to be updated, send the configuration file to the message queue middleware for message queue release, so that the coupling between the cloud server and the micro service application is released or weakened, and the effects of asynchronous processing and flow peak clipping can be achieved.
With reference to the first aspect, in an optional implementation manner, the identification information of the configuration file further includes a device identification of a first device where the first micro service application is located.
Specifically, in this solution, because the identification information of the configuration file not only includes the cloud server, but also includes the device identification of the first device where the first micro service application is located, where the device identification is used to identify, when the number of devices associated with the cloud server is large, the device to which the configuration file belongs, where it is worth mentioning that the identification information in the backed-up configuration file of the first micro service application is only used to determine whether the backed-up configuration file is the latest configuration file, and the identification information of the configuration file at the cloud server also includes other information such as a name space, a group, and a configuration file name, which is convenient for managing the configuration file and classifying the configuration file.
With reference to the first aspect, in an optional solution, the cloud server is configured to manage configuration files of all micro-service applications in the docked device, so as to avoid exposing sensitive information in source code.
The number of configuration files is very large, so that in order to facilitate management, the configuration files of all micro service applications are placed on the cloud server, and the cloud server also takes on the responsibility of sending changed or newly added configuration files.
Specifically, all configuration files may have 3 attributes, namely: namespaces, groups and configuration file names, so that in the configuration management function design, the namespaces need to be managed, in the scheme, the namespaces have multiple functions such as adding, editing, deleting, details, lists, statistics and the like, responsibilities can be cleared, disorder of microservice management is avoided, and in the configuration file management, multiple functions such as configuration file changing, adding, editing, cloning, rollback, examples and the like can be executed
When the configuration file is changed, the content is snapshot, and a version number, a recording date and an MD5 value are generated and stored. The configuration history of a certain configuration can be checked in the background of the cloud server. When a configuration file is added, a namespace, a group, a configuration file name, a configuration format (such as TEXT/JSON/XML/YAML/TOML/Properties), a configuration file content, and a configuration description must be filled in, so that the configuration file can be classified, and subsequent management is facilitated.
When changing or adding the configuration file of the micro service application, the configuration file information of the micro service application with strong correlation can be cloned, then the designated naming space and the designated group lower part which need to be cloned are selected, and the adaptation modification is carried out.
When the configuration file is rolled back, the content of the configuration file with the appointed historical version number is used as the latest configuration file, the version number is the latest version number, but the content of the configuration file is consistent with the content of the configuration file with the appointed historical version number.
In a second aspect, an embodiment of the present application provides a configuration processing method based on a micro-service architecture, where the method is applied to a first device, and the cloud server is configured to manage and issue configuration files of a plurality of micro-service applications, and the method includes:
The method comprises the steps that a first device receives a configuration file of a first micro-service application sent by a cloud server, wherein the cloud server is used for managing configuration files of a plurality of micro-service applications, the plurality of micro-service applications comprise a first micro-service application and a second micro-service application, and the first micro-service application and the second micro-service application are respectively configured on the first device and the second device; the first micro-service application is one of at least two micro-service applications configured by the first device;
The first device configures the first micro-service application according to the configuration file.
Specifically, the configuration file received by the first device includes the configuration file itself and identification information of the configuration file, the identification information of the configuration file includes a name space, a group and a configuration file name, and the first device places the configuration file at a specific position according to the name space and the group to replace the original configuration file.
The first equipment is locally provided with a backup library, the backup library is used for storing the existing configuration files of the first equipment, when the configuration files reach the local equipment, the configuration files are backed up immediately and stored in the backup library, and under the condition that the equipment is restarted, such as a machine refreshing and factory setting restoring, the first equipment can normally operate by operating the configuration files in the backup library.
With reference to the second aspect, in an optional aspect, before the first device receives the configuration file of the first micro service application sent by the cloud server, the method further includes:
Determining that the backed-up configuration file exists in the first micro-service application;
sending the request message to the cloud server, wherein the request message is used for requesting the identification information of the latest configuration file of the first micro-service application, and the identification information comprises a version number and an MD5 value;
receiving identification information of the latest configuration file of the first microservice application sent by the cloud server;
comparing the identification information of the configuration file sent by the cloud server with the identification information of the backed-up configuration file to determine whether the backed-up configuration file of the first micro service is the latest configuration file;
And if the backed-up configuration file of the first microservice application is not the latest configuration file, sending a configuration update request to the cloud server.
Specifically, in the above method, the backup of all the configuration files of the previous application exists locally in the first microservice application, and the backup of the configuration files is the backed up configuration files, where the backed up configuration files include identification information of the configuration files, the identification information includes a version number and an MD5 value, the version number and the MD5 value are used to determine whether the configuration files backed up by the first microservice are the latest configuration files, but it is desired to determine whether the configuration files backed up by the first microservice application are the latest configuration files through the version number and the MD5 value, so after determining that the backed up configuration files exist in the first microservice application, the request message is sent to the cloud server, where the request message is used to request the latest identification information of the configuration files of the first microservice application, where the first device is provided with at least one htment connection pool, although the first microservice application is not connected to the first microservice application, and the first microservice application can still be prevented from being blocked by the first microservice application or other microservices, and the first microservices can still be prevented from being connected to other devices, and the other microservices can still be prevented from being requested from being blocked by the other microservices.
After the first micro service application receives the identification information sent by the cloud server, the identification information sent by the cloud server is compared with the identification information of the backed-up configuration file, if the comparison is inconsistent, the update of the configuration file existing in the first micro service application is indicated, and after the configuration file is determined to need to be updated, the first micro service application sends a configuration update request to the cloud server.
With reference to the second aspect, in an optional aspect, before the first device receives the configuration file of the first micro service application sent by the cloud server, the method further includes:
And the first equipment sends a subscription request of the configuration file of the first micro-service application to the cloud server.
Specifically, the method is implemented by adopting a message queue middleware, in the method, the first micro-service application sends a subscription request of a configuration file of the first micro-service application to the cloud server to request for subscribing related topics of the configuration file, the cloud server configures the first micro-service application to subscribe the topics of the configuration file corresponding to the first micro-service application after receiving the subscription request of the first micro-service application, and when the configuration file of the first micro-service application changes, the related configuration file is pushed to the middleware and then to a subscriber, so that the coupling between the cloud server and the micro-service application is released or weakened, and the effects of asynchronous processing and flow peak clipping can be achieved.
In a third aspect, an embodiment of the present application provides a configuration processing device based on a microservice architecture, where the device includes at least a first determining unit and a first sending unit. The configuration processing device is configured to implement the method described in any implementation manner of the first aspect, where the first determining unit and the first sending unit are described as follows:
A first determining unit, configured to determine that a first micro-service application needs to be updated, where the first micro-service application is one micro-service application of at least two micro-service applications configured for a first device, where the plurality of micro-service applications includes the first micro-service application and a second micro-service application, where the first micro-service application and the second micro-service application are respectively configured for the first device and the second device, where the first micro-service application and the second micro-service application belong to the same micro-service application that is updated in a same batch, and where in any micro-service application that is updated in any batch, the first device and the second device each have only one micro-service application;
And the first sending unit is used for sending the latest configuration file of the first micro-service application to the first micro-service application.
In the internet micro-service scenario, application services are increasingly complex, and various types of configuration information are contained in programs: middleware configuration, framework configuration, application configuration, black and white lists, gray switches, etc. In the prior art, the micro-service configuration update is realized by suspending the original micro-service application in the running equipment, loading the latest configuration file to the original micro-service application, and refreshing the configuration after loading is finished, wherein the micro-service application can be normally used, and particularly, the update of a large version is realized; in the field of intelligent furniture, the normal operation of one device is supported by a plurality of micro-service applications, and intermediaries exist among the plurality of micro-service applications, so that the micro-services are loosely coupled; if one micro service application performs large-version updating, only the micro service application needs to be restarted and refreshed in the one device, normal operation of the device is not affected, but if a plurality of micro service applications need to be updated in the one device, the situation that the micro service applications restart and refresh the device simultaneously may occur, and finally the device cannot operate normally. In other fields, equipment cannot normally run in a short time, and the experience of a user can not be influenced, but in the field of intelligent furniture, the equipment is closely related to life of the user, for example, when the user uses a fingerprint to unlock a door, the door cannot be opened, or when the user washes out clothes and uses an intelligent clothes hanger, the clothes hanger cannot be normally started or retracted, and the experience of the user can be seriously influenced only once.
In the scheme, the configuration files of all micro-service applications of the managed equipment are centrally managed through the cloud server, namely one or more configuration centers, and the configuration files are managed and issued through the cloud server without manual deployment of the configuration files by technicians.
Further, the first micro-service application and the second micro-service application belong to different intelligent furniture devices, and the first micro-service application and the second micro-service application belong to the same batch of micro-service applications needing to be updated, when the micro-service application is configured to be updated, the situation that a plurality of micro-service applications in a plurality of devices are updated simultaneously is represented, but in any batch of micro-service applications needing to be updated, only one micro-service application exists in the first device and the second device, and therefore the micro-service applications in the same device are not updated simultaneously, for example, the plurality of micro-service applications in the first device need to be updated, and only after the configuration file of the first micro-service application is updated, other micro-service applications needing to be updated in the first device can be updated, so that the situation that the plurality of micro-service applications in the same device are updated simultaneously is avoided, and the micro-service applications in the same device cannot be updated in the same batch at the same time, and the normal running process of the micro-service applications can not be updated in the running process of the device.
Further, in the process of updating the micro-service application, the cloud server sends the latest configuration file of the first micro-service application, wherein the latest configuration file comprises configuration file content and identification information of the configuration file, and the identification information comprises a name space, a group, a configuration file name, a configuration format, configuration file content, a configuration description, a version number and an MD5 value.
With reference to the third aspect, in an optional aspect, the determining that the first micro service application needs to be updated, the first determining unit is specifically configured to:
Receiving a request message from the first micro service application, wherein the request message is used for requesting the identification information of the latest configuration file of the first micro service application;
Establishing communication connection with the first micro-service application, and suspending the request message within a preset time limit;
If the configuration file of the first micro service application is updated, sending identification information of the configuration file, wherein the identification information comprises a version number and an MD5 value, and the version number and the MD5 value are used for determining whether the backed-up configuration file of the first micro service application comprises the latest configuration file or not;
if the configuration file of the first micro-service application is not updated, disconnecting the cloud server from the first micro-service application after a preset time limit is reached;
A configuration update request is received from the first micro service application.
In the device, whether the configuration file is updated is checked by a long polling mode, so that hot update can be realized, in the process, as the first device cannot know whether the configuration file is updated or not, the cloud server is required to receive the identification information of the latest configuration file of the first micro-service application by the device and actively send a request message, the cloud server identifies the identification information after receiving the identification information, determines the source of the identification information, the source comprises the device type and the micro-service type, but the cloud server cannot acquire the configuration file use state of the first device, and the request message also does not contain the identification information of the configuration file used by the first device, so that the cloud server only needs to send the identification information of the latest configuration file consistent with the source of the identification information to the first device.
After the cloud server sends the identification information of the configuration file, in an optional implementation manner, under the condition that the threads are sufficient, a main thread which takes over the identification information of the configuration file temporarily suspends the configuration file with the latest version number corresponding to the identification information, waits for a response from the first micro-service application, namely waits for a configuration update request from the first micro-service application, and when receiving the response from the first device, the main thread can return the configuration file to the first device at the first time, so that the waste of time is reduced; in another alternative embodiment, in case of insufficient threads, the main thread taking over the identification information of the profile directly ends the task.
When the first device completes the identification work and determines that the identification information of the configuration file sent by the cloud server belongs to the latest configuration file, the first micro-service application sends a configuration update request to the cloud server, and when the cloud server receives the configuration update request, the cloud server performs the step of sending the latest configuration file to the first micro-service application in order to determine that the first micro-service application needs to be updated.
Further, if the configuration file of the first micro service application is not updated, that is, the configuration file of the first micro service application is not newly added or changed within a preset time, the cloud server is disconnected from the communication connection with the first micro service application after reaching a preset time limit, but the preset time is not too short in consideration of factors of network fluctuation, and optionally, the preset time is 30 seconds, and the request times are reduced, so that thread waste is avoided, and the configuration file can be updated timely according to the above process.
With reference to the third aspect, in an optional aspect, the determining that the first micro service application needs to be updated, the first determining unit is specifically configured to:
Receiving a subscription request from the first microservice application;
determining that a configuration file of the first micro-service application has been updated.
In the device, a method of issuing a configuration file by a message queue is specifically adopted to realize hot update, but in the related technology, a message bus is often used in the current micro-service architecture scene, the message bus is applied to a micro-service architecture system, a common message theme is usually constructed by using a lightweight message agent, all micro-service instances in the system are connected, and messages generated in the theme are monitored and consumed by all the instances, so that the message is called a message queue. The method comprises the steps that all examples on a bus can conveniently broadcast messages which need to be known by other examples connected to the theme, but the carrying capacity and throughput of the messages are insufficient to bear huge message quantity of a plurality of micro-service applications in intelligent furniture equipment, the throughput peak value of message queue middleware is quite large, and the messages are more suitable for being used in the intelligent furniture field, so that the hot update is realized by adopting a mode of releasing the message queue in the scheme, and in the process of updating the configuration file by using the message queue, the micro-service applications need to subscribe to the theme related to the configuration file corresponding to the micro-service application, so that the configuration file can be released in time after the configuration file is updated, for example, when the configuration file of the first micro-service application is updated, the micro-service applications subscribed to the theme receive the configuration file, and in the process, the message queue middleware is adopted to realize the isolation of a cloud server and the micro-service application.
Therefore, the cloud server should firstly receive the subscription request from the micro service application, configure the micro service application to subscribe the theme related to the configuration file of the micro service application, and when the configuration file of the micro service application is determined to be updated, send the configuration file to the message queue middleware for message queue release, so that the coupling between the cloud server and the micro service application is released or weakened, and the effects of asynchronous processing and flow peak clipping can be achieved.
In a fourth aspect, an embodiment of the present application provides a configuration using device based on a micro service architecture, where the device includes at least a first receiving unit and a configuration unit. The configuration using means for implementing the method described in any of the embodiments of the second aspect, wherein the first receiving unit and the configuration unit are presented as follows:
The cloud server is used for managing configuration files of a plurality of micro-service applications, wherein the plurality of micro-service applications comprise a first micro-service application and a second micro-service application, and the first micro-service application and the second micro-service application are respectively configured on the first equipment and the second equipment; the first micro-service application is one of at least two micro-service applications configured by the first device;
and the configuration unit is used for configuring the first micro-service application at the first equipment according to the configuration file.
In the device, the configuration file received by the first device comprises the configuration file itself and identification information of the configuration file, the identification information of the configuration file comprises a name space, a group and a configuration file name, and the first device places the configuration file to a specific position according to the name space and the group to replace the original configuration file.
The first equipment is locally provided with a backup library, the backup library is used for storing the existing configuration files of the first equipment, when the configuration files reach the local equipment, the configuration files are backed up immediately and stored in the backup library, and under the condition that the equipment is restarted, such as a machine refreshing and factory setting restoring, the first equipment can normally operate by operating the configuration files in the backup library.
With reference to the fourth aspect, in an optional aspect, the apparatus further includes:
A second determining unit, configured to determine that the backed-up configuration file exists in the first micro service application;
A second sending unit, configured to send the request message to the cloud server, where the request message is used to request identification information of a latest configuration file of the first micro service application, where the identification information includes a version number and an MD5 value;
The second receiving unit is used for receiving the identification information of the latest configuration file of the first micro-service application, which is sent by the cloud server;
the comparison unit is used for comparing the identification information of the configuration file sent by the cloud server with the identification information of the backed-up configuration file so as to determine whether the backed-up configuration file of the first micro service is the latest configuration file;
And the third sending unit is used for sending a configuration update request to the cloud server when the configuration file backed up by the first micro-service application is not the latest configuration file.
In the apparatus, specifically, in the method, the backup of all configuration files of the application exists locally in the first micro service application, and the backup of the configuration files is the backed up configuration files, the backed up configuration files include identification information of the configuration files, the identification information includes a version number and an MD5 value, the version number and the MD5 value are used for determining whether the configuration files backed up by the first micro service are the latest configuration files, but it is to be determined by the version number and the MD5 value whether the configuration files backed up by the first micro service are the latest configuration files or not, so after determining that the configuration files backed up by the first micro service application exist, the request message is sent to the cloud server, the request message is used for requesting the identification information of the latest configuration files of the first micro service application, it is worth explaining that at least one htt-line connection pool is set at the first device, although the first micro service application is not updated with the first micro service application, and the first micro service application can not be updated, but the first micro service application can not be updated by the first micro service application, or the other micro service can not be requested by the first micro service, and the cloud service can not be updated by the first micro service application, and the cloud service can be requested by the other micro service.
After the first micro service application receives the identification information sent by the cloud server, the identification information sent by the cloud server is compared with the identification information of the backed-up configuration file, if the comparison is inconsistent, the update of the configuration file existing in the first micro service application is indicated, and after the configuration file is determined to need to be updated, the first micro service application sends a configuration update request to the cloud server.
With reference to the fourth aspect, in an optional aspect, the apparatus further includes:
and the fourth sending unit is used for sending a subscription request of the configuration file of the first micro-service application to the cloud server.
In the device, the subscription request is realized by adopting a message queue middleware, the first micro-service application sends a subscription request of a configuration file of the first micro-service application to the cloud server to request to subscribe related topics of the configuration file, the cloud server configures the subscription topics of the first micro-service application after receiving the subscription request of the first micro-service application, and when the configuration file of the first micro-service application changes, the related configuration file is pushed to a subscriber, namely the configuration file of the first micro-service application is sent to the first micro-service application, so that the first micro-service application timely updates the configuration file, and the coupling of the cloud server and the micro-service application is released or weakened, thereby achieving the effects of asynchronous processing and flow peak clipping.
In a fifth aspect, an embodiment of the present application provides a cloud server, where the cloud server includes a processor, a memory, and a communication interface; a memory having a computer program stored therein; the communication interface, when executed by a processor, is configured to transmit and/or receive data, and the cloud server may perform the method described in the foregoing first aspect.
The cloud server described in the fifth aspect may include a processor dedicated to performing the methods (referred to as a dedicated processor for convenience of distinction), or may include a processor that executes the methods by calling a computer program, such as a general-purpose processor. In the alternative, the at least one processor may also include both special purpose and general purpose processors.
Alternatively, the above-mentioned computer program may be stored in a memory. The Memory may be a non-transitory (non-transitory) Memory, such as a Read Only Memory (ROM), which may be integrated on the same device as the processor, or may be separately provided on different devices, and the type of the Memory and the manner in which the Memory and the processor are provided are not limited in the embodiments of the present application.
In one possible implementation, the at least one memory is located outside the cloud server.
In yet another possible embodiment, the at least one memory is located within the cloud server.
In yet another possible embodiment, a portion of the at least one memory is located inside the cloud server, and another portion of the at least one memory is located outside the cloud server.
In the present application, the processor and the memory may also be integrated in one device, i.e. the processor and the memory may also be integrated.
In a sixth aspect, an embodiment of the present application provides a first device, the first device including a processor, a memory, and a communication interface; a memory having a computer program stored therein; the communication interface, when executed by a processor, is adapted to transmit and/or receive data, the first device being adapted to perform the method as described in the second aspect.
The processor included in the first device described in the sixth aspect may be a processor dedicated to performing the methods (referred to as a special purpose processor for convenience), or may be a processor that performs the methods by calling a computer program, such as a general purpose processor. In the alternative, the at least one processor may also include both special purpose and general purpose processors.
Alternatively, the above-mentioned computer program may be stored in a memory. The Memory may be a non-transitory (non-transitory) Memory, such as a Read Only Memory (ROM), which may be integrated on the same device as the processor, or may be separately provided on different devices, and the type of the Memory and the manner in which the Memory and the processor are provided are not limited in the embodiments of the present application.
In a possible embodiment, the at least one memory is located outside the first device.
In yet another possible embodiment, the at least one memory is located within the first device.
In yet another possible embodiment, a portion of the at least one memory is located within the first device and another portion of the at least one memory is located outside of the first device.
In the present application, the processor and the memory may also be integrated in one device, i.e. the processor and the memory may also be integrated.
In a seventh aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, which when executed on at least one processor, implements the method described in the first aspect or any of the alternatives of the second aspect or the second aspect.
In an eighth aspect, the present application provides a computer program product comprising a computer program for implementing the method of the first aspect or any of the alternatives of the second aspect when the program is run on at least one processor.
Alternatively, the computer program product may be a software installation package, which may be downloaded and executed on a computing device in case the aforementioned method is required.
The advantages of the technical solutions provided in the fifth to eighth aspects of the present application may refer to the advantages of the technical solutions in the first aspect and the second aspect, and are not described herein.
Drawings
The drawings that are used in the description of the embodiments will be briefly described below.
FIG. 1 is a schematic diagram of a configuration processing system according to an embodiment of the present application;
fig. 2 is a flow chart of a configuration processing method based on a micro service architecture according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for determining updates of a micro service application according to an embodiment of the present application;
FIG. 4 is a flow chart of yet another method for determining micro-service application updates provided by an embodiment of the present application;
FIG. 5 is a flow chart of yet another method for determining micro-service application updates provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a configuration processing device based on a micro-service architecture according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a configuration using device based on a micro service architecture according to an embodiment of the present application;
Fig. 8 is a schematic structural diagram of a cloud server based on a micro-service architecture according to an embodiment of the present application;
Fig. 9 is a schematic structural diagram of a first device based on a micro service architecture according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
The terms "first," "second," "third," and "fourth" and the like in the description and in the claims and drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
The following describes a system architecture to which the embodiments of the present application are applied. It should be noted that, the system architecture and the service scenario described in the present application are for more clearly describing the technical solution of the present application, and do not constitute a limitation on the technical solution provided by the present application, and those skilled in the art can know that, with the evolution of the system architecture and the appearance of the new service scenario, the technical solution provided by the present application is applicable to similar technical problems.
Referring to fig. 1, fig. 1 is a schematic architecture diagram of a configuration processing system according to an embodiment of the present application, where the system includes a cloud server 101, a first device 102, and a second device 103, and the configuration processing system includes:
The cloud server 101 may be a server or a server cluster formed by a plurality of servers, and is used for managing configuration files of the first device 102 and the second device 103, where the cloud server 101 can establish communication connection with a plurality of devices, so that information related to the configuration files can be received and sent, and optionally, the cloud server 101 is used as a configuration management center, and an administrator can perform various operations such as changing, adding, editing, cloning, backing up, rollback, and example of the configuration files in the cloud server 101, so as to implement centralized management of the configuration files; optionally, a main thread pool and a custom thread pool are set in the cloud server 101, and the main thread pool can transfer the received message to the custom thread pool for processing, so as to avoid the blockage of the main thread when a large number of request messages exist; optionally, the above data persistence is performed in MySQL database, and the Redis cache technology is adopted, so that the performance of the configuration center is improved, the MySQL database supports multiple storage engines, and provides a multi-version concurrency control mechanism and transactions, so that the MySQL database can not only meet different application scenarios, but also ensure the security of the database, and the MySQL database separates query processing and other system tasks and data storage and extraction, and the design of the storage engine architecture can select a data storage mode according to performance, characteristics and other requirements when in use, so that the structured data in the MySQL storage platform is used in an optional embodiment; further, the cloud server 101 needs to implement a cache service, because Memcached supports only one data structure, while rediss supports multiple data structures, the workload can be greatly reduced, and the Redis uses a single thread mode to process requests and store data in a memory, and the access speed to the memory is far greater than the access speed to a disk, so that the Redis is selected as the implementation of the cache in one possible implementation.
The first device 102 may be intelligent furniture such as an intelligent clothes-horse, an intelligent freezer, an intelligent fingerprint burglary-resisting door, etc., and a plurality of micro-service applications exist in the first device 102, and support the first device 102 to realize the intelligent furniture, but in the process of realizing the intelligent furniture, the unavoidable first device 102 needs to be networked, so in the use process of the intelligent furniture, the connection between the first device 102 and the cloud server 101 is required to be established through a local area network or a 4G or 5G network in the home, and when the configuration file of any micro-service application in the first device 102 needs to be updated, the latest configuration file of the corresponding micro-service application can be obtained in an active or passive mode; optionally, the first device 102 may include a message middleware, specifically, since the first device 102 uses multiple micro services to implement different service functions, and messaging is involved between services, and since smart furniture is more and more currently, and it is very important for the smart furniture to respond to the speed of the user, a specific message middleware needs to be used to implement a huge information throughput in the above process; optionally, the first device 102 is provided with a backup repository, where a backed up configuration file is stored in the backup repository, and the backed up configuration file is a historical configuration file of all micro-service applications in the first device 102.
The second device 103 may be other devices except the first device 102 in intelligent furniture such as an intelligent clothes-horse, an intelligent freezer, an intelligent fingerprint burglary-resisting door, and a plurality of micro-service applications exist in the second device 103, and the plurality of micro-service applications support the second device 103 to realize the intellectualization of the furniture. However, in the process of realizing the intelligent furniture, the unavoidable second device 103 needs to be networked, so that in the process of using the intelligent furniture, a connection with the cloud server 101 needs to be established through a local area network or a 4G or 5G network in the home, but the process needs to use a specific message middleware, and weak coupling or decoupling between the intelligent furniture and the cloud server can be realized through the message middleware; optionally, the second device 103 is provided with a backup repository, where a backed up configuration file is stored in the backup repository, and the backed up configuration file is a historical configuration file of all micro-service applications in the second device 103.
Referring to fig. 2, fig. 2 is a flow chart of a configuration processing method based on a micro service architecture according to an embodiment of the present application, where the configuration processing method may be implemented based on the system architecture shown in fig. 1, or may be implemented based on other architectures, and the method includes, but is not limited to, the following steps:
Step S201: the cloud server determines that the first microservice application needs to be updated.
Specifically, centralized management is achieved on configuration files of a plurality of micro-service applications in the managed equipment through a cloud server, the cloud server can set a plurality of configuration centers, the configuration files are managed and issued through the cloud server, a technician does not need to manually issue the configuration files, the plurality of micro-service applications comprise a first micro-service application and a second micro-service application, and the first micro-service application and the second micro-service application are respectively configured on the first equipment and the second equipment; the first micro-service application is one micro-service application in at least two micro-service applications configured for the first device, the first micro-service application and the second micro-service application belong to the same batch of micro-service applications updated, and only one micro-service application exists in the first device and the second device in any batch of micro-service applications updated; the first device is one of intelligent furniture such as an intelligent fingerprint door lock, an intelligent clothes hanger, an intelligent curtain or an intelligent switch, and the second device is the other of intelligent furniture such as an intelligent fingerprint door lock, an intelligent clothes hanger, an intelligent curtain or an intelligent switch, but it is noted that more than two devices which belong to the same batch for updating may exist, and the situation that micro-services on more devices are applied to the same batch for updating may also exist.
In a possible implementation manner, the cloud server updates the managed part of the micro service applications once every preset time, wherein the part of the micro service applications are in the same batch; since it is necessary to avoid simultaneous update of micro service applications in the same device, the last batch of micro service applications must be updated before the next batch of configuration updates starts, so the preset time may be set to exceed the time required for a single update of the micro service applications.
In yet another possible implementation, the cloud server may set the time to issue the configuration file of the micro service application, so as to avoid the situation that the micro service application in the same device is updated simultaneously.
In yet another possible implementation, the tasks requested to be updated from each device form a queue according to the time sequence when the devices request, in the queue, the front N micro service applications consider that a batch can be updated simultaneously, but if one device has multiple tasks appearing in the front N bits according to the time sequence, after the non-first task is forward to the nth bit, the tasks originally arranged in the front N bits are forward to ensure that the tasks in the front N bits all come from different devices, where N can be set according to actual needs, for example, the front 20 micro service applications consider that a batch.
Further, in the embodiment of the present application, the micro service applications updated in the same batch should belong to different devices, but in the embodiment of the present application, the micro service applications of the same device cannot be updated in one batch at the same time, for example, when the configuration file of the first micro service application in the first device is updated, other micro service applications of the first device cannot be updated, so that the situation that the device cannot operate normally due to simultaneous updating of multiple micro service applications of the same device is avoided.
Optionally, a main thread pool is provided in the cloud server, where the main thread pool includes a plurality of main threads, when configuration files of a plurality of micro service applications need to be updated, a situation that the plurality of micro service applications are updated simultaneously may exist, and one main thread is responsible for an update task of the configuration file of one micro service application, so as to relieve load pressure.
Step S202: the cloud server sends a configuration file of the first micro-service application to the first device.
Specifically, the cloud server sends a latest configuration file of the first microservice application, wherein the latest configuration file comprises configuration file content and identification information of the configuration file, and the identification information comprises a name space, a group, a configuration file name, a configuration format, configuration file content, a configuration description, a version number of the configuration file and an MD5 value of the configuration file.
In one possible implementation manner, the cloud server determines that a plurality of micro-service applications of the same device have configuration files changed or updated, in which case, the cloud server determines an update sequence of the micro-service applications according to a dependency relationship between the plurality of micro-service applications in the device, that is, the micro-service applications in the same device do not appear in the same batch at the same time to update.
In another possible implementation manner, the second micro service application of the second device also needs to update the configuration file, and the cloud server sends the configuration file of the first micro service application to the first device and simultaneously sends the configuration file of the second micro service to the second device.
Step S203: the first device receives a configuration file of a first micro-service application from a cloud server.
Step S204: the first device configures a first micro-service application according to the configuration file.
The first device places the configuration file of the first micro-service application at a specific address through the identification information of the configuration file of the first micro-service application, replaces the original configuration file of the first micro-service application, edits the replaced configuration file into a backed-up configuration file, and places the backed-up configuration file into a backup library, wherein the original configuration file is backed up, and after the latest configuration file is received by the first micro-service application of the first device, in a possible implementation mode, the first micro-service application refreshes the configuration in the running process to realize thermal update; in another possible implementation, the first micro-service application restarts the refresh configuration, but does not affect the normal operation of the device.
In yet another possible implementation manner, in a case that the first device is restarted, such as a flashing operation, and a factory setting restoration, the first device enables the device to operate normally by running the configuration file in the backup repository.
In the embodiment of the application, the micro-service applications updated in the same batch belong to different devices, wherein the different devices comprise a first device and a second device, and the micro-service applications of the same device cannot be updated in the same batch in the embodiment of the application, for example, when the configuration file of the first micro-service application in the first device is updated, other micro-service applications of the first device cannot be updated, so that the situation that the device cannot normally run due to the simultaneous updating of a plurality of micro-service applications of the same device is avoided; and a main thread pool is arranged in the cloud server, and the main thread pool is used for processing the request message and other messages from the different devices and relieving load pressure.
In the embodiment of the present application, there are various ways in which the cloud server determines that the first microservice application needs to be updated, and the following is illustrated:
In a first manner, fig. 3 and fig. 4 illustrate two cases in a method for determining update of a micro service application, and fig. 3 mainly explains a case that a configuration file of a first micro service application has update within a preset time limit, specifically as follows:
Step 301: the first device determines that the backed-up configuration file exists for the first micro-service application.
Specifically, a backup library is arranged in the first device, and backed-up configuration files corresponding to the first micro-service application are stored in the backup library, wherein the backed-up configuration files comprise file contents and identification information of the backed-up configuration files; the identification information includes a version number and an MD5 value, and since the first device cannot determine whether the configuration file is up to date, the first device needs to determine whether the configuration file backed up by the first micro service is up to date through the version number and the MD5 value, and needs to determine to the cloud server.
Step 302: the first device sends a request message to the cloud server.
Specifically, the request message is used to request the identifier information of the latest configuration file of the first micro service application, which is worth to say that, considering that the micro service application in the first device may send the request message at the same time, avoiding thread congestion, at least one httplient connection pool is set at the first device, where the httplient connection pool is used for the micro service application in the first device to send the request message or other requests to the cloud server, in this embodiment, optionally, the data exchange between the cloud server and the micro service in the first device is performed in a closed internal environment, such as a cluster intranet, and an SDK (software development kit) is set at the first device, where a thread pool is set, and related information about the configuration file of the first micro service application in the first device is sent to the cloud server at a fixed time (for example, the first device sends the request message to the cloud server, requests the latest configuration file of the micro service application to the cloud server), and a failure mode may occur when a failure measure is normally established in the first device, and a failure measure is normally performed. By sending the request message multiple times, when there is an update of the configuration file, the cloud server can timely respond to the request of the first micro service application.
Step S303: the cloud server receives a request message from a first device.
Step S304: the cloud server suspends the request message within a preset time limit.
Specifically, after receiving a request message from the first micro-service application, the cloud server suspends the request message, and as the cloud server can respond to the request message at any time, suspending the request message is to establish communication connection, and optionally, after updating the configuration corresponding to the first micro-service application on the cloud server within a preset time limit, the cloud server responds to the request message; optionally, the configuration corresponding to the first micro-service application on the cloud server is not updated within a preset time limit, and after the cloud server exceeds the preset time limit, the cloud server responds to the request message and sends a configuration file corresponding to the first micro-service application with the latest current version number; optionally, when the configuration file corresponding to the first micro service application is not updated all the time within the preset time limit, the request message is not responded, and the next request message of the first micro service application is waited.
In this embodiment, the cloud server is provided with a custom thread pool, after receiving the request message, the main thread may forward the request message to the custom thread for processing, and the main thread recovers, where the custom thread suspends the request message, and in a possible implementation, on the basis of using the custom thread, a separate daemon thread or listener is used to monitor a response event queue, for example: the configuration file is updated and packaged into response events to be placed in a response event queue, a daemon thread is used for monitoring the queue, response event objects in the queue are acquired in a blocking mode, and a custom thread pool is called for processing.
Further, in the preset time limit, when the configuration file corresponding to the first micro service application is updated, responding to the request message, namely sending identification information of the configuration file corresponding to the first micro service application, after the first micro service application determines that the configuration file needs to be updated, sending a configuration update request to the cloud server by the first micro service application, and when the cloud server receives the configuration update request, determining that the first micro service application needs to be updated.
Step S305: the cloud server determines that the configuration file of the first micro-service application has an update.
Specifically, within a preset time limit, the cloud server determines that a technician modifies or updates the configuration file of the first micro-service application on the cloud server, but the cloud server cannot actively send the configuration file to the first micro-service application in the current link, if the configuration file needs to be sent to the first micro-service application, the first micro-service application in the first device actively requests the corresponding configuration file, and the first micro-service application verifies itself, so that the dual insurance effect is achieved, and therefore, the update of the configuration file needs to be verified locally in the first micro-service application.
Step S306: and the cloud server sends the identification information of the configuration file to the first device.
Specifically, the cloud server sends identification information of the latest configuration file of the first micro service application to the first device, wherein the identification information comprises a version number and an MD5 value.
Step S307: the first device receives identification information of a configuration file from a cloud server.
Step S308: the first device compares the identification information of the configuration file sent by the cloud server with the identification information of the backed-up configuration file.
After the first micro service application receives the identification information sent by the cloud server, comparing the identification information sent by the cloud server with the identification information of the backed-up configuration file, namely comparing the version number sent by the cloud server with the version number of the backed-up configuration file, comparing the MD5 value sent by the cloud server with the MD5 value of the backed-up configuration file, and when the two values are inconsistent, indicating that the backed-up configuration file of the first micro service application does not have the backup of the configuration file sent by the cloud server, and indicating that the first micro service application needs to update the configuration file; and when the two are consistent, the backed-up configuration file of the first micro service application is backed up by the configuration file sent by the cloud server, which indicates that the first micro service application does not need to update the configuration file.
Step S309: the first device determines that the backed up configuration file is not the most current configuration file.
In this embodiment, the comparison determines that the backed up configuration file of the first micro service application does not have the backup of the configuration file sent by the cloud server, which represents that the first micro service application needs to update the configuration file.
Step S310: the first device sends a configuration update request to the cloud server.
And the first equipment actively sends a configuration update request to the cloud server, wherein the configuration update request is used for requesting the cloud server for the latest configuration file of the first micro-service application.
Step S311: the cloud server receives a configuration update request from a first device.
Fig. 4 mainly illustrates a case where there is no update in the configuration file of the first micro service application within a preset time period, which is specifically as follows:
Step S41: the first device determines that the backed-up configuration file exists for the first micro-service application.
Step S42: the first device sends a request message to the cloud server.
Step S43: the cloud server receives a request message from a first device.
Step S44: the cloud server suspends the request message within a preset time limit.
Step S45: and when the preset time limit is exceeded, the communication connection is disconnected.
Specifically, the cloud server does not detect that the configuration file of the first micro service application is updated within a preset time limit, disconnects the communication with the first device, and in a possible implementation manner, the cloud server does not respond to the request message, and after the preset time limit is reached, the connection is automatically disconnected; in another possible implementation, the cloud server feeds back a status code to the first device indicating no update.
In one possible implementation manner, there may be further a step of judging whether an update process exists in the configuration file of the first micro service application within a preset time limit, the cloud server may perform self-checking after suspending the request message, and detect whether the configuration file of the first micro service application has editing or changing of the configuration file or version number during the suspension period, that is, within the preset time limit, if the configuration file or version number of the first micro service application has editing or changing within the preset time limit, the identification information of the configuration file is returned to the first device, and if the configuration file or version number of the first micro service application does not have editing or changing within the preset time limit, the task suspending the request message is directly suspended without returning the identification information. Optionally, the configuration corresponding to the first micro service application on the cloud server is not updated within a preset time limit, and after the cloud server exceeds the preset time limit, the cloud server responds to the request message and sends the configuration file corresponding to the first micro service application with the latest current version number.
In the embodiment of the application, the cloud server sends the configuration file in a passive mode, namely the configuration file is sent after receiving the configuration update request, so that the cloud server is more suitable for the architecture of a cluster intranet or the scene of poor network, the first equipment detects whether the configuration is updated in a long polling mode to achieve the effect of timely updating, the cloud server processes the request message from the equipment by setting a custom thread pool to avoid overlarge load pressure, and the processing mode of suspending the request and waiting for responding after updating the configuration file can reduce the request times from the equipment and bring instantaneity.
The process is a simpler way for the cloud server to keep instant communication with the first device, and does not use any specific protocol, so that the process does not depend on compatibility of external conditions such as browser version or queue message middleware, other dependence is not required to be introduced, and the implementation difficulty is low.
In a second mode, fig. 5 is a flowchart of another method for determining update of a micro service application according to an embodiment of the present application, which specifically includes the following steps:
step S51: the first device sends a subscription request to the cloud server.
Specifically, the first micro-service application sends a subscription request of the configuration file of the first micro-service application to the cloud server, requests to subscribe to a theme related to the configuration file, and when the configuration file of the subscribed micro-service application is updated, the cloud server can find the published object through a subscription list.
Step S52: the cloud server receives a subscription request from a first device.
Step S53: the cloud server configures a first microservice application subscription topic.
Specifically, after the cloud server configures a related theme of the configuration file of the first micro service application subscription, when the configuration file is updated, the cloud server actively sends the configuration file of the first micro service application subscription to a message queue middleware, and then the message queue middleware forwards the configuration file to the first device.
Step S54: the cloud server determines that the configuration file of the first micro-service application has an update.
In the embodiment of the application, the micro service application managed by the cloud server is configured to subscribe to the configuration file theme corresponding to the micro service application, in a possible implementation manner, when the configuration files of a plurality of micro service applications in a first device are changed, the cloud server updates and sorts the plurality of micro service applications according to the dependency relationship of the plurality of micro service applications in the first device, so that the condition that the plurality of micro service applications are updated simultaneously is avoided, for example, after the configuration files of the first micro service application are configured, an updated code is returned to the cloud server, and after the cloud server receives the updated code, the configuration files are sequentially sent to other micro service applications needing to be updated in the first device according to the sequence; optionally, because the message queue middleware may order the messages to be forwarded, the cloud server may send the configuration files to the first micro service application through the message queue middleware, and there may be a certain delay inevitably, so the cloud server may predict the time when the first micro service application configures the corresponding configuration files, and send the configuration files of another micro service application of the first device into the message queue middleware in advance, so that the configuration files of the other micro service application just reach the first device after the configuration of the corresponding configuration files of the first micro service application is completed; alternatively, the cloud server may implement a hot update through message queue middleware, i.e. the micro-service application is updated during running, but this approach is only suitable for the implementation of configuration files in the case of small version updates or simple iterations.
In one possible implementation, the process of the profile update by the second micro service application in the second device is similar to the process of the profile update by the first micro service application in the first device described above.
In the embodiment of the application, the cloud server should firstly receive the subscription request from the micro-service application, configure the micro-service application to subscribe the theme related to the configuration file of the micro-service application, and when the configuration file of the micro-service application is determined to be updated, send the configuration file to the message queue middleware for releasing the message queue, so that the coupling between the cloud server and the micro-service application is released or weakened, and the effects of asynchronous processing and flow peak clipping can be achieved.
In a possible implementation manner, the methods provided in fig. 3 and fig. 4 may be combined with the method provided in fig. 5, so that the effect of mutually performing two modes and freely switching can be achieved, for example, a functional module for executing the two methods is set in the first device, and the functional module is selected according to a network scenario, such as a intranet or a public network, or a client requirement.
The foregoing details of the method according to the embodiments of the present application and the apparatus according to the embodiments of the present application are provided below.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a configuration processing apparatus 60 according to an embodiment of the present application, where the apparatus 60 may be a cloud server or a device in the cloud server, and the apparatus 60 may include a first determining unit 601 and a first sending unit 602, where detailed descriptions of the respective units are as follows.
A first determining unit 601, configured to determine that a first micro service application needs to be updated, where the first micro service application is one micro service application of at least two micro service applications configured for a first device, where the plurality of micro service applications includes the first micro service application and a second micro service application, where the first micro service application and the second micro service application are respectively configured for the first device and the second device, where the first micro service application and the second micro service application belong to the same batch of micro service applications that are updated, and where in any batch of micro service applications that are updated, the first device and the second device each have only one micro service application;
A first sending unit 602, configured to send, to a first micro service application, a configuration file of the latest configuration file of the first micro service application.
In the internet micro-service scenario, application services are increasingly complex, and various types of configuration information are contained in programs: middleware configuration, framework configuration, application configuration, black and white lists, gray switches, etc. In the prior art, the micro-service configuration update is realized by suspending the original micro-service application in the running equipment, loading the latest configuration file to the original micro-service application, and refreshing the configuration after loading is finished, wherein the micro-service application can be normally used, and particularly, the update of a large version is realized; in the field of intelligent furniture, the normal operation of one device is supported by a plurality of micro-service applications, and intermediaries exist among the plurality of micro-service applications, so that the micro-services are loosely coupled; if one micro service application performs large-version updating, only the micro service application needs to be restarted and refreshed in the one device, normal operation of the device is not affected, but if a plurality of micro service applications need to be updated in the one device, the situation that the micro service applications restart and refresh the device simultaneously may occur, and finally the device cannot operate normally. In other fields, equipment cannot normally run in a short time, and the experience of a user can not be influenced, but in the field of intelligent furniture, the equipment is closely related to life of the user, for example, when the user uses a fingerprint to unlock a door, the door cannot be opened, or when the user washes out clothes and uses an intelligent clothes hanger, the clothes hanger cannot be normally started or retracted, and the experience of the user can be seriously influenced only once.
In the scheme, the configuration files of all micro-service applications of the managed equipment are centrally managed through the cloud server, namely one or more configuration centers, and the configuration files are managed and issued through the cloud server without manual deployment of the configuration files by technicians.
Further, the first micro-service application and the second micro-service application belong to different intelligent furniture devices, and the first micro-service application and the second micro-service application belong to the same batch of micro-service applications needing to be updated, when the micro-service application is configured to be updated, the situation that a plurality of micro-service applications in a plurality of devices are updated simultaneously is represented, but in any batch of micro-service applications needing to be updated, only one micro-service application exists in the first device and the second device, and therefore the micro-service applications in the same device are not updated simultaneously, for example, the plurality of micro-service applications in the first device need to be updated, and only after the configuration file of the first micro-service application is updated, other micro-service applications needing to be updated in the first device can be updated, so that the situation that the plurality of micro-service applications in the same device are updated simultaneously is avoided, and the micro-service applications in the same device cannot be updated in the same batch at the same time, and the normal running process of the micro-service applications can not be updated in the running process of the device.
Further, in the process of updating the micro-service application, the cloud server sends the latest configuration file of the first micro-service application, wherein the latest configuration file comprises configuration file content and identification information of the configuration file, and the identification information comprises a name space, a group, a configuration file name, a configuration format, configuration file content, a configuration description, a version number and an MD5 value.
In an alternative solution, in the aspect of determining that the first micro service application needs to be updated, the first determining unit 601 is specifically configured to:
Receiving a request message from the first micro service application, wherein the request message is used for requesting the identification information of the latest configuration file of the first micro service application;
Establishing communication connection with the first micro-service application, and suspending the request message within a preset time limit;
If the configuration file of the first micro service application is updated, sending identification information of the configuration file, wherein the identification information comprises a version number and an MD5 value, and the version number and the MD5 value are used for determining whether the backed-up configuration file of the first micro service application comprises the latest configuration file or not;
if the configuration file of the first micro-service application is not updated, disconnecting the cloud server from the first micro-service application after a preset time limit is reached;
A configuration update request is received from the first micro service application.
In the device, whether the configuration file is updated is checked by a long polling mode, so that hot update can be realized, in the process, as the first device cannot know whether the configuration file is updated or not, the cloud server is required to receive the identification information of the latest configuration file of the first micro-service application by the device and actively send a request message, the cloud server identifies the identification information after receiving the identification information, determines the source of the identification information, the source comprises the device type and the micro-service type, but the cloud server cannot acquire the configuration file use state of the first device, and the request message also does not contain the identification information of the configuration file used by the first device, so that the cloud server only needs to send the identification information of the latest configuration file consistent with the source of the identification information to the first device.
After the cloud server sends the identification information of the configuration file, in an optional implementation manner, under the condition that the threads are sufficient, a main thread which takes over the identification information of the configuration file temporarily suspends the configuration file with the latest version number corresponding to the identification information, waits for a response from the first micro-service application, namely waits for a configuration update request from the first micro-service application, and when receiving the response from the first device, the main thread can return the configuration file to the first device at the first time, so that the waste of time is reduced; in another alternative embodiment, in case of insufficient threads, the main thread taking over the identification information of the profile directly ends the task.
When the first device completes the identification work and determines that the identification information of the configuration file sent by the cloud server belongs to the latest configuration file, the first micro-service application sends a configuration update request to the cloud server, and when the cloud server receives the configuration update request, the cloud server performs the step of sending the latest configuration file to the first micro-service application in order to determine that the first micro-service application needs to be updated.
Further, if the configuration file of the first micro service application is not updated, that is, the configuration file of the first micro service application is not newly added or changed within a preset time, the cloud server is disconnected from the communication connection with the first micro service application after reaching a preset time limit, but the preset time is not too short in consideration of factors of network fluctuation, and optionally, the preset time is 30 seconds, and the request times are reduced, so that thread waste is avoided, and the configuration file can be updated timely according to the above process.
In an alternative solution, in the aspect of determining that the first micro service application needs to be updated, the first determining unit 601 is specifically configured to:
Receiving a subscription request from the first microservice application;
determining that a configuration file of the first micro-service application has been updated.
In the device, a method of issuing a configuration file by a message queue is specifically adopted to realize hot update, but in the related technology, a message bus is often used in the current micro-service architecture scene, the message bus is applied to a micro-service architecture system, a common message theme is usually constructed by using a lightweight message agent, all micro-service instances in the system are connected, and messages generated in the theme are monitored and consumed by all the instances, so that the message is called a message queue. The method comprises the steps that all examples on a bus can conveniently broadcast messages which need to be known by other examples connected to the theme, but the carrying capacity and throughput of the messages are insufficient to bear huge message quantity of a plurality of micro-service applications in intelligent furniture equipment, the throughput peak value of message queue middleware is quite large, and the messages are more suitable for being used in the intelligent furniture field, so that the hot update is realized by adopting a mode of releasing the message queue in the scheme, and in the process of updating the configuration file by using the message queue, the micro-service applications need to subscribe to the theme related to the configuration file corresponding to the micro-service application, so that the configuration file can be released in time after the configuration file is updated, for example, when the configuration file of the first micro-service application is updated, the micro-service applications subscribed to the theme receive the configuration file, and in the process, the message queue middleware is adopted to realize the isolation of a cloud server and the micro-service application.
Therefore, the cloud server should firstly receive the subscription request from the micro service application, configure the micro service application to subscribe the theme related to the configuration file of the micro service application, and when the configuration file of the micro service application is determined to be updated, send the configuration file to the message queue middleware for message queue release, so that the coupling between the cloud server and the micro service application is released or weakened, and the effects of asynchronous processing and flow peak clipping can be achieved.
The specific implementation principle of the apparatus shown in fig. 6 can be referred to the corresponding description of the method embodiments shown in fig. 2, 3,4 and 5.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a configuration using apparatus 70 based on a micro service architecture according to an embodiment of the present application, the apparatus 70 may be the first device or a device in the first device, and the apparatus 70 may include a first receiving unit 701 and a configuration unit 702, where the details of each unit are as follows.
A first receiving unit 701, configured to receive a configuration file of a first micro service application sent by the cloud server, where the cloud server is configured to manage configuration files of a plurality of micro service applications, where the plurality of micro service applications includes a first micro service application and a second micro service application, and the first micro service application and the second micro service application are configured on the first device and the second device respectively; the first micro-service application is one of at least two micro-service applications configured by the first device;
a configuration unit 702, configured to configure the first micro service application at the first device according to the configuration file.
In the device, the configuration file received by the first device comprises the configuration file itself and identification information of the configuration file, the identification information of the configuration file comprises a name space, a group and a configuration file name, and the first device places the configuration file to a specific position according to the name space and the group to replace the original configuration file.
The first equipment is locally provided with a backup library, the backup library is used for storing the existing configuration files of the first equipment, when the configuration files reach the local equipment, the configuration files are backed up immediately and stored in the backup library, and under the condition that the equipment is restarted, such as a machine refreshing and factory setting restoring, the first equipment can normally operate by operating the configuration files in the backup library.
In an alternative, the apparatus further comprises:
A second determining unit, configured to determine that the backed-up configuration file exists in the first micro service application;
A second sending unit, configured to send the request message to the cloud server, where the request message is used to request identification information of a latest configuration file of the first micro service application, where the identification information includes a version number and an MD5 value;
The second receiving unit is used for receiving the identification information of the latest configuration file of the first micro-service application, which is sent by the cloud server;
the comparison unit is used for comparing the identification information of the configuration file sent by the cloud server with the identification information of the backed-up configuration file so as to determine whether the backed-up configuration file of the first micro service is the latest configuration file;
And the third sending unit is used for sending a configuration update request to the cloud server when the configuration file backed up by the first micro-service application is not the latest configuration file.
In the apparatus, specifically, in the method, the backup of all configuration files of the application exists locally in the first micro service application, and the backup of the configuration files is the backed up configuration files, the backed up configuration files include identification information of the configuration files, the identification information includes a version number and an MD5 value, the version number and the MD5 value are used for determining whether the configuration files backed up by the first micro service are the latest configuration files, but it is to be determined by the version number and the MD5 value whether the configuration files backed up by the first micro service are the latest configuration files or not, so after determining that the configuration files backed up by the first micro service application exist, the request message is sent to the cloud server, the request message is used for requesting the identification information of the latest configuration files of the first micro service application, it is worth explaining that at least one htt-line connection pool is set at the first device, although the first micro service application is not updated with the first micro service application, and the first micro service application can not be updated, but the first micro service application can not be updated by the first micro service application, or the other micro service can not be requested by the first micro service, and the cloud service can not be updated by the first micro service application, and the cloud service can be requested by the other micro service.
After the first micro service application receives the identification information sent by the cloud server, the identification information sent by the cloud server is compared with the identification information of the backed-up configuration file, if the comparison is inconsistent, the update of the configuration file existing in the first micro service application is indicated, and after the configuration file is determined to need to be updated, the first micro service application sends a configuration update request to the cloud server.
In an alternative, the apparatus further comprises:
and the fourth sending unit is used for sending a subscription request of the configuration file of the first micro-service application to the cloud server.
In the device, the subscription request is realized by adopting a message queue middleware, the first micro-service application sends a subscription request of a configuration file of the first micro-service application to the cloud server to request to subscribe related topics of the configuration file, the cloud server configures the subscription topics of the first micro-service application after receiving the subscription request of the first micro-service application, and when the configuration file of the first micro-service application changes, the related configuration file is pushed to a subscriber, namely the configuration file of the first micro-service application is sent to the first micro-service application, so that the first micro-service application timely updates the configuration file, and the coupling of the cloud server and the micro-service application is released or weakened, thereby achieving the effects of asynchronous processing and flow peak clipping.
The specific implementation principle of the apparatus shown in fig. 7 can be referred to the corresponding description of the method embodiments shown in fig. 2, 3,4 and 5.
Referring to fig. 8, fig. 8 is a cloud server 80 based on a micro-service architecture according to an embodiment of the present application, where the cloud server 80 includes: a processor 801, a communication interface 802, and a memory 803. The processor 801, the communication interface 802, and the memory 803 may be connected by a bus or other means, for example, in the embodiment of the present application.
The processor 801 is a computing core and a control core of the cloud server 80, and may parse various instructions in the cloud server 80 and various data of the cloud server 80, for example: the processor 801 may be a central processing unit (Central Processing Unit, CPU), may transmit various interaction data between internal structures of the cloud server 80, and so on. Communication interface 802 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.), and may be controlled by processor 801 to receive and transmit data; the communication interface 802 may also be used for transmission or interaction of signaling or instructions within the cloud server 80. A Memory 803 (Memory) is a Memory device in the cloud server 80 for storing programs and data. It is understood that the memory 803 may include a built-in memory of the cloud server 80, or may include an extended memory supported by the cloud server 80. The memory 803 provides a storage space storing an operating system of the cloud server 80, and also storing program codes or instructions required for a processor to perform a corresponding operation, and optionally, storing related data generated after the processor performs the corresponding operation.
In an embodiment of the present application, the processor 801 runs executable program code in the memory 803 for performing the following operations:
determining that a first micro-service application needs to be updated, wherein the first micro-service application is one micro-service application of at least two micro-service applications configured for a first device, and the plurality of micro-service applications comprise the first micro-service application and a second micro-service application, and the first micro-service application and the second micro-service application are respectively configured on the first device and the second device;
the latest configuration file is sent to the first microservice application via the communication interface 802.
In an alternative, in determining that the first micro service application needs to be updated, the processor 801 is further configured to:
Receiving a request message from the first micro service application through the communication interface 802, where the request message is used to request identification information of a latest configuration file of the first micro service application;
Establishing communication connection with the first micro-service application, and suspending the request message within a preset time limit;
If the configuration file of the first micro service application is updated, executing the step of sending the identification information of the configuration file, if the configuration file of the first micro service application is not updated, disconnecting the cloud server from the first micro service application after a preset time limit is reached;
Transmitting, through the communication interface 802, identification information of the configuration file stored in the memory 803, where the identification information includes a version number and an MD5 value, and the version number and the MD5 value are used to determine whether the configuration file backed up by the first micro service application includes the latest configuration file;
A configuration update request from the first micro service application is received via the communication interface 802.
In yet another alternative, in determining that the first micro service application needs to be updated, the processor 801 is further configured to:
receiving a subscription request from the first micro service application through the communication interface 802;
determining that a configuration file of the first micro-service application has been updated.
It should be noted that, the implementation of each operation may also correspond to the corresponding description on the cloud server side in the method embodiments shown in fig. 2,3, 4 and 5.
Referring to fig. 9, fig. 9 is a first device 90 based on a micro service architecture according to an embodiment of the present application, where the first device 90 described in the embodiment of the present application may be a first device described in the foregoing, and the first device 90 includes: processor 901, communication interface 902, and memory 903. The processor 901, the communication interface 902 and the memory 903 may be connected by a bus or other means, for example, in the embodiment of the present application.
The processor 901 is a computing core and a control core of the first device 90, and may parse various instructions in the first device 90 and various data of the first device 90, for example: the processor 901 may be a central processing unit (Central Processing Unit, CPU), may transfer various types of interaction data between internal structures of the first device 90, and so on. Communication interface 902 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.), and may be controlled by processor 901 to receive and transmit data; the communication interface 902 may also be used for transmission or interaction of signaling or instructions within the first device 90. The Memory 903 (Memory) is a Memory device in the first device 90 for storing programs and data. It will be appreciated that the memory 903 here may include both built-in memory of the first device 90 and extended memory supported by the first device 90. The memory 903 provides storage space that stores the operating system of the first device 90, which may include, but is not limited to: the application is not limited to Android system, iOS system, windows Phone system, etc., and the storage space also stores program codes or instructions required by the processor to execute the corresponding operation, and optionally, the storage space can also store related data generated after the processor executes the corresponding operation.
In an embodiment of the present application, the processor 901 executes executable program code in the memory 903 for performing the following operations:
Receiving, through the communication interface 902, a configuration file of a first micro-service application sent by the cloud server, where the cloud server is configured to manage configuration files of a plurality of micro-service applications, where the plurality of micro-service applications includes a first micro-service application and a second micro-service application, and the first micro-service application and the second micro-service application are configured on the first device and the second device respectively; the first micro-service application is one of at least two micro-service applications configured by the first device;
And configuring the first micro service application according to the configuration file.
In an alternative, the processor 901, before receiving the configuration file of the first micro service application sent by the cloud server, is further configured to:
Determining that the backed-up configuration file exists in the first micro-service application;
Sending the request message to the cloud server through the communication interface 902, where the request message is used to request identification information of a latest configuration file of the first micro service application, where the identification information includes a version number and an MD5 value;
receiving, through the communication interface 902, identification information of a latest configuration file of the first micro service application sent by the cloud server;
comparing the identification information of the configuration file sent by the cloud server with the identification information of the backed-up configuration file to determine whether the backed-up configuration file of the first micro service is the latest configuration file;
And if the backed-up configuration file of the first microservice application is not the latest configuration file, sending a configuration update request to the cloud server.
In yet another alternative, the processor 901, before receiving the configuration file of the first micro service application sent by the cloud server, is further configured to:
and sending a subscription request of the configuration file of the first micro service application to the cloud server through the communication interface 902.
In the process, message queue middleware is arranged to realize subscription receiving, such as RabbitMQ, kafka, in the process of using the message queue middleware, the first micro-service application sends a subscription request of the configuration file of the first micro-service application to the cloud server to request to subscribe related topics of the configuration file, the cloud server configures the subscription topics of the first micro-service application after receiving the subscription request of the first micro-service application, and when the configuration file of the first micro-service application changes, the related configuration file is pushed to a subscriber, namely the configuration file of the first micro-service application is sent to the first micro-service application, so that the thermal updating effect is achieved, and the normal operation of equipment can be ensured.
It should be noted that the implementation of each operation may also correspond to the corresponding description on the first device side in the method embodiments shown in fig. 2,3, 4 and 5.
Embodiments of the present application provide a computer readable storage medium storing a computer program comprising program instructions that when executed by a processor cause the processor to perform operations performed by a cloud server in the embodiments of fig. 2, 3, 4, or 5, or to perform operations performed by a first device in the embodiments of fig. 2, 3, 4, or 5.
Embodiments of the present application also provide a computer program product that, when run on a processor, performs the operations performed by the cloud server in the embodiments described in fig. 2,3, 4, or 5, or the operations performed by the first device in the embodiments described in fig. 2,3, 4, or 5.
Those skilled in the art will appreciate that implementing all or part of the above-described embodiment methods may be accomplished by a program that instructs related hardware, and the program may be stored in a computer-readable storage medium, and the program may include the above-described embodiment methods when executed. And the aforementioned storage medium includes: various media capable of storing program code, such as ROM, RAM, magnetic or optical disks.

Claims (10)

1. A configuration processing method based on a micro-service architecture, wherein the method is applied to a cloud server, the cloud server is used for managing and issuing configuration files of a plurality of micro-service applications, and the method comprises:
Determining that a first micro-service application needs to be updated, wherein the first micro-service application is one micro-service application of at least two micro-service applications configured for a first device, the plurality of micro-service applications comprise the first micro-service application and a second micro-service application, the first micro-service application and the second micro-service application are respectively configured on the first device and the second device, the first micro-service application and the second micro-service application belong to the micro-service application updated in the same batch, and in any micro-service application updated in any batch, the first device and the second device only have one micro-service application;
and sending the latest configuration file to the first micro-service application.
2. The method of claim 1, wherein determining that the first micro-service application needs to be updated comprises:
Receiving a request message from the first micro service application, wherein the request message is used for requesting the identification information of the latest configuration file of the first micro service application;
transmitting identification information of the configuration file, wherein the identification information comprises a version number and an MD5 value, and the version number and the MD5 value are used for determining whether the configuration file backed up by the first micro-service application comprises the latest configuration file or not;
A configuration update request is received from the first micro service application.
3. The method of claim 2, wherein after receiving the request message from the first micro service application, before sending the identification information of the configuration file, the method comprises:
Establishing communication connection with the first micro-service application, and suspending the request message within a preset time limit;
And if the configuration file of the first micro service application is updated, executing the step of sending the identification information of the configuration file.
4. A method according to claim 3, further comprising:
And if the configuration file of the first micro-service application is not updated, disconnecting the cloud server from the first micro-service application after a preset time limit is reached.
5. The method of claim 1, wherein determining that the first micro-service needs to be updated comprises:
Receiving a subscription request from the first microservice application;
determining that a configuration file of the first micro-service application has been updated.
6. The method of any of claims 1-5, wherein the identification information of the configuration file further comprises a device identification of a first device in which the first micro-service application is located.
7. A method for processing configuration based on a micro-service architecture, the method comprising:
The method comprises the steps that a first device receives a configuration file of a first micro-service application sent by a cloud server, wherein the cloud server is used for managing the configuration files of a plurality of micro-service applications, the plurality of micro-service applications comprise a first micro-service application and a second micro-service application, and the first micro-service application and the second micro-service application are respectively configured on the first device and the second device; the first micro-service application is one micro-service application in at least two micro-service applications configured for the first device, the first micro-service application and the second micro-service application belong to the same batch of micro-service applications updated, and only one micro-service application exists in the first device and the second device in any batch of micro-service applications updated;
The first device configures the first micro-service application according to the configuration file.
8. A micro-service architecture-based configuration processing apparatus, the apparatus comprising:
A first determining unit, configured to determine that a first micro-service application needs to be updated, where the first micro-service application is one micro-service application of at least two micro-service applications configured for a first device, where the plurality of micro-service applications includes the first micro-service application and a second micro-service application, where the first micro-service application and the second micro-service application are respectively configured for the first device and the second device, where the first micro-service application and the second micro-service application belong to the same micro-service application that is updated, and where in any micro-service application that is updated in any batch, the first device and the second device each have only one micro-service application;
And the first sending unit is used for sending the latest configuration file of the first micro-service application to the first micro-service application.
9. A cloud server, characterized in that the cloud server comprises at least one processor for transmitting and/or receiving data, a communication interface for storing a computer program, and a memory for invoking the computer program stored in the at least one memory, causing the device to implement the method according to any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when run on a processor, causes the computer to perform the method according to any of claims 1-7.
CN202211036075.6A 2022-08-27 Configuration processing method and device based on micro-service architecture and storage medium Active CN115473809B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211036075.6A CN115473809B (en) 2022-08-27 Configuration processing method and device based on micro-service architecture and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211036075.6A CN115473809B (en) 2022-08-27 Configuration processing method and device based on micro-service architecture and storage medium

Publications (2)

Publication Number Publication Date
CN115473809A CN115473809A (en) 2022-12-13
CN115473809B true CN115473809B (en) 2024-07-05

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105744008A (en) * 2016-05-11 2016-07-06 百度在线网络技术(北京)有限公司 Intelligent home platform, and system updating method and device applied to intelligent home platform
CN108182122A (en) * 2018-01-22 2018-06-19 广东欧珀移动通信有限公司 Using update notifying method, apparatus, storage medium and server

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105744008A (en) * 2016-05-11 2016-07-06 百度在线网络技术(北京)有限公司 Intelligent home platform, and system updating method and device applied to intelligent home platform
CN108182122A (en) * 2018-01-22 2018-06-19 广东欧珀移动通信有限公司 Using update notifying method, apparatus, storage medium and server

Similar Documents

Publication Publication Date Title
CN106878376B (en) Configuration management method and system
WO2016184175A1 (en) Database processing method and apparatus
CN106059825A (en) Distributed system and configuration method
CN110968603B (en) Data access method and device
CN111045745A (en) Method and system for managing configuration information
CN107197012B (en) Service publishing and monitoring system and method based on metadata management system
CN109144748B (en) Server, distributed server cluster and state driving method thereof
CN101188566A (en) A method and system data buffering and synchronization under cluster environment
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN110719311B (en) Distributed coordination service method, system and computer readable storage medium
CN112230987B (en) Distributed modular plug-in frame realization system and method
CN108108119B (en) Configuration method and device for extensible storage cluster things
CN111858190B (en) Method and system for improving availability of cluster
CN117130730A (en) Metadata management method for federal Kubernetes cluster
CN113422692A (en) Method, device and storage medium for detecting and processing node faults in K8s cluster
CN114629883B (en) Service request processing method and device, electronic equipment and storage medium
CN112732674A (en) Cloud platform service management method, device, equipment and readable storage medium
CN111736809A (en) Distributed robot cluster network management framework and implementation method thereof
CN114900449A (en) Resource information management method, system and device
CN114130035A (en) User matching method, device, equipment and storage medium
CN115473809B (en) Configuration processing method and device based on micro-service architecture and storage medium
CN112492037A (en) Data processing system and method
CN101751292B (en) Method for realizing consistency function of multimachine core data in ATC (automatic timing corrector) system
CN115766715B (en) Super-fusion cluster monitoring method and system
CN109032674B (en) Multi-process management method, system and network equipment

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: 518000 Office Building 02, 11th Floor, Building B2, Xiandong Road, Xiandong Community, Xili Street, Nanshan District, Shenzhen City, Guangdong Province, China

Applicant after: Shenzhen Kaidisi Intelligent Technology Co.,Ltd.

Address before: 9 / F, block B, Tsinghua information port, No.1, Xindong Road, songpingshan community, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: SHENZHEN KAADAS INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before: China

GR01 Patent grant