CN111666342A - Data sampling method based on micro-service architecture and related device - Google Patents

Data sampling method based on micro-service architecture and related device Download PDF

Info

Publication number
CN111666342A
CN111666342A CN202010500132.6A CN202010500132A CN111666342A CN 111666342 A CN111666342 A CN 111666342A CN 202010500132 A CN202010500132 A CN 202010500132A CN 111666342 A CN111666342 A CN 111666342A
Authority
CN
China
Prior art keywords
sampling
service
cluster
sub
information
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.)
Granted
Application number
CN202010500132.6A
Other languages
Chinese (zh)
Other versions
CN111666342B (en
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.)
Chongqing Yinglou Weixing Information Technology Co ltd
Original Assignee
Chongqing Yinglou Weixing Information Technology Co ltd
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 Chongqing Yinglou Weixing Information Technology Co ltd filed Critical Chongqing Yinglou Weixing Information Technology Co ltd
Priority to CN202010500132.6A priority Critical patent/CN111666342B/en
Publication of CN111666342A publication Critical patent/CN111666342A/en
Application granted granted Critical
Publication of CN111666342B publication Critical patent/CN111666342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Fuzzy Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a data sampling method based on a micro-service architecture, which is applied to a gateway node and comprises the steps of obtaining sampling information sent by a plurality of sub-service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right; arranging the sampling information in a preset sampling table according to cluster names, wherein the sampling information corresponding to the same cluster is concentrated in the sampling table; after arranging the sampling information in the sampling table, searching a preset part in the sampling table through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table. The sampling query of the sampling information of the same cluster can be realized by retrieving partial areas in the sampling table, so that the gateway node can efficiently acquire the data of the sub-service nodes. The invention also provides a device, equipment and a storage medium, which also have the beneficial effects.

Description

