Block chain docking platform monitoring method, block chain docking platform and electronic device

文档序号:9050 发布日期:2021-09-17 浏览:41次 中文

1. A monitoring method of a block chain docking platform is characterized in that the block chain docking platform comprises a plurality of service units, a block chain and a monitoring module, wherein the monitoring module is respectively connected with the plurality of service units and the block chain; each service unit comprises a micro service and a micro node which are connected with each other, and the micro node is used for providing a block chain contract calling service for the corresponding micro service; the block chain comprises a plurality of block chain nodes which are in communication connection, and each block chain node is used for storing data of a corresponding service unit; the monitoring module is used for executing a monitoring method of a block chain docking platform, and the method comprises the following steps:

acquiring request data received by each service unit, and integrating the request data carrying the same link identification according to a preset rule to obtain actual link information flowing among a plurality of service units corresponding to each link identification;

determining a test link passing through at least one service unit, and detecting the test link to obtain test link information of the test link;

initiating a virtual transaction to the blockchain to obtain transaction feedback information generated by the blockchain in response to the virtual transaction;

respectively carrying out state detection on each service unit and the block chain to obtain state data of each service unit and the block chain;

and sending the actual link information, the test link information, the transaction feedback information and the state data to the block chain for uplink storage, and generating a monitoring result according to the actual link information, the test link information, the transaction feedback information and the state data respectively.

2. The method of claim 1, wherein the request data comprises a unit identifier of a first service unit, a unit identifier of a second service unit, a link identifier of an actual link, a request parameter, a request arrival time, and a request processing end time, and wherein the request data flows from the first service unit to the second service unit.

3. The method of claim 2, wherein before the request data flows from the first service unit to the second service unit, the method further comprises:

creating the link identification in case the request data first reaches the first service unit of the actual link;

and placing the unit identifier of the service unit to be applied and the link identifier in a request header, and keeping and carrying the link identifier and the unit identifier of the service unit to be applied in the circulation process of the plurality of service units until the calling task is finished.

4. The method of claim 1, wherein the micro node comprises a control layer, a probe is disposed in the control layer of the micro node, and acquiring the request data received by each of the service units comprises:

and before the byte code file of the control layer of the micro node is loaded, starting the probe to intercept the byte code file to obtain the request data.

5. The method of claim 1, wherein the micro node comprises a control layer, a probe is disposed in the control layer of the micro node, and the determining a test link passing through at least one service unit and detecting the test link to obtain test link information of the test link comprises:

generating a simulation request carrying a simulation link identification, and sending the simulation request to a test service unit through the probe;

recording unit identifications of a plurality of test service units through which the simulation link identification passes in the circulation process of the at least one service unit, and acquiring response data generated by the plurality of test service units;

and generating the test link information according to the unit identifications of the plurality of test service units and the corresponding response data.

6. The method of claim 5, wherein generating the monitoring result according to the test link information after generating the test link information according to the unit identifiers and the corresponding response data of the plurality of test service units comprises:

judging whether the condition that the response data of any service unit is not acquired exists in the plurality of test service units;

if yes, determining that the test link is abnormal, and sending an alarm;

if not, determining that the test link is normal.

7. The method of claim 5, wherein generating the monitoring result according to the test link information after generating the test link information according to the unit identifiers and the corresponding response data of the plurality of test service units comprises:

acquiring initial data relative to the response data in the plurality of test service units in the blockchain, wherein the initial data is stored in the blockchain through corresponding contracts;

and rolling back the response data according to the initial data, and removing dirty data which interfere with the service according to a result obtained by rolling back.

8. The method for monitoring a blockchain docking platform according to claim 1, wherein after initiating a virtual transaction to the blockchain and obtaining transaction feedback information generated by the blockchain in response to the virtual transaction, generating a monitoring result according to the transaction feedback information comprises:

and determining the activity of the corresponding block chain node according to the transaction feedback information.

9. The method of claim 1, wherein performing state detection on each service unit and the blockchain to obtain state data of each service unit and the blockchain comprises:

polling detection is carried out among a plurality of micro services according to a preset frequency, and state data corresponding to each micro service is generated based on response messages returned by the micro services; and the number of the first and second groups,

