Intelligent terminal connection management method and system, electronic equipment and storage medium
By setting up multiple protocol connection points for different protocols in the intelligent terminal connection management system, decoupling terminal access and service processing functions, the access and convergence of terminal types of terminals is realized, and the existing system cannot quickly expand different terminals. and business issues improve the flexibility and scalability of the system.
Patent Information
- Application Number
- CN202411537906.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
AI Technical Summary
The existing smart terminal connection management system cannot realize the integration of terminals of different protocol types, and the terminal access and service processing functions are mixed, so different terminals and services cannot be quickly expanded.
By setting up multiple protocol connection points with different protocols in the intelligent terminal connection management system, determining the protocol connection points of the terminal based on the terminal login request, and receiving and parsing terminal service messages through the protocol connection points, and performing message encapsulation and service event processing. Decoupled terminal access and service processing functions.
It realizes access and convergence of terminals of different protocol types, decouples terminal access and service processing functions, facilitates the expansion of services and terminals, and improves the flexibility and scalability of the system.
Smart Images

Figure CN119421266A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a smart terminal connection management method, system, electronic device and storage medium. Background Art
[0002] In the field of smart home, the background and significance of smart terminal connection management are becoming increasingly prominent. With the rapid development of information technology, the categories of smart terminals in the home environment have increased dramatically, such as smart speakers, smart bulbs, smart cameras, smart gateways, etc. Terminal connection management acts as the central nervous system of the smart home ecosystem, responsible for coordinating and managing the growing number of smart terminals, maximizing the functions of smart terminals, and providing users with a rich and high-quality life experience. However, the existing terminal connection management system still has the following problems: each terminal manufacturer focuses on building its own closed ecosystem, and the protocols between different types of terminals are not compatible with each other, and terminals with different protocols cannot communicate with each other; secondly, the current smart terminal connection management, terminal access and business processing are mixed together, and different terminals and businesses cannot be quickly expanded. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a smart terminal connection management method, system, electronic device and storage medium, aiming to achieve mutual accommodation between terminals of different protocol types, decouple terminal access and business processing functions, and facilitate the expansion of business and terminals.
[0004] To achieve the above object, an embodiment of the present application provides a method for managing smart terminal connections. The method is applied to a smart terminal connection management system. The method includes the following steps:
[0005] receiving a terminal login request from a terminal, determining a protocol connection point of the terminal according to the terminal login request, and returning login response information including the protocol connection point to the terminal, so that the terminal connects to the corresponding protocol connection point according to the login response information;
[0006] Receiving and parsing the terminal service message through the protocol connection point to obtain the parsed content, and encapsulating the parsed content into a message to obtain the terminal message;
[0007] Based on a preset message format, determining a service event according to the terminal message;
[0008] The service event is consumed to the service side to connect the terminal to the service side.
[0009] In some embodiments, the terminal login request includes a first device ID in plain text, a random number, and a second device ID encrypted using a personal identification code; and determining the protocol connection point of the terminal according to the terminal login request includes the following steps:
[0010] querying a corresponding personal identification code from a database according to the first device ID in the terminal login request;
[0011] Decrypting the second device ID using the retrieved personal identification code to obtain a decrypted device ID;
[0012] Determine whether the decryption device ID is the same as the first device ID in the terminal login request;
[0013] When the decryption device ID is the same as the first device ID, querying the protocol information of the terminal according to the first device ID;
[0014] A protocol connection point of the terminal is determined according to the protocol information.
[0015] In some embodiments, determining the protocol connection point of the terminal according to the protocol information comprises the following steps:
[0016] Determine a plurality of protocol connection points using corresponding protocols according to the protocol information;
[0017] Obtaining the terminal access quantity of each of the protocol connection points;
[0018] A protocol connection point with the smallest terminal access volume is selected from the plurality of protocol connection points and determined as the protocol connection point of the terminal.
[0019] In some embodiments, in the terminal, connecting the corresponding protocol connection point according to the login response information includes the following steps:
[0020] Receiving login response information from the intelligent terminal connection management system, wherein the login response information includes a character string encrypted by the personal identification code, and the character string includes protocol connection point information, a session key, an identity token, and a random number;
[0021] Decrypting the string using the locally stored personal identification code to obtain a decrypted string;
[0022] Determining whether the random number in the decrypted character string is the same as the random number in the terminal login request;
[0023] When the random number in the decrypted string is the same as the random number in the terminal login request, a connection request is sent to the corresponding protocol connection point according to the protocol connection point information in the decrypted string to connect to the protocol connection point.
[0024] In some embodiments, sending a connection request to a corresponding protocol connection point according to the protocol connection point information in the decrypted string to connect to the protocol connection point comprises the following steps:
[0025] Sending a connection request to a corresponding protocol connection point according to the protocol connection point information in the decrypted character string to receive a response connection result from the protocol connection point;
[0026] In response to the response connection result, a session request is sent so that the protocol connection point performs identity authentication according to the session request to establish a long connection between the terminal and the protocol connection point, wherein the session request includes an identity token encrypted using the session key in the decrypted string.
[0027] In some embodiments, the determining the service event according to the terminal message based on a preset message format includes the following steps:
[0028] Parsing the terminal message to determine the message content and terminal information;
[0029] Determine the corresponding protocol type according to the terminal information, and determine the instruction type according to the message content;
[0030] The instruction type, the protocol type, the message content and the terminal information are assembled according to the message format to obtain a service event.
[0031] In some embodiments, consuming the service event to the service side to connect the terminal to the service side includes the following steps:
[0032] Matching a corresponding business party according to the instruction type in the business event;
[0033] The business event is converted and processed according to the message rule defined by the business party, and the converted business event is sent to the business party.
[0034] To achieve the above purpose, another aspect of the embodiment of the present application provides a smart terminal connection management system, including:
[0035] The terminal login submodule is used to receive a terminal login request from a terminal, determine the protocol connection point of the terminal according to the terminal login request, and return login response information containing the protocol connection point to the terminal, so that the terminal connects to the corresponding protocol connection point according to the login response information;
[0036] The terminal connection submodule is used to receive and parse the terminal service message through the protocol connection point to obtain the parsed content, and encapsulate the parsed content into a message to obtain the terminal message;
[0037] A message event module, used to determine a service event according to the terminal message based on a preset message format;
[0038] The business processing module is used to consume the business event to the business side to connect the terminal to the business side.
[0039] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program implements the method described in the above embodiment when executed by the processor.
[0040] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method described in the above embodiment.
[0041] The intelligent terminal connection management method, system, electronic device and storage medium proposed in the present application, the intelligent terminal connection management system sets a plurality of protocol connection points of different protocols, determines the corresponding protocol connection point of the terminal according to the terminal login request, and then returns the login response information containing the protocol connection point to the terminal, so that the terminal can connect to the corresponding protocol connection point according to the login response information, the system can receive and parse the terminal service message through the protocol connection point, and encapsulate the parsed content into a message to obtain the terminal message, and then based on the preset message format, generates a service event according to the terminal message, and then consumes the service event to the service side to connect the terminal to the service side. The present application realizes the access and accommodation of terminals of different protocol types by setting a plurality of protocol connection points of different protocols and allocating the correct protocol connection point to the terminal, and processes the terminal message into a unified service event through the preset message format, and when the service event is consumed to the service side, it only needs to further process the service event, which does not affect the terminal access process, decouples the terminal access and service processing functions, and facilitates the expansion of services and terminals. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flow chart of a smart terminal connection management method provided in an embodiment of the present application;
[0043] Figure 2 yes Figure 1 A flowchart of the step of determining the protocol connection point of the terminal according to the terminal login request in step S101;
[0044] Figure 3 yes Figure 2Flow chart of step S205 in FIG.
[0045] Figure 4 yes Figure 1 A flowchart of the step of connecting the corresponding protocol connection point according to the login response information in step S101;
[0046] Figure 5 yes Figure 4 Flow chart of step S404 in FIG.
[0047] Figure 6 yes Figure 1 Flow chart of step S103 in FIG.
[0048] Figure 7 yes Figure 1 Flow chart of step S104 in FIG.
[0049] Figure 8 is a schematic diagram of a smart terminal connection management system provided in an embodiment of the present application;
[0050] Fig. 9 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0051] Fig.10 is a schematic diagram of a smart terminal connection management system provided by another embodiment of the present application;
[0052] Fig.11 It is a schematic diagram of the connection process between the terminal and the intelligent terminal connection management system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] It should be noted that, although the functional modules are divided in the system and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0055] 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.
[0056] First, some nouns involved in this application are analyzed:
[0057] ES, Elasticsearch, is an open source distributed full-text search engine based on Apache Lucene.
[0058] TiDB, an open source distributed relational database.
[0059] Device ID refers to a string or number that uniquely identifies a device. It can be used to distinguish different devices and track and manage them. It is an ID card for a device in cyberspace. For example, the device ID can be IMEI (International Mobile Equipment Identity) or a custom unique code.
[0060] PIN (Personal Identification Number), each device ID has a corresponding security password, called the device PIN. The device PIN is assigned by the connection management system and written into the device when it is manufactured.
[0061] Sequence: The request or response sequence number, which is incremented by 1 each time based on the previous call and starts again from 0 after reaching the maximum value of 65535.
[0062] sessionKey: smart terminal session key, generated and allocated after the terminal successfully connects to the connection management system, and used for subsequent business data interaction encryption and decryption.
[0063] Token: terminal connection access token, which is generated and allocated after the terminal successfully connects to the connection management system and is used for provincial authentication of subsequent business data interactions.
[0064] Topic: The message middleware topic defines the categories of messages sent by producers and messages pulled by consumers.
[0065] There are numerous smart terminals and communication protocols on the market, and the terminals cannot achieve effective interconnection and interoperability. Terminal connections of specified protocols often require the construction of a connection management system for the corresponding protocol, and the connection management system is not compatible with terminals of other protocol types.
[0066] Based on this, the embodiments of the present application provide a smart terminal connection management method, system, electronic device and storage medium, which aim to achieve mutual accommodation between terminals of different protocol types, decouple terminal access and business processing functions, and facilitate the expansion of business and terminals.
[0067] The smart terminal connection management method, system, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the smart terminal connection management method in the embodiments of the present application is described.
[0068] The intelligent terminal connection management method provided in the embodiment of the present application relates to the field of communication technology. The intelligent terminal connection management method provided in the embodiment of the present application can be applied to the terminal or to the server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0069] According to some embodiments of the present application, the intelligent terminal connection management method of the embodiment of the present application can be used in an intelligent terminal connection management system, please refer to Fig.10 , the intelligent terminal connection management system is described as follows:
[0070] The intelligent terminal connection management system includes a terminal access module, a message event module and a business processing module.
[0071] The terminal access module is responsible for the unified access of terminals with different protocols, and can be specifically divided into a terminal login submodule and a terminal connection submodule. The terminal login submodule is mainly used to verify the legitimacy of the request after receiving the terminal login request, and at the same time allocate the protocol connection point corresponding to the protocol to which the intelligent terminal belongs according to the terminal storage information (such as the protocol type, terminal identification, terminal model information, etc.). The terminal connection submodule is mainly used to verify the legitimacy of the request after receiving the terminal connection request, and to process southbound and northbound business message packets based on the terminal object model defined by the system. Unify the encapsulation of northbound data of terminals of different protocol types and send messages to the message event module. Receive the southbound business data issued by the message event module, parse and convert according to different protocol types, find the corresponding terminal protocol connection point, and the corresponding protocol connection point sends data to the terminal.
[0072] The message event module is responsible for the message transmission between the terminal access module and the business processing module, and encapsulates the business data according to the preset message format, which can be "instruction type | protocol type | message content | terminal information". For the business processing module, the data differences of different protocol types are shielded, and a unified protocol data packet format is provided for the terminal access module to facilitate the rapid expansion of different protocol connection points.
[0073] The business processing module is responsible for receiving messages from the message event center and distributing southbound data from upper-layer applications. By consuming northbound business messages, it uniformly routes different terminal business messages according to the instruction type field in the packet header, uniformly converts business events based on the terminal object model definition, and aggregates them into the business data bus to support different upper-layer businesses. At the same time, it obtains the southbound data of the upper-layer business from the business data bus, processes it in sequence, and sends it uniformly to the message event center.
[0074] It should be noted that northbound service packets, northbound data and northbound service messages refer to a series of formal data in the process of the terminal reporting data to the service side; southbound service packets, southbound data and southbound service messages refer to a series of formal data in the process of the service side sending data to the terminal.
[0075] It should be noted that the terminal login submodule includes multiple login points corresponding to different communication protocols, and each login point can execute the communication process defined by the corresponding communication protocol. The terminal can select the login point by itself when logging in, or the system can determine the protocol used by the terminal based on the terminal login request, and then assign the corresponding login point to process the terminal login request.
[0076] It should be noted that the terminal connection submodule is provided with a plurality of protocol connection points corresponding to different communication protocols, and each protocol connection point can execute the session connection process defined by the same communication protocol, and parse the received data based on the rules of the corresponding protocol.
[0077] It should be noted that the terminal object model is an abstraction of the smart terminal in the physical world. It is a digital model used in the digital world after being digitally described. In other words, the terminal object model uses a language that can be understood by computers to describe the definition of the smart terminal, the functions that can be realized, and the information that can be provided. Abstraction is to extract the common features of the product and form a model. Taking smart lights as an example, different lights have similar properties despite different specifications, such as the properties of the switch state and similar functional logic. Therefore, these features can be standardized to form a physical model of the smart light.
[0078] Figure 1 is an optional flowchart of the intelligent terminal connection management method provided in an embodiment of the present application. Figure 1 The method is applied to the intelligent terminal connection management system. Figure 1 The method may include but is not limited to steps S101 to S104.
[0079] Step S101, receiving a terminal login request from a terminal, determining a protocol connection point of the terminal according to the terminal login request, and returning login response information including the protocol connection point to the terminal, so that the terminal connects to the corresponding protocol connection point according to the login response information;
[0080] Step S102, receiving and parsing the terminal service message through the protocol connection point to obtain parsed content, and encapsulating the parsed content into a message to obtain a terminal message;
[0081] Step S103, determining a service event according to the terminal message based on a preset message format;
[0082] Step S104: consume the business event to the business side to connect the terminal to the business side.
[0083] Steps S101 to S104 shown in the embodiment of the present application are performed by
[0084] In step S101 of some embodiments, the terminal may select a corresponding login point on the intelligent terminal connection management system to log in, that is, send a terminal login request to the login point. The login point of the intelligent terminal connection management system executes the corresponding login process, and allocates the corresponding protocol connection point to the terminal after the terminal successfully logs in, and then encapsulates the protocol connection point information to obtain login response information, and returns the login response information to the terminal. After receiving the login response information, the terminal establishes a session connection with the protocol connection point corresponding to the intelligent terminal connection management system according to the protocol connection point information in the login response information.
[0085] In step S102 of some embodiments, after the terminal establishes a session connection with the protocol connection point, the terminal may send a northbound service message to the intelligent terminal connection management system. The intelligent terminal connection management system receives the service message through the protocol connection point, and the protocol connection point may further parse the service message to obtain the parsed content, which may include the message content, terminal device information, and protocol type, etc. The terminal access submodule uniformly encapsulates the terminal's protocol content to obtain the terminal message, and then submits the terminal message to the message event module for further processing.
[0086] In step S103 of some embodiments, a message format is defined in the message event module of the intelligent terminal connection management system, and the message format can be "instruction type | protocol type | message content | terminal information". The message event module uniformly processes the uploaded terminal messages according to the preset message format to obtain business events, so that the business processing module can implement corresponding business functions based on the business events. This embodiment converts terminal messages into business events uniformly through the message event module. When expanding the business, it is only necessary to add the corresponding business processing logic based on the business events, or when expanding the terminal, it is only necessary to add the corresponding protocol connection point. The message event module can uniformly convert the terminal messages uploaded by the protocol connection point into business events in a fixed format for subsequent business processing, thereby realizing the isolation of terminal access and business processing, and facilitating the expansion of terminals and businesses.
[0087] In step S104 of some embodiments, the service processing module of the intelligent terminal connection management system may consume the service event to the corresponding service party, thereby connecting the terminal to the service side.
[0088] See also Figure 2 In some embodiments, the step of determining the protocol connection point of the terminal according to the terminal login request in step S101 may include but is not limited to steps S201 to S205:
[0089] Step S201, querying a corresponding personal identification code from a database according to the first device ID in the terminal login request;
[0090] Step S202, using the retrieved personal identification code to decrypt the second device ID to obtain a decrypted device ID;
[0091] Step S203, determining whether the decryption device ID is the same as the first device ID in the terminal login request;
[0092] Step S204, when the decryption device ID is the same as the first device ID, query the protocol information of the terminal according to the first device ID;
[0093] Step S205: determine the protocol connection point of the terminal according to the protocol information.
[0094] This embodiment provides a login process, specifically, the terminal initiates a terminal login request to the corresponding login point of the intelligent terminal connection management system, and the terminal login request includes a first device ID in plain text, a random number (Sequence), and a second device ID encrypted with a personal identity identification code (PIN code). The login point of the intelligent terminal connection management system queries the corresponding personal identity identification code from the database according to the first device ID in plain text in the terminal login request, and then uses the queried personal identity identification code to decrypt the second device ID in the terminal login request to obtain the decrypted device ID, and then determines whether the decrypted device ID is the same as the first device ID in the terminal login request. If they are the same, it indicates that the terminal login request is legal, then the terminal protocol information stored in the database is queried according to the first device ID, so as to determine the terminal protocol connection point according to the protocol information; if they are not the same, it indicates that the terminal login request is illegal, and a login failure response can be returned to the terminal.
[0095] In some embodiments, the protocol information represents the protocol to which the terminal belongs, and the intelligent terminal connection management system is provided with multiple protocol connection points of different protocols. After the intelligent terminal connection management system queries the database to determine the protocol information of the terminal, it can determine the protocol connection point of the corresponding protocol according to the protocol to which the terminal belongs.
[0096] See also Figure 3In some embodiments, step S205 may include but is not limited to steps S301 to S303:
[0097] Step S301, determining multiple protocol connection points using corresponding protocols according to protocol information;
[0098] Step S302, obtaining the terminal access quantity of each protocol connection point;
[0099] Step S303: Select a protocol connection point with the smallest terminal access amount from multiple protocol connection points and determine it as the protocol connection point of the terminal.
[0100] In this embodiment, the intelligent terminal connection management system is provided with protocol connection points of multiple protocols, and each protocol is provided with multiple protocol connection points. The intelligent terminal connection management system is provided with multiple protocol connection points of different protocols. After the intelligent terminal connection management system queries the database to determine the protocol information of the terminal, it determines multiple protocol connection points using the corresponding protocol according to the protocol information, and then obtains the terminal access volume of each protocol connection point, and then selects the protocol connection point with the smallest terminal access volume from the multiple protocol connection points to determine it as the protocol connection point of the terminal, thereby providing the terminal with the protocol connection point of the corresponding protocol with the smallest load, which can not only realize the establishment of the terminal session, but also improve the session quality.
[0101] See also Figure 4 In some embodiments, in the terminal, the implementation of connecting the corresponding protocol connection point according to the login response information in step S101 may include but is not limited to steps S401 to S404:
[0102] Step S401, receiving a login response message from the intelligent terminal connection management system, wherein the login response message includes a character string encrypted with a personal identification code, and the character string includes protocol connection point information, a session key, an identity token, and a random number;
[0103] Step S402, using the locally stored personal identification code to decrypt the string to obtain a decrypted string;
[0104] Step S403, determining whether the random number in the decrypted string is the same as the random number in the terminal login request;
[0105] Step S404: when the random number in the decrypted string is the same as the random number in the terminal login request, a connection request is sent to the corresponding protocol connection point according to the protocol connection point information in the decrypted string to connect to the protocol connection point.
[0106] This embodiment provides a connection process. Specifically, after the intelligent terminal connection management system allocates a protocol connection point to the terminal, the protocol connection point, session key (sessionKey), identity token (Token) and the random number in the terminal login request are combined into a string, and then the string is encrypted using the personal identity code of the terminal to obtain a login response message. The terminal receives the login response message from the intelligent terminal connection management system, and uses the locally stored personal identity code to decrypt the string in the login response message to obtain a decrypted string. The terminal determines whether the random number in the decrypted string is the same as the random number in the terminal login request. If they are the same, it indicates that the terminal login is successful, and then sends a connection request to the corresponding protocol connection point in the intelligent terminal connection management system according to the protocol connection point information in the decrypted string to connect to the protocol connection point.
[0107] See also Figure 5 In some embodiments, the step of sending a connection request to the corresponding protocol connection point according to the protocol connection point information in the decrypted string in step S404 to connect to the protocol connection point may include but is not limited to steps S501 to S502:
[0108] Step S501, sending a connection request to a corresponding protocol connection point according to the protocol connection point information in the decrypted character string, to receive a response connection result from the protocol connection point;
[0109] Step S502, in response to the response connection result, sending a session request so that the protocol connection point performs identity authentication according to the session request to establish a long connection between the terminal and the protocol connection point, wherein the session request includes an identity token encrypted by using the session key in the decryption string.
[0110] In this embodiment, after the terminal sends a connection request to the corresponding protocol connection point in the intelligent terminal connection management system, the intelligent terminal connection management system returns the response connection result of the protocol connection point. The terminal receives the response connection result. If the response connection result indicates that the protocol connection point is connected, a session request is sent to the protocol connection point. The session request includes an identity token encrypted with the session key in the decryption string. After receiving the session request, the intelligent terminal connection management system uses the terminal's session key to decrypt the session request, and compares the decrypted identity token with the locally stored identity token. If they are the same, it means that the session request is legal and subsequent business data can be interacted. At this time, a connection service authentication success response is returned to the terminal, the heartbeat interval is returned, and the long connection between the two parties is kept alive. The two parties establish a session connection, and the terminal can send northbound business data to the intelligent terminal connection management system, and the intelligent terminal connection management system can also send southbound business data to the terminal.
[0111] See also Figure 6In some embodiments, step S103 includes but is not limited to steps S601 to S603:
[0112] Step S601, parsing the terminal message to determine the message content and terminal information;
[0113] Step S602, determining the corresponding protocol type according to the terminal information, and determining the instruction type according to the message content;
[0114] Step S603, assembling the instruction type, protocol type, message content and terminal information according to the message format to obtain a business event.
[0115] In this embodiment, after receiving the terminal message, the message event module can parse the terminal message to determine the message content and terminal information, and then query the database to determine the corresponding protocol type according to the terminal information, and determine the instruction type according to the message content. The instruction type can be divided according to business needs, for example, database read data type, database write data type, light control instruction, etc. The above data is assembled according to the message format of "instruction type|protocol type|message content|terminal information" to obtain a business event.
[0116] See also Figure 7 In some embodiments, step S104 may include but is not limited to steps S701 to S702:
[0117] Step S701, matching the corresponding business party according to the instruction type in the business event;
[0118] Step S702: convert the business event according to the message rule defined by the business party, and send the converted business event to the business party.
[0119] In this embodiment, the business processing module can consume business events. Specifically, the business processing module matches the corresponding business party according to the instruction type in the business event. For example, the light control instruction is matched to business A, and the database write data type is matched to the data center. The business event is then converted and processed according to the message rules defined by the business party, and the converted business event is sent to the business party. Different business parties have different data interface rules. Therefore, after determining the business party, the business event can be converted according to the data interface rules of the business party before the message is consumed by the business party.
[0120] According to some embodiments of this application, please refer to Fig.11 The connection process between the terminal and the intelligent terminal connection management system in the embodiment of the present application is as follows:
[0121] S1. The terminal requests the terminal login submodule to send a plaintext first device ID, a random number sequence, and a second device ID encrypted with a PIN code according to the terminal login specification.
[0122] S2. The terminal login submodule queries the corresponding PIN code from the data center according to the device ID, which is used to decrypt the ID and obtain the device ID. If the calculated device ID is consistent with the first device ID sent, it means that the device is legal. The device protocol information is queried and the corresponding load minimum protocol connection point is allocated. At the same time, the corresponding terminal protocol connection point information, session key sessionKey and terminal connection access token Token encrypted with the PIN code are returned.
[0123] S3. The terminal uses the local PIN code to decrypt the string, obtains the Sequence and compares it with the previously sent Sequence. If they are equal, it means that the terminal login is successful, and connects to the corresponding protocol connection point according to the terminal protocol connection information returned by the login.
[0124] S4. The terminal sends the connection access token and the business data packet encrypted with the sessionKey to the corresponding protocol connection point.
[0125] S5. The corresponding protocol connection point finds the corresponding SessionKey in the data center based on the token, and uses the found SessionKey to decrypt the ciphertext token. The decrypted result is compared with the request token. If the comparison results are consistent, it means that the connection is legal and subsequent business data interaction can be carried out. The heartbeat interval is returned to keep alive and maintain the long connection between the two parties.
[0126] S6. The terminal sends business data to the corresponding protocol connection point.
[0127] S7. The terminal connection submodule uniformly encapsulates the northbound data of terminals of different protocol types and sends messages to the message event module; the message event module assembles the terminal business data in the format of "instruction type | protocol type | message content | terminal information", routes and distributes the messages to the business processing module according to the corresponding topic and terminal information; the business processing module consumes the messages, encapsulates the data business bus according to the terminal information, forwards the corresponding information to the relevant business processing submodule, and returns the business data processing results.
[0128] According to some embodiments of the present application, corresponding to the northbound business data, the process of sending southbound business data from the business direction smart terminal is that after the business party sends the message, the message event center converts the sent message into a preset message format, and then the terminal connection sub-module uniformly converts the southbound data into the data format of the corresponding protocol, and the corresponding protocol connection point sends the data to the smart terminal.
[0129] According to some embodiments of the present application, the embodiments of the present application have the following beneficial effects:
[0130] The terminal access module splits terminal login and terminal connection. By exposing a unified terminal login point, the corresponding optimal load connection point is allocated to terminals of different protocols. According to the defined terminal object model, the northbound data of the intelligent terminal is uniformly encapsulated, and the northbound data sent by the message event module is uniformly parsed. Terminals of different protocols are managed and the defects of terminal protocol differences are shielded. Users in the system can seamlessly add and use various intelligent terminals and enjoy a consistent terminal experience.
[0131] Define the message event module, decouple the terminal access module and the business processing module, define a unified message format, and open standard terminal protocol extension points for terminal connection, so that different terminal protocols can be quickly and seamlessly integrated. The system implemented in this paper can integrate TCP protocol, MQTT protocol, OLA protocol and other terminals, and the number of terminals with different protocols managed exceeds 100,000.
[0132] See also Figure 8 The embodiment of the present application also provides a smart terminal connection management system, including:
[0133] The terminal login submodule is used to receive a terminal login request from a terminal, determine the protocol connection point of the terminal according to the terminal login request, and return login response information containing the protocol connection point to the terminal, so that the terminal connects to the corresponding protocol connection point according to the login response information;
[0134] The terminal connection submodule is used to receive and parse the terminal service message through the protocol connection point to obtain the parsed content, and encapsulate the parsed content into a message to obtain the terminal message;
[0135] A message event module is used to determine a business event according to a terminal message based on a preset message format;
[0136] The business processing module is used to consume business events to the business side to connect the terminal to the business side.
[0137] In this embodiment, a more specific description of the intelligent terminal connection management system has been described in the above embodiments and will not be repeated here.
[0138] It can be understood that the contents of the above-mentioned smart terminal connection management method embodiment are applicable to the present system embodiment, the functions specifically implemented by the present system embodiment are the same as those in the above-mentioned smart terminal connection management method embodiment, and the beneficial effects achieved are also the same as those achieved by the above-mentioned smart terminal connection management method embodiment.
[0139] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned intelligent terminal connection management method. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0140] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0141] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0142] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the intelligent terminal connection management method of the embodiment of this application;
[0143] Input / output interface 903, used to implement information input and output;
[0144] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0145] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0146] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0147] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned smart terminal connection management method.
[0148] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0149] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0150] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0151] The system embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0152] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0153] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0154] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0155] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0156] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0158] If the integrated unit 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 the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0159] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for managing intelligent terminal connections, characterized in that: The intelligent terminal connection management method is applied to an intelligent terminal connection management system, and the method comprises the following steps: receiving a terminal login request from a terminal, determining a protocol connection point of the terminal according to the terminal login request, and returning login response information including the protocol connection point to the terminal, so that the terminal connects to the corresponding protocol connection point according to the login response information; Receiving and parsing the terminal service message through the protocol connection point to obtain the parsed content, and encapsulating the parsed content into a message to obtain the terminal message; Based on a preset message format, determining a service event according to the terminal message; The service event is consumed to the service side to connect the terminal to the service side.
2. The intelligent terminal connection management method according to claim 1, characterized in that: The terminal login request includes a first device ID in plain text, a random number, and a second device ID encrypted using a personal identification code; and determining the protocol connection point of the terminal according to the terminal login request includes the following steps: querying a corresponding personal identification code from a database according to the first device ID in the terminal login request; Decrypting the second device ID using the retrieved personal identification code to obtain a decrypted device ID; Determine whether the decryption device ID is the same as the first device ID in the terminal login request; When the decryption device ID is the same as the first device ID, querying the protocol information of the terminal according to the first device ID; A protocol connection point of the terminal is determined according to the protocol information.
3. The intelligent terminal connection management method according to claim 2, characterized in that: Determining the protocol connection point of the terminal according to the protocol information comprises the following steps: Determine a plurality of protocol connection points using corresponding protocols according to the protocol information; Obtaining the terminal access quantity of each of the protocol connection points; A protocol connection point with the smallest terminal access volume is selected from the plurality of protocol connection points and determined as the protocol connection point of the terminal.
4. The intelligent terminal connection management method according to claim 2, characterized in that: In the terminal, connecting the corresponding protocol connection point according to the login response information includes the following steps: Receiving login response information from the intelligent terminal connection management system, wherein the login response information includes a character string encrypted by the personal identification code, and the character string includes protocol connection point information, a session key, an identity token, and a random number; Decrypting the string using the locally stored personal identification code to obtain a decrypted string; Determining whether the random number in the decrypted character string is the same as the random number in the terminal login request; When the random number in the decrypted string is the same as the random number in the terminal login request, a connection request is sent to the corresponding protocol connection point according to the protocol connection point information in the decrypted string to connect to the protocol connection point.
5. The intelligent terminal connection management method according to claim 4, characterized in that: The sending of a connection request to a corresponding protocol connection point according to the protocol connection point information in the decrypted character string to connect to the protocol connection point comprises the following steps: Sending a connection request to a corresponding protocol connection point according to the protocol connection point information in the decrypted character string to receive a response connection result from the protocol connection point; In response to the response connection result, a session request is sent so that the protocol connection point performs identity authentication according to the session request to establish a long connection between the terminal and the protocol connection point, wherein the session request includes an identity token encrypted using the session key in the decrypted string.
6. The intelligent terminal connection management method according to claim 1, characterized in that: The method of determining a service event according to the terminal message based on a preset message format comprises the following steps: Parsing the terminal message to determine the message content and terminal information; Determine the corresponding protocol type according to the terminal information, and determine the instruction type according to the message content; The instruction type, the protocol type, the message content and the terminal information are assembled according to the message format to obtain a service event.
7. The intelligent terminal connection management method according to claim 1, characterized in that: The consuming the service event to the service side to connect the terminal to the service side comprises the following steps: Matching a corresponding business party according to the instruction type in the business event; The business event is converted and processed according to the message rule defined by the business party, and the converted business event is sent to the business party.
8. An intelligent terminal connection management system, characterized in that: include: The terminal login submodule is used to receive a terminal login request from a terminal, determine the protocol connection point of the terminal according to the terminal login request, and return login response information containing the protocol connection point to the terminal, so that the terminal connects to the corresponding protocol connection point according to the login response information; The terminal connection submodule is used to receive and parse the terminal service message through the protocol connection point to obtain the parsed content, and encapsulate the parsed content into a message to obtain the terminal message; A message event module, used to determine a service event according to the terminal message based on a preset message format; The business processing module is used to consume the business event to the business side to connect the terminal to the business side.
9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the method described in any one of claims 1 to 7 are realized.
10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of claims 1 to 7.