Gray release method and device, electronic equipment, storage medium and cloud equipment monitoring system
By using the grayscale service and theme mapping relationship of the Kafka platform in the process of grayscale release of IoT devices, efficient device management and grayscale drainage solutions are provided, and the problem of low grayscale release efficiency in the existing technology is solved.
Patent Information
- Application Number
- CN202411270806.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-02-11
AI Technical Summary
In the process of grayscale release of IoT devices, it is difficult for the existing technology to achieve efficient device management and grayscale drainage, resulting in low grayscale release efficiency.
By receiving access requests from IoT devices, if the request carries a grayscale identifier, obtains the mapping relationship between the device and the grayscale Kafka topic, determines the corresponding grayscale Kafka topic, and uses the Kafka platform to provide messaging services, including grayscale producer services and Grayscale consumer service, collecting equipment parameters and alarm processing.
It realizes efficient grayscale management of IoT devices, simplifies device configuration and grayscale drainage process, and improves the efficiency of grayscale release.
Smart Images

Figure CN119415112A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to computer technology, and in particular to a grayscale publishing method, device, electronic device, storage medium and cloud device monitoring system. Background Art
[0002] In order to ensure that the user experience is not affected when the platform service is iteratively updated, it is necessary to provide a relatively user-impacted and smooth update deployment solution, namely grayscale release. During the grayscale release period, some devices can be used as new version experience devices and directed to the new service for access. When there are no major abnormalities during the operation of the new version, the remaining devices can be gradually directed to the new version service.
[0003] Currently, in the grayscale release process of IoT devices, devices are usually randomly selected to use the new version, and temporary configuration is required for each device. It is also difficult to achieve grayscale management of devices, making grayscale release efficiency low. Summary of the invention
[0004] The embodiments of the present application provide a grayscale publishing method, device, electronic device, and cloud device monitoring system, which can improve the efficiency of grayscale publishing.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] The present application provides a grayscale publishing method, including:
[0007] receiving an access request from a first IoT device;
[0008] If the access request carries a grayscale identifier, a mapping relationship between the first IoT device and the grayscale Kafka topic is obtained;
[0009] Based on the mapping relationship, determine the grayscale Kafka topic corresponding to the first IoT device;
[0010] The Kafka platform is used to provide a message service to the first Internet of Things device based on the grayscale Kafka topic and the corresponding grayscale service.
[0011] In the above scheme, the grayscale service includes a grayscale producer service and a grayscale consumer service. The Kafka platform is used to provide a message service to the first Internet of Things device based on the grayscale Kafka topic and the corresponding grayscale service, including: using the grayscale producer service corresponding to the grayscale Kafka topic to produce messages related to the first Internet of Things device and deliver the messages to the grayscale Kafka topic; using the grayscale producer service corresponding to the grayscale Kafka topic to consume the messages from the grayscale Kafka topic.
[0012] In the above scheme, the grayscale producer service includes a grayscale collection service, and the grayscale consumer service includes a grayscale alarm service. The grayscale producer service corresponding to the grayscale Kafka topic is used to produce messages related to the first Internet of Things device and deliver the messages to the grayscale Kafka topic, including: using the grayscale collection service to collect device parameters of the first Internet of Things device and delivering the device parameters to the grayscale Kafka topic; accordingly, the grayscale producer service corresponding to the grayscale Kafka topic is used to consume the messages from the grayscale Kafka topic, including: if the device parameters include device alarm information, using the grayscale alarm service to obtain the device alarm information of the first Internet of Things device from the grayscale Kafka topic, and sending the device alarm information to the alarm device.
[0013] In the above scheme, before receiving an access request from a first IoT device carrying a grayscale identifier, the method also includes: creating a grayscale Kafka topic and a grayscale service corresponding to the grayscale Kafka topic; configuring a mapping relationship between the first IoT device and the grayscale Kafka topic; adding the grayscale identifier to the first IoT device; and triggering the first IoT device to go back online so that it issues a new access request.
[0014] In some embodiments, configuring the mapping relationship between the first IoT device and the grayscale Kafka topic includes: changing the Kafka topic of the first IoT device from the original Kafka topic to the grayscale Kafka topic; sending the address of the grayscale service to the first IoT device so that the first IoT device is connected to the grayscale service based on the address.
[0015] In the above scheme, the method also includes: adjusting the device parameters of the first IoT device to the target parameters; obtaining the current parameters of the first IoT device in the grayscale Kafka topic; if the current parameters are the same as the target parameters, determining that the grayscale configuration of the first IoT device is successful.
[0016] In the above scheme, after determining that the grayscale configuration of the first IoT device is successful, the method also includes: determining multiple second IoT devices to be configured; and performing grayscale drainage on the multiple second IoT devices so that the grayscale service provides message services to the multiple second IoT devices.
[0017] The embodiment of the present application provides a grayscale publishing device, including:
[0018] A receiving module, configured to receive an access request from a first IoT device;
[0019] An acquisition module, used for obtaining a mapping relationship between the first IoT device and the Grayscale Kafka topic if the access request carries a Grayscale identifier;
[0020] A determination module, configured to determine, based on the mapping relationship, a grayscale Kafka topic corresponding to the first IoT device;
[0021] The service module is used to provide a message service to the first Internet of Things device based on the grayscale Kafka topic and the corresponding grayscale service using the Kafka platform.
[0022] An embodiment of the present application provides an electronic device, including:
[0023] A memory for storing executable instructions;
[0024] The processor is used to implement the grayscale publishing method provided in the embodiment of the present application when executing the executable instructions stored in the memory.
[0025] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute and implement the grayscale release method provided in the embodiment of the present application.
[0026] An embodiment of the present application provides a computer program product storing a computer program for implementing the grayscale release method provided in the embodiment of the present application when executed by a processor.
[0027] The embodiment of the present application provides a cloud device monitoring system, including a microservice group, wherein the microservice group includes a Kafka platform, an original service, and a corresponding grayscale service;
[0028] The original service is used to receive an access request from an IoT device; if the access request carries a grayscale identifier, obtain a mapping relationship between the IoT device and the grayscale Kafka topic; based on the mapping relationship, determine the grayscale Kafka topic corresponding to the IoT device;
[0029] The Kafka platform is used to provide message services to the IoT device based on the Grayscale Kafka topic and in collaboration with corresponding Grayscale services.
[0030] The embodiment of the present application receives an access request from a first Internet of Things device. If the access request carries a grayscale identifier, a mapping relationship between the first Internet of Things device and the grayscale Kafka topic is obtained. Based on the mapping relationship, the grayscale Kafka topic corresponding to the first Internet of Things device is determined. The Kafka platform is used to provide a message service to the first Internet of Things device based on the grayscale Kafka topic and the corresponding grayscale service. The first Internet of Things device is pre-configured. During the grayscale release process, the grayscale service can be used directly based on the grayscale identifier, and the management of the grayscale device is facilitated, and the verification results of the grayscale release process are easily identified and counted, thereby improving the efficiency of the grayscale release. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is an optional structural diagram of the grayscale publishing system 100 provided in an embodiment of the present application;
[0032] Figure 2 is an optional structural diagram of an electronic device 200 provided in an embodiment of the present application;
[0033] Figure 3 This is an optional flowchart of the grayscale publishing method provided in the embodiment of the present application;
[0034] Figure 4 This is an optional structural diagram of a microservice group provided in an embodiment of the present application;
[0035] Figure 5 It is an optional structural diagram of the microservice group provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0037] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0038] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0040] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0041] 1) Grayscale release, also known as canary release, is a release method that can smoothly transition between black and white. A / B testing can be performed on it, that is, some users continue to use product feature A, and some users start using product feature B. If users have no objection to B, then gradually expand the scope and migrate all users to B. Grayscale release can ensure the stability of the overall system. Problems can be discovered and adjusted during the initial grayscale to ensure their impact.
[0042] 2) Kafka is an open source stream processing platform developed by the Apache Software Foundation and written in Scala and Java. Kafka is a high-throughput distributed publish-subscribe messaging system that can process all action stream data of consumers on a website. This action (web browsing, searching, and other user actions) is a key factor in many social functions on modern networks. These data are usually solved by processing logs and log aggregation due to throughput requirements. This is a viable solution for log data and offline analysis systems like Hadoop, but with the limitation of real-time processing. The purpose of Kafka is to unify online and offline message processing through Hadoop's parallel loading mechanism, and to provide real-time messages through clusters. The embodiments of the present application provide a grayscale publishing method, device, electronic device and computer-readable storage medium, which can improve the efficiency of grayscale publishing.
[0043] First, the grayscale publishing system provided in the embodiment of the present application is described. Figure 1 , Figure 1It is an optional structural diagram of the grayscale publishing system 100 provided in the embodiment of the present application, and the Internet of Things device 101 is connected to the cloud device monitoring system 103 through the network 102. Here, the Internet of Things device 101 can be a smart home device, a sensor device, an industrial Internet of Things device, a smart wearable device, and a smart city device, etc. In this embodiment, the grayscale publishing method is specifically applied to the cloud device monitoring system for monitoring the status of the industrial Internet of Things device. Specifically, the industrial Internet of Things device can be a power device (such as photovoltaic equipment, energy storage equipment or UPS equipment, etc.), an environmental conditioning device (air conditioning, liquid cooling unit, etc.), a service cabinet, etc. located at the end user's site, or a collector for parameter collection of the above-mentioned power equipment, environmental conditioning equipment or service cabinet. The cloud device monitoring system 103 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. The network 102 can be a wide area network or a local area network, or a combination of the two. The Internet of Things device 101 and the cloud device monitoring system 103 can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiment of the present application.
[0044] Next, the electronic device for implementing the grayscale publishing method provided in the embodiment of the present application is described. Figure 2 , Figure 2 is an optional structural diagram of an electronic device 200 provided in an embodiment of the present application. In practical applications, the electronic device 200 can be implemented as Figure 1 The server 101 in the embodiment of the present invention is an electronic device. Figure 1 Taking the terminal 103 shown as an example, an electronic device for implementing the grayscale publishing method of the embodiment of the present application is described.
[0045] Figure 2 The electronic device 200 shown includes: at least one processor 201 and a memory 202. The various components in the electronic device 200 are coupled together via a bus system 203. It is understood that the bus system 203 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 203 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 203 is not described in detail. Figure 2 Various buses are labeled as bus system 203.
[0046] The processor 201 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0047] The memory 202 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 202 may optionally include one or more storage devices that are physically remote from the processor 201.
[0048] The memory 202 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 202 described in the embodiments of the present application is intended to include any suitable type of memory.
[0049] In some embodiments, the memory 202 can store data to support various operations. Examples of these data include programs, modules, and data structures, or subsets or supersets thereof. In the embodiment of the present application, the memory 202 stores an operating system 221 and a grayscale release device 222; specifically,
[0050] Operating system 2021, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0051] In some embodiments, the grayscale publishing device provided in the embodiments of the present application can be implemented in software. Figure 2 The grayscale publishing device 2022 stored in the memory 202 is shown, which can be software in the form of a program and a plug-in, including the following software modules: a receiving module 20221, an obtaining module 20222, a determining module 20223 and a service module 20224. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0052] In other embodiments, the grayscale publishing device provided in the embodiments of the present application can be implemented in hardware. As an example, the grayscale publishing device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the grayscale publishing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0053] The grayscale release method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the cloud device monitoring system provided in the embodiment of the present application.
[0054] See also Figure 3 , Figure 3 This is an optional flow chart of the grayscale publishing method provided in the embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.
[0055] Step 301, receiving an access request from a first IoT device;
[0056] Step 302: If the access request carries a grayscale identifier, obtain a mapping relationship between the first IoT device and the grayscale Kafka topic;
[0057] Step 303: Determine the grayscale Kafka topic corresponding to the first IoT device based on the mapping relationship;
[0058] Step 304: Use the Kafka platform to provide a message service to the first IoT device based on the grayscale Kafka topic and the corresponding grayscale service.
[0059] In an embodiment of the present application, the cloud device monitoring system can be a microservice group including a Kafka platform and corresponding services. The microservice group includes at least one group of services. Each group of services includes an original service and a corresponding grayscale service. It should be noted that the original service and the grayscale service in the same group of services are different versions of the same service, and the grayscale service is a new version service relative to the original service. The types of original services include producer services and consumer services. The types of grayscale services also include producer services and consumer services. It should be noted that the producer service is used to produce messages and deliver them to the Kafka platform, and the consumer service is used to consume messages from the Kafka platform.
[0060] For example, see Figure 4 , Figure 4 4 is an optional structural diagram of a microservice group provided in an embodiment of the present application. Here, the microservice group 400 includes at least one group of services 401 corresponding to the Kafka platform 410, and a group of services 401 includes an original service 4011 and a grayscale service 4012. Here, the original service 4011 can be an original producer service, and the corresponding grayscale service 4012 is a grayscale producer service. The original service 4011 can also be an original consumer service, and the corresponding grayscale service 4012 is a grayscale consumer service.
[0061] As an exemplary scenario of an embodiment of the present application, for the monitoring scenario of industrial IoT devices, the same user may have multiple types of IoT devices, and the number of each type of IoT devices may be one or more. For example, user A may have 2 UPS devices and 3 air conditioners, and user B may have 1 photovoltaic device, 1 UPS device and 2 air conditioners.
[0062] Here, during the grayscale release of the microservice group, the first IoT device transmits an access request in the TCP message format to the original producer service. After obtaining the access request, the access request is parsed to obtain parsed data. Here, if the parsed data carries a grayscale identifier, the first IoT device is determined to be a grayscale device, and the mapping relationship between the first IoT device and the grayscale Kafka topic is obtained. Here, each first IoT device is pre-associated with a corresponding Kafka topic. In actual implementation, the mapping relationship between the first IoT device and the grayscale Kafka topic is obtained, and based on the mapping relationship, the grayscale Kafka topic corresponding to the first IoT device is determined. Then, based on the grayscale Kafka topic and the corresponding grayscale service, a message service is provided to the first IoT device. It should be understood that the grayscale service here is the grayscale producer service corresponding to the new version of the original producer service. If the access request does not carry a grayscale identifier, the Kafka platform is directly used to provide a message service to the first IoT device based on the original Kafka topic and the original service. Here, there is a corresponding relationship between the original Kafka topic and the first IoT device and the original service.
[0063] In an embodiment of the present application, by receiving an access request from a first Internet of Things device, if the access request carries a grayscale identifier, a mapping relationship between the first Internet of Things device and the grayscale Kafka topic is obtained, and based on the mapping relationship, the grayscale Kafka topic corresponding to the first Internet of Things device is determined, and the Kafka platform is used to provide a message service to the first Internet of Things device based on the grayscale Kafka topic and the corresponding grayscale service. The first Internet of Things device is pre-configured, and in the grayscale release process, the grayscale service can be used directly based on the grayscale identifier, and the management of the grayscale device is facilitated, and the verification results in the grayscale release process are easily identified and counted, thereby improving the efficiency of the grayscale release.
[0064] In some embodiments, the grayscale service includes a grayscale producer service and a grayscale consumer service. The use of the Kafka platform to provide a message service to the first Internet of Things device based on the grayscale Kafka topic and the corresponding grayscale service includes: using the grayscale producer service corresponding to the grayscale Kafka topic to produce messages related to the first Internet of Things device and deliver the messages to the grayscale Kafka topic; using the grayscale producer service corresponding to the grayscale Kafka topic to consume the messages from the grayscale Kafka topic.
[0065] In the embodiment of the present application, the grayscale service includes a grayscale producer service and a grayscale consumer service. In actual implementation, in step 304, the microservice group can use the grayscale producer service corresponding to the grayscale Kafka topic to produce messages associated with the first IoT device and deliver the produced messages to the grayscale Kafka topic. Here, the produced messages can be, for example, collected device parameters or received device messages. In addition, the grayscale producer service corresponding to the grayscale Kafka topic can also be used to consume messages from the grayscale Kafka topic.
[0066] The grayscale consumer service here is pre-associated with the grayscale Kafka topic. In actual implementation, the microservice group can use the grayscale consumer service corresponding to the grayscale Kafka topic to obtain the message related to the first IoT device from the associated grayscale Kafka topic and perform consumption processing on the message. Here, different types of grayscale consumer services can perform different types of consumption processing on the message. For example, if the device parameters are stored in the grayscale Kafka topic, the device parameters can be obtained from it for corresponding parameter processing.
[0067] In some embodiments, the grayscale producer service includes a grayscale collection service, the grayscale consumer service includes a grayscale alarm service, and the grayscale producer service corresponding to the grayscale Kafka topic is used to produce messages related to the first Internet of Things device and deliver the messages to the grayscale Kafka topic, including: using the grayscale collection service to collect device parameters of the first Internet of Things device, and delivering the device parameters to the grayscale Kafka topic; accordingly, the grayscale producer service corresponding to the grayscale Kafka topic is used to consume the messages from the grayscale Kafka topic, including: if the device parameters include device alarm information, using the grayscale alarm service to obtain the device alarm information of the first Internet of Things device from the grayscale Kafka topic, and sending the device alarm information to the alarm device.
[0068] Here, the device parameters of the first IoT device can be collected by using the collection stick, an IoT device, through the grayscale collection service. Here, the device parameters can be parameters collected by the IoT device. For example, if the IoT device is a temperature sensor, the device parameters can be the temperature value collected by the temperature sensor. The collection stick communicates with the cloud device monitoring system and can exchange information with each service in the system. The collection stick can correspond to different IoT devices to collect different data, and the same collection stick can also correspond to multiple different IoT devices to collect multiple types of data from multiple different IoT devices. In an embodiment of the present application, the collection stick uploads data to the grayscale Kafka topic, a topic message middleware, through the collection service, and then the grayscale Kafka topic is sent to the alarm device through the grayscale alarm service, so that the alarm device sends an alarm message. The alarm device here can be a virtual alarm module in the cloud device monitoring system, which sends an alarm through the system interface, or it can be a physical alarm device at the user's site.
[0069] In some embodiments, the microservice group also includes other types of services. As an optional example, see Figure 5 , Figure 5 It is an optional structural diagram of the microservice group provided in an embodiment of the present application. Here, the microservice group 500 includes the first group of services 501 to the sixth group of services 506 corresponding to the Kafka platform 510. Among them, the first group of services 501 includes the original collection service 5011 and the gray collection service 5012, and the second group of services 502 includes the original alarm service 5021 and the gray alarm service 5022. The third group of services 503 includes the original data processing service 5031 and the gray data processing service 5032. The fourth group of services 504 includes the original statistics service 5041 and the gray statistics service 5042. The fifth group of services 505 includes the original Platform service 5051 and the gray Platform service 5052. The sixth group of services 506 includes the original transparent transmission upgrade service 5061 and the gray transparent transmission upgrade service 5062. Among them, the first group of services 501 is a producer service, and the remaining services are consumer services, which are used to perform different consumption processing on messages.
[0070] In some embodiments, before receiving an access request from a first IoT device carrying a grayscale identifier, the method further includes: creating a grayscale Kafka topic and a grayscale service corresponding to the grayscale Kafka topic; configuring a mapping relationship between the first IoT device and the grayscale Kafka topic; adding the grayscale identifier to the first IoT device; and triggering the first IoT device to go back online so that it issues a new access request.
[0071] In actual implementation, the microservice group also includes a device grayscale configuration service. The device grayscale configuration service is used to perform grayscale configuration on the first IoT device. In an embodiment of the present application, before receiving an access request from the first IoT device carrying a grayscale identifier, the first IoT device is also grayscale configured. Specifically, the microservice group creates a grayscale Kafka topic and a grayscale service corresponding to the grayscale Kafka topic through the device grayscale configuration service, and configures the mapping relationship between the first IoT device and the grayscale Kafka topic. Here, the grayscale service includes a grayscale producer service and / or a grayscale consumer service. In actual implementation, after creating a grayscale Kafka topic, a notification can be sent to the grayscale version service so that the grayscale version service creates a grayscale producer service and a grayscale consumer service for the grayscale Kafka topic. For example, taking the collection of alarm information as an example, assuming that the original version currently running is V2, its corresponding original topic is alarm_V2, the original collection service is logger-fert-V2, and the grayscale alarm service is alarm-server-V2. When configuring grayscale rules, if the corresponding grayscale version is V3, then create grayscale topics, grayscale collection service logger-fert-V3, and grayscale alarm service alarm-server-V3, and configure the mapping relationship between grayscale topics and grayscale services. For example, if the newly added grayscale topic is alarm_V3, then configure the producer of alarm_V3 as logger-fert-V3 and the consumer as alarm-server-V3. When configuring the grayscale of the device, modify the corresponding topic of the first IoT device that needs grayscale from alarm_V2 to alarm_V3. Then, add a grayscale identifier to the first IoT device so that the microservice group can identify the grayscale device. Among them, in the grayscale collection service logger-fert-V3, according to the association between the first IoT device and the grayscale topic, the device data sent by the first IoT device is pushed to the grayscale topic, namely alarm_V3. Then the grayscale alarm service alarm-server-V3 consumes the message of alarm_V3 and completes the new processing logic. After completing the above configuration for the first Internet of Things, the first Internet of Things device is triggered to go back online so that it can reconnect from the original service to the grayscale service, so that a new access request carrying the grayscale identifier can be issued.
[0072] In some embodiments, the user can issue a grayscale configuration instruction based on the grayscale configuration device to perform grayscale configuration of the microservice group through the device grayscale configuration service. Specifically, the user can configure the version, middleware, database and grayscale rules based on the grayscale configuration device. In actual implementation, when configuring the version, the original version number and the grayscale version number can be configured. When configuring the middleware, database and grayscale rules, the grayscale rules for sharing or isolating the reading and writing of the middleware and database by the service can be configured, and the grayscale rules for cross-service requests of the microservice group can also be configured, the grayscale isolation namespace can be configured, and the grayscale rules for users and devices can be configured. For the middleware or database, when sharing, it is necessary to configure a data structure that is compatible with both the original version and the grayscale version. When isolating, reading and writing need to configure the corresponding grayscale identifiers for the Kafka topics, keys, libraries, tables and indexes according to the grayscale isolation namespace.
[0073] In some embodiments, configuring the mapping relationship between the first IoT device and the grayscale Kafka topic includes: changing the Kafka topic of the first IoT device from the original Kafka topic to the grayscale Kafka topic; sending the address of the grayscale service to the first IoT device so that the first IoT device is connected to the grayscale service based on the address.
[0074] In actual implementation, after changing the topic corresponding to the first IoT device from alarm_V2 to alarm_V3, the grayscale collection service address corresponding to alarm_V3 is sent to the first IoT device, triggering it to reconnect to the grayscale collection service logger-fert-V3 after the device is back online. Through service reconnection, the microservice group can quickly provide the corresponding grayscale service to the grayscale device after identifying it.
[0075] In some embodiments, the method also includes: adjusting the device parameters of the first IoT device to target parameters; obtaining the current parameters of the first IoT device in the grayscale Kafka topic; if the current parameters are the same as the target parameters, determining that the grayscale configuration of the first IoT device is successful.
[0076] In actual implementation, after the grayscale configuration is performed, it is also verified to determine whether the grayscale configuration is successful. Specifically, the corresponding device parameter device page can be opened through the grayscale configuration device, and the device parameters of the grayscale device can be set to the target parameters in the device parameter setting page (for example, the temperature displayed by the grayscale device is set to 100°C), and then the grayscale service log is queried to obtain the message service data for the target parameters recorded in the log, and determine whether the current device parameters recorded in the message service data are consistent with the target parameters. If the two are consistent, it is determined that the grayscale configuration of the first Internet of Things device is successful, otherwise the grayscale configuration fails. In some embodiments, the current device parameters of the first Internet of Things device collected in the grayscale Kafka topic can also be displayed through the visualization tool of the Kafka platform, and the user can determine whether the grayscale configuration of the first Internet of Things device is successful by observing whether the displayed current device parameters are consistent with the target parameters.
[0077] In some embodiments, after determining that the grayscale configuration of the first IoT device is successful, the method further includes: determining multiple second IoT devices to be configured; and performing grayscale diversion on the multiple second IoT devices so that the grayscale service provides message services to the multiple second IoT devices.
[0078] In actual implementation, if the grayscale configuration is successful, other devices, i.e., the second IoT device, are gradually grayscale-directed from the original service to the grayscale service until all devices associated with the cloud device monitoring system are switched to the grayscale service and the grayscale release is completed. It should be noted that the grayscale diversion of the second IoT device includes the grayscale configuration of the second IoT device. The grayscale configuration process is the same as the grayscale configuration process of the first IoT device, and will not be repeated here. In some embodiments, grayscale configuration can be performed on multiple types of first IoT devices first. After the grayscale configuration of the first IoT device is successful, grayscale diversion can be performed on the second IoT device of the same type. Batch grayscale diversion of the same type of devices can ensure the reliability of grayscale diversion.
[0079] The following is a description of an exemplary structure of the grayscale publishing device 2022 provided in the embodiment of the present application as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the grayscale publishing device 2022 of the memory 202 may include:
[0080] The receiving module 20221 is used to receive an access request from a first IoT device;
[0081] The obtaining module 20222 is used to obtain a mapping relationship between the first IoT device and the grayscale Kafka topic if the access request carries a grayscale identifier;
[0082] A determination module 20223 is used to determine the grayscale Kafka topic corresponding to the first IoT device based on the mapping relationship;
[0083] The service module 20224 is used to use the Kafka platform to provide message services to the first Internet of Things device based on the grayscale Kafka topic and the corresponding grayscale service.
[0084] In some embodiments, the grayscale service includes a grayscale producer service and a grayscale consumer service. The service module 20224 is also used to use the grayscale producer service corresponding to the grayscale Kafka topic to produce messages related to the first Internet of Things device and deliver the messages to the grayscale Kafka topic; use the grayscale producer service corresponding to the grayscale Kafka topic to consume the messages from the grayscale Kafka topic.
[0085] In some embodiments, the grayscale producer service includes a grayscale collection service, the grayscale consumer service includes a grayscale alarm service, and the service module 20224 is also used to use the grayscale collection service to collect device parameters of the first Internet of Things device, and deliver the device parameters to the grayscale Kafka topic; if the device parameters include device alarm information, use the grayscale alarm service to obtain the device alarm information of the first Internet of Things device from the grayscale Kafka topic, and send the device alarm information to the alarm device.
[0086] In some embodiments, the device also includes: a configuration module for creating a grayscale Kafka topic and a grayscale service corresponding to the grayscale Kafka topic; configuring a mapping relationship between the first Internet of Things device and the grayscale Kafka topic; adding the grayscale identifier to the first Internet of Things device; and triggering the first Internet of Things device to go back online, causing it to issue a new access request.
[0087] In some embodiments, the configuration module is also used to change the Kafka topic of the first IoT device from the original Kafka topic to the grayscale Kafka topic; and send the address of the grayscale service to the first IoT device so that the first IoT device is connected to the grayscale service based on the address.
[0088] In some embodiments, the device also includes: a verification module, used to adjust the device parameters of the first Internet of Things device to target parameters; obtain the current parameters of the first Internet of Things device in the grayscale Kafka topic; if the current parameters are the same as the target parameters, it is determined that the grayscale configuration of the first Internet of Things device is successful.
[0089] In some embodiments, the device also includes: a grayscale diversion module, used to determine multiple second Internet of Things devices to be configured; and grayscale diversion is performed on the multiple second Internet of Things devices so that the grayscale service provides message services to the multiple second Internet of Things devices.
[0090] It should be noted that the description of the device of the embodiment of the present application is similar to the description of the above-mentioned method embodiment, and has similar beneficial effects as the method embodiment, so it will not be repeated.
[0091] The embodiment of the present application provides a cloud device monitoring system, including a microservice group, wherein the microservice group includes a Kafka platform, an original service, and a corresponding grayscale service;
[0092] The original service is used to receive an access request from an IoT device; if the access request carries a grayscale identifier, obtain a mapping relationship between the IoT device and the grayscale Kafka topic; based on the mapping relationship, determine the grayscale Kafka topic corresponding to the IoT device;
[0093] The Kafka platform is used to provide message services to the IoT device based on the Grayscale Kafka topic and in collaboration with corresponding Grayscale services.
[0094] In some embodiments, the grayscale service includes a grayscale producer service and a grayscale consumer service. The Kafka platform is also used to use the grayscale producer service corresponding to the grayscale Kafka topic to produce messages related to the first Internet of Things device and deliver the messages to the grayscale Kafka topic; and use the grayscale producer service corresponding to the grayscale Kafka topic to consume the messages from the grayscale Kafka topic.
[0095] In some embodiments, the grayscale producer service includes a grayscale collection service, the grayscale consumer service includes a grayscale alarm service, and the Kafka platform is also used to use the grayscale collection service to collect device parameters of the first Internet of Things device, and deliver the device parameters to the grayscale Kafka topic; if the device parameters include device alarm information, the grayscale alarm service is used to obtain the device alarm information of the first Internet of Things device from the grayscale Kafka topic, and the device alarm information is sent to the alarm device.
[0096] In some embodiments, the microservice group also includes a device grayscale configuration service, which is used to create a grayscale Kafka topic and a grayscale service corresponding to the grayscale Kafka topic; configure a mapping relationship between the first IoT device and the grayscale Kafka topic; add the grayscale identifier to the first IoT device; and trigger the first IoT device to go back online, causing it to issue a new access request.
[0097] In some embodiments, the device grayscale configuration service is also used to change the Kafka topic of the first IoT device from the original Kafka topic to the grayscale Kafka topic; and send the address of the grayscale service to the first IoT device so that the first IoT device connects to the grayscale service based on the address.
[0098] In some embodiments, the device grayscale configuration service is also used to adjust the device parameters of the first IoT device to target parameters; obtain the current parameters of the first IoT device in the grayscale Kafka topic; if the current parameters are the same as the target parameters, it is determined that the grayscale configuration of the first IoT device is successful.
[0099] In some embodiments, the device grayscale configuration service is also used to, after determining that the grayscale configuration of the first IoT device is successful, the method also includes: determining multiple second IoT devices to be configured; and performing grayscale drainage on the multiple second IoT devices so that the grayscale service provides message services to the multiple second IoT devices.
[0100] The embodiment of the present application provides a computer program product, which includes computer instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the grayscale release method described in the embodiment of the present application.
[0101] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the grayscale release method provided in the embodiment of the present application.
[0102] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.
[0103] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0104] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0105] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0106] In summary, the efficiency of grayscale publishing can be improved through the embodiments of the present application.
[0107] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A grayscale release method, characterized in that: include: receiving an access request from a first IoT device; If the access request carries a grayscale identifier, obtain a mapping relationship between the first IoT device and the grayscale Kafka topic; Based on the mapping relationship, determine the grayscale Kafka topic corresponding to the first IoT device; The Kafka platform is used to provide a message service to the first Internet of Things device based on the grayscale Kafka topic and the corresponding grayscale service.
2. The method according to claim 1, characterized in that The grayscale service includes a grayscale producer service and a grayscale consumer service. The use of the Kafka platform to provide a message service to the first IoT device based on the grayscale Kafka topic and the corresponding grayscale service includes: Using the grayscale producer service corresponding to the grayscale Kafka topic, producing a message related to the first IoT device, and delivering the message to the grayscale Kafka topic; The message is consumed from the grayscale Kafka topic using the grayscale producer service corresponding to the grayscale Kafka topic.
3. The method according to claim 2, characterized in that The grayscale producer service includes a grayscale collection service, the grayscale consumer service includes a grayscale alarm service, and the grayscale producer service corresponding to the grayscale Kafka topic is used to produce a message related to the first IoT device, and the message is delivered to the grayscale Kafka topic, including: Using the grayscale collection service, collecting device parameters of the first IoT device, and delivering the device parameters to the grayscale Kafka topic; Correspondingly, the grayscale producer service corresponding to the grayscale Kafka topic is used to consume the message from the grayscale Kafka topic, including: If the device parameters include device alarm information, the grayscale alarm service is used to obtain the device alarm information of the first IoT device from the grayscale Kafka topic, and the device alarm information is sent to an alarm device.
4. The method according to claim 1, characterized in that: Before receiving an access request from a first IoT device carrying a grayscale identifier, the method further includes: Create a grayscale Kafka topic and a grayscale service corresponding to the grayscale Kafka topic; Configure a mapping relationship between the first IoT device and the grayscale Kafka topic; Adding the grayscale identifier to the first IoT device; Trigger the first IoT device to go back online, causing it to issue a new access request.
5. The method according to claim 4, characterized in that The configuring a mapping relationship between the first IoT device and the grayscale Kafka topic includes: Changing the Kafka topic of the first IoT device from the original Kafka topic to the grayscale Kafka topic; The address of the grayscale service is sent to the first IoT device, so that the first IoT device is connected to the grayscale service based on the address.
6. The method according to claim 4 or 5, characterized in that: The method further comprises: Adjusting device parameters of the first IoT device to target parameters; Obtain current parameters of the first IoT device in the grayscale Kafka topic; If the current parameter is the same as the target parameter, it is determined that the grayscale configuration of the first Internet of Things device is successful.
7. The method according to claim 6, characterized in that After determining that the grayscale configuration of the first IoT device is successful, the method further includes: Determining a plurality of second IoT devices to be configured; Grayscale traffic is directed to the multiple second IoT devices so that the grayscale service provides message services to the multiple second IoT devices.
8. A grayscale publishing device, characterized in that: include: A receiving module, configured to receive an access request from a first IoT device; An acquisition module, used for obtaining a mapping relationship between the first IoT device and the Grayscale Kafka topic if the access request carries a Grayscale identifier; A determination module, configured to determine, based on the mapping relationship, a grayscale Kafka topic corresponding to the first IoT device; A first service module, configured to provide a message service to the first IoT device based on the grayscale Kafka topic and the corresponding grayscale service using the Kafka platform; The second service module is used to provide a message service to the first Internet of Things device based on the original Kafka topic and the original service by using the Kafka platform if the access request does not carry the grayscale identifier.
9. An electronic device, characterized in that: include: A memory for storing executable instructions; The processor is used to implement the grayscale release method described in any one of claims 1 to 7 when executing the executable instructions stored in the memory.
10. A cloud device monitoring system, characterized in that: It includes a microservice group, which includes a Kafka platform, an original service, and a corresponding grayscale service; The original service is used to receive an access request from an IoT device; If the access request carries a grayscale identifier, a mapping relationship between the IoT device and the grayscale Kafka topic is obtained; Based on the mapping relationship, determine the grayscale Kafka topic corresponding to the IoT device; The Kafka platform is used to provide message services to the IoT device based on the Grayscale Kafka topic and in collaboration with corresponding Grayscale services.