CN114090388A - Information acquisition method, server cluster, server and device - Google Patents

Information acquisition method, server cluster, server and device Download PDF

Info

Publication number
CN114090388A
CN114090388A CN202111407957.4A CN202111407957A CN114090388A CN 114090388 A CN114090388 A CN 114090388A CN 202111407957 A CN202111407957 A CN 202111407957A CN 114090388 A CN114090388 A CN 114090388A
Authority
CN
China
Prior art keywords
node
resource
nodes
information
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111407957.4A
Other languages
Chinese (zh)
Inventor
邓苏冰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Corp
Original Assignee
Neusoft Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Neusoft Corp filed Critical Neusoft Corp
Priority to CN202111407957.4A priority Critical patent/CN114090388A/en
Publication of CN114090388A publication Critical patent/CN114090388A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides an information acquisition method, a server cluster, a server and equipment, and relates to the technical field of the Internet. The method is applied to a server cluster, wherein the server cluster comprises a plurality of nodes with hierarchical relation; the method comprises the following steps: acquiring an information acquisition request, wherein the information acquisition request is used for requesting to acquire information of a target resource and comprises an identifier of a target user; determining M resource groups corresponding to the identification of the target user; determining N nodes based on the M resource groups, wherein the N nodes comprise one or more nodes corresponding to each resource group in the M resource groups; the server cluster comprises N nodes; determining a target node based on the N nodes, wherein the target node stores information of target resources; the target node outputs the information of the target resource, and the method can improve the query efficiency on the basis of ensuring that the user can check the information of the target resource.

Description

