Netty-based cloud-cloud docking method and device, storage medium and program product
Through the cloud-cloud docking method of Netty framework, the problems of high complexity and delay in cloud-cloud docking in the existing technology are solved, efficient and secure data transmission and real-time updates are achieved, and the efficiency of cloud-cloud docking is improved.
Patent Information
- Application Number
- CN202510286149.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-07-01
AI Technical Summary
The existing cloud-to-cloud docking technology has high complexity and high end-to-end latency, resulting in low efficiency and difficult to guarantee data security.
The Netty framework is used to realize cloud-cloud docking, verify the client's authentication information through the central cloud platform, establish a stable TCP long connection, and obtain the latest material model function definition of the device, perform data format conversion, and ensure the security and real-timeness of data transmission.
It reduces the complexity and end-to-end delay of cloud-to-cloud docking, improves the efficiency and security of cloud-to-cloud docking, and realizes real-time data updates and accuracy.
Smart Images

Figure CN120238561A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a cloud-to-cloud docking method, device, storage medium, and program product based on Netty. Background Art
[0002] With the rapid progress of Internet of Things technology, many devices are being connected to the central Internet of Things cloud platform. For some legacy devices, the unified management of the central cloud platform is usually achieved through the docking between different cloud platforms, that is, cloud-to-cloud docking.
[0003] In the prior art, cloud-to-cloud docking is implemented using technologies based on REST (Representational State Transfer) API (Application Programming Interface) or message queues. To ensure data security, both REST API and message queues require additional configuration.
[0004] Therefore, the prior art has high complexity and high end-to-end latency, resulting in low efficiency of cloud-to-cloud docking. Summary of the Invention
[0005] This application provides a cloud-to-cloud docking method, device, storage medium, and program product based on Netty, so as to achieve the effect of reducing the complexity of cloud-to-cloud docking and end-to-end latency, thereby improving the efficiency of cloud-to-cloud docking.
[0006] In a first aspect, this application provides a cloud-to-cloud docking method based on Netty, which is applied to a cloud-to-cloud docking client and includes:
[0007] Sending a software development kit online request to the central cloud platform, so that the central cloud platform verifies the authentication information of the cloud-to-cloud docking client according to the software development kit online request, and after successful verification, establishes a Transmission Control Protocol long connection between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request;
[0008] Responding to a device online request sent by a third-party platform after the device goes online, and reading the adapter configuration information corresponding to the device;
[0009] Obtaining the latest physical model function definition corresponding to the device;
[0010] Responding to a call attribute publishing request sent by the third-party platform after receiving the uplink data sent by the device, and performing format conversion on the uplink data according to the latest physical model function definition to obtain device uplink data that meets the latest physical model function definition;
[0011] Send the upstream data of the device to the central cloud platform so that the central cloud platform updates the device data according to the upstream data of the device;
[0012] Receive the downstream data of the device sent by the central cloud platform after updating the device data;
[0013] Perform format conversion on the downstream data of the device to obtain downstream data that meets the downstream device data format;
[0014] According to the downstream data, send a call for a downstream device control request to the third-party platform so that the third-party platform sends the downstream data to the device.
[0015] In a possible implementation manner, the obtaining the latest physical model function definition corresponding to the device includes: sending a pull request for the physical model to the central cloud platform, where the pull request is used to pull the latest physical model function definition in the central cloud platform; receiving the latest physical model function definition corresponding to the device sent by the central cloud platform, where the latest physical model function definition is sent by the central cloud platform in response to the pull request for the physical model, and / or the latest physical model function definition is sent by the central cloud platform in response to an update by a user in the central cloud platform; updating the physical model locally in the cloud-cloud docking client according to the latest physical model function definition.
[0016] In a possible implementation manner, at least one of the software development kit online request, the device online request, the latest physical model function definition, the call attribute publishing request, the upstream data of the device, the downstream data of the device, and the downstream data is transmitted between the cloud-cloud docking client and the central cloud platform by using a custom codec; the custom codec is used to perform encoding and decoding processing on data in the format of a cloud-cloud docking data message frame; where the cloud-cloud docking data message frame format includes a message identifier, a control unit, application data, and a cyclic redundancy check bit.
[0017] In a possible implementation manner, before sending the software development kit online request to the central cloud platform, it further includes: receiving service configuration item information sent by the central cloud platform, where the service configuration item information is sent by the central cloud platform to the cloud-cloud docking client after creating a cloud-cloud docking service and service instance, creating a product and a device, and binding the product to the service instance, and the service configuration item information includes a service unique code, a service key, a service password, an instance unique code, and a list of products allowed for data transmission; generating a software development kit online request according to the service configuration item information.
[0018] In a possible implementation, the service unique code, the service key, and the service password are used by the central cloud platform to verify the authentication information of the cloud-to-cloud docking client; the service unique code and the instance unique code are used to uniquely identify the transmission control protocol long connection between the cloud-to-cloud docking client and the central cloud platform.
[0019] In a second aspect, the present application provides a cloud-to-cloud docking method based on Netty, which is applied to a central cloud platform and includes:
[0020] Receiving a software development kit online request sent by a cloud-to-cloud docking client;
[0021] According to the software development kit online request, verifying the authentication information of the cloud-to-cloud docking client, and after successful verification, establishing a transmission control protocol long connection between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request;
[0022] Receiving device uplink data sent by the cloud-to-cloud docking client, where the device uplink data is that the cloud-to-cloud docking client reads the adapter configuration information corresponding to the device in response to a device online request sent by a third-party platform after the device goes online, obtains the latest physical model function definition corresponding to the device, and in response to a call attribute publishing request sent by the third-party platform after receiving the uplink data sent by the device, performs format conversion on the uplink data according to the latest physical model function definition;
[0023] Updating device data according to the device uplink data;
[0024] After updating the device data, sending device downlink data to the cloud-to-cloud docking client, so that the cloud-to-cloud docking client performs format conversion on the device downlink data to obtain downlink data that meets the downlink device data format, and according to the downlink data, sending a call downlink device control request to the third-party platform, so that the third-party platform sends the downlink data to the device.
[0025] In a possible implementation, before receiving the software development kit online request sent by the cloud-to-cloud docking client, it further includes: creating a cloud-to-cloud docking service and a service instance; creating a product and a device; binding the product to the service instance; and sending service configuration item information to the cloud-to-cloud docking client, where the service configuration item information includes a service unique code, a service key, a service key, an instance unique code, and a list of products allowed for data transmission.
[0026] In a third aspect, the present application provides a cloud-to-cloud docking device based on Netty, including: a memory, a processor;
[0027] The memory stores computer-executable instructions;
[0028] The processor executes the computer-executable instructions stored in the memory, such that the processor executes the first aspect and / or various possible implementation manners of the first aspect as described above.
[0029] In a fourth aspect, the present application provides a cloud-to-cloud docking device based on Netty, including: a memory, a processor;
[0030] The memory stores computer-executable instructions;
[0031] The processor executes the computer-executable instructions stored in the memory, such that the processor executes the second aspect and / or various possible implementation manners of the second aspect as described above.
[0032] In a fifth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the first aspect and / or various possible implementation manners of the first aspect as described above.
[0033] In a sixth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the second aspect and / or various possible implementation manners of the second aspect as described above.
[0034] In a seventh aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the first aspect and / or various possible implementation manners of the first aspect as described above.
[0035] In an eighth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the second aspect and / or various possible implementation manners of the second aspect as described above.
[0036] The cloud-to-cloud docking method, device, storage medium and program product based on Netty provided by the present application, based on the cloud-to-cloud docking service architecture of Netty, realizes a stable TCP long connection between the cloud-to-cloud docking client and the central cloud platform. This connection method can effectively avoid the performance degradation caused by the traditional blocking mechanism. Before establishing the TCP long connection, the central cloud platform verifies the authentication information of the cloud-to-cloud docking client to ensure the security and reliability of communication; afterwards, the latest device model function definition corresponding to the device is obtained to ensure that the service can obtain complete device model information at the initial stage and realize real-time update of information, so as to ensure the real-time performance and accuracy of data while optimizing performance. Furthermore, based on the latest device model, cloud-to-cloud docking is completed, reducing the complexity of cloud-to-cloud docking and end-to-end latency, thereby improving the efficiency of cloud-to-cloud docking. Description of the Drawings
[0037] The drawings herein are incorporated into and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0038] Figure 1 It is a schematic diagram of the scenario of the cloud-to-cloud docking method based on Netty provided by an embodiment of the present application;
[0039] Figure 2 It is a schematic diagram of the architecture of the cloud-to-cloud docking method based on Netty provided by an embodiment of the present application;
[0040] Figure 3 It is a flowchart of the cloud-to-cloud docking method based on Netty provided by an embodiment of the present application Figure 1 ;
[0041] Figure 4 It is a flowchart of the cloud-to-cloud docking method based on Netty provided by an embodiment of the present application Figure 2 ;
[0042] Figure 5 It is a flowchart of the cloud-to-cloud docking method based on Netty provided by an embodiment of the present application Figure 3 ;
[0043] Figure 6 It is a schematic diagram of the structure of the cloud-to-cloud docking device based on Netty provided by the present application Figure 1 ;
[0044] Figure 7 It is a schematic diagram of the structure of the cloud-to-cloud docking device based on Netty provided by the present application Figure 2 ;
[0045] Figure 8 It is a schematic diagram of the structure of the cloud-to-cloud docking device based on Netty provided by the present application
[0046] Through the above drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and written descriptions are not intended to limit the scope of the concept of the present application in any way, but to explain the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed Embodiments
[0047] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0048] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for users to choose to authorize or reject.
[0049] There are mainly two implementation methods for the existing cloud-to-cloud docking: hard-coded implementation based on REST and implementation based on message queues such as Kafka. Each of these two methods has its limitations.
[0050] For the hard-coded implementation based on REST, its blocking nature will lead to a significant decline in performance when facing a large number of devices reporting data simultaneously. This is because each data reporting request must wait for the previous request to be processed, thus unable to fully utilize system resources and resulting in a relatively high end-to-end latency. In addition, when transmitting sensitive data, the REST API cannot guarantee data security, and additional security measures need to be taken to protect data privacy, which not only increases the complexity of implementation but also raises costs.
[0051] On the other hand, although the implementation based on message queues such as Kafka shows certain advantages in processing large-scale data, it also faces the problem of performance bottlenecks caused by data backlog, which is particularly prominent when the data volume increases sharply, and may affect the response time, resulting in a relatively high end-to-end latency and thus unable to meet user requirements. At the same time, message queues cannot guarantee data security. To ensure data security and compliance with industry standards, additional configurations are required for message queues such as Kafka, which increases the complexity of operation and maintenance.
[0052] In summary, the existing cloud-to-cloud docking implementation technologies have high complexity and high end-to-end latency, resulting in low efficiency of cloud-to-cloud docking.
[0053] To solve the above technical problems, the cloud-to-cloud docking method based on Netty provided by this application performs authentication information verification on the cloud-to-cloud docking client through the central cloud platform, and establishes a stable Transmission Control Protocol (TCP) long connection between the cloud-to-cloud docking client and the central cloud platform after successful verification; the cloud-to-cloud docking client obtains the latest device model function definition, converts the format of the device uplink data, and sends it to the central cloud platform; the central cloud platform updates the device data according to the device uplink data. This reduces the complexity of cloud-to-cloud docking and end-to-end latency, thereby improving the efficiency of cloud-to-cloud docking.
[0054] Figure 1 The following is a schematic diagram of the scenario of the cloud-to-cloud docking method based on Netty provided by the embodiments of this application. As Figure 1 shown, the specific application scenarios of this application include: device 101, third-party cloud platform 102, cloud-to-cloud docking client 103, and central cloud platform 104.
[0055] Among them, device 101 can be an Internet of Things device.
[0056] Among them, device 101 can communicate with the third-party cloud platform 102, the third-party cloud platform 102 also establishes a communication connection with the cloud-to-cloud docking client 103, and the cloud-to-cloud docking client 103 and the central cloud platform 104 can communicate with each other.
[0057] Optionally, the embodiments of this application provide a user-unaware secure cloud-to-cloud docking service, which allows device 101 to finally communicate with the central cloud platform 104 through the third-party cloud platform 102. This service is applicable to Internet of Things (IoT) devices that require cross-cloud platform operations. Its main architecture design is based on Netty, which is an asynchronous event-driven network application framework based on Java and is used to quickly develop high-performance and highly reliable network servers and clients.
[0058] Among them, the cloud-to-cloud docking client 103 completes the communication service based on Netty. Benefiting from the high-performance network communication framework of Netty, the cloud-to-cloud docking client 103 adopts a non-blocking IO (Input Output) processing method to ensure the efficient data processing ability of the system under high concurrency and avoid the performance degradation caused by the traditional blocking mechanism.
[0059] Optionally, the Netty-based user-unaware secure cloud-cloud docking method provided by the embodiments of the present application ensures the efficient data processing ability of the system in high-concurrency scenarios by adopting a non-blocking IO processing method, avoiding the performance degradation caused by traditional blocking mechanisms. At the same time, the cloud-cloud docking proposed by the embodiments of the present application has dynamic parsing and conversion functions, which can read and parse the function definitions of the device-corresponding physical models in real time, realize automatic data format conversion, enabling users to freely expand the product function definitions without touching the service source code, greatly improving the flexibility and scalability of the system. In addition, the service strengthens the security and consistency verification of data transmission by customizing the data message frame format, ensuring the reliability and integrity of data transmission between cloud platforms.
[0060] Optionally, Figure 2 is a schematic architecture diagram of the Netty-based cloud-cloud docking method provided by the embodiments of the present application. As Figure 2 shown, the cloud-cloud docking client and the central cloud platform are implemented through a TCP long connection, and a combination of a service-unique encoding and an instance-unique encoding is used to identify the TCP long connection.
[0061] Among them, each cloud-cloud docking client contains an adapter configuration file, which includes the access address, port, and service configuration information array of the central cloud platform. Each service configuration item includes a service-unique encoding, a service key, a service password, an instance-unique encoding, and a product list allowing data transmission. The service-unique encoding, service key, and service password are used for the authentication and online access of the cloud-cloud docking client. The service-unique encoding and the instance-unique encoding are used to uniquely identify a TCP connection.
[0062] The architecture of the Netty-based cloud-cloud docking method provided by the embodiments of the present application has the ability to cluster-deploy the client and the server, effectively ensuring the high availability of the cloud-cloud docking client and the high efficiency of data processing. Under this architecture, the communication between the cloud-cloud docking client and the central cloud platform is implemented through a TCP long connection, and a combination of a service-unique encoding and an instance-unique encoding is used to identify the TCP long connection, enabling the central cloud platform to distinguish the data of different instances, allowing the central cloud platform to receive data reports of the same product from different cloud-cloud docking clients in parallel, ensuring that even if a certain cloud-cloud docking client fails, other cloud-cloud docking clients can continue to transmit data, thus improving the high availability of cloud-cloud docking.
[0063] It should be noted that during the process of reporting data to the central cloud platform, the cloud-to-cloud docking client matches the product list in the configuration file with the product key of the device, and then determines the service unique code and instance unique code of the device reporting channel. In addition, thanks to the high-performance network communication framework Netty, the cloud-to-cloud docking client adopts a non-blocking IO processing method to ensure efficient data processing capabilities in high-concurrency situations, avoiding performance degradation caused by traditional blocking mechanisms and reducing end-to-end latency.
[0064] The following uses specific embodiments to elaborate in detail on the technical solution of this application and how the technical solution of this application solves the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0065] Figure 3 Flow schematic of the cloud-to-cloud docking method based on Netty provided by the embodiment of this application Figure 1 。The execution subject of this embodiment can be Figure 1 the cloud-to-cloud docking client 103 shown in Figure 3 or other computer devices, and no special restrictions are imposed here in this embodiment. As
[0066] shown, this method includes:
[0067] S301: Initiate a software development kit online request to the central cloud platform, so that the central cloud platform verifies the authentication information of the cloud-to-cloud docking client according to the software development kit online request, and after successful verification, establish a Transmission Control Protocol long connection between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request.
[0068] Among them, the software development kit (SDK) can be transmitted between the cloud-to-cloud docking client and the central cloud platform by using a custom encoder.
[0069] Among them, the custom codec is used to encode and decode the data in the format of the cloud-to-cloud docking data message frame.
[0070] Among them, the message identifier includes a message start identifier and an end identifier, which are used to clearly define the start and end of a message, ensuring that the receiving party can accurately identify and parse the message; the control unit includes key metadata such as a business serial number, a timestamp, a service unique code, an instance unique code, and a command type, providing necessary context information for the message to facilitate subsequent processing by the receiving party; the application data is used to encapsulate specific business data objects, and its length is variable to meet the requirements of different business scenarios; the CRC bit is calculated using the cyclic redundancy check algorithm and is used to ensure the integrity of data transmission and prevent errors from occurring during data transmission.
[0071] It should be noted that the embodiment of this application adopts the cloud-to-cloud docking data packet frame format and implements a custom encoder and decoder; during the encoding and decoding process, according to the command type, the application data is encapsulated or parsed into the corresponding Message entity to ensure that the application layer can process it correctly.
[0072] It should be noted that in order to maintain the TCP long connection between the cloud-to-cloud docking client and the central cloud platform, the embodiment of this application adds a heartbeat mechanism to the transmission control protocol. The heartbeat message, as a data packet in a specific format, is used to detect the survival status of the long connection, ensuring the stability and reliability of the TCP long connection.
[0073] It should be noted that after encoding is completed, the custom encoder encrypts the transmitted byte stream, ensuring the security of data transmission in cloud-to-cloud docking and preventing data leakage and tampering.
[0074] Table 1
[0075]
[0076] S302: In response to the device online request sent by the third-party platform after the device goes online, read the adapter configuration information corresponding to the device.
[0077] Among them, the device online request can be transmitted between the cloud-to-cloud docking client and the central cloud platform by using a custom encoder.
[0078] Specifically, match the adapter configuration file according to the device online request to obtain the adapter configuration information corresponding to the device.
[0079] S303: Obtain the latest physical model function definition corresponding to the device.
[0080] Specifically, receive the latest physical model function definition corresponding to the device sent by the central cloud platform.
[0081] S304: In response to the call attribute publishing request sent by the third-party platform after receiving the uplink data sent by the device, format conversion is performed on the uplink data according to the latest device model function definition to obtain device uplink data that meets the latest device model function definition.
[0082] Specifically, according to the latest device model function definition, the data format of the uplink data is converted into the latest device model data format.
[0083] S305: Send the device uplink data to the central cloud platform so that the central cloud platform updates the device data according to the device uplink data.
[0084] S306: Receive the device downlink data sent by the central cloud platform after updating the device data.
[0085] Among them, at least one of the software development kit online request, device online request, latest device model function definition, call attribute publishing request, device uplink data, device downlink data, and downlink data is transmitted between the cloud-to-cloud docking client and the central cloud platform by using a custom codec.
[0086] S307: Perform format conversion on the device downlink data to obtain downlink data that meets the downlink device data format.
[0087] S308: Send a call to the downlink device control request to the third-party platform according to the downlink data so that the third-party platform sends the downlink data to the device.
[0088] The cloud-to-cloud docking method based on Netty provided by the embodiments of the present application, based on the cloud-to-cloud docking service architecture of Netty, realizes a stable TCP long connection between the cloud-to-cloud docking client and the central cloud platform. This connection method can effectively avoid the performance degradation caused by the traditional blocking mechanism. Before establishing the TCP long connection, the central cloud platform verifies the authentication information of the cloud-to-cloud docking client to ensure the security and reliability of communication. After that, the latest device model function definition corresponding to the device is obtained to ensure that the service can obtain complete device model information at the initial stage and realize real-time update of information, thereby optimizing performance while ensuring the real-time and accuracy of data. Furthermore, based on the latest device model, cloud-to-cloud docking is completed, reducing the complexity of cloud-to-cloud docking and end-to-end latency, and thus improving the efficiency of cloud-to-cloud docking.
[0089] In an embodiment of the present application, on the basis of the above embodiment, another implementation manner is further provided for step S303, which is described in detail as follows:
[0090] S3031: Initiate a pull request for the device model to the central cloud platform, where the pull request is used to pull the latest device model function definition in the central cloud platform.
[0091] Specifically, according to the product list in the adapter configuration file, a pull request for the generated object model is sent; a pull request for the object model is initiated to the central cloud platform.
[0092] S3032: Receive the latest object model function definition corresponding to the device sent by the central cloud platform, where the latest object model function definition is sent by the central cloud platform in response to the pull request for the object model, and / or the latest object model function definition is sent by the central cloud platform in response to an update by the user on the central cloud platform.
[0093] Among them, the object model function definition includes object model data format, device identifier, device attributes, protocols, etc.
[0094] It should be noted that there are two ways for the cloud-to-cloud docking client to obtain the latest object model function definition: one is to automatically pull the object model function definition corresponding to the product list defined in the adapter configuration information from the central cloud platform to ensure that the cloud-to-cloud docking client can obtain complete object model information in the initial stage; the other is that after the object model function definition on the central cloud platform changes, the central platform will actively push the latest object model function definition to the cloud-to-cloud docking client to achieve real-time update of the object model function definition. This combination of push and pull endows the cloud-to-cloud docking client with the ability of dynamic parsing and conversion, enabling it to read and parse the object model function definition corresponding to the device in real time and automatically perform data format conversion. Through the above mechanism, users can expand or modify the object model function definition of the product without touching the service source code, significantly improving the flexibility and scalability of cloud-to-cloud docking, enabling it to quickly adapt to changes in product functions, while maintaining the stability and efficiency of cloud-to-cloud docking.
[0095] S3033: Update the object model locally in the cloud-to-cloud docking client according to the latest object model function definition.
[0096] Specifically, replace the current object model function definition with the latest object model function definition to update the object model locally in the cloud-to-cloud docking client.
[0097] The cloud-to-cloud docking method based on Netty provided in the embodiments of the present application realizes real-time update of the object model function definition by the cloud-to-cloud docking client actively pulling the latest object model function definition and the central cloud platform responding to the update by the user on the central cloud platform and sending the latest object model function definition to the cloud-to-cloud docking service, thereby optimizing the cloud-to-cloud docking performance while ensuring the real-time and accuracy of data, without any additional configuration, greatly improving the user experience.
[0098] In an embodiment of the present application, on the basis of the above embodiment, before step S301, it further includes the process of generating a software development kit online request, which is described in detail as follows:
[0099] S309: Receive the service configuration item information sent by the central cloud platform. The service configuration item information is sent by the central cloud platform to the cloud-cloud docking client after creating the cloud-cloud docking service and service instance, creating the product and device, and binding the product to the service instance. The service configuration item information includes the service unique code, service key, service password, instance unique code, and the list of products allowed for data transmission.
[0100] Among them, the service unique code, service key, and service password are used by the central cloud platform to verify the authentication information of the cloud-cloud docking client.
[0101] Among them, the service unique code and instance unique code are used to uniquely identify the Transmission Control Protocol long connection between the cloud-cloud docking client and the central cloud platform.
[0102] It should be noted that using the combination of the service unique code and instance unique code as the unique identifier of the Transmission Control Protocol long connection ensures the high availability of the cloud-cloud docking client and ensures the continuity and stability of data transmission in case of failures of some cloud-cloud docking clients.
[0103] S310: Generate a software development kit online request according to the service configuration item information.
[0104] In an embodiment of the present application, after the cloud-cloud docking client receives the data packet sent by the sender, it further includes a verification process for the data packet, which is described in detail as follows:
[0105] Perform a preliminary verification on the data packet; if the data packet verification fails, identify the error type of the data packet, and send an error response to the sender according to the error type; after the error response is successfully sent, start the retransmission mechanism and send a retransmission data packet request to the sender.
[0106] Specifically, performing a preliminary verification on the data packet includes: verifying whether the basic structure of the data packet is complete.
[0107] Among them, the basic structure of the data packet includes key information such as the header, length, and checksum of the data packet.
[0108] Among them, the error types of the data packet include length mismatch, checksum error, format error, etc.
[0109] The cloud-cloud docking method based on Netty provided by the embodiment of the present application can significantly improve the reliability of data transmission by performing a preliminary verification on the data packet, sending an error response to the sender according to the error type, and sending a retransmission data packet request to the sender.
[0110] In an embodiment of the present application, on the basis of the above embodiment, it further includes a processing process for error data packets, which is described in detail as follows:
[0111] If the data packet verification fails, the number of error data packets is counted; if it is determined that the number of error data packets reaches a preset threshold, a warning message is sent to the central cloud platform so that the central cloud platform can give an alarm according to the warning message to notify the user or administrator to handle it in time.
[0112] The cloud-to-cloud docking method based on Netty provided by the embodiments of this application can quickly respond and take actions when problems occur in data transmission by sending a warning message to the central cloud platform.
[0113] Figure 4 It is a flow schematic diagram of the cloud-to-cloud docking method based on Netty provided by the embodiments of this application Figure 2 。The execution subject of this embodiment can be Figure 1 the central cloud platform 104 shown in Figure 4 , or other computer devices, and no special limitation is made here for this embodiment. As
[0114] S401: Receive the software development kit online request sent by the cloud-to-cloud docking client.
[0115] S402: According to the software development kit online request, verify the authentication information of the cloud-to-cloud docking client, and after the verification is successful, establish a Transmission Control Protocol long connection between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request.
[0116] Specifically, match the software development kit online request with the pre-stored authentication information. If the match is successful, the verification is successful; if the match fails, the verification fails.
[0117] S403: Receive the device uplink data sent by the cloud-to-cloud docking client. The device uplink data is obtained by the cloud-to-cloud docking client in response to the device online request sent by the third-party platform after the device goes online, reading the adapter configuration information corresponding to the device, obtaining the latest physical model function definition corresponding to the device, and in response to the call attribute publishing request sent by the third-party platform after receiving the uplink data sent by the device, and performing format conversion on the uplink data according to the latest physical model function definition.
[0118] S404: Update the device data according to the device uplink data.
[0119] S405: After updating the device data, send device downlink data to the cloud-to-cloud docking client so that the cloud-to-cloud docking client performs format conversion on the device downlink data to obtain downlink data that meets the downlink device data format, and according to the downlink data, send a call to the third-party platform for a downlink device control request so that the third-party platform sends the downlink data to the device.
[0120] The Netty-based cloud-to-cloud docking method provided in the embodiment of the present application verifies the authentication information of the cloud-to-cloud docking client, and after the verification is successful, establishes a transmission control protocol long connection between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request, thereby improving the security of the cloud-to-cloud docking, reducing the end-to-end delay of the cloud-to-cloud docking, and improving the efficiency of the cloud-to-cloud docking.
[0121] In one embodiment of the present application, based on the above embodiment, after step S401, a process of sending service configuration item information to the cloud-to-cloud docking client is further included, which is described in detail as follows:
[0122] S406: Create a cloud-to-cloud connection service and service instance.
[0123] S407: Create products and equipment.
[0124] S408: Product binding service instance.
[0125] S409: Send service configuration item information to the cloud-to-cloud docking client, where the service configuration item information includes a service unique code, a service key, a service key, an instance unique code, and a list of products that allow data transmission.
[0126] The Netty-based cloud-to-cloud docking method provided in the embodiment of the present application provides a basis for verifying the authentication information of the cloud-to-cloud docking client by sending service configuration item information to the cloud-to-cloud docking client, thereby improving the security of the cloud-to-cloud docking.
[0127] Figure 5 Schematic diagram of the process of the cloud-to-cloud connection method based on Netty provided in the embodiment of the present application Figure 3 .like Figure 5 As shown, the method includes:
[0128] S501: The central cloud platform creates cloud-to-cloud docking services, service instances, products and devices.
[0129] S502: The central cloud platform binds the product to the service instance.
[0130] S503: The central cloud platform sends service configuration item information to the cloud-to-cloud docking client, where the service configuration item information includes a service unique code, a service key, a service key, an instance unique code, and a list of products that allow data transmission.
[0131] S504: The cloud-to-cloud docking client initiates a software development kit online request to the central cloud platform.
[0132] S505: The central cloud platform verifies the authentication information of the cloud-to-cloud docking client according to the software development kit online request. After successful verification, a Transmission Control Protocol long connection is established between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request.
[0133] S506: The device sends the online information to the third-party platform.
[0134] S507: The third-party platform sends a device online request to the cloud-to-cloud docking client.
[0135] S508: In response to the device online request, the cloud-to-cloud docking client reads the adapter configuration information corresponding to the device.
[0136] S509: The cloud-to-cloud docking client receives the latest physical model function definition corresponding to the device sent by the central cloud platform.
[0137] Among them, the latest physical model function definition is sent by the central cloud platform in response to the pull request of the physical model, and / or the latest physical model function definition is sent by the central cloud platform in response to the update of the user on the central cloud platform.
[0138] S510: The device sends the uplink data to the third-party platform.
[0139] S511: The third-party platform sends a call attribute publishing request to the cloud-to-cloud docking client.
[0140] S512: The cloud-to-cloud docking client converts the format of the uplink data according to the latest physical model function definition to obtain device uplink data that meets the latest physical model function definition.
[0141] S513: The cloud-to-cloud docking client sends the device uplink data to the central cloud platform.
[0142] S514: The central cloud platform updates the device data according to the device uplink data.
[0143] S515: The central cloud platform sends device downlink data to the cloud-to-cloud docking client.
[0144] S516: The cloud-to-cloud docking client converts the format of the device downlink data to obtain downlink data that meets the downlink device data format.
[0145] S517: The cloud-to-cloud docking client sends a call to the downlink device control request to the third-party platform according to the downlink data.
[0146] S518: The third-party platform sends the downstream data to the device. The cloud-to-cloud docking method based on Netty provided by the embodiments of the present application can reduce the complexity of cloud-to-cloud docking and end-to-end latency, thereby improving the efficiency of cloud-to-cloud docking and enhancing the security of cloud-to-cloud docking.
[0147] Figure 6 Structural schematic of the cloud-to-cloud docking device based on Netty provided by the present application Figure 1 As Figure 6 shown, the cloud-to-cloud docking device 60 provided in this embodiment includes: a sending module 601, a reading module 602, an obtaining module 603, a format conversion module 604, and a receiving module 605.
[0148] The sending module 601 is configured to initiate a software development kit online request to the central cloud platform, so that the central cloud platform verifies the authentication information of the cloud-to-cloud docking client according to the software development kit online request, and after the verification is successful, establishes a Transmission Control Protocol long connection between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request;
[0149] The reading module 602 is configured to, in response to a device online request sent by the third-party platform after the device goes online, read the adapter configuration information corresponding to the device;
[0150] The obtaining module 603 is configured to obtain the latest physical model function definition corresponding to the device;
[0151] The format conversion module 604 is configured to, in response to a call attribute publishing request sent by the third-party platform after receiving the upstream data sent by the device, perform format conversion on the upstream data according to the latest physical model function definition to obtain device upstream data that meets the latest physical model function definition;
[0152] The sending module 601 is further configured to send the device upstream data to the central cloud platform, so that the central cloud platform updates the device data according to the device upstream data;
[0153] The receiving module 605 is configured to receive the device downstream data sent by the central cloud platform after updating the device data;
[0154] The format conversion module 604 is further configured to perform format conversion on the device downstream data to obtain downstream data that meets the downstream device data format;
[0155] The sending module 601 is further configured to send a call downstream device control request to the third-party platform according to the downstream data, so that the third-party platform sends the downstream data to the device.
[0156] In a possible implementation manner, the obtaining module 603 is specifically configured to: send a pulling request for the device model to the central cloud platform, where the pulling request is used to pull the latest device model function definition in the central cloud platform; receive the latest device model function definition corresponding to the device sent by the central cloud platform, where the latest device model function definition is sent by the central cloud platform in response to the pulling request for the device model, and / or the latest device model function definition is sent by the central cloud platform in response to an update by a user on the central cloud platform; update the device model locally in the cloud-to-cloud docking client according to the latest device model function definition.
[0157] In a possible implementation manner, at least one of the software development kit online request, the device online request, the latest device model function definition, the call attribute publishing request, the device uplink data, the device downlink data, and the downlink data is transmitted between the cloud-to-cloud docking client and the central cloud platform by using a custom codec; the custom codec is used to perform encoding and decoding processing on data in the format of a cloud-to-cloud docking data message frame; where the cloud-to-cloud docking data message frame format includes a message identifier, a control unit, application data, and a cyclic redundancy check bit.
[0158] In a possible implementation manner, the receiving module 605 is further configured to: receive service configuration item information sent by the central cloud platform, where the service configuration item information is sent by the central cloud platform to the cloud-to-cloud docking client after creating a cloud-to-cloud docking service and service instance, creating a product and device, and binding the product to the service instance, and the service configuration item information includes a service unique code, a service key, a service password, an instance unique code, and a list of products allowed for data transmission; generate a software development kit online request according to the service configuration item information.
[0159] In a possible implementation manner, the service unique code, the service key, and the service password are used by the central cloud platform to perform authentication information verification on the cloud-to-cloud docking client; the service unique code and the instance unique code are used to uniquely identify the transmission control protocol long connection between the cloud-to-cloud docking client and the central cloud platform.
[0160] The cloud-to-cloud docking system based on Netty provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here in this embodiment.
[0161] Figure 7 For the structural schematic diagram of the cloud-to-cloud docking device based on Netty provided in this application Figure 2 , such as Figure 7As shown in the figure, the cloud-to-cloud docking device 70 based on Netty provided in this embodiment includes: a receiving module 701, a verification module 702, an update module 703, and a sending module 704.
[0162] The receiving module 701 is configured to receive a software development kit online request sent by a cloud-to-cloud docking client.
[0163] The verification module 702 is configured to verify the authentication information of the cloud-to-cloud docking client according to the software development kit online request, and after successful verification, establish a Transmission Control Protocol long connection between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request.
[0164] The receiving module 701 is further configured to receive device uplink data sent by the cloud-to-cloud docking client, where the device uplink data is obtained by the cloud-to-cloud docking client in response to a device online request sent by a third-party platform after the device goes online, reading the adapter configuration information corresponding to the device, obtaining the latest physical model function definition corresponding to the device, and in response to a call attribute publishing request sent by the third-party platform after receiving the uplink data sent by the device, performing format conversion on the uplink data according to the latest physical model function definition.
[0165] The update module 703 is configured to update device data according to the device uplink data.
[0166] The sending module 704 is configured to send device downlink data to the cloud-to-cloud docking client after updating the device data, so that the cloud-to-cloud docking client performs format conversion on the device downlink data to obtain downlink data that meets the downlink device data format, and according to the downlink data, send a call downlink device control request to the third-party platform, so that the third-party platform sends the downlink data to the device.
[0167] In a possible implementation manner, the sending module 704 is further configured to: create a cloud-to-cloud docking service and a service instance; create a product and a device; bind the product to the service instance; and send service configuration item information to the cloud-to-cloud docking client, where the service configuration item information includes a service unique code, a service key, a service key, an instance unique code, and a list of products allowed for data transmission.
[0168] The cloud-to-cloud docking system based on Netty provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here in this embodiment.
[0169] Figure 8 It is a structural schematic diagram of the cloud-to-cloud docking device based on Netty provided in this application. As Figure 8As shown in the figure, the cloud-to-cloud docking device 80 based on Netty provided in this embodiment includes at least one processor 801 and a memory 802. Optionally, the device 80 further includes a communication component 803. Among them, the processor 801, the memory 802, and the communication component 803 are connected through a bus 804.
[0170] In the specific implementation process, at least one processor 801 executes the computer-executable instructions stored in the memory 802, so that at least one processor 801 executes the above-mentioned method.
[0171] For the specific implementation process of the processor 801, reference can be made to the above method embodiment. The implementation principle and technical effect are similar, and will not be elaborated here in this embodiment.
[0172] In the above embodiment, it should be understood that the processor may be a central processing unit (English: Central Processing Unit, abbreviated: CPU), or other general-purpose processors, digital signal processors (English: Digital Signal Processor, abbreviated: DSP), application-specific integrated circuits (English: Application Specific Integrated Circuit, abbreviated: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0173] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0174] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0175] This application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the processor executes the computer-executable instructions, the above-mentioned method is implemented.
[0176] The present application also provides a computer program product, including a computer program which, when executed by a processor, implements the above-mentioned method.
[0177] The above-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk or an optical disc. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.
[0178] An exemplary readable storage medium is coupled to the processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.
[0179] The division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0180] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0181] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can physically exist alone, or two or more units can be integrated in one unit.
[0182] If a function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of this application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, and other various media that can store program codes.
[0183] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When this program is executed, it executes the steps including the above method embodiments; and the aforementioned storage medium includes: ROMs, RAMs, magnetic disks, or optical discs, and other various media that can store program codes.
[0184] Finally, it should be noted that: After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other implementation manners of this application. This application is intended to cover any variations, uses, or adaptive changes of this application. These variations, uses, or adaptive changes follow the general principles of this application and include the common general knowledge or conventional technical means in the technical field not disclosed in this application. It is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is only limited by the appended claims.
Claims
1. A cloud-to-cloud connection method based on Netty, characterized in that: Applied to a cloud-to-cloud docking client, the method includes: Initiate a software development kit online request to the central cloud platform, so that the central cloud platform verifies the authentication information of the cloud-to-cloud docking client according to the software development kit online request, and after the verification is successful, establish a transmission control protocol long connection between the cloud-to-cloud docking client and the central cloud platform according to the software development kit online request; In response to a device online request sent by a third-party platform after the device is online, read adapter configuration information corresponding to the device; Obtaining the latest object model function definition corresponding to the device; In response to a call attribute publishing request sent by the third-party platform after receiving the uplink data sent by the device, format conversion is performed on the uplink data according to the latest object model function definition to obtain device uplink data that meets the latest object model function definition; Sending the device uplink data to the central cloud platform, so that the central cloud platform updates the device data according to the device uplink data; Receiving device downlink data sent by the central cloud platform after updating device data; Performing format conversion on the device downlink data to obtain downlink data that meets the downlink device data format; According to the downlink data, a downlink device control request is sent to the third-party platform, so that the third-party platform sends the downlink data to the device.
2. The method according to claim 1, characterized in that The obtaining the latest object model function definition corresponding to the device includes: Initiating a pull request for a thing model to the central cloud platform, wherein the pull request is used to pull the latest thing model function definition in the central cloud platform; Receive the latest object model function definition corresponding to the device sent by the central cloud platform, wherein the latest object model function definition is sent by the central cloud platform in response to a pull request for the object model, and / or, the latest object model function definition is sent by the central cloud platform in response to an update by a user on the central cloud platform; According to the latest object model function definition, the local object model of the cloud-to-cloud docking client is updated.
3. The method according to claim 1, characterized in that The software development kit online request, the device online request, the latest object model function definition, the call attribute publishing request, the device uplink data, the device downlink data and at least one of the downlink data are transmitted between the cloud-to-cloud docking client and the central cloud platform using a custom codec; The custom codec is used to encode and decode data in the cloud-to-cloud interconnection data message frame format; Among them, the cloud-to-cloud connection data message frame format includes a message identifier, a control unit, application data and a cyclic redundancy check bit.
4. The method according to any one of claims 1 to 3, characterized in that: Before initiating a software development kit online request to the central cloud platform, the method further includes: Receive service configuration item information sent by the central cloud platform, wherein the service configuration item information is sent to the cloud-to-cloud docking client by the central cloud platform after creating a cloud-to-cloud docking service and service instance, creating a product and device, and binding a product to a service instance, and the service configuration item information includes a service unique code, a service key, a service password, an instance unique code, and a list of products that allow data transmission; Generate a software development kit online request based on the service configuration item information.
5. The method according to claim 4, characterized in that The service unique code, the service key and the service password are used by the central cloud platform to verify the authentication information of the cloud-to-cloud docking client; The service unique code and the instance unique code are used to uniquely identify the transmission control protocol long connection between the cloud-to-cloud docking client and the central cloud platform.
6. A cloud-to-cloud connection method based on Netty, characterized in that: Applied to the central cloud platform, the method includes: Receive the software development kit online request sent by the cloud-to-cloud docking client; According to the software development kit online request, the cloud-to-cloud docking client is verified for authentication information, and after the verification is successful, according to the software development kit online request, a transmission control protocol long connection between the cloud-to-cloud docking client and the central cloud platform is established; Receiving device uplink data sent by the cloud-to-cloud docking client, wherein the device uplink data is obtained by the cloud-to-cloud docking client responding to a device online request sent by a third-party platform after the device is online, reading the adapter configuration information corresponding to the device, obtaining the latest object model function definition corresponding to the device, and responding to a call attribute publishing request sent by the third-party platform after receiving the uplink data sent by the device, and converting the format of the uplink data according to the latest object model function definition; Updating device data according to the device uplink data; After updating the device data, the device downlink data is sent to the cloud-to-cloud docking client, so that the cloud-to-cloud docking client converts the format of the device downlink data to obtain downlink data that meets the downlink device data format, and based on the downlink data, sends a downlink device control request to the third-party platform, so that the third-party platform sends the downlink data to the device.
7. The method according to claim 6, characterized in that Before receiving the software development kit online request sent by the cloud-to-cloud docking client, the method further includes: Create cloud-to-cloud connection services and service instances; Create products and devices; Product binding service instance; The service configuration item information is sent to the cloud-to-cloud docking client, wherein the service configuration item information includes a service unique code, a service key, a service key, an instance unique code, and a list of products that allow data transmission.
8. A cloud-to-cloud connection device based on Netty, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 5.
9. A cloud-to-cloud connection device based on Netty, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 6 or 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to claim 6 or 7 when executed by a processor.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 5 when being executed by a processor.
13. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to claim 6 or 7 when being executed by a processor.