A method, device, equipment and storage medium for subscribing to view resources
Patent Information
- Application Number
- CN202211650590.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-12-21
AI Technical Summary
[0003]然而,目前推送和订阅服务均需要分节点申请公网ip和暴露服务端口,当高级分节点向低级分节点订阅视图资源时,需要经历多次申请公网ip和暴露服务端口的流程,使得订阅视图资源的过程效率和安全性低下
[0049] Through the above technical solution, the view library of this application sends a view resource request subscription instruction to the central node through the pre-configured IP and pre-configured port in the central node, so that the central node can use the registered sub-node to The domain name accesses the registered sub-node. The registered sub-node is registered based on the domain name obtained by the sub-node from the central node. The domain name is the domain name that the registered sub-node provides to the said sub-node when it has view resources. Reported by the central node, the central node is driven to determine whether the resource id of the view resource in the registered sub-node matches the sub-node id of the registered sub-node. If so, if the current value of the registered sub-node is The status is online, driving the central node to forward the view resource request subscription instruction to the registered sub-node. When the registered sub-node receives the view resource request subscription instruction, it sends the view resource request subscription instruction through the ip and The port subscribes to the view resource. It can be seen that the central node can find the corresponding sub-node based on the domain name of the registered sub-node. When pushing the view resources, the registered sub-node does not need to apply for a public network IP and expose the service port. Only its domain name and view library are in the central node. The view resources can be pushed to the view library according to the IP and port configured in it, which simplifies the cascading process of view resource subscription, saves the time of view resource subscription, and improves the security of view resource subscription.
Smart Images