Data sampling method based on micro-service architecture and related device
Technical Field
The present invention relates to the field of micro-service technologies, and in particular, to a data sampling method based on a micro-service architecture, a data sampling apparatus based on a micro-service architecture, a data sampling device based on a micro-service architecture, and a computer-readable storage medium.
Background
With the progress of science and technology and the development of society, the micro service system is more and more widely applied to the daily life of people. Microservice is an emerging software architecture that splits a large single application and service into tens of supporting microservices. A microservice policy may facilitate work by extending individual components rather than the entire application stack to meet service level agreements.
At present, a plurality of sub-service nodes are usually used to form a cluster with specific functions, such as a cluster for implementing a user management function, a cluster for implementing an order service, a cluster for implementing a payment service function, and the like. The state parameters of the sub-service nodes in the micro-service architecture, such as the load parameters, are highly regarded by each micro-service system in the high-traffic state. Spring-group is a micro-service framework of Java language, and how to efficiently realize data sampling of each sub-service node is a problem which needs to be solved by technical personnel in the field under the support of a Spring-group micro-service system architecture.
Disclosure of Invention
The invention aims to provide a data sampling method based on a micro-service architecture, which can enable a gateway node to efficiently acquire data of sub-service nodes; another object of the present invention is to provide a data sampling apparatus based on micro service architecture, a data sampling device based on micro service architecture and a computer readable storage medium, which can enable a gateway node to efficiently collect data of sub service nodes.
In order to solve the above technical problem, the present invention provides a data sampling method based on a micro service architecture, which is applied to a gateway node, and comprises:
acquiring sampling information sent by a plurality of sub-service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right;
arranging the sampling information in a preset sampling table according to the cluster name, wherein the sampling information corresponding to the same cluster is concentrated in the sampling table;
after the sampling information is arranged in the sampling table, searching a preset part in the sampling table through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
Optionally, the obtaining of the sampling information sent by the multiple sub-service nodes includes:
and acquiring sampling information transmitted by a plurality of sub service nodes through the RabbitMQ.
Optionally, the character string is a randomly generated random character string.
Optionally, the method further includes:
acquiring service information corresponding to a target cluster;
after the sampling information is arranged in the sampling table, searching a preset part in the sampling table according to the cluster name of the target cluster so as to inquire the sampling information corresponding to the target cluster in the sampling table;
and sending the service information to the corresponding sub-service node according to the sampling result in the inquired sampling information.
Optionally, the sampling parameter name includes a load parameter.
The invention also provides a data sampling device based on the micro-service architecture, which is applied to the gateway node and comprises the following components:
an acquisition module: the method comprises the steps of obtaining sampling information sent by a plurality of sub service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right;
an arrangement module: the device is used for arranging the sampling information in a preset sampling table according to the cluster name, and the sampling information corresponding to the same cluster is concentrated in the sampling table;
the retrieval module: after the sampling information is arranged in the sampling table, a preset part in the sampling table is searched through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
Optionally, the obtaining module is specifically configured to:
and acquiring sampling information transmitted by a plurality of sub service nodes through the RabbitMQ.
Optionally, the method further includes:
a service information acquisition module: the service information of the corresponding target cluster is obtained;
a target cluster retrieval module: after the sampling information is arranged in the sampling table, searching a preset part in the sampling table according to the cluster name of the target cluster so as to query the sampling information corresponding to the target cluster in the sampling table;
a distribution module: and the sub-service node is used for sending the service information to the corresponding sub-service node according to the sampling result in the inquired sampling information.
The invention also provides a data sampling device based on the micro-service architecture, which is applied to a gateway node and comprises the following components:
a memory for storing a computer program;
a processor for implementing the steps of the microservice-architecture based data sampling method according to any one of the preceding claims when executing the computer program.
The invention further provides a computer-readable storage medium, which is applied to a gateway node, and the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the data sampling method based on the micro service architecture.
The invention provides a data sampling method based on a micro-service architecture, which is applied to a gateway node and comprises the steps of obtaining sampling information sent by a plurality of sub-service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right; arranging the sampling information in a preset sampling table according to cluster names, wherein the sampling information corresponding to the same cluster is concentrated in the sampling table; after arranging the sampling information in the sampling table, searching a preset part in the sampling table through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
The cluster name of the cluster to which the corresponding sub-service node belongs can be identified through the name of the sub-service node by setting the name of the sub-service node in a uniform format and adding the cluster name of the cluster to which the sub-service node belongs to the name of the sub-service node. The cluster of the sampling information is reflected on the leftmost side in the sampling information acquired by the gateway node, so that the gateway node can arrange the sampling information according to the corresponding cluster only by traversing the cluster name at the beginning of each piece of sampling information in the sampling table, and concentrate the sampling information corresponding to the same cluster in the sampling table. The gateway node specifically takes the cluster as a unit, and can realize sampling query on the sampling information of the same cluster by only retrieving partial areas in the sampling table, so that the workload required by the sampling query is reduced, the process that all the sampling information in the sampling table needs to be traversed when the sampling information of a certain cluster is queried is avoided, and the gateway node can efficiently acquire the data of the sub-service nodes.
The invention also provides a data sampling device based on the micro-service architecture, data sampling equipment based on the micro-service architecture and a computer readable storage medium, which also have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments or technical solutions of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
Fig. 1 is a flowchart of a data sampling method based on a microservice architecture according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a micro service architecture according to an embodiment of the present invention;
fig. 3 is a flowchart of a data sampling method based on a microservice architecture according to an embodiment of the present invention;
fig. 4 is a block diagram of a data sampling apparatus based on a microservice architecture according to an embodiment of the present invention;
fig. 5 is a block diagram of a data sampling apparatus based on a microservice architecture according to an embodiment of the present invention.
Detailed Description
The core of the invention is to provide a data sampling method based on a micro-service architecture. In the prior art, when data sampling needs to be performed on a certain cluster every time, all sampling information generally needs to be traversed, so that the speed of acquiring the sampling information by a gateway node is low, and the efficiency is low.
The data sampling method based on the micro-service architecture is applied to the gateway node and comprises the steps of obtaining sampling information sent by a plurality of sub-service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right; arranging the sampling information in a preset sampling table according to cluster names, wherein the sampling information corresponding to the same cluster is concentrated in the sampling table; after arranging the sampling information in the sampling table, searching a preset part in the sampling table through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
The cluster name of the cluster to which the corresponding sub-service node belongs can be identified through the name of the sub-service node by setting the name of the sub-service node in a uniform format and adding the cluster name of the cluster to which the sub-service node belongs to the name of the sub-service node. The cluster of the sampling information is reflected on the leftmost side in the sampling information acquired by the gateway node, so that the gateway node can arrange the sampling information according to the corresponding cluster only by traversing the cluster name at the beginning of each piece of sampling information in the sampling table, and concentrate the sampling information corresponding to the same cluster in the sampling table. The gateway node specifically takes the cluster as a unit, and can realize sampling query on the sampling information of the same cluster by only retrieving partial areas in the sampling table, so that the workload required by the sampling query is reduced, the process that all the sampling information in the sampling table needs to be traversed when the sampling information of a certain cluster is queried is avoided, and the gateway node can efficiently acquire the data of the sub-service nodes.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. 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 invention.
Referring to fig. 1 and fig. 2, fig. 1 is a flowchart illustrating a data sampling method based on a microservice architecture according to an embodiment of the present invention; fig. 2 is a schematic structural diagram of a micro service architecture according to an embodiment of the present invention.
Referring to fig. 1, in the embodiment of the present invention, a data sampling method based on a micro service architecture is applied to a gateway node, and includes:
s101: and acquiring sampling information sent by a plurality of sub-service nodes.
In the embodiment of the invention, the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right.
Referring to fig. 2, in the embodiment of the present invention, a gateway node is specifically in communication connection with each sub service node through a RabbitMQ, and the corresponding step may generally be specifically: and acquiring sampling information transmitted by a plurality of sub service nodes through the RabbitMQ. RabbitMQ is a message queue, which is an open source message broker software (also known as message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). In the embodiment of the invention, the RabbitMQ is used for transmitting the sampling information of the sub-service nodes, so that the system coupling caused in the micro-service system can be reduced, and the stability of the transmission of the sampling information is ensured. Generally, RabbitMQ is interconnected with a gateway node and each sub-service node through long connection of TCP (transmission control protocol), respectively. It should be noted that the data sampling method provided by the embodiment of the present invention is specifically applied to a gateway node, but names of sub-service nodes are specifically stored in the gateway node, a corresponding sub-service node, and a registration center node, so as to satisfy the uniform naming among the three. Of course, in the embodiment of the present invention, the above sampling information may also be obtained by any other third party MQ component instead of the RabbitMQ, and the specific selection of the MQ component may be set according to the actual situation, which is not limited specifically herein.
In the embodiment of the invention, the registration center node is mainly used for service discovery and service registration in the micro-service system, so that a plurality of sub-service nodes can form a cluster with a specific function. For the specific functions of the registry node, reference may be made to the prior art, and further description is omitted here. In the embodiment of the invention, when a certain sub-service node is added into the micro-service system for the first time, the heartbeat connection is firstly established with the registration center node, so that the sub-service node is added into the micro-service system through the registration center node. In the embodiment of the present invention, the name of the sub-service node is usually modified to include cluster names and character strings arranged sequentially from left to right in the sub-service node, and when the sub-service node communicates with the registry node and the gateway node, the name is sent to the registry node and the gateway node for storage.
In this step, the gateway node acquires sampling information sent by each sub-service node, where the sampling information includes, from left to right, a cluster name, a character string, a sampling parameter name, and a sampling result. The cluster name plus character string represents the name of the sub-service node, and the cluster name plus character string can not only identify the corresponding sub-service node, but also identify the cluster corresponding to the sub-service node. For example, when the micro service system has two clusters of a management service cluster and an order service cluster, the management service cluster has three sub-service nodes, and the order service cluster has two sub-service nodes, the five sub-service nodes may be named as: UM0as-1, UM9sk12, UMow _93, OM0sk12, OM902 ik; the UM is the name of the management service cluster, and the OM is the name of the order service cluster.
The format of the above sampling information is generally specified as follows: { "cluster name", "character string corresponding to sub service node", Map < sampling parameter name, sampling result > }. The name of the sampling parameter needs to be determined according to the actual sampling parameter type, and the sampling result is usually data collected by each sub-service node.
Specifically, in the embodiment of the present invention, the character string corresponding to each sub-service node is a random character string generated at random, where the random character string is a string of random characters generated by using uuid.
S102: and arranging the sampling information in a preset sampling table according to the cluster name, wherein the sampling information corresponding to the same cluster is concentrated in the sampling table.
In the embodiment of the present invention, a sampling table for storing sampling information is usually established in the gateway node, and the gateway node puts the sampling information into the sampling table. In this step, the sampling information is arranged in the sampling table according to the cluster name, usually according to the alphabetical order of the cluster name. After the arrangement is performed according to the cluster names, the sampling information corresponding to the same cluster is collected in the sampling table. It should be noted that, in the embodiment of the present invention, the cluster name is recorded in the leftmost side, i.e., the opening, of the sampling information, so that in this step, the arrangement of the sampling information can be realized only by reading the beginning content, i.e., the cluster name, of each piece of sampling information, and it is not necessary to traverse all contents of all pieces of sampling information.
S103: after arranging the sampling information in the sampling table, searching a preset part in the sampling table through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
After the sampling tables are arranged in S102, because the sampling information corresponding to the same cluster is already collected in the sampling tables, the sampling information corresponding to the same cluster can be queried in the sampling tables only by searching a preset part in the sampling tables in this step, instead of searching all parts in the sampling tables, so as to implement data sampling of the same cluster.
The data sampling method based on the micro-service architecture is applied to a gateway node and comprises the steps of obtaining sampling information sent by a plurality of sub-service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right; arranging the sampling information in a preset sampling table according to cluster names, wherein the sampling information corresponding to the same cluster is concentrated in the sampling table; after arranging the sampling information in the sampling table, searching a preset part in the sampling table through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
The cluster name of the cluster to which the corresponding sub-service node belongs can be identified through the name of the sub-service node by setting the name of the sub-service node in a uniform format and adding the cluster name of the cluster to which the sub-service node belongs to the name of the sub-service node. The cluster of the sampling information is reflected on the leftmost side in the sampling information acquired by the gateway node, so that the gateway node can arrange the sampling information according to the corresponding cluster only by traversing the cluster name at the beginning of each piece of sampling information in the sampling table, and concentrate the sampling information corresponding to the same cluster in the sampling table. The gateway node specifically takes the cluster as a unit, and can realize sampling query on the sampling information of the same cluster by only retrieving partial areas in the sampling table, so that the workload required by the sampling query is reduced, the process that all the sampling information in the sampling table needs to be traversed when the sampling information of a certain cluster is queried is avoided, and the gateway node can efficiently acquire the data of the sub-service nodes.
The detailed contents of the data sampling method based on the microservice architecture provided by the present invention will be described in detail in the following embodiments of the invention.
Referring to fig. 3, fig. 3 is a flowchart illustrating a data sampling method based on a microservice architecture according to an embodiment of the present invention.
Referring to fig. 3, in the embodiment of the present invention, a data sampling method based on a micro service architecture is applied to a gateway node, and includes:
s201: and acquiring sampling information sent by a plurality of sub-service nodes.
S202: and arranging the sampling information in a preset sampling table according to the cluster name, wherein the sampling information corresponding to the same cluster is concentrated in the sampling table.
S203: after arranging the sampling information in the sampling table, searching a preset part in the sampling table through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
S201 to S203 are substantially the same as S101 to S103 in the above embodiment of the invention, and for details, reference is made to the above embodiment of the invention, which is not repeated herein.
S204: and acquiring the service information of the corresponding target cluster.
In this step, the gateway node specifically obtains service information input from the outside of the micro service system, where the service information specifically corresponds to a cluster having a preset function, that is, a target cluster.
S205: after the sampling information is arranged in the sampling table, searching a preset part in the sampling table according to the cluster name of the target cluster so as to inquire the sampling information of the corresponding target cluster in the sampling table.
In this step, after the sampling information stored in the sampling table is arranged in the manner of S202, a preset portion in the sampling table is retrieved according to the cluster name of the target cluster. Because the sampling information corresponding to the same cluster is concentrated in the sampling table during arrangement, the query of the target cluster sampling information can be completed only by retrieving the preset part of the cluster name corresponding to the target cluster in the step without retrieving all parts in the sampling table.
S206: and sending the service information to the corresponding sub-service node according to the sampling result in the inquired sampling information.
In this step, specifically, according to the sampling result recorded in the plurality of sampling information queried in S205, a sub-service node meeting the requirement in the target cluster is selected as a target sub-service node, and the obtained service information is sent to the target sub-service node, so that the target sub-service node executes a corresponding task according to the service information. For the above-mentioned specific process of selecting a sub-service node meeting the requirement from the cluster according to the sampling result, reference may be made to the prior art, and details are not described herein again.
Specifically, in the embodiment of the present invention, the name of the sampling parameter includes a load parameter, and the corresponding sampling result corresponds to a specific load parameter value of each sub-service node. When the target sub-service node is selected in the embodiment of the invention, the load parameters of each sub-service node are specifically referred to, so that the sub-service node meeting the requirements is selected as the target sub-service node to execute the corresponding service. Of course, the name of the sampling parameter may be other names, and the specific content of the name of the sampling parameter is not specifically limited in the embodiment of the present invention.
It should be noted that, in the embodiment of the present invention, S204 to S206 are generally executed in parallel with S201 to S203, but S205 specifically needs to be executed after at least one rearrangement of the sampling table in S202.
According to the data sampling method based on the micro-service architecture, provided by the embodiment of the invention, the load in the micro-service system can be effectively balanced by referring to the sampling result of the target cluster when the service is distributed, and the normal execution of the service is ensured. And when the sampling result of the target cluster is referred, the sampling result of the target cluster can be efficiently read by combining the arranged sampling tables, so that the efficient service distribution is realized.
In the following, a data sampling apparatus based on a micro service architecture according to an embodiment of the present invention is introduced, and the data sampling apparatus described below and the data sampling method described above may be referred to correspondingly.
Fig. 4 is a block diagram of a data sampling apparatus based on a micro service architecture according to an embodiment of the present invention, and referring to fig. 4, the data sampling apparatus based on a micro service architecture, applied to a gateway node, may include:
the acquisition module 100: the method comprises the steps of obtaining sampling information sent by a plurality of sub service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right.
The arrangement module 200: the cluster name processing module is used for arranging the sampling information in a preset sampling table according to the cluster name, and the sampling information corresponding to the same cluster is concentrated in the sampling table.
The retrieval module 300: after the sampling information is arranged in the sampling table, a preset part in the sampling table is searched through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
Preferably, in the embodiment of the present invention, the obtaining module 100 is specifically configured to:
and acquiring sampling information transmitted by a plurality of sub service nodes through the RabbitMQ.
Preferably, in the embodiment of the present invention, the character string is a randomly generated random character string.
Preferably, in the embodiment of the present invention, the method further includes:
a service information acquisition module: the service information of the corresponding target cluster is obtained;
a target cluster retrieval module: after the sampling information is arranged in the sampling table, searching a preset part in the sampling table according to the cluster name of the target cluster so as to query the sampling information corresponding to the target cluster in the sampling table;
a distribution module: and the sub-service node is used for sending the service information to the corresponding sub-service node according to the sampling result in the inquired sampling information.
Preferably, in the embodiment of the present invention, the sampling parameter name includes a load parameter.
The data sampling apparatus based on the micro service architecture of this embodiment is used to implement the data sampling method based on the micro service architecture, and therefore, specific embodiments of the data sampling apparatus may be found in the previous embodiment parts of the data sampling method, for example, the obtaining module 100, the arranging module 200, and the retrieving module 300 are respectively used to implement steps S101, S102, and S103 in the data sampling method, so that the specific embodiments thereof may refer to descriptions of corresponding embodiments of each part, and are not described herein again.
In the following, a data sampling device based on a micro service architecture according to an embodiment of the present invention is introduced, and the data sampling device described below, the data sampling method described above, and the data sampling apparatus described above may be referred to correspondingly.
Referring to fig. 5, fig. 5 is a block diagram of a data sampling apparatus based on a microservice architecture according to an embodiment of the present invention.
Referring to fig. 5, the microservice-based architecture data sampling apparatus, applied to a gateway node, may include a processor 11 and a memory 12.
The memory 12 is used for storing a computer program; the processor 11 is configured to implement the data sampling method based on the microservice architecture described in the above embodiment of the invention when executing the computer program.
The processor 11 of the data sampling apparatus of this embodiment is used to install the data sampling device described in the above embodiment of the invention, and the processor 11 and the memory 12 are combined to implement the data sampling method described in any embodiment of the invention. Therefore, the specific implementation of the data sampling device based on the microservice architecture can be seen from the foregoing description of the embodiments of the data sampling method, and the specific implementation of the data sampling device may refer to the description of each corresponding embodiment, which is not described herein again.
The present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements a data sampling method based on a micro service architecture as described in any of the embodiments of the present invention. The rest can be referred to the prior art and will not be described in an expanded manner.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. 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 invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The data sampling method based on the micro-service architecture, the data sampling device based on the micro-service architecture, the data sampling equipment based on the micro-service architecture and the computer readable storage medium provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A data sampling method based on a micro-service architecture is applied to a gateway node and comprises the following steps:
acquiring sampling information sent by a plurality of sub-service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right;
arranging the sampling information in a preset sampling table according to the cluster name, wherein the sampling information corresponding to the same cluster is concentrated in the sampling table;
after the sampling information is arranged in the sampling table, searching a preset part in the sampling table through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
2. The method of claim 1, wherein obtaining the sampling information sent by the plurality of sub-service nodes comprises:
and acquiring sampling information transmitted by a plurality of sub service nodes through the RabbitMQ.
3. The method of claim 2, wherein the string is a randomly generated random string.
4. The method of any one of claims 1 to 3, further comprising:
acquiring service information corresponding to a target cluster;
after the sampling information is arranged in the sampling table, searching a preset part in the sampling table according to the cluster name of the target cluster so as to inquire the sampling information corresponding to the target cluster in the sampling table;
and sending the service information to the corresponding sub-service node according to the sampling result in the inquired sampling information.
5. The method of claim 4, wherein the sampling parameter name comprises a load parameter.
6. A data sampling device based on micro-service architecture is applied to a gateway node and comprises:
an acquisition module: the method comprises the steps of obtaining sampling information sent by a plurality of sub service nodes; the sampling information comprises a sub-service node name, a sampling parameter name and a sampling result which are sequentially arranged from left to right; the sub-service node names comprise cluster names and character strings which are sequentially arranged from left to right;
an arrangement module: the device is used for arranging the sampling information in a preset sampling table according to the cluster name, and the sampling information corresponding to the same cluster is concentrated in the sampling table;
the retrieval module: after the sampling information is arranged in the sampling table, a preset part in the sampling table is searched through the cluster name so as to inquire the sampling information corresponding to the same cluster in the sampling table.
7. The apparatus of claim 6, wherein the obtaining module is specifically configured to:
and acquiring sampling information transmitted by a plurality of sub service nodes through the RabbitMQ.
8. The apparatus of claim 6 or 7, further comprising:
a service information acquisition module: the service information of the corresponding target cluster is obtained;
a target cluster retrieval module: after the sampling information is arranged in the sampling table, searching a preset part in the sampling table according to the cluster name of the target cluster so as to query the sampling information corresponding to the target cluster in the sampling table;
a distribution module: and the sub-service node is used for sending the service information to the corresponding sub-service node according to the sampling result in the inquired sampling information.
9. A data sampling device based on micro service architecture is applied to a gateway node, and comprises:
a memory for storing a computer program;
a processor for implementing the steps of the microservice architecture-based data sampling method according to any one of claims 1 to 5 when executing said computer program.
10. A computer-readable storage medium, for application in a gateway node, having a computer program stored thereon, which, when being executed by a processor, implements the steps of the microservice-architecture-based data sampling method according to any one of claims 1 to 5.
CN202010500132.6A 2020-06-04 2020-06-04 Data sampling method and related device based on micro-service architecture Active CN111666342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010500132.6A CN111666342B (en) 2020-06-04 2020-06-04 Data sampling method and related device based on micro-service architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010500132.6A CN111666342B (en) 2020-06-04 2020-06-04 Data sampling method and related device based on micro-service architecture