Information acquisition method, server cluster, server and equipment
Technical Field
The embodiment of the application relates to the technical field of internet, and in particular relates to an information acquisition method, a server cluster, a server and equipment.
Background
In the face of tens of thousands of large-scale resource monitoring or scenes with network isolation among monitoring nodes, it is necessary to introduce a distributed monitoring acquisition architecture; at present, under an existing monitoring architecture, the role of a master node is mainly to summarize and display monitoring data of each agent node, and the role of an agent node is mainly to collect and report monitoring data to the master node, where the master node is a root node in the existing monitoring architecture, and the agent node is a child node under the root node in the existing monitoring architecture.
As the amount of the monitoring resources is gradually increased, the ordinary user only needs to check the monitoring information of the resources under the authority of a small part of the ordinary user originally, but the query efficiency of each operation can be ensured only by carrying out a series of optimization because the master node database stores the resource complete set.
Therefore, when a user views information of a target resource, how to share the pressure of the main node and improve the query efficiency is a problem to be solved urgently in the field.
Disclosure of Invention
The information acquisition method, the server cluster, the server and the equipment can improve the query efficiency on the basis of ensuring that a user can check the information of the target resource.
In a first aspect, an information acquisition method is provided, and is applied to a server cluster, where the server cluster includes a plurality of nodes having a hierarchical relationship;
the method comprises the following steps:
acquiring an information acquisition request, wherein the information acquisition request is used for requesting to acquire information of a target resource and comprises an identifier of a target user;
determining M resource groups corresponding to the identification of the target user, wherein M is a positive integer greater than or equal to 1;
determining N nodes based on the M resource groups, wherein the N nodes comprise one or more nodes corresponding to each resource group in the M resource groups, N is a positive integer greater than or equal to 1, and the server cluster comprises the N nodes;
determining a target node based on the N nodes, wherein the target node stores the information of the target resource;
the target node outputs information of the target resource.
In a second aspect, an information obtaining method is provided, where the method is applied to a first server, and includes:
receiving original data sent by a cache server, wherein the original data comprises an identifier of a first resource;
based on the identifier of the first resource, performing data processing on original data corresponding to the identifier of the first resource in the original data in at least one preset period to obtain at least one piece of information of the first resource;
determining the identifier of the first node corresponding to the identifier of the first resource based on the identifier of the first resource;
the at least one message is sent to a first node corresponding to the identity of the first node and all parent nodes of the first node.
In a third aspect, a server cluster is provided, which includes a plurality of nodes in a hierarchical relationship;
the server cluster includes:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an information acquisition request which is used for requesting to acquire the information of a target resource, and the information acquisition request comprises an identification of a target user;
a first determining unit, configured to determine M resource groups corresponding to the identifier of the target user, where M is a positive integer greater than or equal to 1;
a second determining unit, configured to determine N nodes based on the M resource groups, where the N nodes include one or more nodes corresponding to each resource group in the M resource groups, where N is a positive integer greater than or equal to 1, and the server cluster includes the N nodes;
a third determining unit, configured to determine a target node based on the N nodes, where the target node stores information of the target resource;
and the output unit is used for outputting the information of the target resource by the target node.
In a fourth aspect, a server is provided, comprising:
the receiving unit is used for receiving original data sent by the cache server, wherein the original data comprises an identifier of a first resource;
the data processing unit is used for carrying out data processing on original data corresponding to the identifier of the first resource in the original data in at least one preset period based on the identifier of the first resource to obtain at least one piece of information of the first resource;
a determining unit, configured to determine, based on the identifier of the first resource, an identifier of a first node corresponding to the identifier of the first resource;
a sending unit, configured to send the at least one piece of information to a first node corresponding to the identifier of the first node and all parent nodes of the first node.
In a fifth aspect, an electronic device is provided, comprising:
a processor adapted to execute a computer program;
a computer readable storage medium having stored thereon a computer program which, when executed by the processor, implements the method of the first aspect or the method of the second aspect.
In a sixth aspect, there is provided a computer readable storage medium for storing a computer program for causing a computer to perform the method of the first aspect or the method of the second aspect.
In a seventh aspect, there is provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the method of the first aspect or the method of the second aspect.
Based on the scheme, firstly, the application determines M resource groups corresponding to the identification of the target user, namely, the authority of the resource groups accessible by the target user is considered; secondly, determining N nodes corresponding to the M resource groups, namely considering that the resources in the resource groups accessible by the target user are related to the N nodes; finally, based on the N nodes, a target node is determined, so that when a target user accesses the uppermost node (root node) of the nodes with the hierarchical relationship, the target user can directly jump to the only target node from the root node, and the target node stores the information of the target resource, so that the information of the target resource is directly output by the target node.
That is, by determining M resource groups corresponding to the identifier of the target user and N nodes corresponding to the M resource groups, and then determining the target node based on the N nodes, the user can directly jump from the root node to the target node when accessing the root node of the plurality of nodes, thereby improving the output efficiency of the information of the target resource.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is an example of a system framework provided by an embodiment of the present application.
Fig. 2 is a schematic flow chart of an information acquisition method provided in an embodiment of the present application.
Fig. 3 is an exemplary block diagram of a plurality of nodes in a two-layer hierarchical relationship provided by an embodiment of the present application.
Fig. 4 is an exemplary block diagram of a plurality of nodes in a three-tier hierarchical relationship provided by an embodiment of the present application.
Fig. 5a is an example of a process of pre-storing a correspondence relationship in a master node according to an embodiment of the present application.
Fig. 5b is an example of a process that a user accesses a server cluster to obtain information of a target resource according to an embodiment of the present application.
Fig. 6 is another schematic flow chart of an information acquisition method provided in an embodiment of the present application.
Fig. 7 is a schematic block diagram of a first server sending at least one piece of information to a server cluster according to an embodiment of the present application.
Fig. 8 is a schematic block diagram of a server cluster provided in an embodiment of the present application.
Fig. 9 is a schematic block diagram of a server provided in an embodiment of the present application.
Fig. 10 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the research and progress of artificial intelligence technology, the artificial intelligence technology is developed and applied in a plurality of fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, unmanned aerial vehicles, robots, smart medical care, smart customer service, and the like.
The scheme provided by the embodiment of the application also relates to a data processing technology in the field of network media. Network media works differently from traditional audio and video devices, and relies on technology and equipment provided by Information Technology (IT) device developers to transmit, store and process audio and video signals. The conventional Serial Digital (SDI) transmission method lacks a network switching characteristic in a true sense. A great deal of work is required to create a portion of the network functions like those provided by ethernet and Internet Protocol (IP) using SDI. Therefore, network media technology in the video industry has been developed. Further, the data processing technology of the network media can comprise the transmission, storage and processing processes of audio and video signals.
Fig. 1 is an example of a system framework 100 provided by an embodiment of the present application.
The system framework 100 may be an information query system, and the embodiment of the present application does not limit the specific type of the information. The system framework 100 includes: server cluster 110, cache server 120, and first server 130. Both the cache server 120 and the first server 130 may be connected to the server cluster 110 via a wireless or wired network.
The cache server 120 and the first server 130 may be at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center, respectively. The cache server 120 is configured to receive the original data sent by the server cluster 110, and send the received original data to the first server 130; the first server 130 processes the received original data to obtain processed data, and sends the processed data to the server cluster 110.
The server cluster 110 may include at least one of a plurality of servers, a cloud computing platform, and a virtualization center. The server cluster 110 includes a plurality of nodes in a hierarchical relationship, wherein each node may be one or more servers; on one hand, the server cluster 110 undertakes to obtain and store the original data; on the other hand, the server cluster 110 is responsible for receiving and storing the processed data. Optionally, the server cluster 110 may also undertake secondary data processing tasks, with the first server 130 undertaking primary data processing tasks; optionally, the cache server 120 may also undertake secondary data processing, and the first server 130 undertakes primary data processing, or the cache server 120, the first server 130 and the server cluster 110 perform cooperative computing by using a distributed computing architecture.
Optionally, taking the system framework 100 as an example of a monitoring resource report query system, the server cluster 110 includes: a master node 111, a broker node 112 and a broker node 113. The master node 111, the proxy node 112, and the proxy node 113 may be servers, respectively, and the master node 111 is a parent node of the proxy node 112 and the proxy node 113; illustratively, the master node 111, the proxy node 112, and the proxy node 113 are respectively configured to obtain monitoring data of different resources in their respective nodes, and uniformly send the obtained monitoring data to the cache server 120, the cache server 120 sends the received monitoring data to the first server 130, the first server 130 performs data processing on the received monitoring data to obtain processed data, and then sends the processed data to at least one of the master node 111, the proxy node 112, and the proxy node 113 in the server cluster 110 according to a certain rule.
It should be noted that the number of nodes in the server cluster 110 is merely illustrative, and other multiple proxy nodes may also be included, which is not specifically limited in this application.
Fig. 2 is a schematic flow chart of an information obtaining method 200 provided in an embodiment of the present application. The method 200 is applied to a server cluster, wherein the server cluster comprises a plurality of nodes with a hierarchical relationship; such as server cluster 110 shown in fig. 1.
As shown in fig. 2, the method 200 may include some or all of the following:
s201, acquiring an information acquisition request, wherein the information acquisition request is used for requesting to acquire information of a target resource and comprises an identifier of a target user;
s202, determining M resource groups corresponding to the identification of the target user, wherein M is a positive integer greater than or equal to 1;
s203, determining N nodes based on the M resource groups, wherein the N nodes comprise one or more nodes corresponding to each resource group in the M resource groups, N is a positive integer greater than or equal to 1, and the server cluster comprises the N nodes;
s204, determining a target node based on the N nodes, wherein the target node stores the information of the target resource;
s205, the target node outputs the information of the target resource.
In other words, first, the server cluster obtains an information obtaining request for obtaining information of a target resource, where the information obtaining request includes an identifier of a target user; secondly, the server cluster determines M resource groups corresponding to the user identification according to the identification of the target user, determines one or more nodes corresponding to each resource group aiming at each resource group in the M resource groups, finally determines N nodes, and determines the target node based on the N nodes; finally, the target node outputs information of the target resource.
Illustratively, first, a server cluster acquires an information acquisition request through a master node, the request acquiring information of a target resource, the information acquisition request including an identifier of a target user; secondly, determining M resource groups corresponding to the user identification through the master node according to the target user identification, determining one or more proxy nodes corresponding to each resource group aiming at each resource group in the M resource groups, finally determining N proxy nodes corresponding to the M resource groups, and determining a target node based on the N proxy nodes; and finally, the server cluster outputs the information of the target resource through the target node. For example, the master node may be the master node 111 shown in fig. 1, the N nodes may be the proxy nodes 112 and 113 shown in fig. 1, and the target node is the master node 111.
Illustratively, the information may be a statistical report of the monitoring data, or may be large-screen display information of the monitoring data; for example, the large screen display information may be a ranking of a certain index in the monitoring data, or may be average data of a certain index.
For another example, the information may be a statistical report of the order data, or may be large-screen display information of the order data; for example, the large screen display information may be a ranking of different order categories, or may be average data of a certain order category, which is not specifically limited in this application.
Of course, in other alternative embodiments, if the information of the target resource is the original data of the target resource, the server cluster may directly determine the node corresponding to the target resource from the N nodes as the target node.
Based on the scheme, firstly, the application determines M resource groups corresponding to the identification of the target user, namely, the authority of the resource groups accessible by the target user is considered; secondly, determining N nodes corresponding to the M resource groups, namely considering that the resources in the resource groups accessible by the target user are related to the N nodes; finally, based on the N nodes, a target node is determined, so that when a target user accesses the uppermost node (root node) of the nodes with the hierarchical relationship, the target user can directly jump to the only target node from the root node, and the target node stores the information of the target resource, so that the information of the target resource is directly output by the target node.
That is, by determining M resource groups corresponding to the identifier of the target user and N nodes corresponding to the M resource groups, and then determining the target node based on the N nodes, the user can directly jump from the root node to the target node when accessing the root node of the plurality of nodes, thereby improving the output efficiency of the information of the target resource.
It should be noted that the hierarchical relationship may be a hierarchical relationship of a tree structure. The information acquisition request can be acquired through a root node in the server cluster.
It is noted that the target resource is one or more of the resources accessible to the target user.
It should be noted that a node corresponding to each resource group in the M resource groups may configure one or more resources, where the M resource groups are resource groups corresponding to resources accessible by a target user;
the following will illustrate the process of outputting the information of the target resource by the target node with reference to fig. 3 and 4.
Fig. 3 is an exemplary block diagram 300 of a plurality of nodes in a two-tier hierarchical relationship provided by an embodiment of the present application.
As shown in fig. 3, the block diagram 300 includes a node 310, a node 320, a node 330, and a node 340; wherein the node 310 is a parent node of the nodes 320, 330 and 340.
Wherein, the node 320 is associated with Beijing resource group, the node 330 is associated with Hangzhou resource group, and the node 340 is associated with big connection resource group. The node 310 is responsible for monitoring resource E and resource F, the node 320 is responsible for monitoring resource a and resource B, the node 330 is responsible for monitoring resource C, and the node 340 is responsible for monitoring resource D. The user A is associated with a Beijing resource group, the user B is associated with a Hangzhou resource group, and the user C is associated with a Beijing resource group and a large connection resource group.
Based on this, if the node 310 acquires the information acquisition request of the user a, first, it detects that the resource group associated with the user a is the beijing resource group; secondly, determining that the node 320 is associated with the Beijing resource group based on the Beijing resource group; finally, the node 310 transmits an information acquisition request to the node 320, and acquires the information of the target resource from the node 320.
In the existing scheme, the nodes 320, 330, and 340 all send the acquired data of the monitored resources to the node 310, so that the data volume of the node 310 is much larger than that of the node 320, and therefore, in the block diagram 300 shown in fig. 3 provided by the present application, a user can directly check the information of the target resource at the node 320, which not only can improve the query efficiency, but also relieves the query pressure of the node 310.
If the node 310 acquires the information acquisition request of the user C, firstly, detecting that the resource group associated with the user C is a Beijing resource group and a large connection resource group; secondly, based on the beijing resource group and the big connection resource group, it is determined that the node 320 and the node 340 are respectively associated with the beijing resource group and the big connection resource group, and a target node is determined in the father node 310 of the node 320 and the node 340, that is, the target node is the node 310, and since the target node and the node of the information acquisition request are the same node, the information of the target resource is directly acquired at the node 310 of the information acquisition request.
Fig. 4 is an exemplary block diagram 400 of a plurality of nodes in a three-level hierarchical relationship provided by an embodiment of the present application.
As shown in fig. 4, the block diagram 400 includes node 410, node 420, node 430, node 440, node 450, node 460, node 470, node 480, and node 490; wherein the node 410 is a parent node of the nodes 420, 430, 440, 450, 460, 470, 480 and 490; node 420 is a parent node of node 450, node 460, node 470; node 440 is a parent of node 480 and node 490.
The node 420 is associated with a Beijing resource group, the node 430 is associated with a Hangzhou resource group, the node 440 is associated with a large connection resource group, the node 450 is associated with a Western district resource group, the nodes 460 and 470 are associated with a Haihu district resource group, and the nodes 480 and 490 are associated with a high-new district resource group. The node 420 is responsible for monitoring resource D, the node 430 is responsible for monitoring resource E, the node 440 is responsible for monitoring resource H, the node 450 is responsible for monitoring resource a, the node 460 is responsible for monitoring resource B, the node 470 is responsible for monitoring resource C, the node 480 is responsible for monitoring resource F, and the node 490 is responsible for monitoring resource G. The user A is associated with a Beijing resource group, the user B is associated with a Western-style regional resource group, and the user C is associated with a Hai lake regional resource group and a Western-style regional resource group.
Based on this, if the node 410 acquires the information acquisition request of the user a, first, it detects that the resource group associated with the user a is the beijing resource group; secondly, determining that the node 420 is associated with the Beijing resource group based on the Beijing resource group; finally, the node 410 transmits an information acquisition request to the node 420, and acquires the information of the target resource from the node 420.
If the node 410 acquires the information acquisition request of the user B, firstly, detecting that a resource group associated with the user B is a city western resource group; secondly, determining nodes 450 associated with the resource groups in the western regions based on the resource groups in the western regions; finally, the node 410 transmits an information acquisition request to the node 450, and acquires the information of the target resource from the node 450.
If the node 410 acquires the information acquisition request of the user C, first, detecting that the resource group associated with the user C is a sea lake region resource group and a western city region resource group; secondly, determining that a node 450, a node 460 and a node 470 are respectively associated with the resource group of the western city region and the resource group of the marine lake region based on the resource group of the marine lake region and the resource group of the western city region; finally, a target node is determined from the parent nodes of the nodes 450, 460 and 470, i.e., the target node is determined from the nodes 420 and 410, e.g., the target node is determined to be 420, an information acquisition request is transmitted to the node 420, and the information of the target resource is acquired from the node 420.
In the existing scheme, the node 420, the node 440, and the node 440 all send the acquired data of the monitored resource to the node 410, so that the data volume of the node 410 is much larger than that of the node 420, and therefore, in the block diagram 400 shown in fig. 4 provided by the present application, a user can directly check the information of the target resource at the node 420, which not only can improve the query efficiency, but also relieves the query pressure of the node 410.
If the node 410 acquires the information acquisition request of the user C, firstly, it detects that the resource group associated with the user C is a beijing resource group and a large connection resource group; secondly, based on the beijing resource group and the big connection resource group, it is determined that the node 420 and the node 440 are respectively associated with the beijing resource group and the big connection resource group, and a target node is determined in the father node 410 of the node 420 and the node 440, that is, the target node is the node 410, and since the target node and the node of the information acquisition request are the same node, the information of the target resource is directly acquired at the node 410 of the information acquisition request.
In some embodiments of the present application, S202 may include:
acquiring a first mapping relation;
the first mapping relation comprises an identifier of at least one user and an identifier of a resource group corresponding to the identifier of each user in the identifiers of the at least one user, and the identifier of the at least one user comprises the identifier of the target user;
determining the identifier of the resource group corresponding to the identifier of the target user in the first mapping relation as the identifiers of the M resource groups;
and determining the resource group corresponding to the identifier of the M resource groups as the M resource groups.
For example, the resource group may be divided by regions, and may be a beijing resource group, a hang state resource group, a big link resource group, or the like, and the user identifier may also be divided by regions, and may be a beijing operation and maintenance 1, a hang state operation and maintenance 2, a big link operation and maintenance 3, a northeast china north operation and maintenance director 4, or the like.
For another example, the resource group may also be divided by region, and may be a western region resource group, a marine region resource group, a sunny region resource group, and the like, and the user identifier may also be divided by region, and may be a western region operation and maintenance 2, a marine region operation and maintenance 3, a sunny region operation and maintenance 4, and the like. Of course, the resource groups may also be divided by combining regions and regions, which is not specifically limited in this application.
For example, the first mapping relationship may be stored in the node in a manner of a vocabulary file, or may be stored in the node in a manner of a corresponding relationship graph, and the storage manner or the storage format of the first mapping relationship is not particularly limited in the present application.
In some embodiments of the present application, S203 may comprise:
acquiring a second mapping relation;
the second mapping relation comprises an identifier of at least one resource group and an identifier of a node corresponding to the identifier of each resource group in the identifiers of the at least one resource group, and the at least one resource group comprises the M resource groups;
determining the identifier of the node corresponding to the identifier of the first resource group in the second mapping relation as the identifier of the node in the identifiers of the N nodes corresponding to the N nodes respectively, aiming at the identifier of the first resource group in the identifiers of the M resource groups corresponding to the M resource groups respectively;
and determining the N nodes corresponding to the identifiers of the N nodes respectively as the N nodes.
For example, any node in the N nodes may be one server in a server cluster, or may be multiple servers in the server cluster, which is not specifically limited in this application.
Illustratively, the identifier of the node may be a number of the server, or may be an IP address of the server, which is not specifically limited in this application.
For example, the second mapping relationship may be stored in the node in a manner of a vocabulary file, or may be stored in the node in a manner of a corresponding relationship graph, and the storage manner or the storage format of the second mapping relationship is not particularly limited in the present application.
It should be noted that any node in the N nodes is configured to monitor one or more resources in a resource group corresponding to the node.
In some embodiments of the present application, S204 may include:
and if the N is larger than 1, determining a common father node of the N nodes as the target node in the father nodes corresponding to the N nodes.
The common father node of the N nodes is determined as the target node, which is equivalent to sharing the pressure of the node acquiring the information acquisition request for inquiring the information of the target resource by sacrificing part of the storage space of the common father node of the N nodes, and when the node acquiring the information acquisition request is the root node and the common father node of the N nodes is not the root node, the data volume of the common father node of the N nodes is much smaller than that of the root node, so that the information of the target resource is inquired in the common father node of the N nodes, and the inquiry efficiency can be improved.
Of course, in other alternative embodiments, since the common parent node of the N nodes stores the information of the target resource, if the user directly queries the information of the target resource in the common parent node of the N nodes, the user does not need to call the interfaces of the N nodes again, and can directly obtain the information of the target resource.
In some embodiments of the present application, if N is equal to 1, the N nodes are determined as the target node.
If N is equal to 1, which is equivalent to that N nodes only have one definite node, directly determining a node in the N nodes as the target node, which is equivalent to directly jumping from the node acquiring the information acquisition request to the target node, and querying and outputting the information of the target resource from the target node.
In some embodiments of the present application, the target resource includes resources monitored by the N nodes, and/or resources monitored by all children nodes of the N nodes.
For example, as shown in fig. 4, since the resource group associated with the user a is a beijing resource group, the user a can view the resource in the node corresponding to the beijing resource group associated with the user a, that is, can view the information of the resource D in the node 420, and since the node 450, the node 460, and the node 470 are child nodes of the node 420, the user can also access the information of the resource (the resource A, B, C) monitored by the node 450, the node 460, and the node 470, respectively.
For example, as shown in fig. 4, since the resource group associated with the user C is a west city resource group and a sea lake resource group, the user C can view the resources (resource a and resource B) monitored by the nodes 450 and 460 respectively corresponding to the west city resource group and the sea lake resource group associated with the user C, since the node 451 is a child node of the node 450, the user C can also view the information of the resource I monitored by the node 451, and since the target node is a parent node corresponding to the N nodes, when the target node is the node 420, the user C can view the information of the resource a, the resource B, and the resource I in the node 420, but cannot view the information of the resource D monitored by the node 420.
In some embodiments of the present application, before S201, the method may further include:
constructing a plurality of nodes with the hierarchical relationship;
acquiring and storing original data of a first resource through a first node in the plurality of nodes, wherein the original data comprises an identifier of the first resource;
sending the original data to a cache server;
at least one message of the first resource sent by the first server is received and stored by the first node and all parents of the first node.
In other words, before acquiring the information acquisition request, the server cluster first constructs a plurality of nodes having a hierarchical relationship, acquires and stores original data of a first resource by a first node of the plurality of nodes, sends the original data to the cache server, performs data processing on the original data by the cache server and the first server to obtain at least one piece of information of the first resource, sends the at least one piece of information of the first resource to the server cluster by the first server, and receives and stores the at least one piece of information of the first resource sent by the first server by the first node and all father nodes of the first node in the server cluster.
For example, after the first node collects and stores the original data of the first resource, the original data of the first resource is delivered to a cache server Kafka, or a message middleware, and the server Kafka, or the message middleware sends the original data of the first resource to the first server, and the first server performs data processing on the original data of the first resource. For example, the plurality of nodes spit the acquired original data of the resources corresponding to the nodes into the same category (Topic) of the same kafka.
It should be noted that the first server may be an independently deployed server, and is configured to uniformly consume the raw data of the resource corresponding to each node sent by the kafka.
It should be noted that Kafka is a high throughput distributed publish-subscribe messaging system, each message published to the Kafka cluster has a category, which is called Topic, and generally, messages of physically different topics are stored separately, and logically, although a message of one Topic is stored on one or more servers, a user only needs to specify the Topic of the message to produce or consume data without caring where the data is stored.
It should be noted that the first node is any one of the plurality of nodes.
It should be noted that the first resource is a resource corresponding to the first node in the pre-stored correspondence relationship between the node and the resource.
It should be noted that, if the user can access a certain resource group, the user can add a new resource to the node corresponding to the resource group, that is, based on the pre-stored correspondence between the user identifier and the resource group and the correspondence between the resource group and the node, the new resource is transmitted to the node through the interface. Optionally, the new Resource is transmitted to the node through a Resource Representational State (REST) interface.
It should be noted that the cache server and the first server may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, and big data and artificial intelligence platform, and the servers may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
It should be noted that, since all the parent nodes include the root node in the plurality of nodes, in other alternative embodiments, if the user accesses the root node, since the root node also stores the information of the target resource, the user may still ensure efficiency when viewing the information of the target resource.
On one hand, if a user accesses the father node, the information of the target resource can be directly obtained without calling an interface of a child node; on the other hand, compared with the existing scheme in which the root node stores the processed data of all the resources, the data volume of at least one piece of information of the first resource occupies a limited storage space of the parent node, that is, on the basis of sacrificing a small part of the storage space of the parent node, the information of the first resource is efficiently queried, and the query efficiency is improved.
In addition, on one hand, the original data of the first resource is only stored in the corresponding node of the first resource, and is not required to be reported to the root node, so that the storage space of the root node can be saved; on the other hand, the user can directly check the original data of the target resource at the node where the original data of the target resource is stored, and compared with the method for inquiring at the root node, the method improves the inquiring efficiency.
It should be noted that, before constructing a plurality of nodes having a hierarchical relationship, the following correspondence relationship may be pre-stored in the root node:
pre-storing the corresponding relation between the resource groups and the nodes:
illustratively, the resource groups may include Beijing resource groups, Hangzhou resource groups, big connection resource groups, and other resource groups, and the nodes may include the node 320, the node 330, and the node 340 as shown in FIG. 3; wherein, the Beijing resource group corresponding node 320, the Hangzhou resource group corresponding node 330 and the large connection resource group corresponding node 340.
For another example, the resource groups may include a Beijing resource group, a Western-style resource group, a Haishen resource group, a sunny resource group, and other resource groups, and the nodes may include a node 420, a node 450, a node 460, and a node 470 as shown in FIG. 4; the resource group mapping node comprises a Beijing resource group corresponding node 420, a Western district resource group corresponding node 450, a Haihu district resource group corresponding node 460 and a sunny district resource group corresponding node 470.
Pre-storing the corresponding relation between the resource groups and the resources:
illustratively, the resource A, B corresponds to a Beijing resource group, the resource C corresponds to a Hangzhou resource group, the resource D corresponds to a large connection resource group, the resource E corresponds to another resource group, and the resource F does not have a corresponding resource group. Based on this, the corresponding relationship of nodes and resources is pre-stored:
resource A, B corresponds to node 320, resource C corresponds to node 330, resource D corresponds to node 340, and resource E, F does not have a matching node, and thus corresponds to root node 310.
For another example, resource D corresponds to a beijing resource group, resource a corresponds to a western region resource group, resource B corresponds to a hai lake region resource group, and resource C corresponds to a sunny region resource group. Based on this, the corresponding relationship of nodes and resources is pre-stored:
node 450 corresponds to resource a, node 460 corresponds to resource B, node 470 corresponds to resource C, and node 420 corresponds to resource D.
Pre-storing the corresponding relation between users and resource groups:
illustratively, the user A corresponds to a Beijing resource group, the user B corresponds to a Hangzhou resource group, and the user C corresponds to a large connection resource group.
For another example, user a corresponds to a beijing resource group, user B corresponds to a western region resource group, and user C corresponds to a hail lake region resource group and a sunny region resource group.
It should be noted that the administrator user may view all resources in the multiple nodes, that is, the resource group corresponding to the administrator user is all resource groups.
In some embodiments of the present application, the plurality of nodes having the hierarchical relationship may be constructed by:
acquiring a configuration file of each node in the plurality of nodes;
the plurality of nodes is constructed based on the configuration file of each node.
Illustratively, a plurality of nodes are registered according to configuration files of the respective nodes when the nodes are started for the first time, and after the nodes are registered, a plurality of nodes with a hierarchical relationship are formed, and when the nodes are operated subsequently, corresponding functions are executed according to the registration information of the configuration files.
It should be noted that the configuration file format of each node is the same.
By distributing the configuration file for each node, which is equivalent to expanding functions for the child nodes, the child nodes do not just monitor the original data of the resources, but have all functions of a complete node as the root node, share the storage and query pressure for the root node, reduce the data storage capacity of the root node and improve the query efficiency of the data.
Illustratively, as shown in FIG. 3, there is node 310, node 320, node 330, and node 340.
For the nodes 310, 320, 330 and 340, when deployed, the node 310 is the root node, the identifier of the node 310 may be ADMIN, and the identifiers of the parent nodes of the nodes 320, 330 and 340 are ADMIN, then each node will register according to the configuration file of its own node in the first starting process, so as to form 4 nodes with a hierarchical relationship as shown in fig. 3.
For another example, as shown in FIG. 4, the identity of node 420 may be BEIJING, and the identity of the parent node of node 420 may be ADMIN; the identifiers of the node 450, the node 460 and the node 470 are XICHENG, HAIDIAN and CHAOYANG, respectively, and the identifiers of the parent nodes of the node 450, the node 460 and the node 470 are BEIJING, respectively, then each node will be registered according to the configuration file of its own node during the first boot process, thereby forming a plurality of nodes with a hierarchical relationship as shown in fig. 4.
The nodes are configured through the configuration files of the nodes when the nodes are started for the first time, so that the subordination relation can be established between the nodes quickly, and a plurality of nodes with the hierarchical relation are further realized.
In some embodiments of the present application, the configuration file includes at least one of:
a node identification of the node, an internet protocol, IP, address of the node, a service port of the node, a node identification of a parent node of the node, an internet protocol, IP, address of the parent node of the node, and a service port of the parent node of the node.
It should be noted that, based on the internet protocol IP address of the node, the service port of the node, the internet protocol IP address of the parent node of the node, and the service port of the parent node of the node, communication between the node and the parent node of the node is realized, that is, the IP address and the service port are mainly used for REST interface call between nodes.
In some embodiments of the present application, the collecting and saving, by the first node, raw data of the first resource includes:
acquiring a third mapping relation;
the third mapping relation comprises identifiers of a plurality of nodes and identifiers of resources corresponding to the identifiers of each node in the identifiers of the plurality of nodes, and the identifiers of the plurality of nodes comprise the identifier of the first node;
determining the identifier of the resource corresponding to the identifier of the first node in the third mapping relationship as the identifier of the first resource;
and acquiring and storing the original data of the first resource corresponding to the identifier of the first resource through the first node.
For example, the third mapping relationship may be stored in the node in a form of a vocabulary file, or may be stored in the node in a form of a correspondence graph, and the storage manner or the storage format of the third mapping relationship is not particularly limited in the present application.
The following will schematically describe an overall flow of the information obtaining method provided in the embodiment of the present application with reference to fig. 5a and 5 b.
Fig. 5a is an example of a process of pre-storing a correspondence relationship in a master node according to an embodiment of the present application.
As shown in fig. 5a, firstly, an administrator logs in a host node, creates a common user on the host node, and creates a resource group on the host node; secondly, the administrator associates the common user with the resource group at the main node, and associates the resource group with the node in the server cluster; finally, the common user adds the resource in the resource group associated with the common user, and the resource group distributes the added resource to the proxy node associated with the resource group.
On the basis of fig. 5a, fig. 5b is an example of a process that a user accesses a server cluster to obtain information of a target resource according to an embodiment of the present application.
As shown in fig. 5b, after the normal user logs in the master node in the server cluster, the master node may jump from the master node to the proxy node according to the resource group associated with the normal user in fig. 5a, and the proxy node in the server cluster associated with the resource group, so as to obtain information of the target resource at the proxy node.
Fig. 6 is another schematic flow chart of an information obtaining method 600 provided in an embodiment of the present application. The method 600 is applied to a first server, which may be the first server 130 shown in fig. 1.
It should be noted that the first server may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, and a big data and artificial intelligence platform, and the servers may be directly or indirectly connected in a wired or wireless communication manner, which is not limited herein.
As shown in fig. 6, the method 600 may include some or all of the following:
s601, receiving original data sent by a cache server, wherein the original data comprises an identifier of a first resource;
s602, based on the identifier of the first resource, performing data processing on original data corresponding to the identifier of the first resource in the original data in at least one preset period to obtain at least one piece of information of the first resource;
s603, determining the identifier of the first node corresponding to the identifier of the first resource based on the identifier of the first resource;
s604, sending the at least one message to the first node corresponding to the identifier of the first node and all parent nodes of the first node.
In other words, after receiving the original data sent by the cache server, the first server performs data processing on the original data corresponding to the identifier of the first resource in the original data in at least one preset period to obtain at least one piece of information of the first resource, and sends the at least one piece of information to a first node monitoring the original data of the first resource in the server cluster and all father nodes of the first node.
Illustratively, as shown in fig. 3, if the first node is node 320, the at least one message will be sent to node 320 and node 310.
Illustratively, the at least one piece of information may be an average value of a statistical report of the monitoring data in a preset period, or may be large-screen display information of the monitoring data in a preset period; for example, the statistical form may be an average of the monitored data; for example, the large screen display information may be a ranking of a certain index in the monitoring data, or may be average data of a certain index.
Of course, the at least one piece of information may also be a statistical report of the monitoring data in a plurality of preset periods, or may also be large-screen display information of the monitoring data in a plurality of preset periods;
for another example, the at least one piece of information may be a statistical report of order data placed in a preset period, or may be large-screen display information of order data placed in a preset period; for example, the large screen display information may be a ranking of different order categories, or may be average data of a certain order category, which is not specifically limited in this application.
Of course, the at least one piece of information may also be a statistical report of the order data placed in a plurality of preset periods, or may also be large-screen display information of the order data placed in a plurality of preset periods.
It is noted that the raw data includes raw data of one or more resources, and the one or more resources include the first resource.
It should be noted that the at least one preset period may be an hour, a day, a week, a half month, a month, etc., and the setting time of the at least one preset period is not particularly limited in the present application.
It should be noted that the first node and all parent nodes of the first node are nodes in the server cluster.
On one hand, on the basis of ensuring that a user can acquire information of target resources in the server cluster, the computing requirement on equipment in the server cluster is reduced, the cost of the equipment in the server cluster is reduced, and the load of the equipment in the server cluster is reduced; on the other hand, the data processing is handed to the first server, and the calculation capacity utilization rate of the first server can be improved.
The sending of the at least one information by the first server to the server cluster will be illustrated below with reference to fig. 7.
Fig. 7 is a schematic block diagram 700 of a first server sending at least one message to a server cluster according to an embodiment of the present application.
As shown in fig. 7, the block diagram includes all parents 710 of the first node, first node 720, cache server 730, and first server 740.
First, the first node 720 is configured to store the acquired original data of the first resource in a local database, and send the original data of the first resource to a cache server.
The cache server 720 is configured to receive the original data of the first resource sent by the first node 720, and send the original data of the first resource to the first server 730.
The first server 730 is configured to consume the raw data of the first resource sent by the cache server 720, perform data processing on the raw data of the first resource in at least one preset period to obtain at least one piece of information, and send the at least one piece of information to the first node 720 and all parent nodes 710 of the first node.
It is noted that the at least one period includes hourly, daily, weekly, monthly.
In some embodiments of the present application, the at least one predetermined period includes a first predetermined period, a second predetermined period, a third predetermined period, and a fourth predetermined period, the first predetermined period is less than the second predetermined period, the second predetermined period is less than the third predetermined period, and the third predetermined period is less than the fourth predetermined period; based on this, S602 may include:
performing data processing on original data corresponding to the identifier of the first resource in the first preset period to obtain first information;
performing data processing on a plurality of first information respectively obtained in a plurality of first preset periods in the second preset period to obtain second information;
performing data processing on a plurality of second information respectively obtained in a plurality of second preset periods in the third preset period to obtain third information;
performing data processing on a plurality of third information respectively obtained in a plurality of third preset periods in the fourth preset period to obtain fourth information;
determining the first information, the second information, the third information and the fourth information as the at least one information;
based on this, S604 may include:
the first information, the second information, the third information, and the fourth information are transmitted to the first node and all parent nodes of the first node.
For example, the first preset period, the second preset period, the third preset period and the fourth preset period may be one hour, one day, one week and one month, respectively.
And the data processing result of the large period is calculated based on the data processing result of the small preset period, so that the calculation complexity is reduced, and the calculation power resource is saved.
In some embodiments of the present application, S602 may further include:
after the first information is sent to the first node and all father nodes of the first node, original data corresponding to the identifier of the first resource is deleted;
deleting the first information after sending the second information to the first node and all father nodes of the first node;
deleting the second information after sending the third information to the first node and all father nodes of the first node;
and deleting the third information after sending the fourth information to the first node and all parent nodes of the first node.
By deleting the source data of the data processing in the small period after the result of the data processing in the small period is sent, the storage space of the first server is saved on the basis of ensuring the integrity of the data sent to the server cluster.
It should be noted that the terms "root node" and "master node" are used interchangeably in this application.
It should be noted that the terms "child node" and "proxy node" are used interchangeably in this application.
It should be noted that, in the above description, the terms "first \ second \ third" merely distinguish similar objects, and do not represent specific ordering for the objects, and it should be understood that "first \ second \ third" can exchange specific order or sequence when allowed, and should not be limited by the application.
The preferred embodiments of the present application have been described in detail with reference to the accompanying drawings, however, the present application is not limited to the details of the above embodiments, and various simple modifications can be made to the technical solution of the present application within the technical idea of the present application, and these simple modifications are all within the protection scope of the present application. For example, the various features described in the foregoing detailed description may be combined in any suitable manner without contradiction, and various combinations that may be possible are not described in this application in order to avoid unnecessary repetition. For example, various embodiments of the present application may be arbitrarily combined with each other, and the same should be considered as the disclosure of the present application as long as the concept of the present application is not violated. It should also be understood that, in the various method embodiments of the present application, the sequence numbers of the above-mentioned processes do not imply an execution sequence, and the execution sequence of the processes should be determined by their functions and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
The method provided by the embodiment of the present application is explained above, and the server cluster and the first server provided by the embodiment of the present application are explained below.
Fig. 8 is a schematic block diagram of a server cluster 800 provided by an embodiment of the present application. It should be noted that the server cluster includes a plurality of nodes in a hierarchical relationship.
As shown in fig. 8, the server cluster 800 may include some or all of the following:
an obtaining unit 810 that obtains an information obtaining request for requesting to obtain information of a target resource, the information obtaining request including an identifier of a target user;
a first determining unit 820, which determines M resource groups corresponding to the identifier of the target user, where M is a positive integer greater than or equal to 1;
a second determining unit 830, configured to determine N nodes based on the M resource groups, where the N nodes include one or more nodes corresponding to each resource group in the M resource groups, where N is a positive integer greater than or equal to 1, and the server cluster includes the N nodes;
a third determining unit 840, configured to determine a target node based on the N nodes, where the target node stores information of the target resource;
and an output unit 850, wherein the target node outputs the information of the target resource.
In some embodiments of the present application, the first determination unit 820 is configured to:
acquiring a first mapping relation;
the first mapping relation comprises an identifier of at least one user and an identifier of a resource group corresponding to the identifier of each user in the identifiers of the at least one user, and the identifier of the at least one user comprises the identifier of the target user;
determining the identifier of the resource group corresponding to the identifier of the target user in the first mapping relation as the identifiers of the M resource groups;
and determining the resource group corresponding to the identifier of the M resource groups as the M resource groups.
In some embodiments of the present application, the second determining unit 830 is configured to:
acquiring a second mapping relation;
the second mapping relation comprises an identifier of at least one resource group and an identifier of a node corresponding to the identifier of each resource group in the identifiers of the at least one resource group, and the at least one resource group comprises the M resource groups;
determining the identifier of the node corresponding to the identifier of the first resource group in the second mapping relation as the identifier of the node in the identifiers of the N nodes corresponding to the N nodes respectively, aiming at the identifier of the first resource group in the identifiers of the M resource groups corresponding to the M resource groups respectively;
and determining the N nodes corresponding to the identifiers of the N nodes respectively as the N nodes.
In some embodiments of the present application, the third determining unit 840 is configured to:
and if the N is larger than 1, determining a common father node of the N nodes as the target node in the father nodes corresponding to the N nodes.
In some embodiments of the present application, if N is equal to 1, the N nodes are determined as the target node.
In some embodiments of the present application, the target resource includes resources monitored by the N nodes, and/or resources monitored by all children nodes of the N nodes.
In some embodiments of the present application, the obtaining unit 810 may further be configured to:
constructing a plurality of nodes with the hierarchical relationship;
acquiring and storing original data of a first resource through a first node in the plurality of nodes, wherein the original data comprises an identifier of the first resource;
sending the original data to a cache server;
at least one message of the first resource sent by the first server is received and stored by the first node and all parents of the first node.
In some embodiments of the present application, the obtaining unit 810 may further be configured to:
acquiring a configuration file of each node in the plurality of nodes;
the plurality of nodes is constructed based on the configuration file of each node.
In some embodiments of the present application, the configuration file includes at least one of:
a node identification of the node, an internet protocol, IP, address of the node, a service port of the node, a node identification of a parent node of the node, an internet protocol, IP, address of the parent node of the node, and a service port of the parent node of the node.
In some embodiments of the present application, the obtaining unit 810 may further be configured to:
acquiring a third mapping relation;
the third mapping relation comprises identifiers of a plurality of nodes and identifiers of resources corresponding to the identifiers of each node in the identifiers of the plurality of nodes, and the identifiers of the plurality of nodes comprise the identifier of the first node;
determining the identifier of the resource corresponding to the identifier of the first node in the third mapping relationship as the identifier of the first resource;
and acquiring and storing the original data of the first resource corresponding to the identifier of the first resource through the first node.
Fig. 9 is a schematic block diagram of a server 900 provided in an embodiment of the present application.
It should be noted that the server may be the first server 130 shown in fig. 1.
As shown in fig. 9, the server 900 may include some or all of the following:
a receiving unit 910, configured to receive original data sent by a cache server, where the original data includes an identifier of a first resource;
a data processing unit 920, configured to perform data processing on original data corresponding to the identifier of the first resource in the original data in at least one preset period based on the identifier of the first resource, so as to obtain at least one piece of information of the first resource;
a determining unit 930 configured to determine, based on the identifier of the first resource, an identifier of the first node corresponding to the identifier of the first resource;
the sending unit 940 sends the at least one message to the first node corresponding to the identifier of the first node and all parent nodes of the first node.
In some embodiments of the present application, the at least one predetermined period includes a first predetermined period, a second predetermined period, a third predetermined period, and a fourth predetermined period, the first predetermined period is less than the second predetermined period, the second predetermined period is less than the third predetermined period, and the third predetermined period is less than the fourth predetermined period;
based on this, the data processing unit 920 may be configured to:
performing data processing on original data corresponding to the identifier of the first resource in the first preset period to obtain first information;
performing data processing on a plurality of first information respectively obtained in a plurality of first preset periods in the second preset period to obtain second information;
performing data processing on a plurality of second information respectively obtained in a plurality of second preset periods in the third preset period to obtain third information;
performing data processing on a plurality of third information respectively obtained in a plurality of third preset periods in the fourth preset period to obtain fourth information;
determining the first information, the second information, the third information and the fourth information as the at least one information;
based on this, the sending unit 940 may be configured to:
the first information, the second information, the third information, and the fourth information are transmitted to the first node and all parent nodes of the first node.
In some embodiments of the present application, the data processing unit 920 is further operable to:
after the first information is sent to the first node and all father nodes of the first node, original data corresponding to the identifier of the first resource is deleted;
deleting the first information after sending the second information to the first node and all father nodes of the first node;
deleting the second information after sending the third information to the first node and all father nodes of the first node;
and deleting the third information after sending the fourth information to the first node and all parent nodes of the first node.
It should be understood that embodiments of the server cluster 800 and the server 900 may correspond to method embodiments and similar descriptions may refer to method embodiments. To avoid repetition, further description is omitted here. Specifically, the server cluster 800 may correspond to a corresponding main body for executing the method 200 of the embodiment of the present application, the server 900 may correspond to a corresponding main body for executing the method 600 of the embodiment of the present application, and each unit in the server cluster 800 and the server 900 is respectively for implementing a corresponding flow in the method 200 and the method 600, and is not described herein again for brevity.
It should also be understood that the units of the server cluster 800 and the server 900 related to the embodiment of the present application may be respectively or entirely combined into one or several other units to form one or several other units, or some unit(s) thereof may be further split into multiple functionally smaller units to form one or several other units, which may achieve the same operation without affecting the achievement of the technical effect of the embodiment of the present application. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present application, the server cluster 800 and the server 900 may also include other units, and in practical applications, these functions may also be implemented by being assisted by other units, and may be implemented by cooperation of a plurality of units. According to another embodiment of the present application, the server cluster 800 and the server 900 according to the embodiment of the present application may be configured by running a computer program (including program codes) capable of executing the steps involved in the corresponding methods on a general-purpose computing device including a general-purpose computer such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a storage element, and the information acquisition method according to the embodiment of the present application may be implemented. The computer program can be loaded on a computer-readable storage medium, for example, and loaded and executed in an electronic device through the computer-readable storage medium, so as to implement the corresponding method of the embodiments of the present application.
In other words, the above-mentioned units may be implemented in hardware, may be implemented by instructions in software, and may also be implemented in a combination of hardware and software. Specifically, the steps of the method embodiments in the present application may be implemented by integrated logic circuits of hardware in a processor and/or instructions in the form of software, and the steps of the method disclosed in conjunction with the embodiments in the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software in the decoding processor. Alternatively, the software may reside in random access memory, flash memory, read only memory, programmable read only memory, electrically erasable programmable memory, registers, and the like, as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps in the above method embodiments in combination with hardware thereof.
Fig. 10 is a schematic structural diagram of an electronic device 10 provided in an embodiment of the present application.
As shown in fig. 10, the electronic device 10 includes at least a processor 11 and a computer-readable storage medium 12. Wherein the processor 11 and the computer readable storage medium 12 may be connected by a bus or other means. The computer-readable storage medium 12 is used for storing a computer program 14, the computer program 14 comprises computer instructions, and the processor 11 is used for executing the computer instructions stored by the computer-readable storage medium 12. The processor 11 is a computing core and a control core of the electronic device 10, which is adapted to implement one or more computer instructions, in particular to load and execute the one or more computer instructions to implement a corresponding method flow or a corresponding function.
By way of example, the processor 11 may also be referred to as a Central Processing Unit (CPU). The processor 11 may include, but is not limited to: general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like.
By way of example, computer-readable storage medium 12 may be a high-speed RAM Memory or a Non-Volatile Memory (Non-Volatile Memory), such as at least one disk Memory; alternatively, it may be at least one computer readable storage medium located remotely from the aforementioned processor 11. In particular, computer-readable storage medium 12 includes, but is not limited to: volatile memory and/or non-volatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (DDR SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
In one implementation, the electronic device 10 may be the server cluster 800 and the server 900 shown in fig. 8 and 9, respectively; the computer readable storage medium 12 has stored therein computer instructions; computer instructions stored in the computer-readable storage medium 12 are loaded and executed by the processor 11 to implement the corresponding steps in the method embodiments shown in fig. 2 and 6; in a specific implementation, the computer instructions in the computer-readable storage medium 12 are loaded by the processor 11 and perform corresponding steps, which are not described herein again to avoid repetition.
According to another aspect of the present application, a computer-readable storage medium (Memory) is provided, which is a Memory device in the electronic device 10 and is used for storing programs and data. Such as computer readable storage medium 12. It is understood that the computer readable storage medium 12 herein may comprise a built-in storage medium in the electronic device 10, and may of course also comprise an extended storage medium supported by the electronic device 10. The computer readable storage medium provides a storage space that stores an operating system of the electronic device 10. Also stored in the memory space are one or more computer instructions, which may be one or more computer programs 14 (including program code), suitable for loading and execution by the processor 11.
The electronic device 10 may further include: a transceiver 13, the transceiver 13 being connectable to the processor 11 or computer readable storage medium 12.
The computer-readable storage medium 12 can control the transceiver 13 to communicate with other devices, and in particular, can transmit information or data to the other devices or receive information or data transmitted by the other devices. The transceiver 13 may include a transmitter and a receiver. The transceiver 13 may further include one or more antennas.
According to another aspect of the application, a computer program product or computer program is provided, comprising computer instructions stored in a computer readable storage medium. Such as computer program 14. At this time, the electronic device 10 may be a computer, and the processor 11 reads the computer instructions from the computer-readable storage medium 12, and the processor 11 executes the computer instructions, so that the computer executes the information acquisition method provided in the above-described various alternative manners.
In other words, when implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes of the embodiments of the present application are executed in whole or in part or to realize the functions of the embodiments of the present application. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.).
Those of ordinary skill in the art will appreciate that the various illustrative elements and process steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Finally, it should be noted that the above embodiments are only specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and all such changes or substitutions should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. An information acquisition method is applied to a server cluster, wherein the server cluster comprises a plurality of nodes with a hierarchical relationship;
the method comprises the following steps:
acquiring an information acquisition request, wherein the information acquisition request is used for requesting to acquire information of a target resource and comprises an identifier of a target user;
determining M resource groups corresponding to the identification of the target user, wherein M is a positive integer greater than or equal to 1;
determining N nodes based on the M resource groups, wherein the N nodes comprise one or more nodes corresponding to each resource group in the M resource groups, N is a positive integer greater than or equal to 1, and the server cluster comprises the N nodes;
determining a target node based on the N nodes, wherein the target node stores information of the target resource;
and the target node outputs the information of the target resource.
2. The method of claim 1, wherein the determining the M resource groups corresponding to the target user id comprises:
acquiring a first mapping relation;
the first mapping relation comprises an identifier of at least one user and an identifier of a resource group corresponding to the identifier of each user in the identifiers of the at least one user, and the identifier of the at least one user comprises an identifier of the target user;
determining the identifier of the resource group corresponding to the identifier of the target user in the first mapping relation as the identifier of the M resource groups;
and determining the resource groups corresponding to the identifiers of the M resource groups as the M resource groups.
3. The method of claim 1, wherein determining N nodes based on the M resource groups comprises:
acquiring a second mapping relation;
the second mapping relationship comprises an identifier of at least one resource group and an identifier of a node corresponding to the identifier of each resource group in the identifiers of the at least one resource group, and the at least one resource group comprises the M resource groups;
determining, for an identifier of a first resource group among identifiers of M resource groups corresponding to the M resource groups, an identifier of a node corresponding to the identifier of the first resource group in the second mapping relationship as an identifier of a node among identifiers of N nodes corresponding to the N nodes, respectively;
and determining the N nodes corresponding to the identifiers of the N nodes respectively as the N nodes.
4. The method of claim 1, wherein determining a target node based on the N nodes comprises:
and if the N is larger than 1, determining a common father node of the N nodes as the target node in father nodes corresponding to the N nodes.
5. The method of claim 4, further comprising:
and if the N is equal to 1, determining the N nodes as the target nodes.
6. The method according to any one of claims 1 to 5, wherein before the obtaining the information obtaining request, the method further comprises:
constructing the plurality of nodes with the hierarchical relationship;
acquiring and storing original data of a first resource through a first node in the plurality of nodes, wherein the original data comprises an identifier of the first resource;
sending the original data to a cache server;
receiving and storing at least one information of the first resource sent by a first server through the first node and all parent nodes of the first node.
7. The method according to claim 6, wherein said constructing the plurality of nodes having the hierarchical relationship comprises:
acquiring a configuration file of each node in the plurality of nodes;
constructing the plurality of nodes based on the configuration file of each node.
8. The method of claim 6, wherein collecting and storing raw data for a first resource by a first node of the plurality of nodes comprises:
acquiring a third mapping relation;
the third mapping relation comprises identifiers of a plurality of nodes and identifiers of resources corresponding to the identifiers of each node in the identifiers of the plurality of nodes, and the identifiers of the plurality of nodes comprise the identifier of the first node;
determining the identifier of the resource corresponding to the identifier of the first node in the third mapping relationship as the identifier of the first resource;
and acquiring and storing the original data of the first resource corresponding to the identifier of the first resource through the first node.
9. An information acquisition method applied to a first server includes:
receiving original data sent by a cache server, wherein the original data comprises an identifier of a first resource;
based on the identifier of the first resource, performing data processing on original data corresponding to the identifier of the first resource in the original data in at least one preset period to obtain at least one piece of information of the first resource;
determining an identifier of a first node corresponding to the identifier of the first resource based on the identifier of the first resource;
and sending the at least one piece of information to a first node corresponding to the identification of the first node and all parent nodes of the first node.
10. The method according to claim 9, wherein the at least one preset period comprises a first preset period, a second preset period, a third preset period, and a fourth preset period, wherein the first preset period is less than the second preset period, the second preset period is less than the third preset period, and the third preset period is less than the fourth preset period; the data processing is performed on the original data corresponding to the identifier of the first resource in the original data in at least one preset period based on the identifier of the first resource to obtain at least one piece of information of the first resource, and the method includes:
performing data processing on original data corresponding to the identifier of the first resource in the first preset period to obtain first information;
performing data processing on a plurality of pieces of first information respectively obtained in a plurality of first preset periods in the second preset period to obtain second information;
performing data processing on a plurality of second information respectively obtained in a plurality of second preset periods in the third preset period to obtain third information;
performing data processing on a plurality of third information respectively obtained in a plurality of third preset periods in the fourth preset period to obtain fourth information;
determining the first information, the second information, the third information and the fourth information as the at least one information;
wherein the sending the at least one message to the first node corresponding to the identifier of the first resource and all parent nodes of the first node comprises:
transmitting the first information, the second information, the third information, and the fourth information to the first node and all parent nodes of the first node.
11. The method of claim 10, further comprising:
after the first information is sent to the first node and all father nodes of the first node, deleting original data corresponding to the identifier of the first resource;
deleting the first information after sending the second information to the first node and all father nodes of the first node;
deleting the second information after sending the third information to the first node and all parent nodes of the first node;
and deleting the third information after sending the fourth information to the first node and all father nodes of the first node.
12. A server cluster, characterized in that the server cluster comprises a plurality of nodes in a hierarchical relationship;
the server cluster includes:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an information acquisition request which is used for requesting to acquire information of a target resource, and the information acquisition request comprises an identification of a target user;
a first determining unit, configured to determine M resource groups corresponding to the identifier of the target user, where M is a positive integer greater than or equal to 1;
a second determining unit, configured to determine N nodes based on the M resource groups, where the N nodes include one or more nodes corresponding to each of the M resource groups, where N is a positive integer greater than or equal to 1, and the server cluster includes the N nodes;
a third determining unit, configured to determine a target node based on the N nodes, where the target node stores information of the target resource;
and the output unit is used for outputting the information of the target resource by the target node.
13. A server, comprising:
the receiving unit is used for receiving original data sent by the cache server, wherein the original data comprises an identifier of a first resource;
the data processing unit is used for performing data processing on original data corresponding to the identifier of the first resource in the original data in at least one preset period based on the identifier of the first resource to obtain at least one piece of information of the first resource;
a determining unit, configured to determine, based on the identifier of the first resource, an identifier of a first node corresponding to the identifier of the first resource;
a sending unit, configured to send the at least one piece of information to a first node corresponding to the identifier of the first node and all parent nodes of the first node.
14. An electronic device, comprising:
a processor adapted to execute a computer program;
a computer-readable storage medium, in which a computer program is stored which, when executed by the processor, implements the method of any of claims 1 to 8 or the method of any of claims 9 to 11.
15. A computer-readable storage medium for storing a computer program which causes a computer to perform the method of any one of claims 1 to 8 or the method of any one of claims 9 to 11.
16. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 11.
CN202111407957.4A 2021-11-23 2021-11-23 Information acquisition method, server cluster, server and device Pending CN114090388A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111407957.4A CN114090388A (en) 2021-11-23 2021-11-23 Information acquisition method, server cluster, server and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111407957.4A CN114090388A (en) 2021-11-23 2021-11-23 Information acquisition method, server cluster, server and device