performing polling detection among a plurality of micro nodes according to a preset frequency, and generating state data corresponding to each micro node based on response messages returned by the micro nodes; and the number of the first and second groups,

and polling among the plurality of blockchain nodes according to a preset frequency, and generating state data corresponding to each blockchain node based on response messages returned by the plurality of blockchain nodes.

10. The method of claim 9, wherein the status data of each micro-service includes at least one of: the information of the survival state of the micro-service, the memory occupation information of the micro-service and the CPU occupation information of the micro-service;

the state data of each micro node comprises at least one of the following: survival state information of the micro nodes, memory occupation information of the micro nodes and CPU occupation information of the micro nodes;

the state data of each of the blockchain nodes includes at least one of: the information of the survival state of the block link node, the memory occupation information of the block link node and the CPU occupation information of the block link node.

11. The method of claim 9, wherein after performing status detection on each service unit and the blockchain to obtain status data of each service unit and the blockchain, generating a monitoring result according to the status data comprises:

comparing state data of each micro service, each micro node and each block chain node with corresponding threshold values respectively;

determining whether the states of each micro service, each micro node and each block chain node are abnormal according to the comparison result;

and if the abnormal micro service, micro node or block chain node exists, an alarm is given out.

12. The method of claim 1, wherein generating monitoring results based on the actual link information, the test link information, the transaction feedback information, and the status data comprises:

and visually displaying the actual link information, the test link information, the transaction feedback information and the state data.

13. A blockchain docking platform, comprising: the system comprises a plurality of service units, a block chain and a monitoring module, wherein the monitoring module is respectively connected with the service units and the block chain; each service unit comprises a micro service and a micro node which are connected with each other, and the micro node is used for providing a block chain contract calling service for the corresponding micro service; the block chain comprises a plurality of block chain nodes which are in communication connection, and each block chain node is used for storing data of a corresponding service unit; the monitoring module is used for executing the monitoring method of the block chain docking platform of any one of claims 1 to 12.

14. The blockchain docking platform of claim 13, wherein the monitoring module comprises a plurality of abatement devices and operation and maintenance nodes, each abatement device being communicatively coupled to a corresponding micro node and blockchain node, respectively, the operation and maintenance nodes being communicatively coupled to the blockchain;

the governance device is used for generating a governance result and sending the governance result to the block chain for uplink storage; each governance device comprises an information acquisition layer, an information analysis layer, an information processing layer, an information contract layer and an information display layer which are sequentially coupled;

the information acquisition layer is used for acquiring actual link information, test link information, transaction feedback information and state data;

the information analysis layer is used for analyzing the data acquired by the information acquisition layer to obtain an analysis result;

the information processing layer is used for sending the data acquired by the information acquisition layer to the block chain for uplink storage, judging whether abnormality exists according to an analysis result generated by the information analysis layer, and if the abnormality exists, sending an alarm;

the information contract layer is used for controlling the permission of the block linkage call service; the information display layer is used for displaying the result processed by the information processing layer for a user interface and providing an interface application program interface;

and the operation and maintenance node is used for acquiring the treatment result generated by the treatment device from the block chain and displaying the treatment result.

15. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the method for monitoring a blockchain docking platform according to any one of claims 1 to 12.

16. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for monitoring a blockchain docking platform according to any one of claims 1 to 12.

Background

With the development of business, the monolithic architecture becomes a micro-service architecture, the system scale also becomes larger and larger, and the calling relationship among micro-services also becomes more and more complex. In microservice applications, a client-initiated request is invoked in the backend system via multiple different microservice calls to cooperatively generate the final request result.

