Distributed video cloud status information synchronization device and method based on message queue
Through the distributed video cloud state information synchronization device based on message queue, the problems of traditional low synchronization efficiency and difficulty in synchronization with heterogeneous nodes are solved, efficient and secure state information synchronization is achieved, and user experience and system performance are improved.
Patent Information
- Application Number
- CN202211636901.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-12-16
AI Technical Summary
The state information synchronization between traditional video cloud service nodes is low and does not adapt to heterogeneous node environments. The database performance is high, which affects the system processing efficiency.
Using a distributed video cloud state information synchronization device based on message queue, the global state information synchronization service and distributed node registration and message queue binding topic matching can realize efficient synchronization of state information, providing query interfaces and local persistent storage , ensure safety and reliability.
It improves the synchronization efficiency of status information of the video cloud service system, improves user experience, adapts to the information synchronization needs between heterogeneous service nodes, and reduces database performance consumption.
Smart Images

Figure CN115996240B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distributed video cloud, and in particular relates to a distributed video cloud state information synchronization device and method based on a message queue. Background Art
[0002] With the continuous development of cloud computing technology, video communication systems are moving towards cloud computing. Compared with traditional video communication systems, video cloud has obvious technical advantages in terms of simple network structure, easy expansion, and low construction cost. Since video communication has the characteristics of high real-time requirements and high bandwidth occupancy, large-scale video cloud systems generally adopt a regionalized service guarantee model, which consists of multiple video cloud service nodes distributed in different regions, and the nodes are interconnected to achieve wide-area video communication.
[0003] The interconnection of video cloud service nodes requires the establishment of signaling control channels, media transmission channels, and information synchronization channels. Especially when the video cloud service nodes are implemented using different technical systems, efficient and accurate information synchronization between service nodes is a necessary prerequisite for realizing the "wide-area integration and interconnection" of the video cloud service system. In addition, the video cloud is a complex system. The information that needs to be synchronized between service nodes is diverse, and the synchronization requirements are also different. Since the state information has the characteristics of time-varying, the timeliness and efficiency of information synchronization are required to be high.
[0004] The data synchronization between service nodes of traditional video communication systems mainly adopts the trigger synchronization mechanism provided by data storage facilities such as databases. This method relies on the writing or updating of data tables to trigger data synchronization. Each service node is required to adopt the same technical system in terms of data storage, including technical facilities and data structures, which makes it difficult to achieve information synchronization between heterogeneous service nodes. At the same time, when data is updated frequently, the database performance consumption is large, affecting the processing efficiency of the original system.
[0005] The commonly used state information synchronization method in the hierarchically deployed video communication system also includes encapsulating the information to be synchronized in the signaling, and transmitting it along the tree networking structure of the service node through the routing forwarding mechanism of the signaling. The advantage of this method is that information synchronization does not depend on the specific implementation technology and can achieve information synchronization between heterogeneous service nodes. However, since the signaling carrying the information is forwarded level by level, the synchronization efficiency is low, and when an intermediate node fails, the information synchronization path is interrupted and the reliability is poor. Summary of the invention
[0006] In view of the above analysis, the present invention aims to disclose a distributed video cloud status information synchronization device and method based on a message queue to improve the synchronization efficiency of the status information of the distributed video cloud service system and enhance the user experience.
[0007] The present invention discloses a distributed video cloud state information synchronization device based on a message queue, comprising: a global state information synchronization service; each distributed video cloud service node is respectively connected to the state information synchronization service for communication;
[0008] When a new video cloud service node is online, it registers with the status information synchronization service, establishes a control connection channel, subscribes to the status information according to its demand for status information, adds a message queue, and establishes a binding topic for the message queue when exchanging messages; the format of the binding topic is the same as the routing keyword format of the status message;
[0009] When the state of an object managed by an online video cloud service node changes, the state information synchronization service receives the state change information sent by the video cloud service node, parses the routing keyword of the state change message and matches it with the binding topic in the information queue, and then copies and distributes it to each successfully matched message queue. The video cloud service node reads the corresponding message queue information to achieve state synchronization.
[0010] Furthermore, the topic format in the binding topic is the same as the routing keyword format; the format is <objid> . <objtype> . <orgid> . <nodeid>; Where objID is the object ID, objType is the object type, orgUUID is the organization ID to which the object belongs, and nodeID is the service node ID that sends the message;
[0011] Among them, the fields that do not specify information in the binding topic are replaced with wildcards; when the routing keywords of the parsed state change message are matched with the binding topics in the information queue, the wildcard can match any keyword in the corresponding position.
[0012] Furthermore, the state information synchronization service also provides a query interface for the video cloud service node to perform one-time synchronization through information query;
[0013] The state information synchronization service also provides local persistent storage for persistent storage of state change messages for the video cloud service node to query information through a query interface.
[0014] Furthermore, the status information synchronization service includes:
[0015] The authentication module is used to authenticate the connection request of the video cloud service node according to the configuration and permission information to ensure the security of the status information synchronization service;
[0016] The control channel connection module is used to create and manage the connection instance between the state information synchronization service and the service node. The connection instance is used to create, bind and destroy the message queue, as well as read and write messages.
[0017] A status information receiving module, used to receive the to-be-synchronized status messages sent by each video cloud service node;
[0018] The message exchange module is used to distribute the to-be-synchronized status message received by the status information receiving module to the message queue module according to the routing keyword of the status message and the binding relationship of the message queue;
[0019] The message queue module is used to receive status messages to be synchronized, create and manage message queue instances; the message queue instances are used to send status messages to be synchronized to the video cloud service nodes. The message queue instances are created by each video cloud service node according to the status information subscription requirements. When creating, a binding relationship should be established with the message exchange module. When establishing the binding relationship, the binding topic of the subscribed message is declared.
[0020] Furthermore, the status information synchronization service also includes:
[0021] A status information query module, which is used by the video cloud service node to query the historical status information saved by the status information synchronization service;
[0022] The data storage module is mainly used to store the received status information and perform persistent processing. The stored status information is mainly used for querying service nodes. At the same time, the data storage module is also used to store configuration information related to the status information synchronization service;
[0023] Configuration management module, used to manage the configuration information of the status information synchronization service and provide users with a system configuration management interface;
[0024] The anomaly detection module is used to detect operation failures or state anomalies of the state information synchronization service, including module operation failures and information synchronization failures.
[0025] The present invention also discloses a synchronization method according to the distributed video cloud state information synchronization device based on the message queue as described above, comprising:
[0026] Online steps: When a video cloud service node is newly online, it registers with the status information synchronization service, establishes a control connection channel, subscribes to the status information according to its demand for status information, adds a message queue, and establishes a binding topic for the message queue when exchanging messages; the format of the binding topic is the same as the routing keyword format of the status message;
[0027] Synchronization step: When the state of the object managed by the online video cloud service node changes, the state information synchronization service receives the state change information sent by the video cloud service node, parses the routing keyword of the state change message and matches it with the binding topic in the information queue, and then copies and distributes it to each successfully matched message queue. The video cloud service node reads the corresponding message queue information to achieve state synchronization.
[0028] Furthermore, the online step includes:
[0029] Step S101: The video cloud service node goes online and sends a registration request to the status information synchronization service. The status information synchronization service authenticates the registration request sent by the service node through an authentication module.
[0030] Step S102: After successful registration, the video cloud service node establishes a control connection channel with the status information synchronization service, and the status information synchronization service creates a connection channel instance with the service node through the control channel connection module;
[0031] Step S103: The video cloud service node sends a message queue establishment control command, and the message queue module of the status information synchronization service establishes a private temporary message queue instance for the video cloud service node;
[0032] Step S104: The video cloud service node establishes a binding relationship between the message queue and the message exchange module according to its demand for status information, and subscribes to the status information; when establishing the binding relationship, the binding topic of the subscribed message is declared;
[0033] Step S105: The video cloud service node queries historical status information, obtains known historical status information saved by the status information synchronization service through the status information query module, and synchronizes the known status information with the status information synchronization service;
[0034] Step S106: The video cloud service node encapsulates the state information it maintains into a message and sends it to the state information synchronization service, which then synchronizes the message to other service nodes.
[0035] Furthermore, the synchronization step includes:
[0036] Step S201: When the state of an object managed by the video cloud service node changes, the state change is packaged into a message and sent to the state information synchronization service;
[0037] Step S202: After receiving the message, the status information receiving module of the status information synchronization service forwards it to the message exchange module;
[0038] Step S203: The message exchange module parses the routing keyword of the status message;
[0039] Step S204: The message exchange module matches the parsed routing keyword with the bound topic of each message queue. If the match is successful, the message is copied and distributed to the corresponding message queue instance.
[0040] Step S205: The message queue instance forwards the status message to its corresponding video cloud service node;
[0041] Step S206: The data storage module performs persistence processing on the received status information.
[0042] Furthermore, in step S105, querying the historical status information includes querying by organization, querying by service node, and querying by list;
[0043] When querying by organization, the query conditions include the organization ID, the type of query object, the index value of the returned page, and the number of entries in the returned data page; when the query conditions do not include the organization ID, it indicates that the entire organization structure is queried; the query results returned by querying by organization are the status information of the organization and its subordinate organizations' users and devices;
[0044] When querying by service node, the query conditions include the service node ID, the type of query object, the index value of the returned page, and the number of entries in the returned data page; when the query conditions do not include the service node ID, it means that all service nodes are queried; the query results returned by querying by service node are the status information of users and devices registered under the service node;
[0045] When querying by list, the query condition is the list of objects to be queried, which further includes information such as the ID and type of the object to be queried. The query result returned is the status information of the users and devices in the list.
[0046] Furthermore, when the query is successful, the query result is returned, and the query result includes information such as the total number of data entries, the number of data entries on the current page, the starting index of the data on the current page, and a list of status information. Each piece of status information in the list of status information includes: object ID, object type, object status, status change time, and the ID of the node to which the object belongs;
[0047] When the query fails, the failure reason is returned, including the exception response code, exception response information and detailed exception information. The present invention can achieve one of the following beneficial effects:
[0048] The message queue-based distributed video cloud status information synchronization device and method disclosed in the present invention can distribute the status information of resources such as users and devices on demand from multiple dimensions such as the organizational structure, service node, object type, etc. according to the video cloud service node's demand for obtaining status information, which can greatly improve the synchronization efficiency of the video cloud service system status information and enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings are only for the purpose of illustrating specific embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0050] Figure 1 is a block diagram of the composition of a distributed video cloud system in an embodiment of the present invention;
[0051] Figure 2 It is a block diagram of the composition of the distributed video cloud state information synchronization device in an embodiment of the present invention;
[0052] Figure 3 It is a flow chart of a synchronization method of a distributed video cloud state information synchronization device in an embodiment of the present invention;
[0053] Figure 4 is a flowchart of the online steps in an embodiment of the present invention;
[0054] Figure 5 is a flow chart of synchronization steps in an embodiment of the present invention;
[0055] Figure 6 is a schematic diagram of an example of information synchronization in an embodiment of the present invention;
[0056] Figure 7 This is an example diagram of query by organization encapsulated in XML format in an embodiment of the present invention;
[0057] Figure 8 This is an example diagram of querying by service node encapsulated in XML format in an embodiment of the present invention;
[0058] Fig. 9 This is an example diagram of a query by list packaged in XML format in an embodiment of the present invention;
[0059] Fig.10 This is an example diagram of the query result format encapsulated in XML format in an embodiment of the present invention;
[0060] Fig.11 This is an example diagram of the failure reason format encapsulated in XML format in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used to illustrate the principles of the present invention together with the embodiments of the present invention.
[0062] An embodiment of the present invention discloses a distributed video cloud status information synchronization device based on a message queue. The distributed video cloud system is composed of multiple video cloud service nodes. When the user status of a service node changes, it is necessary to synchronously notify other service nodes that pay attention to the user status. Based on this, this embodiment implements this function by setting a global status information synchronization service connected to each video cloud service node in the distributed video cloud system, such as Figure 1 shown.
[0063] The message queue-based distributed video cloud state information synchronization device in this embodiment includes: a global state information synchronization service; and each distributed video cloud service node is respectively connected to the state information synchronization service for communication.
[0064] The status information synchronization service can be deployed as a basic component together with the core service nodes of the video cloud, or it can be deployed independently of any service node. When a service node detects that the status of a user registered on it (such as online status, busy status, custom status, etc.) has changed, it can send a message to the status information synchronization service, which will distribute the message according to the status subscription and synchronize this information to other service nodes.
[0065] When a new video cloud service node is online, it registers with the status information synchronization service, establishes a control connection channel, subscribes to the status information according to its demand for status information, adds a message queue, and establishes a binding topic for the message queue when exchanging messages; the format of the binding topic is the same as the routing keyword format of the status message;
[0066] When the state of an object managed by an online video cloud service node changes, the state information synchronization service receives the state change information sent by the video cloud service node, parses the routing keyword of the state change message and matches it with the binding topic in the information queue, and then copies and distributes it to each successfully matched message queue. The video cloud service node reads the corresponding message queue information to achieve state synchronization.
[0067] Specifically, the topic format in the binding topic is the same as the routing keyword format; the format is <objid> . <objtype> . <orgid> . <nodeid>; Where objID is the object ID, objType is the object type, orgUUID is the organization ID to which the object belongs, and nodeID is the service node ID that sends the message;
[0068] Among them, the fields that do not specify information in the binding topic are replaced with wildcards; when the routing keywords of the parsed state change message are matched with the binding topics in the information queue, the wildcard can match any keyword in the corresponding position.
[0069] Specifically, the status information synchronization service also provides a query interface for the video cloud service node to perform one-time synchronization through information query;
[0070] The state information synchronization service also provides local persistent storage for persistent storage of state change messages for the video cloud service node to query information through a query interface.
[0071] like Figure 2 As shown, in this embodiment, the state information synchronization service includes an authentication module, a state information query module, a control channel connection module, a state information receiving module, a message queue module, a message exchange module, a data storage module, a configuration management module and an anomaly detection module; wherein,
[0072] The authentication module is used to authenticate the connection request of the video cloud service node according to the configuration and permission information to ensure the security of the status information synchronization service;
[0073] The control channel connection module is used to create and manage the connection instance between the state information synchronization service and the service node. The connection instance is used to create, bind and destroy the message queue, as well as read and write messages.
[0074] A status information receiving module, used to receive the to-be-synchronized status messages sent by each video cloud service node;
[0075] The state message to be synchronized shall contain a routing key, which is used to exchange the information on demand. The routing key shall contain information such as the object ID, object type, organization to which the object belongs, and the service node that sends the message;
[0076] The format of the routing keyword is as follows: <objid> . <objtype> . <orgid> . <nodeid>Among them, objID is the object ID, objType is the object type, orgUUID is the ID of the organization to which the object belongs, and nodeID is the ID of the service node that sends the message.
[0077] The message exchange module is used to distribute the to-be-synchronized status message received by the status information receiving module to the message queue module according to the routing keyword of the status message and the binding relationship of the message queue;
[0078] The message queue module is used to create and manage message queue instances. The message queue instances are used to send status messages to be synchronized to the video cloud service nodes. The message queue instances are created by each video cloud service node according to the status information subscription requirements. When creating, a binding relationship should be established with the message exchange module. When establishing the binding relationship, the binding topic of the subscribed message is declared;
[0079] More specifically, the created message queue instance is a private temporary queue of the service node. When the connection between the service node and the state information synchronization service is disconnected, all message queue instances created by the service node are automatically destroyed.
[0080] A status information query module, which is used by the video cloud service node to query the historical status information saved by the status information synchronization service;
[0081] When the video cloud service node connects to the status information synchronization service for the first time, it needs to first obtain the currently known historical status information, and then perform incremental synchronization based on the content of the received status message to ensure the consistency of the status. In addition, the video cloud service node can also use this module to temporarily query the status information of a device or user without subscription.
[0082] The data storage module is mainly used to store the received status information and perform persistent processing. The stored status information is mainly used for querying service nodes. At the same time, the data storage module is also used to store configuration information related to the status information synchronization service;
[0083] More specifically, the data storage module establishes a persistent message queue instance in the message queue module during the initialization process, and uses "#" as a subscription topic to establish a binding relationship with the message exchange module to receive all status messages for persistent processing.
[0084] Configuration management module, used to manage the configuration information of the status information synchronization service and provide users with a system configuration management interface;
[0085] The anomaly detection module is used to detect operation failures or state anomalies of the state information synchronization service, including module operation failures and information synchronization failures.
[0086] In this embodiment, a synchronization method of the distributed video cloud state information synchronization device based on the message queue as described above is also disclosed, such as Figure 3 As shown, including:
[0087] Online steps: When a video cloud service node is newly online, it registers with the status information synchronization service, establishes a control connection channel, subscribes to the status information according to its demand for status information, adds a message queue, and establishes a binding topic for the message queue when exchanging messages; the format of the binding topic is the same as the routing keyword format of the status message;
[0088] Synchronization step: When the state of the object managed by the online video cloud service node changes, the state information synchronization service receives the state change information sent by the video cloud service node, parses the routing keyword of the state change message and matches it with the binding topic in the information queue, and then copies and distributes it to each successfully matched message queue. The video cloud service node reads the corresponding message queue information to achieve state synchronization.
[0089] like Figure 4 As shown, the online steps include:
[0090] Step S101: The video cloud service node goes online and sends a registration request to the status information synchronization service. The status information synchronization service authenticates the registration request sent by the service node through an authentication module.
[0091] Step S102: After successful registration, the video cloud service node establishes a control connection channel with the status information synchronization service, and the status information synchronization service creates a connection channel instance with the service node through the control channel connection module;
[0092] Step S103: The video cloud service node sends a message queue establishment control command, and the message queue module of the status information synchronization service establishes a private temporary message queue instance for the video cloud service node;
[0093] Step S104: The video cloud service node establishes a binding relationship between the message queue and the message exchange module according to its demand for status information, and subscribes to the status information; when establishing the binding relationship, the binding topic of the subscribed message is declared;
[0094] When establishing a binding relationship, the topic of the subscribed message needs to be declared. The format of the topic is the same as the message routing key format of the state, including the object ID, object type, organization to which the object belongs, the service node that sends the message, and other information. The format is as follows: <objid> . <objtype> . <orgid> . <nodeid>. Where objID is the object ID, objType is the object type, orgUUID is the ID of the organization to which the object belongs, and nodeID is the ID of the service node that sends the message. The information in the topic can be replaced with "*" or "#" for fuzzy matching. "*" means matching one word, and "#" means matching one or more words.
[0095] Step S105: The video cloud service node queries historical status information, obtains known historical status information saved by the status information synchronization service through the status information query module, and synchronizes the known status information with the status information synchronization service;
[0096] Step S106: The video cloud service node encapsulates the state information it maintains into a message and sends it to the state information synchronization service, which then synchronizes the message to other service nodes.
[0097] like Figure 5 As shown, the synchronization step includes:
[0098] Step S201: When the state of an object managed by the video cloud service node changes, the state change is packaged into a message and sent to the state information synchronization service;
[0099] Step S202: After receiving the message, the status information receiving module of the status information synchronization service forwards it to the message exchange module;
[0100] Step S203: The message exchange module parses the routing keyword of the status message;
[0101] Step S204: The message exchange module matches the parsed routing keyword with the bound topic of each message queue. If the match is successful, the message is copied and distributed to the corresponding message queue instance.
[0102] Step S205: The message queue instance forwards the status message to its corresponding video cloud service node;
[0103] Step S206: The data storage module performs persistence processing on the received status information.
[0104] like Figure 6 As shown, a specific example of information synchronization is given in this embodiment. In the example, video cloud service node B subscribes to the status information of the object with ID 002, establishes a message queue queue1 and uses "002.#" as the topic to establish a binding relationship with the message exchange module, video cloud service node C subscribes to the status information of all objects with organization ID 024, establishes a message queue queue2 and uses "#.024.*" as the topic to establish a binding relationship with the message exchange module, video cloud service node D subscribes to the status information of all objects with organization ID 031 and type 1, establishes a message queue queue3 and uses "*.1.031.*" as the topic to establish a binding relationship with the message exchange module. When the state of object 002 on video cloud service node A changes, a state message is sent to the video cloud state information synchronization, and the routing key is 002.1.031.024. When the message exchange module of the state information synchronization service receives the message, it parses the message, obtains the routing key, and matches the rules with the bound topics of each message queue. If the match is successful, the message is pushed to the corresponding message queue (queue1 and queue3 in the figure), and then sent to the corresponding video cloud service node (video cloud service node B and video cloud service node D in the figure).
[0105] In a more specific solution, in step S105, the query of historical status information adopts a RESTful style interface based on HTTP / HTTPS, and the HTTP request header field is extended to add <user-identify>Field, indicating the identity attribute of the query requester. Provides three query methods: query by organization, query by service node, and query by list. The query conditions and return results are encapsulated in XML or JSON format.
[0106] When querying by organization, the query conditions include the organization ID, the type of query object, the index value of the returned page, and the number of entries in the returned data page; when the query conditions do not include the organization ID, it indicates that the entire organization structure is queried; the query results returned by querying by organization are the status information of the users and devices of the organization and its subordinate organizations; an example of querying by organization encapsulated in XML format is as follows Figure 7 shown.
[0107] When querying by service node, the query conditions include the service node ID, the type of query object, the index value of the returned page, and the number of entries in the returned data page; when the query conditions do not include the service node ID, it means that all service nodes are queried; the query results returned by querying by service node are the status information of users and devices registered under the service node; the example of querying by service node encapsulated in XML format is as follows Figure 8 shown.
[0108] When querying by list, the query condition is the list of objects to be queried, which further includes the ID, type and other information of the objects to be queried. The query result returned is the status information of users and devices in the list. Fig. 9 shown.
[0109] When the query is successful, the query result is returned. The query result includes the total number of data entries, the number of data entries on the current page, the starting index of the data on the current page, and a list of status information. Each piece of status information in the list includes: object ID, object type, object status, status change time, and the ID of the node to which the object belongs. The query result format encapsulated in XML format is as follows: Fig.10 shown.
[0110] When a query fails, the failure reason is returned, including the exception response code, exception response information, and detailed exception information. The exception response code and exception response information comply with IETF RFC 7231. The format of the failure reason encapsulated in XML format is as follows: Fig.11 shown.
[0111] To sum up, the distributed video cloud status information synchronization device and method based on message queue disclosed in the embodiments of the present invention can distribute the status information of users, devices and other resources on demand from multiple dimensions such as the organizational structure, service node, object type, etc. according to the video cloud service node's demand for obtaining status information, which can greatly improve the synchronization efficiency of the video cloud service system status information and enhance the user experience.
[0112] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. < / nodeid> < / orgid> < / objtype> < / objid> < / nodeid> < / orgid> < / objtype> < / objid> < / nodeid> < / orgid> < / objtype> < / objid> < / nodeid> < / orgid> < / objtype> < / objid>
Claims
1. A distributed video cloud status information synchronization device based on a message queue, characterized in that: include: Global status information synchronization service; each distributed video cloud service node is respectively connected to the status information synchronization service for communication; When a new video cloud service node is online, it registers with the status information synchronization service, establishes a control connection channel, subscribes to the status information according to its demand for status information, adds a message queue, and establishes a binding topic for the message queue when exchanging messages; the format of the binding topic is the same as the routing keyword format of the status message; When the state of the object managed by the online video cloud service node changes, the state information synchronization service receives the state change information sent by the video cloud service node, parses the routing keyword of the state change message and matches it with the binding topic in the information queue, and then copies and distributes it to each successfully matched message queue. The video cloud service node reads the corresponding message queue information to achieve state synchronization; The state information synchronization service includes: A status information receiving module, used to receive the to-be-synchronized status messages sent by each video cloud service node; The state message to be synchronized must contain a routing keyword for exchanging the information on demand. The routing keyword includes the object ID, object type, organization to which the object belongs, and information about the service node that sent the message. The message exchange module is used to distribute the state message to be synchronized received by the state information receiving module to the message queue module according to the routing keyword of the state message to be synchronized and the binding relationship of the message queue; The message queue module is used to create and manage message queue instances. The message queue instances are used to send status messages to be synchronized to the video cloud service nodes. The message queue instances are created by each video cloud service node according to the status information subscription requirements. When creating, a binding relationship should be established with the message exchange module. When establishing the binding relationship, the binding topic of the subscribed message is declared; The created message queue instance is a private temporary queue of the service node. When the connection between the service node and the status information synchronization service is disconnected, all message queue instances created by the service node are automatically destroyed. The message exchange module receives the status message to be synchronized, parses it, obtains the routing keyword, and matches the rules with the bound topics of each message queue. If the match is successful, the message is pushed to the corresponding message queue; The topic format in the binding topic is the same as the routing keyword format; the format is <objid> . <objtype> . <orgid> . <nodeid> ; Where objID is the object ID, objType is the object type, orgUUID is the organization ID to which the object belongs, and nodeID is the service node ID that sends the message;< / nodeid> < / orgid> < / objtype> < / objid> Among them, the fields that do not specify information in the binding topic are replaced with wildcards; when the routing keywords of the parsed state change message are matched with the binding topics in the information queue, the wildcard can match any keyword in the corresponding position.
2. The distributed video cloud state information synchronization device according to claim 1, characterized in that: The state information synchronization service also provides a query interface for the video cloud service node to perform one-time synchronization through information query; The state information synchronization service also provides local persistent storage for persistent storage of state change messages for the video cloud service node to query information through a query interface.
3. The distributed video cloud state information synchronization device according to any one of claims 1 to 2, characterized in that: The state information synchronization service also includes: The authentication module is used to authenticate the connection request of the video cloud service node according to the configuration and permission information to ensure the security of the status information synchronization service; The control channel connection module is used to create and manage the connection instance between the state information synchronization service and the service node. The connection instance is used for the creation, binding and destruction of message queues, as well as the reading and writing of messages.
4. The distributed video cloud state information synchronization device according to claim 3, characterized in that: The state information synchronization service also includes: A status information query module, which is used by the video cloud service node to query the historical status information saved by the status information synchronization service; The data storage module is mainly used to store the received status information and perform persistent processing. The stored status information is mainly used for querying service nodes. At the same time, the data storage module is also used to store configuration information related to the status information synchronization service; Configuration management module, used to manage the configuration information of the status information synchronization service and provide users with a system configuration management interface; The anomaly detection module is used to detect operation failures or state anomalies of the state information synchronization service, including module operation failures and information synchronization failures.
5. A synchronization method for a distributed video cloud state information synchronization device based on a message queue according to any one of claims 1 to 4, characterized in that: include: Online steps: When a video cloud service node is newly online, it registers with the status information synchronization service, establishes a control connection channel, subscribes to the status information according to its demand for status information, adds a message queue, and establishes a binding topic for the message queue when exchanging messages; the format of the binding topic is the same as the routing keyword format of the status message; Synchronization step: When the state of the object managed by the online video cloud service node changes, the state information synchronization service receives the state change information sent by the video cloud service node, parses the routing keyword of the state change message and matches it with the binding topic in the information queue, and then copies and distributes it to each successfully matched message queue. The video cloud service node reads the corresponding message queue information to achieve state synchronization.
6. The synchronization method according to claim 5, characterized in that: The online steps include: Step S101: The video cloud service node goes online and sends a registration request to the status information synchronization service. The status information synchronization service authenticates the registration request sent by the service node through an authentication module. Step S102: After successful registration, the video cloud service node establishes a control connection channel with the status information synchronization service, and the status information synchronization service creates a connection channel instance with the service node through the control channel connection module; Step S103: The video cloud service node sends a message queue establishment control command, and the message queue module of the status information synchronization service establishes a private temporary message queue instance for the video cloud service node; Step S104: The video cloud service node establishes a binding relationship between the message queue and the message exchange module according to its demand for status information, and subscribes to the status information; when establishing the binding relationship, the binding topic of the subscribed message is declared; Step S105: The video cloud service node queries historical status information, obtains known historical status information saved by the status information synchronization service through the status information query module, and synchronizes the known status information with the status information synchronization service; Step S106: The video cloud service node encapsulates the state information it maintains into a message and sends it to the state information synchronization service, which then synchronizes the message to other service nodes.
7. The synchronization method according to claim 5, characterized in that: The synchronization step includes: Step S201: When the state of an object managed by the video cloud service node changes, the state change is packaged into a message and sent to the state information synchronization service; Step S202: After receiving the message, the status information receiving module of the status information synchronization service forwards it to the message exchange module; Step S203: The message exchange module parses the routing keyword of the status message; Step S204: The message exchange module matches the parsed routing keyword with the bound topic of each message queue. If the match is successful, the message is copied and distributed to the corresponding message queue instance. Step S205: The message queue instance forwards the status message to its corresponding video cloud service node; Step S206: The data storage module performs persistence processing on the received status information.
8. The synchronization method according to claim 6, characterized in that: In step S105, querying the historical status information includes querying by organization, querying by service node, and querying by list; When querying by organization, the query conditions include the organization ID, the type of query object, the index value of the returned page, and the number of entries in the returned data page; when the query conditions do not include the organization ID, it indicates that the entire organization structure is queried; the query results returned by querying by organization are the status information of the organization and its subordinate organizations' users and devices; When querying by service node, the query conditions include the service node ID, the type of query object, the index value of the returned page, and the number of entries in the returned data page; when the query conditions do not include the service node ID, it means that all service nodes are queried; the query results returned by querying by service node are the status information of users and devices registered under the service node; When querying by list, the query condition is the list of objects to be queried, which further includes information such as the ID and type of the object to be queried. The query result returned is the status information of the users and devices in the list.
9. The synchronization method according to claim 8, characterized in that: When the query is successful, the query result is returned, which includes the total number of data entries, the number of data entries on the current page, the starting index of the data on the current page, and a list of status information. Each piece of status information in the list includes: object ID, object type, object status, status change time, and the ID of the node to which the object belongs. When a query fails, the failure reason is returned, including the exception response code, exception response information and detailed exception information.