Figure CN115996252B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of information technology and software development, and more specifically, to a method, apparatus, device and storage medium for subscribing to view resources. Background Art
[0002] With the continuous development of visual networking equipment and business scale, various cities and regions need to cascade the view information of public areas captured by the equipment to the view library of higher-level areas (superior view library) to standardize the management of public view information of each area under the level area. The current cascade push mechanism usually adopts the form of subscription notification to cascade push public view resources to the superior view library, and then adopts the form of hierarchical sub-nodes, where the sub-nodes one level higher than the current level subscribe to the view resources of the sub-nodes of the current level, and the sub-nodes of the current level subscribe to the view resources of the sub-nodes one level lower than the current level, so as to realize the cascade push and subscription of view resources.
[0003] However, currently both push and subscription services require subnodes to apply for public IP addresses and expose service ports. When a high-level subnode subscribes to view resources from a low-level subnode, it needs to go through the process of applying for public IP addresses and exposing service ports multiple times, making the process of subscribing to view resources inefficient and insecure. Summary of the invention
[0004] In view of the above problems, the present application is proposed to provide a method, apparatus, device and storage medium for subscribing to view resources, so as to improve the efficiency and security of the process of subscribing to view resources.
[0005] In order to achieve the above objectives, the specific plan is proposed as follows:
[0006] A view resource subscription method, applied to a view library, includes:
[0007] Sending a view resource subscription request instruction to the central node through the pre-configured IP and pre-configured port in the central node, so that the central node can access the registered sub-node through the domain name of the registered sub-node, the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, and the domain name is reported by the registered sub-node to the central node when it has the view resource;
[0008] Driving the central node to determine whether the resource ID of the view resource in the registered sub-node matches the sub-node ID of the registered sub-node;
[0009] If yes, if the current state of the registered sub-node is online, drive the central node to forward the view resource subscription request instruction to the registered sub-node;
[0010] When the registered sub-node receives the view resource subscription request instruction, it subscribes to the view resource through the IP and the port.
[0011] Optionally, the registered sub-node includes a 1400 protocol device, and the registered sub-node is obtained by the 1400 protocol device registering the sub-node based on the domain name of the sub-node obtained from the central node.
[0012] The method further includes:
[0013] If the resource id of the view resource in the registered sub-node does not match the sub-node id of the registered sub-node, drive the central node to determine whether the resource id matches the device id of the 1400 protocol device in the registered sub-node;
[0014] If so, the step of driving the central node to forward the view resource subscription request instruction to the registered sub-node if the current state of the registered sub-node is online is performed.
[0015] Optionally, the method further includes:
[0016] If the resource id does not match the device id of the 1400 protocol device in the registered sub-node, a subscription failure prompt message sent by the registered sub-node is received.
[0017] Optionally, the method further includes:
[0018] If the current state of the registered sub-node is an offline state, a subscription failure prompt message sent by the registered sub-node is received.
[0019] Optionally, the method further includes:
[0020] After the subscription to the view resource is completed, a subscription success prompt message sent by the registered sub-node is received.
[0021] A view resource subscription method, applied to a central node, includes:
[0022] Obtaining a view resource request subscription instruction of the view library through the IP and port pre-configured by the view library in the central node;
[0023] In response to the view resource subscription request instruction, access the registered sub-node through the domain name of the registered sub-node, where the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, and the domain name is reported by the registered sub-node to the central node when the registered sub-node has the view resource;
[0024] Determine whether the resource id of the view resource in the registered sub-node matches the sub-node id of the registered sub-node;
[0025] If yes, if the current state of the registered sub-node is online, the view resource subscription request instruction is sent to the registered sub-node, so that the registered sub-node can send the view resource to the view library through the IP and the port.
[0026] A view resource subscription device, applied to a view library, comprising:
[0027] A request subscription unit, used to send a view resource request subscription instruction to the central node through the pre-configured IP and pre-configured port in the central node, so that the central node can access the registered sub-node through the domain name of the registered sub-node, the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, and the domain name is reported by the registered sub-node to the central node when it has the view resource;
[0028] A sub-node id matching judgment unit, used to drive the central node to judge whether the resource id of the view resource in the registered sub-node matches the sub-node id of the registered sub-node, and if so, execute the driving forwarding unit;
[0029] The driving forwarding unit is configured to drive the central node to forward the view resource subscription request instruction to the registered subnode if the current state of the registered subnode is online;
[0030] The view resource subscription unit is used to subscribe to the view resource through the IP and the port when the registered sub-node receives the view resource subscription request instruction.
[0031] Optionally, the registered sub-node includes a 1400 protocol device, and the registered sub-node is obtained by the 1400 protocol device registering the sub-node based on the domain name of the sub-node obtained from the central node.
[0032] The device also includes:
[0033] The device ID matching judgment unit is used to drive the central node to determine whether the resource ID of the view resource in the registered sub-node matches the device ID of the 1400 protocol device in the registered sub-node if the resource ID of the view resource in the registered sub-node does not match the sub-node ID of the registered sub-node. If so, execute the drive forwarding unit.
[0034] Optionally, the device further comprises:
[0035] The first subscription failure message receiving unit is configured to receive a subscription failure prompt message sent by the registered sub-node if the resource id does not match the device id of the 1400 protocol device in the registered sub-node.
[0036] Optionally, the device further comprises:
[0037] The second subscription failure message receiving unit is configured to receive a subscription failure prompt message sent by the registered sub-node if the current state of the registered sub-node is an offline state.
[0038] Optionally, the device further comprises:
[0039] The subscription success message receiving unit is used to receive a subscription success prompt message sent by the registered sub-node after completing the subscription to the view resource.
[0040] A view resource subscription device, applied to a central node, comprising:
[0041] A request subscription instruction acquisition unit, used to acquire a view resource request subscription instruction of the view library through the IP and port pre-configured by the view library in the central node;
[0042] A subnode access unit, configured to respond to the view resource subscription request instruction and access the registered subnode through the domain name of the registered subnode, wherein the registered subnode is registered based on the domain name obtained by the subnode from the central node, and the domain name is reported by the registered subnode to the central node when the registered subnode has the view resource;
[0043] A resource id matching judgment unit, used to judge whether the resource id of the view resource in the registered sub-node matches the sub-node id of the registered sub-node, and if so, execute the forwarding unit;
[0044] The forwarding unit is used to send the view resource subscription request instruction to the registered sub-node if the current state of the registered sub-node is online, so that the registered sub-node can send the view resource to the view library through the IP and the port.
[0045] A view resource subscription device, comprising a memory and a processor;
[0046] The memory is used to store programs;
[0047] The processor is used to execute the program to implement the various steps of the view resource subscription method described above.
[0048] A storage medium stores a computer program, which, when executed by a processor, implements each step of the above-mentioned method for subscribing to view resources.
[0049] By means of the above technical solution, the view library of the present application sends a view resource subscription request instruction to the central node through the pre-configured IP and pre-configured port in the central node, so that the central node can access the registered sub-node through the domain name of the registered sub-node, and the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, and the domain name is reported to the central node by the registered sub-node when it has view resources, driving the central node to determine whether the resource ID of the view resource in the registered sub-node matches the sub-node ID of the registered sub-node, and if so, if the current state of the registered sub-node is online, driving the central node to forward the view resource subscription request instruction to the registered sub-node, and when the registered sub-node receives the view resource subscription request instruction, it subscribes to the view resource through the IP and the port. It can be seen that the central node can find the corresponding sub-node according to the domain name of the registered sub-node. When pushing view resources, the registered sub-node does not need to apply for a public IP and expose the service port. It can push the view resources to the view library only based on its domain name and the IP and port configured in the central node of the view library, which simplifies the cascading process of view resource subscription, saves the time of view resource subscription, and improves the security of view resource subscription. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0051] Figure 1 An optional system architecture for implementing subscription view resources provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of a process for implementing subscription of view resources by the view library provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of a process for a central node to implement subscription of view resources provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of a device structure for implementing subscription of view resources for the view library provided in an embodiment of the present application;
[0055] Figure 5A schematic diagram of a device structure for implementing subscription of view resources by a central node provided in an embodiment of the present application;
[0056] Figure 6 A schematic diagram of the structure of a device for implementing subscription of view resources provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] Figure 1 An optional system architecture for implementing subscription of view resources provided in the embodiment of the present application, such as Figure 1 As shown, the system architecture may include:
[0059] The view library 10 , the central node 20 and the registered sub-nodes 30 .
[0060] Specifically, the view library 10 may be a view library 10 of a sub-node of a higher level than the registered sub-node 30 , the view library 10 may cascade the registered sub-nodes 30 corresponding to the sub-nodes of a lower level than the sub-node where it is located, and the view library 10 may subscribe to the view resources of the registered sub-nodes 30 .
[0061] The central node 20 can accept the node status, resource ID of the view resource, domain name information, etc. reported by the registered sub-node 30. The central node 20 can have the function of configuring the IP and port for the view library 10, so it can communicate with the view library 10 according to the IP and port corresponding to the view library 10. The central node 20 can provide configuration information for registration to the unregistered sub-node, and the configuration information can include the domain name.
[0062] The registered sub-node 30 can store view resources and push view resources to the view library 10. The registered sub-node 30 can have the authority to report node status, resource ID of view resources, domain name information and other data to the central node 20. The registered sub-node 30 can send notification messages of subscription success or subscription failure to the view library 10 regardless of whether it is online or offline.
[0063] based on Figure 1 The system architecture shown, Figure 2 A schematic diagram of a process for implementing a view resource subscription method by the view library 10 provided in an embodiment of the present application is shown, referring to Figure 2 , the process may include:
[0064] Step S110: Send a view resource subscription request instruction to the central node 20 through the pre-configured IP and pre-configured port in the central node 20, so that the central node 20 can access the registered sub-node 30 through the domain name of the registered sub-node.
[0065] The registered sub-node 30 is registered based on the domain name obtained by the sub-node from the central node 20. The domain name is reported by the registered sub-node 30 to the central node 20 when it has view resources.
[0066] Step S120 , driving the central node 20 to determine whether the resource ID of the view resource in the registered sub-node 30 matches the sub-node ID of the registered sub-node 30 , and if so, executing step S130 .
[0067] It can be understood that one of the necessary conditions for the view library 10 to subscribe to view resources from the registered subnode 30 is that the resource ID of the view resource possessed by the registered subnode 30 matches the node ID of the registered subnode 30 , which can indicate that the view resource belongs to the registered subnode 30 .
[0068] Step S130 : If the current state of the registered sub-node 30 is online, drive the central node 20 to forward the view resource subscription request instruction to the registered sub-node 30 .
[0069] It can be understood that view resources can only be pushed to the view library 10 when the registered sub-node 30 is online. Therefore, the central node 20 can monitor the current status of the registered sub-node 30 and feed the current status back to the view library 10. When the view library receives that the current status of the registered sub-node 30 is online, the central node 20 can be driven to forward the view resource request subscription instruction to the registered sub-node 30 to command the registered sub-node 30 to push the view resources.
[0070] Step S140: When the registered subnode 30 receives the view resource subscription request instruction, it subscribes to the view resource through the IP and the port.
[0071] Specifically, the path for the registered sub-node 30 to push view resources can be the IP and port configured by the view library 10 at the central node 20. Therefore, when pushing view resources, there is no need to apply for a public IP and expose a service port. The view resources can be pushed to the view library only by its domain name and the IP and port configured by the view library in the central node.
[0072] The view resource subscription method provided in this embodiment is that the view library sends a view resource subscription request instruction to the central node through the pre-configured IP and pre-configured port in the central node, so that the central node can access the registered sub-node through the domain name of the registered sub-node, the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, the domain name is reported to the central node by the registered sub-node when it has the view resource, the central node is driven to determine whether the resource ID of the view resource in the registered sub-node matches the sub-node ID of the registered sub-node, if so, if the current state of the registered sub-node is online, the central node is driven to forward the view resource subscription request instruction to the registered sub-node, when the registered sub-node receives the view resource subscription request instruction, it subscribes to the view resource through the IP and the port. It can be seen that the central node can find the corresponding sub-node according to the domain name of the registered sub-node. When pushing view resources, the registered sub-node does not need to apply for a public IP and expose the service port. It can push the view resources to the view library only based on its domain name and the IP and port configured in the central node of the view library, which simplifies the cascading process of view resource subscription, saves the time of view resource subscription, and improves the security of view resource subscription.
[0073] Furthermore, the central node can perform authentication according to the online status of the registered sub-nodes, thereby determining the registered sub-nodes that can push view resources, making the operation safer.
[0074] In some embodiments of the present application, the registered sub-node 30 mentioned in the above embodiment may include a 1400 protocol device, and the 1400 protocol device is a device with a 1400 protocol cascade push mechanism. Based on this, the registered sub-node 30 may be obtained by registering the sub-node based on the domain name of the sub-node obtained from the most advanced 20 by the included 1400 protocol device. Then, on this basis, if the resource id of the view resource in the registered sub-node does not match the sub-node id of the registered sub-node, the following process may be performed:
[0075] S1. Drive the central node 20 to determine whether the resource ID matches the device ID of the 1400 protocol device in the registered sub-node 30. If so, execute step S130 of the above embodiment; if not, execute S2.
[0076] It can be understood that although the subnode id of the registered subnode 30 does not match the resource id of the view resource, the device id of the 1400 protocol device of the registered subnode 30 matches the resource id of the view resource, then the central node 20 can be driven to forward the view resource request subscription instruction to the registered subnode 30.
[0077] S2. Receive a subscription failure prompt message sent by the registered sub-node 30.
[0078] It can be understood that when the resource id of the view resource does not match the subnode id of the registered subnode 30 and the device id of the 1400 protocol device, it can be said that the view resource does not belong to the registered subnode 30. Then the central node 20 can send a failure message prompt instruction to the registered subnode 30, so that the registered subnode 30 sends a subscription failure prompt message to the view library 10.
[0079] Specifically, the registered sub-node 30 may send a subscription failure prompt message to the view library 10 through the IP and port of the private network.
[0080] In some embodiments of the present application, considering that the registered sub-node 30 is not always online, when the registered sub-node 30 is offline, the view resource cannot be pushed. Based on this, the view resource subscription method provided by the present application may also include:
[0081] If the current state of the registered sub-node 30 is an offline state, a subscription failure prompt message sent by the registered sub-node 30 is received.
[0082] It is understandable that, although the registered sub-node 30 cannot push view resources after being offline, it still has the function of sending notification messages, and thus can send a subscription failure prompt message to the view library 10 .
[0083] Specifically, when the central node 20 detects that the current state of the registered sub-node 30 is offline, it sends a failure message prompt instruction to the registered sub-node 30, so that the registered sub-node 30 sends a subscription failure prompt message to the view library 10. The registered sub-node 30 may send a subscription failure prompt message to the view library 10 through the IP and port of the private network.
[0084] In some embodiments of the present application, considering that the registered sub-node 30 needs to inform the view library 10 of the prompt message of completing the push after the push is completed, in order to increase the transparency of the subscription process of the view resource, the subscription method of the view resource provided by the present application may also include:
[0085] After the subscription to the view resource is completed, a subscription success prompt message sent by the registered sub-node 30 is received.
[0086] Specifically, the registered sub-node 30 may send a subscription success prompt message to the view library 10 through the IP and port of the private network.
[0087] Next, the embodiment of the present application further introduces a method for subscribing to view resources from the perspective of the central node 20 .
[0088] based on Figure 1 The system architecture shown, Figure 3 A schematic diagram of a flow chart showing a method for implementing a view resource subscription method by the central node 20 provided in an embodiment of the present application is shown. Figure 3 , the process may include:
[0089] Step S210 : obtaining a view resource subscription request instruction of the view library 10 through the IP and port pre-configured by the view library 10 in the central node 20 .
[0090] Step S220 , responding to the view resource subscription request instruction, accessing the registered sub-node 30 through the domain name of the registered sub-node 30 .
[0091] The registered sub-node 30 is registered based on the domain name obtained by the sub-node from the central node. The domain name is reported by the registered sub-node 30 to the central node when it has view resources.
[0092] Step S230 , determining whether the resource id of the view resource in the registered sub-node 30 matches the sub-node id of the registered sub-node 30 , if so, executing step S240 .
[0093] Step S240: If the current state of the registered sub-node 30 is online, send the view resource subscription request instruction to the registered sub-node 30, so that the registered sub-node 30 can send the view resource to the view library 10 through the IP and the port.
[0094] The view resource subscription method provided in this embodiment is as follows: the central node obtains the view resource subscription request instruction of the view library through the IP and the port pre-configured in the central node by the view library, responds to the view resource subscription request instruction, accesses the registered sub-node through the domain name of the registered sub-node, the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, the domain name is reported by the registered sub-node to the central node when it has the view resource, determines whether the resource ID of the view resource in the registered sub-node matches the sub-node ID of the registered sub-node, and if so, if the current state of the registered sub-node is online, sends the view resource subscription request instruction to the registered sub-node, so that the registered sub-node sends the view resource to the view library through the IP and the port. It can be seen that the central node can find the corresponding sub-node according to the domain name of the registered sub-node. When pushing view resources, the registered sub-node does not need to apply for a public IP and expose the service port. It can push the view resources to the view library only based on its domain name and the IP and port configured in the central node of the view library, which simplifies the cascading process of view resource subscription, saves the time of view resource subscription, and improves the security of view resource subscription.
[0095] Furthermore, the central node can perform authentication according to the online status of the registered sub-nodes, thereby determining the registered sub-nodes that can push view resources, making the operation safer.
[0096] The following describes a device for implementing subscription of view resources provided in an embodiment of the present application. The device for implementing subscription of view resources described below and the method for implementing subscription of view resources described above can refer to each other.
[0097] First, combine Figure 4 , the subscription device for the view resource applied to the view library 10 is introduced, such as Figure 4 As shown, the subscription device of the view resource may include:
[0098] The request subscription unit 11 is used to send a view resource subscription request instruction to the central node through the pre-configured IP and pre-configured port in the central node, so that the central node can access the registered sub-node through the domain name of the registered sub-node, and the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, and the domain name is reported by the registered sub-node to the central node when it has the view resource;
[0099] A sub-node id matching judgment unit 12, used to drive the central node to judge whether the resource id of the view resource in the registered sub-node matches the sub-node id of the registered sub-node, and if so, execute the driving forwarding unit 13;
[0100] The driving forwarding unit 13 is used to drive the central node to forward the view resource subscription request instruction to the registered sub-node if the current state of the registered sub-node is online;
[0101] The view resource subscription unit 14 is configured to subscribe to the view resource through the IP and the port when the registered sub-node receives the view resource subscription request instruction.
[0102] Optionally, the registered sub-node includes a 1400 protocol device, and the registered sub-node is obtained by the 1400 protocol device registering the sub-node based on the domain name of the sub-node obtained from the central node.
[0103] The device also includes:
[0104] The device ID matching judgment unit is used to drive the central node to determine whether the resource ID of the view resource in the registered sub-node matches the device ID of the 1400 protocol device in the registered sub-node if the resource ID of the view resource in the registered sub-node does not match the sub-node ID of the registered sub-node. If so, execute the drive forwarding unit.
[0105] Optionally, the device further comprises:
[0106] The first subscription failure message receiving unit is configured to receive a subscription failure prompt message sent by the registered sub-node if the resource id does not match the device id of the 1400 protocol device in the registered sub-node.
[0107] Optionally, the device further comprises:
[0108] The second subscription failure message receiving unit is configured to receive a subscription failure prompt message sent by the registered sub-node if the current state of the registered sub-node is an offline state.
[0109] Optionally, the device further comprises:
[0110] The subscription success message receiving unit is used to receive a subscription success prompt message sent by the registered sub-node after completing the subscription to the view resource.
[0111] Further, combined with Figure 5 , the subscription device for the view resource applied to the central node 20 is introduced, such as Figure 5 As shown, the subscription device of the view resource may include:
[0112] A subscription request instruction acquisition unit 21 is used to acquire a view resource subscription request instruction of the view library through the IP and port pre-configured by the view library in the central node;
[0113] A subnode access unit 22, configured to respond to the view resource subscription request instruction and access the registered subnode through the domain name of the registered subnode, wherein the registered subnode is registered based on the domain name obtained by the subnode from the central node, and the domain name is reported by the registered subnode to the central node when the registered subnode has the view resource;
[0114] The resource ID matching judgment unit 23 is used to judge whether the resource ID of the view resource in the registered sub-node matches the sub-node ID of the registered sub-node, and if so, execute the forwarding unit 24;
[0115] The forwarding unit 24 is used to send the view resource subscription request instruction to the registered sub-node if the current state of the registered sub-node is online, so that the registered sub-node can send the view resource to the view library through the IP and the port.
[0116] The apparatus for subscribing to view resources provided in the embodiments of the present application may be applied to a device for subscribing to view resources. Figure 6 The hardware structure diagram of the subscription device of the view resource is shown in FIG. Figure 6 , the hardware structure of the subscription device of the view resource may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0117] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0118] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0119] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;
[0120] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to: implement various processing flows of the view library 10 in the subscription scheme of view resources, or implement various processing flows of the central node 20 in the subscription scheme of view resources. Optionally, the detailed functions and extended functions of the program can refer to the above description.
[0121] The embodiment of the present application further provides a storage medium, which can store a program suitable for execution by a processor, wherein the program is used to: implement various processing flows of the view library 10 in the subscription scheme of view resources, or implement various processing flows of the central node 20 in the subscription scheme of view resources. Optionally, the detailed functions and extended functions of the program can refer to the above description.
[0122] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0123] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0124] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for subscribing to view resources. It is characterized in that Applies to view libraries, including: Sending a view resource subscription request instruction to the central node through the pre-configured IP and pre-configured port in the central node, so that the central node can access the registered sub-node through the domain name of the registered sub-node, the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, and the domain name is reported by the registered sub-node to the central node when it has the view resource; Driving the central node to determine whether the resource ID of the view resource in the registered sub-node matches the sub-node ID of the registered sub-node; If yes, if the current state of the registered sub-node is online, drive the central node to forward the view resource subscription request instruction to the registered sub-node; When the registered sub-node receives the view resource subscription request instruction, it subscribes to the view resource through the IP and the port.
2. The method according to claim 1, It is characterized in that The registered sub-node includes a 1400 protocol device, and the registered sub-node is obtained by the 1400 protocol device registering the sub-node based on the domain name of the sub-node obtained from the central node, The method further includes: If the resource id of the view resource in the registered sub-node does not match the sub-node id of the registered sub-node, drive the central node to determine whether the resource id matches the device id of the 1400 protocol device in the registered sub-node; If so, the step of driving the central node to forward the view resource subscription request instruction to the registered sub-node if the current state of the registered sub-node is online is performed.
3. The method according to claim 2, It is characterized in that Also includes: If the resource id does not match the device id of the 1400 protocol device in the registered sub-node, a subscription failure prompt message sent by the registered sub-node is received.
4. The method according to claim 1, It is characterized in that Also includes: If the current state of the registered sub-node is an offline state, a subscription failure prompt message sent by the registered sub-node is received.
5. The method according to any one of claims 1 to 4, It is characterized in that Also includes: After the subscription to the view resource is completed, a subscription success prompt message sent by the registered sub-node is received.
6. A method for subscribing to view resources, It is characterized in that Applied to the central node, including: Obtaining a view resource request subscription instruction of the view library through the IP and port pre-configured by the view library in the central node; In response to the view resource subscription request instruction, access the registered sub-node through the domain name of the registered sub-node, where the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, and the domain name is reported by the registered sub-node to the central node when the registered sub-node has the view resource; Determine whether the resource id of the view resource in the registered sub-node matches the sub-node id of the registered sub-node; If yes, if the current state of the registered sub-node is online, the view resource subscription request instruction is sent to the registered sub-node, so that the registered sub-node can send the view resource to the view library through the IP and the port.
7. A subscription device for view resources, It is characterized in that Applies to view libraries, including: A request subscription unit, used to send a view resource request subscription instruction to the central node through the pre-configured IP and pre-configured port in the central node, so that the central node can access the registered sub-node through the domain name of the registered sub-node, the registered sub-node is registered based on the domain name obtained by the sub-node from the central node, and the domain name is reported by the registered sub-node to the central node when it has the view resource; A sub-node id matching judgment unit, used to drive the central node to judge whether the resource id of the view resource in the registered sub-node matches the sub-node id of the registered sub-node, and if so, execute the driving forwarding unit; The driving forwarding unit is configured to drive the central node to forward the view resource subscription request instruction to the registered subnode if the current state of the registered subnode is online; The view resource subscription unit is used to subscribe to the view resource through the IP and the port when the registered sub-node receives the view resource subscription request instruction.
8. A subscription device for view resources, It is characterized in that Applied to the central node, including: A request subscription instruction acquisition unit, used to acquire a view resource request subscription instruction of the view library through an IP and a port pre-configured by the view library in the central node; A subnode access unit, configured to respond to the view resource subscription request instruction and access the registered subnode through the domain name of the registered subnode, wherein the registered subnode is registered based on the domain name obtained by the subnode from the central node, and the domain name is reported by the registered subnode to the central node when the registered subnode has the view resource; A resource id matching judgment unit, used to judge whether the resource id of the view resource in the registered sub-node matches the sub-node id of the registered sub-node, and if so, execute the forwarding unit; The forwarding unit is used to send the view resource subscription request instruction to the registered sub-node if the current state of the registered sub-node is online, so that the registered sub-node can send the view resource to the view library through the IP and the port.
9. A subscription device for a view resource, It is characterized in that including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the various steps of the view resource subscription method according to any one of claims 1 to 5 or claim 6.
10. A storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, each step of the method for subscribing to a view resource according to any one of claims 1 to 5 or claim 6 is implemented.
