Method, device, storage medium and electronic device for allocating monitoring objects
By calculating the correlation value between the monitoring agent node and the monitored object and making a reasonable allocation, the problem of unreasonable allocation of monitored objects in the distributed monitoring system is solved, the allocation efficiency and accuracy are improved, and the occurrence of monitoring errors is reduced.
Patent Information
- Application Number
- CN202111258080.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2041-10-27
AI Technical Summary
In a distributed monitoring system, the monitoring master node randomly assigns the monitored objects to the monitoring agent nodes, resulting in unreasonable allocation. This may cause problems such as the monitoring agent nodes being irrelevant to business functions, network failure, monitoring errors, and monitoring agent node overload.
By obtaining the label of the object to be monitored, calculating the association value between the monitoring agent node and the object to be monitored, and assigning the object to be monitored to the target monitoring agent node corresponding to the maximum association value, the allocation process is optimized by combining the number of label clustering and memory usage.
It achieves the reasonable allocation of objects to be monitored, improves the allocation efficiency and accuracy, avoids the load imbalance and monitoring errors of the monitoring agent nodes, and improves the stability of the monitoring system.
Smart Images

Figure CN114048092B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of distributed monitoring technology, and in particular to a method, device, storage medium, and electronic device for allocating monitoring objects. Background Art
[0002] In the face of large-scale resource monitoring or scenarios where network isolation exists between monitoring nodes, it is very necessary to introduce a distributed monitoring and collection architecture.
[0003] In related technologies, distributed monitoring systems include a master node and proxy nodes. After a monitored object is imported into the master node, the master node assigns it to a proxy node, which then monitors the predefined monitoring content of the object. However, the master node's assignment of monitored objects to proxy nodes can lead to irrational allocation. Summary of the Invention
[0004] The purpose of the present disclosure is to provide a method, device, storage medium and electronic device for allocating monitoring objects to solve the problems existing in the related art.
[0005] To achieve the above objectives, an embodiment of the present disclosure provides a method for allocating monitoring objects, the method comprising:
[0006] Acquire an object to be monitored, wherein the object to be monitored carries at least one tag;
[0007] Calculating the association value between each monitoring agent node and the object to be monitored based on the label of each monitoring agent node and the label of the object to be monitored; and
[0008] The object to be monitored is assigned to the target monitoring agent node corresponding to the maximum correlation value.
[0009] Optionally, there are multiple objects to be monitored, and the method further includes:
[0010] Clustering the plurality of objects to be monitored based on the number of tags of each object to be monitored, so as to cluster the objects to be monitored with the same number of tags into one class, and using the objects to be monitored clustered into one class as a subsequence of objects to be monitored;
[0011] Sort the subsequences of the objects to be monitored in ascending order of the number of tags to obtain a sequence of objects to be monitored;
[0012] The step of allocating the object to be monitored to the target monitoring agent node corresponding to the maximum correlation value includes:
[0013] For each of the objects to be monitored in the sequence of objects to be monitored, the object to be monitored is allocated to the target monitoring agent node having the maximum correlation value with the object to be monitored.
[0014] Optionally, the calculating the association value between each monitoring agent node and the object to be monitored according to the label of each monitoring agent node and the label of the object to be monitored includes:
[0015] Determine that the monitoring agent node has the same target tag as the object to be monitored;
[0016] The weight sum is calculated according to the preset weight value of each target tag to obtain the association value between the monitoring agent node and the object to be monitored.
[0017] Optionally, the maximum correlation value corresponds to a plurality of candidate monitoring proxy nodes, and allocating the object to be monitored to the target monitoring proxy node corresponding to the maximum correlation value includes:
[0018] Determining the memory usage of each of the candidate monitoring agent nodes;
[0019] Determine the candidate monitoring proxy node corresponding to the minimum memory usage as the target monitoring proxy node;
[0020] Allocate the object to be monitored to the target monitoring agent node.
[0021] Optionally, determining the candidate monitoring proxy node corresponding to the minimum memory usage as the target monitoring proxy node further includes:
[0022] In a case where the minimum memory usage corresponds to at least two candidate monitoring proxy nodes, randomly determining the target monitoring proxy node from the at least two candidate monitoring proxy nodes; or
[0023] In a case where the minimum memory usage corresponds to at least two candidate monitoring proxy nodes, the candidate monitoring proxy node with the largest remaining memory capacity among the at least two candidate monitoring proxy nodes is determined as the target monitoring proxy node.
[0024] Optionally, the method further includes:
[0025] Determining whether the maximum correlation value is zero;
[0026] The step of allocating the object to be monitored to the target monitoring agent node corresponding to the maximum correlation value includes:
[0027] When the maximum correlation value is not zero, the object to be monitored is allocated to the target monitoring agent node corresponding to the maximum correlation value.
[0028] Optionally, the method further includes:
[0029] When the maximum correlation value is zero, an alarm message is sent to an administrator.
[0030] The present disclosure also provides a device for allocating monitoring objects, the device comprising:
[0031] An acquisition module, configured to acquire an object to be monitored, wherein the object to be monitored carries at least one tag;
[0032] a calculation module, configured to calculate an association value between each monitoring agent node and the object to be monitored based on the label of each monitoring agent node and the label of the object to be monitored;
[0033] The allocation module is used to allocate the object to be monitored to the target monitoring agent node corresponding to the maximum correlation value.
[0034] Optionally, there are multiple objects to be monitored, and the device further includes:
[0035] a clustering module, configured to cluster the plurality of objects to be monitored based on the number of tags of each object to be monitored, so as to cluster the objects to be monitored with the same number of tags into one class, and to use the objects to be monitored clustered into one class as a subsequence of objects to be monitored;
[0036] The sorting module is used to sort the subsequences of the objects to be monitored in ascending order of the number of tags to obtain a sequence of objects to be monitored.
[0037] Correspondingly, the allocation module is specifically configured to allocate each of the objects to be monitored in the sequence of objects to be monitored to the target monitoring agent node having the maximum correlation value with the object to be monitored.
[0038] Optionally, the calculation module includes:
[0039] A first determining submodule is used to determine that the monitoring agent node has the same target tag as the object to be monitored;
[0040] The calculation submodule is used to calculate the weight sum value according to the preset weight value of each target tag to obtain the association value between the monitoring agent node and the object to be monitored.
[0041] Optionally, the maximum correlation value corresponds to multiple candidate monitoring agent nodes, and the allocation module includes:
[0042] A second determining submodule is configured to determine the memory usage of each candidate monitoring agent node;
[0043] A third determining submodule is configured to determine the candidate monitoring proxy node corresponding to the minimum memory usage as the target monitoring proxy node;
[0044] The allocation submodule is used to allocate the object to be monitored to the target monitoring agent node.
[0045] Optionally, the third determining submodule is further configured to:
[0046] When the minimum memory usage corresponds to at least two candidate monitoring proxy nodes, the target monitoring proxy node is randomly determined from the at least two candidate monitoring proxy nodes; or, when the minimum memory usage corresponds to at least two candidate monitoring proxy nodes, the candidate monitoring proxy node with the largest remaining memory capacity among the at least two candidate monitoring proxy nodes is determined as the target monitoring proxy node.
[0047] Optionally, the device further comprises:
[0048] A judging module, configured to judge whether the maximum correlation value is zero;
[0049] The allocation module is specifically configured to allocate the object to be monitored to a target monitoring agent node corresponding to the maximum association value when the maximum association value is not zero.
[0050] Optionally, the device further comprises:
[0051] The alarm module is used to send an alarm message to an administrator when the maximum correlation value is zero.
[0052] The embodiment of the present disclosure further provides a non-temporary computer-readable storage medium having a computer program stored thereon, which implements the steps of any of the above-mentioned methods for allocating monitoring objects when executed by a processor.
[0053] The present disclosure also provides an electronic device, including:
[0054] a memory having a computer program stored thereon;
[0055] A processor is configured to execute the computer program in the memory to implement any of the steps of the above-mentioned method for allocating monitoring objects.
[0056] The above technical solution can achieve at least the following beneficial technical effects:
[0057] The monitored object is obtained and the association value between each monitoring agent node and the monitored object is calculated based on the tag of each monitoring agent node and the tag of the monitored object. The monitored object is then assigned to the target monitoring agent node corresponding to the maximum association value. This method of the present disclosure achieves the goal of rationally assigning the monitored object to the target monitoring agent node with the maximum association value.
[0058] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following detailed description, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0060] Figure 1 The block diagram of a distributed monitoring system is shown according to an exemplary embodiment of the present disclosure.
[0061] Figure 2 is a block diagram showing another distributed monitoring system according to an exemplary embodiment of the present disclosure.
[0062] Figure 3 The figure is a flowchart showing a method for allocating monitoring objects according to an exemplary embodiment of the present disclosure.
[0063] Figure 4 The flowchart of another method for allocating monitoring objects according to an exemplary embodiment of the present disclosure is shown.
[0064] Figure 5 The figure is a block diagram showing a device for allocating monitoring objects according to an exemplary embodiment of the present disclosure.
[0065] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0066] The following describes the specific embodiments of the present disclosure in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure and are not intended to limit the present disclosure.
[0067] In the related art, a distributed monitoring system includes a monitoring master node and a monitoring proxy node. After the monitored object is imported into the monitoring master node, the monitoring master node assigns the monitored object to the monitoring proxy node, which then monitors the predefined monitoring content of the monitored object. However, in the process of the monitoring master node assigning the monitored object to the monitoring proxy node, since the monitoring master node randomly assigns the monitored object to the monitoring proxy node, it is possible that the monitored object is assigned to a monitoring proxy node that is not related to its business function. Over time, this will cause the monitoring proxy node to have difficulty in operation and maintenance due to monitoring multiple types of monitored objects. In addition, since the monitoring master node randomly assigns the monitored object to the monitoring proxy node, it is also possible that the monitored object is assigned to a monitoring proxy node that is not connected to its network. In this case, monitoring errors and false alarms will occur due to the failure to monitor the monitored object. In addition, since the monitoring master node randomly assigns the monitored object to the monitoring proxy node, it is also possible that multiple monitored objects are assigned to a monitoring proxy node at the same time, which may cause the monitoring proxy node to be overloaded.
[0068] To solve the problem of unreasonable allocation caused by the above allocation method, the objects to be monitored can be manually assigned to the corresponding monitoring agent nodes. However, this may cause the monitoring threads of the monitoring agent node to be blocked due to manual allocation of multiple objects to be monitored to the same monitoring agent node, thus affecting the monitoring performance.
[0069] In view of this, the embodiments of the present disclosure provide a method, device, storage medium and electronic device for allocating monitoring objects, so as to at least partially solve the problems existing in the related art and achieve the purpose of more reasonably allocating objects to be monitored.
[0070] In order to make it easier for those skilled in the art to understand the technical solution of the present disclosure, the application scenario of the present disclosure is first described below. The method for allocating monitoring objects disclosed in the present disclosure can be applied to a distributed monitoring system. Figure 1 As shown, the distributed monitoring system includes a monitoring master node and monitoring proxy nodes. The disclosed method for assigning monitoring objects can be specifically applied to the monitoring master node. It should be noted that the monitoring master node in the distributed monitoring system is used to provide an interface for users to import monitored objects and to assign monitored objects to monitoring proxy nodes. The monitoring proxy nodes are used to monitor information related to the monitored objects based on predefined monitoring parameters.
[0071] In one achievable implementation, in order to reduce the functional complexity of the monitoring master node or to reduce the load of the monitoring master node, as Figure 2As shown, an auxiliary node may be added between the monitoring main node and the monitoring agent node, so that the method for allocating monitoring objects disclosed in the present invention may be applied to the auxiliary node.
[0072] The technical solution of the present disclosure is described in detail below with reference to embodiments.
[0073] Figure 3 FIG. 1 is a flow chart showing a method for allocating monitoring objects according to an exemplary embodiment of the present disclosure. Figure 3 As shown, the method may include the following steps:
[0074] S11. Acquire an object to be monitored, where the object to be monitored carries at least one tag.
[0075] Monitoring objects to be monitored refers to monitoring servers, databases, terminal devices, VPSs (Virtual Private Servers), and other objects. In some implementations of monitoring objects to be monitored, the content to be monitored for the objects to be monitored can be predefined. For example, information such as CPU usage, memory usage, load, response time, and RPC (Remote Procedure Call) call status can be predefined.
[0076] The monitored object carries at least one tag, which can be set based on the business domain, functional characteristics, and geographical location of the monitored object. For example, the tag can be at least one of a region tag, an industry tag, a company tag, a department tag, and a business tag.
[0077] S12: Calculate an association value between each monitoring agent node and the object to be monitored according to the label of each monitoring agent node and the label of the object to be monitored.
[0078] In some embodiments, one or more labels may be set for each monitoring agent node. For example, at least one of a region label, an industry label, a company label, a department label, and a business label may be set for the monitoring agent node.
[0079] Based on the tags of the monitoring agent node and the tags of the monitored object, it can be determined whether the two have the same tags. If the two have at least one identical tag, they are considered to have an association relationship. The degree of association between the monitoring agent node and the monitored object, i.e., the association value, can be further calculated based on the number of identical tags and the type of identical tags.
[0080] S13: Allocate the object to be monitored to the target monitoring agent node corresponding to the maximum correlation value.
[0081] For example, assuming that the association degrees between monitored object A and monitoring agent nodes a, b, and c are 10, 8, and 16 respectively, the maximum association value is 16, and the monitoring agent node corresponding to the maximum association value 16 is C. In this way, monitored object A can be assigned to monitoring agent node c.
[0082] By adopting the above method, the object to be monitored is obtained, and the association value between each monitoring agent node and the object to be monitored is calculated based on the label of each monitoring agent node and the label of the object to be monitored. The object to be monitored is assigned to the target monitoring agent node corresponding to the maximum association value. By adopting this method disclosed in the present invention, the purpose of reasonably assigning the object to be monitored to the target monitoring agent node with the maximum association value is achieved, and the efficiency and accuracy of assigning the object to be monitored are improved.
[0083] Since the monitoring master node of the distributed monitoring system supports batch import of monitored objects (such as importing via Excel), in the above step S11, the number of monitored objects obtained may be multiple. In the case of obtaining multiple monitored objects, the method may further include the following steps:
[0084] Based on the number of labels of each of the objects to be monitored, multiple objects to be monitored are clustered to cluster the objects to be monitored with the same number of labels into one category, and the objects to be monitored clustered into one category are used as a subsequence of objects to be monitored; and each subsequence of objects to be monitored is sorted in ascending order of the number of labels to obtain a sequence of objects to be monitored.
[0085] For example, assume that monitored object A has 4 types / labels, monitored object B has 1 label, monitored object C has 4 labels, monitored object D has 3 labels, monitored object E has 5 labels, and monitored object F has 3 labels. Then, clustering objects A, B, C, D, E, and F will result in objects A and C being grouped together, resulting in a subsequence of monitored objects with 4 labels: A, C (or C, A). Object B can be clustered together as a separate class, resulting in a subsequence of monitored objects with 1 label: B. Objects D and F can be clustered together as a separate class, resulting in a subsequence of monitored objects with 3 labels: D, F (or F, D). Object E can be clustered together as a separate class, resulting in a subsequence of monitored objects with 5 labels: E.
[0086] Furthermore, by sorting the subsequences A and C of the objects to be monitored with 4 labels, the subsequence B of the objects to be monitored with 1 label, the subsequences D and F of the objects to be monitored with 3 labels, and the subsequence E of the objects to be monitored with 5 labels in ascending order of the number of labels, the sequence of the objects to be monitored is B, D, F, A, C, E.
[0087] Accordingly, in the case where multiple objects to be monitored are acquired, allocating the objects to be monitored to the target monitoring agent node corresponding to the maximum correlation value may include:
[0088] For each of the objects to be monitored in the sequence of objects to be monitored, the object to be monitored is allocated to the target monitoring agent node having the maximum correlation value with the object to be monitored.
[0089] For example, if the sequence of monitored objects is B, D, F, A, C, and E, first, for monitored object B, assign it to the target monitoring proxy node with the highest correlation value. Next, for monitored object D, assign it to the target monitoring proxy node with the highest correlation value. Next, for monitored object F, assign it to the target monitoring proxy node with the highest correlation value. This process continues until monitored object E is assigned to the target monitoring proxy node with the highest correlation value.
[0090] The above-mentioned serial allocation method of allocating each monitored object to the target monitoring agent node with the largest correlation value in turn can avoid the phenomenon that the monitoring agent node becomes unstable due to a sudden increase in load caused by allocating multiple monitored objects to a certain monitoring agent node at the same time.
[0091] In addition, since the fewer the number of tags of the monitored object, the lower the computational complexity of calculating the association value between the monitored object and each monitoring agent node, the lower the computational complexity, the faster and more accurately the target monitoring agent node corresponding to the monitored object can be determined. Therefore, the above method of first allocating the monitored objects with a small number of tags and then allocating the monitored objects with a large number of tags can quickly reduce the number of distributed monitoring system allocation nodes ( Figure 1 The monitoring master node in Figure 2 The number of objects to be monitored in the auxiliary nodes in the allocation node is reduced to reduce the allocation pressure of the allocation node.
[0092] It is worth noting here that if the method of allocating monitoring objects disclosed in this disclosure is applied to Figure 2For the auxiliary nodes in the distributed monitoring system shown, one implementation method that can be implemented is: in response to obtaining a plurality of objects to be monitored, the monitoring main node determines the memory ratio between the auxiliary nodes, and allocates the plurality of objects to be monitored to the auxiliary nodes according to the memory ratio. Then, each auxiliary node executes the steps of the method for allocating monitoring objects disclosed in the present invention to allocate each object to be monitored to a specific monitoring agent node. For example, assuming that the monitoring main node obtains a total of 9 objects to be monitored, and the memory ratio between auxiliary node 1 and auxiliary node 2 is 1:2, then the monitoring main node can allocate 3 objects to be monitored to auxiliary node 1, and allocate 6 objects to be monitored to auxiliary node 2. Auxiliary node 1 and auxiliary node 2 respectively execute the steps of the method for allocating monitoring objects disclosed in the present invention to allocate each object to be monitored to a specific monitoring agent node. The monitoring agent node completes the monitoring task of the objects to be monitored.
[0093] In some embodiments, calculating the association value between each monitoring agent node and the object to be monitored based on the label of each monitoring agent node and the label of the object to be monitored may include the following steps:
[0094] Determine the target tag that the monitoring agent node has in common with the object to be monitored; calculate a weight sum value according to a preset weight value of each target tag to obtain an association value between the monitoring agent node and the object to be monitored.
[0095] The preset weight value is a positive number greater than zero.
[0096] In some implementations, a corresponding weight value may be pre-set for each tag based on application requirements, for example, a weight value of 10 may be set for a region tag, a weight value of 8 may be set for a company tag, a weight value of 6 may be set for a department tag, and so on.
[0097] By determining the target tag that the monitoring agent node has in common with the object to be monitored, and calculating the weight sum value based on the preset weight value of each target tag, the association value between the monitoring agent node and the object to be monitored can be obtained. For example, assume that the tag carried by the monitored object A is "Beijing, Group Purchasing Department." The tag of the monitoring agent node a is "Beijing, Alibaba Company, Group Purchasing Department." In this way, it can be determined that the target tag that the monitored object A and the monitoring agent node a have in common is "Beijing, Group Purchasing Department." Since the preset weight value of the regional tag "Beijing" is 10, and the preset weight value of the department tag "Group Purchasing Department" is 6, the weight sum value is 16, that is, the association value between the monitored object A and the monitoring agent node a is 16.
[0098] Optionally, the maximum correlation value corresponds to a plurality of candidate monitoring proxy nodes, and allocating the object to be monitored to the target monitoring proxy node corresponding to the maximum correlation value includes:
[0099] Determine the memory usage of each candidate monitoring proxy node; determine the candidate monitoring proxy node corresponding to the minimum memory usage as the target monitoring proxy node; and assign the object to be monitored to the target monitoring proxy node.
[0100] In one possible scenario, there may be multiple monitoring proxy nodes with the highest correlation values for the monitored object. In this case, all of these monitoring proxy nodes can be considered candidate monitoring proxy nodes. The load of each candidate monitoring proxy node can be determined by determining its memory usage. The candidate monitoring proxy node with the lowest memory usage, i.e., the candidate monitoring proxy node with the lowest load, can then be identified as the target monitoring proxy node, and the monitored object can be assigned to this target monitoring proxy node.
[0101] In this way, if there are multiple candidate monitoring proxy nodes with the highest correlation values for the monitored object, a target monitoring proxy node with the lowest load can be selected to monitor the monitored object based on the load of each candidate monitoring proxy node, thereby achieving load balancing among the monitoring proxy nodes.
[0102] In an inevitable situation, among multiple candidate monitoring proxy nodes, there may be at least two candidate monitoring proxy nodes with the same and minimum memory usage. Then, the method of selecting a target monitoring proxy node from the at least two candidate monitoring proxy nodes can be:
[0103] The target monitoring proxy node is randomly determined from the at least two candidate monitoring proxy nodes; or the candidate monitoring proxy node with the largest remaining memory capacity among the at least two candidate monitoring proxy nodes is determined as the target monitoring proxy node.
[0104] For example, assume that the candidate monitoring agent nodes are candidate monitoring agent node a, candidate monitoring agent node b, and candidate monitoring agent node c. The memory usage of candidate monitoring agent node a, candidate monitoring agent node b, and candidate monitoring agent node c is 30%, 30%, and 60%, respectively. The minimum memory usage among candidate monitoring agent node a, candidate monitoring agent node b, and candidate monitoring agent node c is 30%, and the minimum memory usage of 30% occurs for candidate monitoring agent node a and candidate monitoring agent node b.
[0105] In one embodiment, one of candidate monitoring proxy nodes a and candidate monitoring proxy node b may be randomly selected as the target monitoring proxy node, for example, candidate monitoring proxy node a may be selected as the target monitoring proxy node. In another embodiment, if candidate monitoring proxy node a and candidate monitoring proxy node b have different remaining memory capacities, the candidate monitoring proxy node with the largest remaining memory capacity between candidate monitoring proxy node a and candidate monitoring proxy node b may be selected as the target monitoring proxy node. For example, if candidate monitoring proxy node a has a remaining memory capacity of 50 GB and candidate monitoring proxy node b has a remaining memory capacity of 45 GB, candidate monitoring proxy node a may be selected as the target monitoring proxy node.
[0106] Optionally, the method also includes: determining whether the maximum association value is zero; accordingly, assigning the object to be monitored to the target monitoring agent node corresponding to the maximum association value includes: when the maximum association value is not zero, assigning the object to be monitored to the target monitoring agent node corresponding to the maximum association value.
[0107] If the correlation value between the monitored object and the monitoring proxy node is zero, it indicates that the two do not share the same label. If the monitored object and the monitoring proxy node do not share the same label, it indicates that the two are completely unrelated or even disconnected from the network. Therefore, in one feasible implementation, it is possible to first determine whether the maximum correlation value is zero. Then, if the maximum correlation value is not zero, the monitored object is assigned to the target monitoring proxy node corresponding to the maximum correlation value.
[0108] Accordingly, when the maximum correlation value is zero, an alarm message can be sent to the administrator to remind the administrator that there is currently no monitoring agent node that matches the object to be monitored, so that the administrator can set a new monitoring agent node based on the current situation or manually assign the object to be monitored to a certain monitoring agent node.
[0109] The specific implementation method of sending the alarm information to the administrator may be to send the alarm information to the administrator's terminal device, or to prompt by popping up an alarm information prompt box on the administrator operation page of the monitoring master node.
[0110] Figure 4 is a flowchart showing another method for allocating monitoring objects according to an exemplary embodiment of the present disclosure. Figure 4 Shown, including:
[0111] S21. Acquire multiple objects to be monitored, each of which carries at least one tag;
[0112] S22. Clustering the multiple objects to be monitored based on the number of tags of each of the objects to be monitored, so as to cluster the objects to be monitored with the same number of tags into one class, and using the objects to be monitored clustered into one class as a subsequence of objects to be monitored;
[0113] S23, sorting the subsequences of the objects to be monitored in ascending order of the number of tags to obtain a sequence of objects to be monitored;
[0114] S24. For each of the objects to be monitored in the sequence of objects to be monitored, perform the following steps in sequence:
[0115] S241, calculating the association value between each monitoring agent node and the object to be monitored according to the label of each monitoring agent node and the label of the object to be monitored;
[0116] S242: Allocate the object to be monitored to the target monitoring agent node corresponding to the maximum correlation value.
[0117] The specific implementation of each step in the above method has been described in detail in the above embodiments and will not be repeated here.
[0118] Based on the same inventive concept, the embodiment of the present disclosure also provides a device for allocating monitoring objects, such as Figure 5 As shown, the device 500 for allocating monitoring objects includes:
[0119] An acquisition module 510 is configured to acquire an object to be monitored, wherein the object to be monitored carries at least one tag;
[0120] A calculation module 520, configured to calculate an association value between each monitoring agent node and the object to be monitored based on the label of each monitoring agent node and the label of the object to be monitored;
[0121] The allocation module 530 is configured to allocate the object to be monitored to a target monitoring agent node corresponding to the maximum correlation value.
[0122] Using the above-described apparatus, the monitored object is obtained and, based on the labels of each monitoring agent node and the label of the monitored object, the association value between each monitoring agent node and the monitored object is calculated. The monitored object is then assigned to the target monitoring agent node corresponding to the maximum association value. This approach of the present disclosure achieves the goal of rationally assigning the monitored object to the target monitoring agent node with the maximum association value.
[0123] Optionally, there are multiple objects to be monitored, and the device 500 further includes:
[0124] a clustering module, configured to cluster the plurality of objects to be monitored based on the number of tags of each object to be monitored, so as to cluster the objects to be monitored with the same number of tags into one class, and to use the objects to be monitored clustered into one class as a subsequence of objects to be monitored;
[0125] The sorting module is used to sort the subsequences of the objects to be monitored in ascending order of the number of tags to obtain a sequence of objects to be monitored.
[0126] Correspondingly, the allocation module 530 is specifically configured to sequentially allocate each of the objects to be monitored in the sequence of objects to be monitored to the target monitoring agent node having the maximum correlation value with the object to be monitored.
[0127] Optionally, the calculation module 520 includes:
[0128] A first determining submodule is used to determine that the monitoring agent node has the same target tag as the object to be monitored;
[0129] The calculation submodule is used to calculate the weight sum value according to the preset weight value of each target tag to obtain the association value between the monitoring agent node and the object to be monitored.
[0130] Optionally, the maximum correlation value corresponds to multiple candidate monitoring agent nodes, and the allocation module 530 includes:
[0131] A second determining submodule is configured to determine the memory usage of each candidate monitoring agent node;
[0132] A third determining submodule is configured to determine the candidate monitoring proxy node corresponding to the minimum memory usage as the target monitoring proxy node;
[0133] The allocation submodule is used to allocate the object to be monitored to the target monitoring agent node.
[0134] Optionally, the third determining submodule is further configured to:
[0135] When the minimum memory usage corresponds to at least two candidate monitoring proxy nodes, the target monitoring proxy node is randomly determined from the at least two candidate monitoring proxy nodes; or, when the minimum memory usage corresponds to at least two candidate monitoring proxy nodes, the candidate monitoring proxy node with the largest remaining memory capacity among the at least two candidate monitoring proxy nodes is determined as the target monitoring proxy node.
[0136] Optionally, the apparatus 500 further includes:
[0137] A judging module, configured to judge whether the maximum correlation value is zero;
[0138] The allocation module is specifically configured to allocate the object to be monitored to a target monitoring agent node corresponding to the maximum association value when the maximum association value is not zero.
[0139] Optionally, the apparatus 500 further includes:
[0140] The alarm module is used to send an alarm message to an administrator when the maximum correlation value is zero.
[0141] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0142] Figure 6 FIG. 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. Figure 6 As shown, the electronic device 700 may include: a processor 701 , a memory 702 , and may further include one or more of a multimedia component 703 , an input / output (I / O) interface 704 , and a communication component 705 .
[0143] The processor 701 is used to control the overall operation of the electronic device 700 to complete all or part of the steps in the above-mentioned method for assigning monitoring objects. The memory 702 is used to store various types of data to support the operation of the electronic device 700. Such data may include, for example, instructions for any application or method operating on the electronic device 700, as well as application-related data, such as contact information, sent and received messages, images, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 703 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 702 or sent via the communication component 705. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules. The above-mentioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more thereof, is not limited here. Therefore, the corresponding communication component 705 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.
[0144] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-mentioned method of allocating monitoring objects.
[0145] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided. When executed by a processor, the program instructions implement the steps of the above-described method for allocating monitoring objects. For example, the computer-readable storage medium may be the aforementioned memory 702 including the program instructions. The program instructions may be executed by the processor 701 of the electronic device 700 to implement the above-described method for allocating monitoring objects.
[0146] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned method for allocating monitoring objects when executed by the programmable device.
[0147] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the scope of protection of the present disclosure.
[0148] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0149] In addition, the various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A method for allocating monitoring objects, characterized in that: The method comprises: Acquire at least one object to be monitored, wherein the object to be monitored carries at least one tag; Calculating an association value between each monitoring agent node and the object to be monitored according to the label of each monitoring agent node and the label of the object to be monitored; In the case where there is only one object to be monitored, allocating the object to be monitored to the target monitoring agent node corresponding to the maximum correlation value; In the case where there are multiple objects to be monitored, clustering the multiple objects to be monitored based on the number of tags of each object to be monitored, so as to cluster the objects to be monitored with the same number of tags into one class, and the objects to be monitored clustered into one class are used as a subsequence of objects to be monitored; Sort the subsequences of the objects to be monitored in ascending order of the number of tags to obtain a sequence of objects to be monitored; For each of the objects to be monitored in the sequence of objects to be monitored, the object to be monitored is allocated to the target monitoring agent node having the maximum correlation value with the object to be monitored.
2. The method according to claim 1, characterized in that The calculating, based on the labels of the monitoring agent nodes and the labels of the objects to be monitored, an association value between each monitoring agent node and the object to be monitored includes: Determine that the monitoring agent node has the same target tag as the object to be monitored; The weight sum is calculated according to the preset weight value of each target tag to obtain the association value between the monitoring agent node and the object to be monitored.
3. The method according to claim 1 or 2, characterized in that The maximum correlation value corresponds to a plurality of candidate monitoring proxy nodes, and allocating the object to be monitored to the target monitoring proxy node corresponding to the maximum correlation value includes: Determining the memory usage of each of the candidate monitoring agent nodes; Determine the candidate monitoring proxy node corresponding to the minimum memory usage as the target monitoring proxy node; Allocate the object to be monitored to the target monitoring agent node.
4. The method according to claim 3, characterized in that The step of determining the candidate monitoring agent node corresponding to the minimum memory usage as the target monitoring agent node includes: In a case where the minimum memory usage corresponds to at least two candidate monitoring proxy nodes, randomly determining the target monitoring proxy node from the at least two candidate monitoring proxy nodes; or In a case where the minimum memory usage corresponds to at least two candidate monitoring proxy nodes, the candidate monitoring proxy node with the largest remaining memory capacity among the at least two candidate monitoring proxy nodes is determined as the target monitoring proxy node.
5. The method according to claim 1, wherein The method further comprises: Determining whether the maximum correlation value is zero; The step of allocating the object to be monitored to the target monitoring agent node corresponding to the maximum correlation value includes: When the maximum correlation value is not zero, the object to be monitored is allocated to the target monitoring agent node corresponding to the maximum correlation value.
6. The method according to claim 5, characterized in that The method further comprises: When the maximum correlation value is zero, an alarm message is sent to an administrator.
7. A device for allocating monitoring objects, characterized in that: The device comprises: An acquisition module, configured to acquire at least one object to be monitored, wherein the object to be monitored carries at least one tag; a calculation module, configured to calculate an association value between each monitoring agent node and the object to be monitored based on the label of each monitoring agent node and the label of the object to be monitored; An allocation module is used to allocate the object to be monitored to the target monitoring agent node corresponding to the maximum association value when there is only one object to be monitored, or to cluster the multiple objects to be monitored based on the number of tags of each object to be monitored, so as to cluster the objects to be monitored with the same number of tags into one class, and to use the objects to be monitored clustered into one class as a subsequence of objects to be monitored; sort the subsequences of objects to be monitored in ascending order of the number of tags to obtain a sequence of objects to be monitored; and allocate each object to be monitored in the sequence of objects to be monitored to the target monitoring agent node with the maximum association value with the object to be monitored.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Monitoring method, monitoring agency, monitoring server and monitoring system
CN103118248A
Data monitoring method, device and system
CN109522189A