Publications (2)

Publication Number Publication Date
CN111666342A true CN111666342A (en) 2020-09-15
CN111666342B CN111666342B (en) 2023-08-18

Family

ID=72386120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010500132.6A Active CN111666342B (en) 2020-06-04 2020-06-04 Data sampling method and related device based on micro-service architecture

Country Status (1)

Country Link
CN (1) CN111666342B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102124439A (en) * 2008-06-13 2011-07-13 电子湾有限公司 Method and system for clustering
US20140351176A1 (en) * 2013-05-24 2014-11-27 International Business Machines Corporation Active learning on statistical server name extraction from information technology (it) service tickets
CN105574204A (en) * 2016-01-08 2016-05-11 国网冀北电力有限公司 Searching method and system for distributed power grid regulation and operation data
US20180121307A1 (en) * 2016-11-02 2018-05-03 Sap Se Monitoring processes running on a platform as a service architecture
CN108874623A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 Distributed type assemblies method for monitoring performance, device, equipment, system and storage medium
CN109587264A (en) * 2018-12-20 2019-04-05 新华三技术有限公司 Data monitoring method, device and cloud platform server
US20190205332A1 (en) * 2016-08-25 2019-07-04 Koninklijke Philips N.V. Storing and retrieving spatial data in/from a database
CN110716744A (en) * 2019-10-21 2020-01-21 中国科学院空间应用工程与技术中心 Data stream processing method, system and computer readable storage medium
CN111176941A (en) * 2019-12-25 2020-05-19 贝壳技术有限公司 Data processing method, device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102124439A (en) * 2008-06-13 2011-07-13 电子湾有限公司 Method and system for clustering
US20140351176A1 (en) * 2013-05-24 2014-11-27 International Business Machines Corporation Active learning on statistical server name extraction from information technology (it) service tickets
CN105574204A (en) * 2016-01-08 2016-05-11 国网冀北电力有限公司 Searching method and system for distributed power grid regulation and operation data
US20190205332A1 (en) * 2016-08-25 2019-07-04 Koninklijke Philips N.V. Storing and retrieving spatial data in/from a database
US20180121307A1 (en) * 2016-11-02 2018-05-03 Sap Se Monitoring processes running on a platform as a service architecture
CN108874623A (en) * 2018-05-31 2018-11-23 郑州云海信息技术有限公司 Distributed type assemblies method for monitoring performance, device, equipment, system and storage medium
CN109587264A (en) * 2018-12-20 2019-04-05 新华三技术有限公司 Data monitoring method, device and cloud platform server
CN110716744A (en) * 2019-10-21 2020-01-21 中国科学院空间应用工程与技术中心 Data stream processing method, system and computer readable storage medium
CN111176941A (en) * 2019-12-25 2020-05-19 贝壳技术有限公司 Data processing method, device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
OLIVIER SALLOU, CYRIL MONJEAUD: "GO-Docker:A Batch Scheduling System with Docker Containers", 2015 IEEE INTERNATIONAL CONFERENCE ON CLUSTER COMPUTING *
凌硕豪: "基于个性推荐的企业内Feed流系统设计与实现", 中国优秀硕士学位论文数据库 *

Also Published As

Publication number Publication date
CN111666342B (en) 2023-08-18

Similar Documents

Publication Publication Date Title
US8065657B2 (en) Exchange infrastructure system and method
US8069224B2 (en) Method, equipment and system for resource acquisition
JP3980596B2 (en) Method and system for remotely and dynamically configuring a server
CN108989066B (en) Equipment management method and device
US20030217176A1 (en) Content-based routing system and method
CN108365971A (en) Daily record analytic method, equipment and computer-readable medium
MX2007015188A (en) Extensible and automatically replicating server farm configuration management infrastructure.
CN102571420A (en) Method and system for network element data management
CN111736775A (en) Multi-source storage method, device, computer system and storage medium
CN104333573B (en) A kind of processing method and processing system of large concurrent request
JP6252570B2 (en) Information processing system, access control method, information processing apparatus, control method thereof, and control program
CN104268143A (en) XML (extensible markup language) data processing method and device
CN105814864B (en) A kind of input and output I/O request processing method and file server
CN111782361A (en) Quantum computer cluster distributed queue scheduling method and system
US8055665B2 (en) Sorted search in a distributed directory environment using a proxy server
CN108055296B (en) Transaction processing method and device based on micro-service architecture
JP6067714B2 (en) Scale-out system that acquires event data
CA2481099C (en) Exchange infrastructure system and method
CN110929130B (en) Public security level audit data query method based on distributed scheduling
CN111666342A (en) Data sampling method based on micro-service architecture and related device
JP2006106933A (en) Load sharing network system and load sharing program
CN112804313B (en) Data synchronization method, device, equipment and medium based on cross-domain edge node
CN103428231A (en) Offline download method and system
Caron et al. Implementation and evaluation of a P2P service discovery system: Application in a dynamic large scale computing infrastructure
CN112667677A (en) Digital operation method and system for data center station

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
GR01 Patent grant
GR01 Patent grant