Publications (1)

Publication Number Publication Date
CN114090388A true CN114090388A (en) 2022-02-25

Family

ID=80304454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111407957.4A Pending CN114090388A (en) 2021-11-23 2021-11-23 Information acquisition method, server cluster, server and device

Country Status (1)

Country Link
CN (1) CN114090388A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114265701A (en) * 2022-03-01 2022-04-01 深圳思谋信息科技有限公司 Resource processing method, resource processing device, computer equipment and storage medium
CN114827674A (en) * 2022-03-30 2022-07-29 北京奇艺世纪科技有限公司 Network resource display method, device and system
CN116880426A (en) * 2023-09-06 2023-10-13 中国邮电器材集团有限公司 Production line variable adjusting method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411575A (en) * 2010-09-21 2012-04-11 北京大学 A webpage display method, system and server
CN110297766A (en) * 2019-06-03 2019-10-01 合肥移瑞通信技术有限公司 Method for testing software and software testing system based on distributed test node cluster
CN111488362A (en) * 2020-04-17 2020-08-04 苏州浪潮智能科技有限公司 A resource information query method, system, device and medium of a server
US20210194810A1 (en) * 2018-02-02 2021-06-24 Wangsu Science & Technology Co., Ltd. Method and system for transmitting data resource acquisition request
CN113204427A (en) * 2021-05-20 2021-08-03 远景智能国际私人投资有限公司 Resource management method, resource management device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411575A (en) * 2010-09-21 2012-04-11 北京大学 A webpage display method, system and server
US20210194810A1 (en) * 2018-02-02 2021-06-24 Wangsu Science & Technology Co., Ltd. Method and system for transmitting data resource acquisition request
CN110297766A (en) * 2019-06-03 2019-10-01 合肥移瑞通信技术有限公司 Method for testing software and software testing system based on distributed test node cluster
CN111488362A (en) * 2020-04-17 2020-08-04 苏州浪潮智能科技有限公司 A resource information query method, system, device and medium of a server
CN113204427A (en) * 2021-05-20 2021-08-03 远景智能国际私人投资有限公司 Resource management method, resource management device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
曹海涛;胡牧;蒋厚明;: "基于集群节点间即时拷贝的会话同步技术研究", 计算机系统应用, no. 03, 15 March 2017 (2017-03-15) *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114265701A (en) * 2022-03-01 2022-04-01 深圳思谋信息科技有限公司 Resource processing method, resource processing device, computer equipment and storage medium
CN114827674A (en) * 2022-03-30 2022-07-29 北京奇艺世纪科技有限公司 Network resource display method, device and system
CN114827674B (en) * 2022-03-30 2023-09-05 北京奇艺世纪科技有限公司 Network resource display method, device and system
CN116880426A (en) * 2023-09-06 2023-10-13 中国邮电器材集团有限公司 Production line variable adjusting method and system
CN116880426B (en) * 2023-09-06 2023-12-26 中国邮电器材集团有限公司 Production line variable adjusting method and system