Fig. 1 is a block chain-based microservice architecture diagram of the related art, and as shown in fig. 1, the architecture includes two intranet platforms, each intranet platform including an application layer, a plurality of micro nodes and a block chain, wherein the micro nodes are used for providing a block chain contract call service to the application layer. When a user initiates a request, the request firstly goes from the micro service to the micro node A and then to the block chain link point A, trusted data sharing is carried out through the block chain node A and then is transmitted to the block chain link point B, and then the request reaches the micro service B through the micro node B. When cross-platform data interaction is involved, the blockchains of the two intranet platforms are communicated through blockchain nodes, however, when one intranet platform fails, due to the fact that the resource logs of one intranet and the resource logs of the other intranet are independent of each other, the resource logs of the two intranet platforms cannot be coordinated for fault location, and therefore cross-platform tracking of data flowing between micro-services or micro-nodes cannot be achieved. Moreover, when there is an abnormality in the system, the system can only malfunction by the application layer, and there is a problem of hysteresis in fault discovery, which is not favorable for timely maintenance of the system.

Aiming at the problem that the block chain-based micro-service architecture cannot be effectively monitored in the related art, no effective solution is provided at present.

Disclosure of Invention

The present embodiment provides a monitoring method for a block chain docking platform, an electronic device, and a storage medium, so as to solve the problem that a micro-service architecture based on a block chain cannot be effectively monitored in the related art.

In a first aspect, in this embodiment, a method for monitoring a blockchain docking platform is provided, where the blockchain docking platform includes a plurality of service units, a blockchain, and a monitoring module, and the monitoring module is respectively connected to the plurality of service units and the blockchain; each service unit comprises a micro service and a micro node which are connected with each other, and the micro node is used for providing a block chain contract calling service for the corresponding micro service; the block chain comprises a plurality of block chain nodes which are in communication connection, and each block chain node is used for storing data of a corresponding service unit; the monitoring module is used for executing a monitoring method of a block chain docking platform, and the method comprises the following steps:

acquiring request data received by each service unit, and integrating the request data carrying the same link identification according to a preset rule to obtain actual link information flowing among a plurality of service units corresponding to each link identification;

determining a test link passing through at least one service unit, and detecting the test link to obtain test link information of the test link;

initiating a virtual transaction to the blockchain to obtain transaction feedback information generated by the blockchain in response to the virtual transaction;

respectively carrying out state detection on each service unit and the block chain to obtain state data of each service unit and the block chain;

and sending the actual link information, the test link information, the transaction feedback information and the state data to the block chain for uplink storage, and generating a monitoring result according to the actual link information, the test link information, the transaction feedback information and the state data respectively.

In some of these embodiments, the request data includes a unit identifier of a first service unit, a unit identifier of a second service unit, a link identifier of an actual link, a request parameter, a request arrival time, and a request processing end time, wherein the request data flows from the first service unit to the second service unit.

In some embodiments, before the request data flows from the first service unit to the second service unit, the method further comprises:

creating the link identification in case the request data first reaches the first service unit of the actual link;

and placing the unit identifier of the service unit to be applied and the link identifier in a request header, and keeping and carrying the link identifier and the unit identifier of the service unit to be applied in the circulation process of the plurality of service units until the calling task is finished.

In some embodiments, the micro node includes a control layer, a probe is disposed in the control layer of the micro node, and acquiring the request data received by each of the service units includes:

and before the byte code file of the control layer of the micro node is loaded, starting the probe to intercept the byte code file to obtain the request data.

In some embodiments, the micro node includes a control layer, a probe is disposed in the control layer of the micro node, a test link passing through at least one service unit is determined, and the test link is detected, and obtaining test link information of the test link includes:

generating a simulation request carrying a simulation link identification, and sending the simulation request to a test service unit through the probe;

recording unit identifications of a plurality of test service units through which the simulation link identification passes in the circulation process of the at least one service unit, and acquiring response data generated by the plurality of test service units;

and generating the test link information according to the unit identifications of the plurality of test service units and the corresponding response data.

In some embodiments, after generating the test link information according to the unit identifiers of the plurality of test service units and the corresponding response data, generating the monitoring result according to the test link information includes:

judging whether the condition that the response data of any service unit is not acquired exists in the plurality of test service units;

if yes, determining that the test link is abnormal, and sending an alarm;

if not, determining that the test link is normal.

In some embodiments, after generating the test link information according to the unit identifiers of the plurality of test service units and the corresponding response data, generating the monitoring result according to the test link information includes:

acquiring initial data relative to the response data in the plurality of test service units in the blockchain, wherein the initial data is stored in the blockchain through corresponding contracts;

and rolling back the response data according to the initial data, and removing dirty data which interfere with the service according to a result obtained by rolling back.

In some embodiments, after initiating a virtual transaction to the blockchain and obtaining transaction feedback information generated by the blockchain in response to the virtual transaction, generating a monitoring result according to the transaction feedback information includes:

and determining the activity of the corresponding block chain node according to the transaction feedback information.

In some embodiments, the performing state detection on each service unit and the block chain respectively to obtain state data of each service unit and the block chain includes:

polling detection is carried out among the micro services according to a preset frequency, and state data corresponding to each micro service is generated based on response messages returned by the micro services; and the number of the first and second groups,

polling detection is carried out among the micro nodes according to a preset frequency, and state data corresponding to each micro node are generated based on response messages returned by the micro nodes; and the number of the first and second groups,

and polling among the plurality of blockchain nodes according to a preset frequency, and generating state data corresponding to each blockchain node based on response messages returned by the plurality of blockchain nodes.

In some embodiments, the state data for each of the microservices includes at least one of: the information of the survival state of the micro-service, the memory occupation information of the micro-service and the CPU occupation information of the micro-service;

the state data of each micro node comprises at least one of the following: survival state information of the micro nodes, memory occupation information of the micro nodes and CPU occupation information of the micro nodes;

the state data of each of the blockchain nodes includes at least one of: the information of the survival state of the block link node, the memory occupation information of the block link node and the CPU occupation information of the block link node.

In some embodiments, after performing state detection on each service unit and the block chain respectively to obtain state data of each service unit and the block chain, generating a monitoring result according to the state data includes:

comparing state data of each micro service, each micro node and each block chain node with corresponding threshold values respectively;

determining whether the states of each micro service, each micro node and each block chain node are abnormal according to the comparison result;

and if the abnormal micro service, micro node or block chain node exists, an alarm is given out.

In some of these embodiments, generating monitoring results from the actual link information, the test link information, the transaction feedback information, and the status data comprises:

and visually displaying the actual link information, the test link information, the transaction feedback information and the state data.

In a second aspect, in this embodiment, a blockchain docking platform is provided, including: the system comprises a plurality of service units, a block chain and a monitoring module, wherein the monitoring module is respectively connected with the service units and the block chain; each service unit comprises a micro service and a micro node which are connected with each other, and the micro node is used for providing a block chain contract calling service for the corresponding micro service; the block chain comprises a plurality of block chain nodes which are in communication connection, and each block chain node is used for storing data of a corresponding service unit; the monitoring module is configured to perform the monitoring method of the block chain docking platform according to the first aspect.

In some embodiments, the monitoring module comprises a plurality of abatement devices and operation and maintenance nodes, each of the abatement devices is in communication connection with a corresponding micro-node and a corresponding block link node, and the operation and maintenance nodes are in communication connection with the block link;

the governance device is used for generating a governance result and sending the governance result to the block chain for uplink storage; each governance device comprises an information acquisition layer, an information analysis layer, an information processing layer, an information contract layer and an information display layer which are sequentially coupled; the information acquisition layer is used for acquiring actual link information, test link information, transaction feedback information and state data; the information analysis layer is used for analyzing the data acquired by the information acquisition layer to obtain an analysis result; the information processing layer is used for sending the data acquired by the information acquisition layer to the block chain for uplink storage, judging whether abnormality exists according to an analysis result generated by the information analysis layer, and if the abnormality exists, sending an alarm; the information contract layer is used for controlling the permission of the block linkage call service; the information display layer is used for displaying the result processed by the information processing layer for a user interface and providing an interface application program interface;

and the operation and maintenance node is used for acquiring the treatment result generated by the treatment device from the block chain and displaying the treatment result.

In a third aspect, in this embodiment, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the monitoring method for the blockchain docking platform according to the first aspect.

In a fourth aspect, in the present embodiment, there is provided a storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the monitoring method for the blockchain docking platform according to the first aspect.

Compared with the related art, the monitoring method of the block chain docking platform, the electronic device and the storage medium provided in this embodiment acquire actual link information corresponding to each link identifier flowing among a plurality of service units by acquiring request data received by each service unit and integrating the request data carrying the same link identifier according to a preset rule; determining a test link passing through at least one service unit, and detecting the test link to obtain test link information of the test link; initiating a virtual transaction to the blockchain to obtain transaction feedback information generated by the blockchain in response to the virtual transaction; respectively carrying out state detection on each service unit and each block chain to obtain state data of each service unit and each block chain; the actual link information, the test link information, the transaction feedback information and the state data are sent to the block chain for uplink storage, and monitoring results are generated according to the actual link information, the test link information, the transaction feedback information and the state data respectively, so that the problem that the block chain-based micro-service architecture cannot be effectively monitored in the related art is solved, and the block chain-based micro-service architecture can be effectively monitored.

The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.

Drawings

The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:

FIG. 1 is a block chain based microservice architecture diagram of the related art;

fig. 2 is a block diagram of a hardware structure of a terminal of the monitoring method for a blockchain docking platform according to the embodiment;

FIG. 3 is a flowchart of a method for monitoring a blockchain docking platform according to the present embodiment;

FIG. 4 is a block diagram of the blockchain docking platform of the present embodiment;

FIG. 5 is a functional block diagram of the abatement device of the present embodiment;

FIG. 6 is a schematic diagram of the detection of the test link based on the abatement device of this embodiment.

Detailed Description

For a clearer understanding of the objects, aspects and advantages of the present application, reference is made to the following description and accompanying drawings.

Unless defined otherwise, technical or scientific terms used herein shall have the same general meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of this application do not denote a limitation of quantity, either in the singular or the plural. The terms "comprises," "comprising," "has," "having," and any variations thereof, as referred to in this application, are intended to cover non-exclusive inclusions; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or modules, but may include other steps or modules (elements) not listed or inherent to such process, method, article, or apparatus. Reference throughout this application to "connected," "coupled," and the like is not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference to "a plurality" in this application means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. In general, the character "/" indicates a relationship in which the objects associated before and after are an "or". The terms "first," "second," "third," and the like in this application are used for distinguishing between similar items and not necessarily for describing a particular sequential or chronological order.

The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or a similar computing device. For example, the method is executed on a terminal, and fig. 2 is a block diagram of a hardware structure of the terminal according to the monitoring method for a blockchain docking platform of the embodiment. As shown in fig. 2, the terminal may include one or more processors 202 (only one shown in fig. 2) and a memory 204 for storing data, wherein the processor 202 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The terminal may also include a transmission device 206 for communication functions and an input-output device 208. It will be understood by those skilled in the art that the structure shown in fig. 2 is only an illustration and is not a limitation to the structure of the terminal. For example, the terminal may also include more or fewer components than shown in FIG. 2, or have a different configuration than shown in FIG. 2.

The memory 204 may be used to store a computer program, for example, a software program and a module of an application software, such as a computer program corresponding to the monitoring method of the blockchain docking platform in the present embodiment, and the processor 202 executes various functional applications and data processing by running the computer program stored in the memory 204, so as to implement the method described above. Memory 204 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 204 may further include memory located remotely from the processor 202, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The transmission device 206 is used to receive or transmit data via a network. The network described above includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 206 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 206 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.

Referring to fig. 4, the block chain docking platform includes a plurality of service units 41, a block chain 42, and a monitoring module 43, where the monitoring module 43 is connected to the plurality of service units 41 and the block chain 42, respectively; each service unit 41 includes a micro service 411 and a micro node 412 connected to each other, and the micro node 412 is configured to provide a block chain contract invoking service for the corresponding micro service 411; the block chain 42 includes a plurality of block chain nodes 421, which are connected in communication, and each block chain node is used for storing data of a corresponding service unit 41; the monitoring module 43 is used for executing a monitoring method of the block chain docking platform.

With reference to the blockchain docking platform shown in fig. 4, fig. 3 is a flowchart of a monitoring method for the blockchain docking platform of the present embodiment, and as shown in fig. 3, the flow includes the following steps:

step S301, collecting the request data received by each service unit, and integrating the request data carrying the same link identification according to a preset rule to obtain the actual link information corresponding to each link identification flowing among a plurality of service units.

When a user initiates a request, the service unit starts to circulate, and when the monitoring module collects request data of the current service unit, the request data flows from the previous service unit to the current service unit, so that the request data includes a unit identifier of the previous service unit and a unit identifier of the current service unit, and in addition, the request data also carries a link identifier of an actual link, a request parameter, a request arrival time and a request processing end time. After the request data received by the service unit is collected, the calling sequence of the service unit is determined according to the request arrival time and the request processing ending time, and the request data carrying the same link identification are sequentially connected according to the calling sequence of the service unit to obtain the actual link information. Wherein, the actual link information can be presented in the form of a graph model.

Step S302, determining a test link passing through at least one service unit, and detecting the test link to obtain test link information of the test link.

When testing the test link, several service units may be selected as test service units, or all the service units may be selected as test service units. In some embodiments, the micro node of the service unit includes a control layer, a probe is disposed in the control layer of the micro node, and when a test link is detected, a simulation request carrying a simulation link identifier may be generated and sent to the test service unit via the probe; recording unit identifications of a plurality of test service units through which analog link identifications pass in the streaming process of at least one service unit, and acquiring response data generated by the plurality of test service units; and generating test link information according to the unit identifications of the plurality of test service units and the corresponding response data.

Step S303, a virtual transaction is initiated to the blockchain, and transaction feedback information generated by the blockchain in response to the virtual transaction is obtained.

For example, a virtual transaction is initiated to each blockchain node by means of a Json-Rpc (remote procedure call transfer protocol), and the activity of the corresponding blockchain node is determined according to transaction feedback information.

Step S304, respectively performing status detection on each service unit and the block chain to obtain status data of each service unit and the block chain.

And performing polling detection among the micro services according to a preset frequency, and generating state data corresponding to each micro service based on response messages returned by the micro services. And performing polling detection among the micro nodes according to a preset frequency, and generating state data corresponding to each micro node based on response messages returned by the micro nodes. And performing polling detection among the plurality of blockchain nodes according to a preset frequency, and generating state data corresponding to each blockchain node based on response messages returned by the plurality of blockchain nodes.

In specific implementation, the status of the serving cell and the blockchain are respectively detected in a polling heartbeat detection manner. Wherein. The state data of each microservice includes at least one of: the information includes information on the survival state of the microservice, information on the memory occupancy of the microservice, and information on the CPU (Central Processing Unit) occupancy of the microservice. The state data of each micro node comprises at least one of the following: the method comprises the steps of survival state information of the micro nodes, memory occupation information of the micro nodes and CPU occupation information of the micro nodes. The state data of each blockchain node includes at least one of: the information of the survival state of the block link node, the memory occupation information of the block link point and the CPU occupation information of the block link point.

Step S305, sending the actual link information, the test link information, the transaction feedback information, and the status data to the block chain for uplink storage, and generating a monitoring result according to the actual link information, the test link information, the transaction feedback information, and the status data, respectively.

For example, after test link information is generated according to the node identifiers of the multiple test service units and corresponding response data, whether a situation that response data of any micro node is not acquired exists in the multiple test service units is judged; if yes, determining that the test link is abnormal, and sending an alarm; if not, determining that the test link is normal.

For example, after generating the test link information according to the unit identifiers of the plurality of test service units and the corresponding response data, acquiring initial data relative to the response data in the plurality of test service units in the blockchain, wherein the initial data is stored into the blockchain by corresponding contracts; and rolling back the response data according to the initial data, and removing dirty data which interfere with the service according to a result obtained by rolling back.

For another example, after status detection is performed on each service unit and each block chain, and status data of each service unit and each block chain is obtained, the status data of each micro service, each micro node, and each block chain node are compared with corresponding thresholds; determining whether the states of each micro service, each micro node and each block chain node are abnormal or not according to the comparison result; and if the abnormal micro service, micro node or block chain node exists, an alarm is given out.

In addition, when the monitoring result is generated according to the actual link information, the test link information, the transaction feedback information and the state data, the actual link information, the test link information, the transaction feedback information and the state data can be visually displayed.

In the above steps S301 to S305, on one hand, data acquisition is performed on the service units and the block link points of the multiple intranet platforms to generate actual link information, test link information, transaction feedback information, and state data, the data and the information are sent to the block chain to perform uplink storage, and monitoring results are generated according to the actual link information, the test link information, the transaction feedback information, and the state data, respectively, so as to implement joint monitoring on the micro service, the micro node, and the block link points. When one intranet platform fails, data can be directly acquired from the blockchain, the failure occurrence position is analyzed according to the data acquired from the blockchain, resource logs of the intranet platforms are coordinated for fault positioning, and data flowing among the cross-platform tracking service units are achieved. On the other hand, by detecting the test link comprising a plurality of test service units, the smoothness of the test link between the test service units can be detected under the condition of not influencing the service so as to realize early warning, thereby improving the problem of failure discovery hysteresis and being beneficial to maintaining the system in time. In addition, this embodiment can monitor the operational aspect of microservice, micronode and block chain node comparatively comprehensively through the data of gathering a plurality of dimensions.

Through the steps, the problem that the block chain-based micro-service architecture cannot be effectively monitored in the related technology is solved, and the block chain-based micro-service architecture can be effectively monitored.

In some embodiments, during the circulation of the request data in each service unit, when the request data first reaches the first service unit of the actual link, a link identifier is created; and placing the unit identifier and the link identifier of the service unit to be applied in the request header, and keeping and carrying the link identifier and the unit identifier of the service unit to be applied in the circulation process of the plurality of service units until the calling task is finished.

In step S301, the micro node includes a control layer, and may collect the request data received by the service unit in the following manner.

In the first mode, the request data is acquired in a manual coding mode at the micro-node control layer.

And in the second mode, by using an AOP (Aspect organized Programming) technology, the request data is circularly captured at the micro-node control layer in a dynamic proxy mode.

And thirdly, setting a Java probe in the control layer of the micro node, and starting the Java probe to intercept the byte code file before the byte code file of the control layer of the micro node is loaded to obtain the request data.

The first mode has code intrusiveness, the second mode has lower code intrusiveness compared with the first mode, and the third mode has no code intrusiveness.

With reference to the monitoring method of the block chain docking platform of the above embodiment, the present embodiment provides a block chain docking platform, fig. 4 is a block diagram of the block chain docking platform of the present embodiment, as shown in fig. 4, the block chain docking platform includes a plurality of service units 41, a block chain 42, and a monitoring module 43, and the monitoring module 43 is respectively connected to the plurality of service units 41 and the block chain 42; each service unit 41 includes a micro service 411 and a micro node 412 connected to each other, and the micro node 412 is configured to provide a block chain contract invoking service for the corresponding micro service 411; the block chain 42 includes a plurality of block chain nodes 421, which are connected in communication, and each block chain node is used for storing data of a corresponding service unit 41; the monitoring module 43 is used for executing a monitoring method of the block chain docking platform.

In some embodiments, monitoring module 43 includes a plurality of abatement devices 431 and an operation and maintenance node 432, each abatement device 431 is communicatively connected to a corresponding micro-node 412, block-link point 421, and operation and maintenance node 432 is communicatively connected to block-link 42.

Abatement 431 is configured to generate abatement results and send the abatement results to blockchain 42 for uplink storage.

Fig. 5 is a functional architecture diagram of the abatement device of the present embodiment, and as shown in fig. 5, the abatement device 431 includes an information acquisition layer 51, an information analysis layer 52, an information processing layer 53, an information contract layer 54, and an information presentation layer 55, which are coupled in sequence.

The information collection layer 51 is used for collecting actual link information, test link information, transaction feedback information and status data.

The information analysis layer 52 is used for analyzing the data acquired by the information acquisition layer 51 to obtain an analysis result.

The information processing layer 53 is configured to send data acquired by the information acquisition layer 51 to the block chain 42 for uplink storage, and determine whether an abnormality exists according to an analysis result generated by the information analysis layer 52, and if so, send an alarm.

The information contract layer 54 is used to control the authority of the blockchain contract call service.

The information presentation layer 55 is used for presenting the results processed by the information processing layer 53 for the user interface and providing an interface application program interface.

Referring to fig. 4, operation and maintenance node 432 is configured to obtain abatement results generated by abatement device 431 from blockchain 42 and display the abatement results. In some embodiments, a message queue is disposed between the operation and maintenance node 432 and the blockchain 42, and the operation and maintenance node 432 obtains the abatement result from the blockchain 42 through the message queue and performs visual display. For example, a node status module, a link calling module, a link alarming module and a link early warning module which are visually checked are arranged at the operation and maintenance node 432.

In some embodiments, the operation and maintenance node 432 calls an interface application program interface of the information presentation layer 55 to obtain a result processed by the information processing layer 53, and visually presents the result according to the contract authorization information.

In combination with the block chain docking platform of fig. 4, fig. 6 shows a detection schematic diagram of a test link based on a governance device, as shown in fig. 6, service units a to E are provided, wherein the service units C to E are selected as test service units, and the service units C to E form the test link. When detecting the test link, selecting a target governer from the plurality of governers, and generating a simulation request through the target governer, wherein the simulation request carries a simulation link identifier; the method comprises the steps that simulation requests are sent to a plurality of test service units through Java probes, wherein the micro nodes of the service units comprise control layers, the Java probes are arranged in the control layers of the micro nodes, and the Java probes can cut in codes from a byte code layer without invading source codes; in the process of simulating the link identification to flow among the plurality of test service units, the unit identifications of the plurality of test service units are registered in the target governance device, response data generated by the plurality of test service units are recorded in the target governance device, and test link information is generated according to the registered unit identifications and the recorded response data.

The target controller can judge whether the condition that response data generated by any registered test service unit is not received exists or not based on the test link information; if yes, determining that the test link is abnormal, and sending an alarm; if not, determining that the test link is normal.

In some embodiments, the blockchain docking platform may be used as follows.

(1) And installing a block chain butt joint platform. The first mode is that the exterior is independently installed, the treatment device is independently installed to a certain server, and the server can be connected with the micro nodes and the block chain nodes. And the second mode is that the SDK is integrated to the micro-nodes, the micro-nodes use the treatment device by adopting a mode of introducing the SDK, and a plurality of micro-nodes automatically construct a high-availability cluster. And the third mode is integration to a block chain, a block is introduced to use a governing device, and a multi-block automatically constructs a high-availability cluster.

(2) Platform configuration information is interfaced at the blockchain. Configuring the address and name of the micro node, the address of the block chain link point and the acquisition frequency; and starting the relevant treatment device after the configuration is finished, wherein the treatment device automatically sends the probes to each detected service, and the probes are specified in the detected service starting instruction.

(3) And configuring a visual interface on the blockchain docking platform. The visual interface comprises a node state module, a link calling module, a link alarming module and a link early warning module.

There is also provided in this embodiment an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.

Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.

Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:

and S1, acquiring the request data received by each service unit, and integrating the request data carrying the same link identification according to a preset rule to obtain the actual link information corresponding to each link identification flowing among a plurality of service units.

And S2, determining a test link passing through at least one service unit, and detecting the test link to obtain test link information of the test link.

And S3, initiating a virtual transaction to the blockchain, and obtaining transaction feedback information generated by the blockchain in response to the virtual transaction.

S4, performing status detection on each service unit and each block chain, respectively, to obtain status data of each service unit and each block chain.

And S5, sending the actual link information, the test link information, the transaction feedback information and the state data to a block chain for uplink storage, and generating a monitoring result according to the actual link information, the test link information, the transaction feedback information and the state data respectively.

It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementations, and details are not described again in this embodiment.

In addition, in combination with the monitoring method of the block chain docking platform provided in the above embodiment, a storage medium may also be provided in this embodiment to implement the method. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements any of the above embodiments of the method for monitoring a blockchain docking platform.

It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without any inventive step, shall fall within the scope of protection of the present application.

It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.

The term "embodiment" is used herein to mean that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

The above embodiments, which may not affect the business, only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种基于哈希链的数字水印验证方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!