Similar Documents

Publication Publication Date Title
US20200344189A1 (en) Communication method and communication apparatus
CN114090388A (en) Information acquisition method, server cluster, server and device
EP2835938B1 (en) Message publishing and subscribing method and apparatus
US20170163479A1 (en) Method, Device and System of Renewing Terminal Configuration In a Memcached System
US10055266B1 (en) Dynamic optimization of application workflows
CN110535928B (en) Event pushing method for JAVA intelligent contract of block chain
CN107291744A (en) It is determined that and with the method and device of the relationship between application program
CN110933188A (en) Remote service calling method, system, server and storage medium
CN113792008B (en) Method and device for acquiring network topology structure, electronic equipment and storage medium
CN111767144A (en) Transaction routing determination method, device, equipment and system for transaction data
CN111400598A (en) Information push method, server, multi-port repeater and storage medium
CN116303608A (en) Data processing method and device for application service
CN115277707B (en) Service processing method, device, electronic equipment and storage medium
KR102124954B1 (en) IoT PLATFORM SYSTEM FOR SUPPORTING HETEROGENEOUS DATABASE MANAGEMENT SYSTEM SIMULTANEOUSLY AND OPERATING METHOD THEREOF
CN114327710B (en) Function management method, management device, terminal equipment and readable storage medium
CN114238473B (en) Metadata management method, device and electronic equipment
CN115836511B (en) Device management method, device, computer equipment and storage medium in the Internet of Things
CN113779452A (en) Data processing method, device, equipment and storage medium
CN112711466B (en) Hanging affair inspection method and device, electronic equipment and storage medium
US11757959B2 (en) Dynamic data stream processing for Apache Kafka using GraphQL
CN112231405B (en) Data storage device
CN111125223B (en) Database connection pool updating method and device
CN114461387A (en) Virtual warehouse system, operation method, medium and electronic device
US20120016900A1 (en) Identification of third party pim repositories storing a user's contact information
CN111078736A (en) Data aggregation processing method and device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination