CN111432042B - Network address processing method, computer device and storage medium - Google Patents

Network address processing method, computer device and storage medium Download PDF

Info

Publication number
CN111432042B
CN111432042B CN202010137266.6A CN202010137266A CN111432042B CN 111432042 B CN111432042 B CN 111432042B CN 202010137266 A CN202010137266 A CN 202010137266A CN 111432042 B CN111432042 B CN 111432042B
Authority
CN
China
Prior art keywords
network address
heartbeat packet
agent component
component
heartbeat
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.)
Active
Application number
CN202010137266.6A
Other languages
Chinese (zh)
Other versions
CN111432042A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010137266.6A priority Critical patent/CN111432042B/en
Priority to PCT/CN2020/099298 priority patent/WO2021174730A1/en
Publication of CN111432042A publication Critical patent/CN111432042A/en
Application granted granted Critical
Publication of CN111432042B publication Critical patent/CN111432042B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a network address processing method, which comprises the steps of establishing dynamic periodic heartbeat connection between an Agent component and an API component; sending a heartbeat packet to the API component, wherein the heartbeat packet carries a network address and a request parameter corresponding to the Agent component; receiving a heartbeat packet returned by the API component and acquiring the latest network address in the heartbeat packet; judging whether the network address corresponding to the Agent component is updated or not according to the latest network address; and when the judgment result is that the network address corresponding to the Agent component is updated, updating the network address corresponding to the Agent component to the latest network address. The invention also provides computer equipment and a storage medium. By the embodiment of the invention, the network address can be dynamically updated, and the parameter configuration in the Agent component does not need to be modified again every time the network address changes or expands, so that the monitoring service efficiency is improved.

Description

Network address processing method, computer device and storage medium
Technical Field
The present invention relates to the field of status monitoring technologies, and in particular, to a network address processing method, a computer device, and a computer-readable storage medium.
Background
In the distributed monitoring architecture, a set of monitoring service is respectively set up in different available areas according to specific requirements in each region, and monitoring data acquired by the available areas in each region are reported to the monitoring service in the available areas so as to carry out unified data storage and data analysis. Generally, the reported network address is stored in a specific configuration file, and is loaded into a memory when a program is started so as to be used when needed.
However, storing the network address in the designated configuration file is not beneficial to the expansion of the monitoring service and disaster recovery, and once the upper layer reports the migration and expansion of the network address, the process of the bottom layer responsible for collecting data needs to modify the configuration parameters, and the restart party can acquire the updated network address, so that the operation is not convenient and sensitive enough.
Therefore, a solution for network address processing is desired.
Disclosure of Invention
In view of the foregoing, there is a need for a network address processing method, a computer device and a computer readable storage medium, which can dynamically update a network address without modifying a parameter configuration in an Agent component every time the network address changes or expands, thereby improving monitoring service efficiency.
A first aspect of an embodiment of the present invention provides a network address processing method, which is applied to an Agent component, and the network address processing method includes:
establishing a dynamic periodic heartbeat connection between the Agent component and the API component;
sending a heartbeat packet to the API component, wherein the heartbeat packet carries a network address and a request parameter corresponding to the Agent component, and the network address corresponds to a reporting address of monitoring data of the Agent component;
receiving a heartbeat packet returned by the API component and acquiring the latest network address in the heartbeat packet;
judging whether the network address corresponding to the Agent component is updated or not according to the latest network address;
and when the judgment result is that the network address corresponding to the Agent component is updated, updating the network address corresponding to the Agent component to the latest network address.
Further, in the network address processing method provided in the embodiment of the present invention, the step of establishing a dynamic periodic heartbeat connection between the Agent component and the API component includes:
acquiring sending data of the heartbeat packet sent by the Agent component in the latest detection period;
acquiring the receiving data of the heartbeat packet received by the API component in the latest detection period;
counting the loss times of the heartbeat packet in the latest detection period according to the sending data and the receiving data;
and adjusting the next sending time interval of the heartbeat packet according to the rule that the loss times and the sending time interval of the heartbeat packet are in negative correlation.
Further, in the above network address processing method provided in the embodiment of the present invention, the step of adjusting the next sending time interval of the heartbeat packet according to the rule that the number of times of loss is negatively correlated with the sending time interval of the heartbeat packet includes:
determining the loss level corresponding to the loss times;
obtaining a proportionality coefficient of the sending time interval of the heartbeat packet according to the loss level;
and adjusting the next sending time interval of the heartbeat packet according to the proportionality coefficient.
Further, in the above network address processing method provided in the embodiment of the present invention, before the step of sending the heartbeat packet to the API component, the method further includes:
acquiring a monitoring process corresponding to an available area, and determining current load data of the monitoring process;
detecting whether the current load data exceeds a preset load threshold value;
when the detection result is that the current load data exceeds a preset load threshold value, determining that the network address corresponding to the available area meets an updating condition, and outputting a notification that the network address corresponding to the available area meets the updating condition to a corresponding Agent component;
and carrying request parameters in the heartbeat packet according to the notification, and sending the heartbeat packet to the API component.
Further, in the network address processing method provided in the embodiment of the present invention, the step of determining whether the network address corresponding to the Agent component is updated according to the latest network address includes:
judging whether the network address corresponding to the Agent component is consistent with the latest network address carried in the heartbeat packet returned by the API component or not;
when the judgment result is inconsistent, determining that the network address corresponding to the Agent component is updated;
and when the judgment result is consistent, determining that the network address corresponding to the Agent component is not updated.
A second aspect of the present invention further provides a network address processing method, which is applied to an API component, and the network address processing method includes:
establishing a dynamic periodic heartbeat connection between an Agent component and the API component;
receiving a heartbeat packet sent by the Agent component;
detecting whether request parameters exist in the heartbeat packet or not;
when the detection result is that the request parameters exist in the heartbeat packet, acquiring the network address of the Agent component carried in the heartbeat packet;
acquiring target available area information corresponding to the network address of the Agent component from a specified database according to the mapping relation between the network address of the Agent component and the available area;
acquiring the latest network address of the Agent component corresponding to the target available area information;
and taking the latest network address corresponding to the Agent component as response data carried by the heartbeat packet and returning the response data to the Agent component.
Further, in the foregoing network address processing method provided in the embodiment of the present invention, the method further includes:
analyzing the identity information of the Agent component in the heartbeat packet;
storing the heartbeat packet into a time queue according to the identity information of the Agent component;
and starting threads with preset number, polling the time queue in parallel, and detecting whether request parameters exist in the heartbeat packet according to the time priority sequence.
Further, in the above network address processing method provided in the embodiment of the present invention, the step of detecting whether there is a request parameter in the heartbeat packet includes:
detecting whether data in a preset format exists in the heartbeat packet or not, and determining that request parameters exist in the heartbeat packet when a detection result is that the data in the preset format exists in the heartbeat packet; or
And detecting whether a preset label exists in the heartbeat packet, and determining that a request parameter exists in the heartbeat packet when the detection result is that the preset label exists in the heartbeat packet.
The third aspect of the embodiments of the present invention further provides a computer device, where the computer device includes a processor, and the processor is configured to implement any one of the network address processing methods when executing a computer program stored in a memory.
The fourth aspect of the embodiments of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any one of the network address processing methods described above.
The embodiment of the invention provides a network address processing method, computer equipment and a computer readable storage medium, wherein a heartbeat connection with a dynamic period is established between an Agent component and an API component; sending a heartbeat packet to the API component, wherein the heartbeat packet carries a network address and a request parameter corresponding to the Agent component; receiving a heartbeat packet returned by the API component and acquiring the latest network address in the heartbeat packet; judging whether the network address corresponding to the Agent component is updated or not according to the latest network address; and when the judgment result is that the network address corresponding to the Agent component is updated, updating the network address corresponding to the Agent component to the latest network address. By the embodiment of the invention, the network address can be dynamically updated, and the parameter configuration in the Agent component is not required to be modified again each time the network address is changed or expanded, so that the monitoring service efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a network address processing method according to a first embodiment of the present invention.
Fig. 2 is a flowchart of a network address processing method according to a second embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
FIG. 4 is an exemplary functional block diagram of the computer device shown in FIG. 3.
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention, and the described embodiments are a part, but not all, of the present 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.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Fig. 1 is a flowchart of a network address processing method according to a first embodiment of the present invention, where the network address processing method may be applied to a distributed monitoring architecture, and the distributed monitoring architecture includes: the system comprises a client, a server and a plurality of Agent components. The server side is mainly responsible for interacting with the client side and the Agent components, the server side opens a class of API components, the API components are used for interacting with the Agent components, receiving heartbeat requests sent by the Agent components to the server side, and monitoring the states of the Agent components in real time.
Specifically, the corresponding implementation process of the distributed monitoring architecture is as follows:
the Agent component is used for collecting monitoring data and sending the collected monitoring data to the API component; the API component writes the monitoring data into a monitoring database corresponding to a server side; the client can send a request for acquiring the monitoring data to the API component, and the API component returns the monitoring data to the client according to the request for the client to inquire and modify.
As shown in fig. 1, an embodiment of the present invention provides a network processing method, which is applied to an Agent component, where the network address processing method may include the following steps:
and S11, establishing dynamic periodic heartbeat connection between the Agent component and the API component.
In at least one embodiment of the present invention, a heartbeat connection in a dynamic period is established between an Agent component and an API component, that is, a time interval when the Agent component sends a heartbeat packet to the API component may be dynamically adjusted. Specifically, the step of establishing a dynamic periodic heartbeat connection between the Agent component and the API component includes: acquiring sending data of the heartbeat packet sent by the Agent component in the latest detection period; acquiring the receiving data of the heartbeat packet received by the API component in the latest detection period; counting the loss times of the heartbeat packet in the latest detection period according to the sending data and the receiving data; and adjusting the next sending time interval of the heartbeat packet according to the rule that the loss times and the sending time interval of the heartbeat packet are in negative correlation. Wherein the detection period is preset by a user.
Preferably, the step of adjusting the next transmission time interval of the heartbeat packet according to the rule that the loss number is negatively correlated to the transmission time interval of the heartbeat packet includes: determining the loss level corresponding to the loss times; obtaining a proportionality coefficient of the sending time interval of the heartbeat packet according to the loss level; and adjusting the next sending time interval of the heartbeat packet according to the proportionality coefficient. The incidence relation between the times and the loss level and the incidence relation between the loss level and the proportionality coefficient of the heartbeat packet sending time interval are preset and can be represented in a list form.
Illustratively, counting received data of the API component on the heartbeat packet sent by the Agent component in the last detection period, and when the number of times of the heartbeat packet sent by the Agent component is 10, but the number of times of the heartbeat packet received by the API component is 7, the number of times of the heartbeat packet loss is 3. Wherein, if the 3 times belong to the interval [1,3], the corresponding loss level is one level, and the proportionality coefficient of the transmission time interval of the heartbeat packet corresponding to the loss level being one level is 2/3, the transmission time interval of the heartbeat packet is shortened to 2/3 of the transmission time interval of the current heartbeat packet (for example, if the transmission time interval of the current heartbeat packet is 12 seconds, the transmission time interval of the shortened heartbeat packet is 8 seconds). If the number of times of losing the heartbeat packet sent by the Agent component is 5 times, the 5 times belong to an interval [4,6], the corresponding loss level is two levels, the proportional coefficient of the heartbeat packet sending time interval corresponding to the second level is 1/2, and so on, and details are not repeated herein.
And S12, sending a heartbeat packet to the API component, wherein the heartbeat packet carries a network address and a request parameter corresponding to the Agent component, and the network address corresponds to a reporting address of the Agent component monitoring data.
In at least one embodiment of the present invention, a heartbeat packet is sent to the API component by the Agent component, where the heartbeat packet carries a network address and a request parameter corresponding to the Agent component, the network address corresponds to a reporting address of monitoring data of the Agent component, that is, after the Agent component uploads the collected monitoring data to the API component, the API component writes the monitoring data into a monitoring database corresponding to a server according to the network address. The network address of the Agent component is in a mapping relation with the available area information, the mapping relation between the network address and the available area information is stored in a list of a designated database, and the list comprises the available area information and the network address of the corresponding Agent component. The available area information corresponding to the Agent component can be determined through the network address of the Agent component. Wherein, the usable area refers to a physical area where power and network are independent from each other in the same region. Different available areas can be contained in the same region, each available area can be used for building a set of monitoring service according to respective requirements, and the monitoring service comprises an Agent component, a monitoring server side and an API component.
And the request parameter is used for acquiring the latest network address corresponding to the Agent component when the network address corresponding to the Agent component is judged to meet the updating condition. And the request parameters are added into the heartbeat packet according to a preset format, wherein the preset format is preset by a user. The preset format is common to the Agent component and the API component, and specifically, the method further includes: and the Agent component transmits the preset format of the request parameter to the API component in an off-line mode, and sets the validity period of the preset format with the API component. Therefore, the API component can determine whether the request parameters exist in the heartbeat packet sent by the Agent component by checking whether the data in the preset format exists in the heartbeat packet. Preferably, the method further comprises: and adding a preset label to the request parameter, and visually detecting whether the heartbeat packet carries the request parameter or not by checking the preset label, wherein the preset label is preset by a user and can be a digital label.
And S13, receiving the heartbeat packet returned by the API component and acquiring the latest network address in the heartbeat packet.
In at least one embodiment of the present invention, after the Agent component sends the heartbeat packet to the API component, there may be a case where the API component does not respond, or there may be a case where the heartbeat packet responded by the API component does not carry a network address. When the API component is unresponsive, the method further comprises: and sending a heartbeat packet again through the Agent component, carrying the request parameter in the heartbeat packet, and requesting to acquire the latest network address until the related information is successfully acquired. When the Agent component receives the heartbeat packet returned by the API component, the method further comprises the following steps: detecting whether the heartbeat packet carries the network address or not; and when the detection result shows that the network address is not carried in the heartbeat packet, the heartbeat packet is sent again, the request parameter is carried in the heartbeat packet, and the latest network address is requested to be obtained until the related information is successfully obtained. It can be understood that when the Agent component receives a heartbeat packet returned by the API component, the Agent component parses the heartbeat packet to obtain the latest network address, and if the heartbeat packet is parsed incorrectly, the Agent component sends the heartbeat packet again, and carries the request parameter in the heartbeat packet to request to obtain the latest network address until the relevant information is successfully obtained.
And S14, judging whether the network address corresponding to the Agent component is updated according to the latest network address, and entering the step S15 when the judgment result is that the network address corresponding to the Agent component is updated.
In at least one embodiment of the present invention, determining whether a network address is updated according to the response data, where the step of determining whether a network address corresponding to the Agent component is updated according to the latest network address includes: judging whether the network address corresponding to the Agent component is consistent with the latest network address carried in the heartbeat packet returned by the API component or not; when the judgment result is inconsistent, determining that the network address corresponding to the Agent component is updated, and further updating the network address corresponding to the Agent component; and when the judgment result is consistent, determining that the network address corresponding to the Agent component is not updated, and updating the network address corresponding to the Agent component is not needed.
And S15, updating the network address corresponding to the Agent component to the latest network address.
In at least one embodiment of the present invention, when the determination result indicates that the network address corresponding to the Agent component is updated, that is, the network address of the Agent component requiring to report the monitoring data is updated, and specifically, the network address corresponding to the Agent component is updated to the latest network address.
It will be appreciated that the network address needs to be updated when some sudden cause causes cause the server to crash, or when the pressure carried by the server is too high. Preferably, in order to save transmission traffic, in the heartbeat connection process between the Agent component and the API component, each heartbeat packet does not need to carry a request parameter for requesting a network address update. Therefore, before sending the heartbeat packet to the API component, it is further required to detect whether the network address corresponding to the available area meets the update condition, so that when the network address meets the update condition, the request parameter is carried in the heartbeat packet. Specifically, the step of detecting whether the network address corresponding to the available area meets the update condition includes: acquiring a monitoring process corresponding to an available area, and determining current load data of the monitoring process; detecting whether the current load data exceeds a preset load threshold value; and when the detection result is that the current load data exceeds a preset load threshold value, determining that the network address corresponding to the available area meets the updating condition, and outputting a notification that the network address corresponding to the available area meets the updating condition to a corresponding Agent component. Wherein the preset load threshold is preset by a user.
It is to be understood that, when the network address corresponding to the available area satisfies the update condition, the network address corresponding to the available area is updated, the updated network address may be stored in a corresponding configuration file, and the method for updating the network address may include, but is not limited to, modifying the network address, migrating the network address, and expanding the network address. And after the network address is updated, outputting an update instruction to the API component, wherein the update instruction is used for informing the API component that the network address of the current available area is updated. Preferably, the update instruction includes a latest network address corresponding to the available area.
The embodiment of the invention provides a network address processing method, which is applied to an Agent component and used for establishing dynamic periodic heartbeat connection between the Agent component and an API component; sending a heartbeat packet to the API component, wherein the heartbeat packet carries a network address and a request parameter corresponding to the Agent component; receiving a heartbeat packet returned by the API component and acquiring the latest network address in the heartbeat packet; judging whether the network address corresponding to the Agent component is updated or not according to the latest network address; and when the judgment result is that the network address corresponding to the Agent component is updated, updating the network address corresponding to the Agent component to the latest network address. By the embodiment of the invention, the network address can be dynamically updated, and the parameter configuration in the Agent component does not need to be modified again every time the network address changes or expands, so that the monitoring service efficiency is improved.
As shown in fig. 2, an embodiment of the present invention provides a network address processing method, which is applied in an API component, and the network address processing method includes:
and S21, establishing a dynamic periodic heartbeat connection between the Agent component and the API component.
In at least one embodiment of the present invention, a heartbeat connection in a dynamic period is established between an Agent component and an API component, that is, a time interval when the Agent component sends a heartbeat packet to the API component may be dynamically adjusted. Specifically, the step of establishing a dynamic periodic heartbeat connection between the Agent component and the API component includes: acquiring sending data of the heartbeat packet sent by the Agent component in the latest detection period; acquiring the receiving data of the heartbeat packet received by the API component in the latest detection period; counting the loss times of the heartbeat packet in the latest detection period according to the sending data and the receiving data; and adjusting the next sending time interval of the heartbeat packet according to the rule that the loss times and the sending time interval of the heartbeat packet are in negative correlation. Wherein the detection period is preset by a user.
And S22, receiving the heartbeat packet sent by the Agent component.
In at least one embodiment of the present invention, when the API component receives heartbeat packets sent by a plurality of Agent components at the same time, or when the API component receives a plurality of heartbeat packets sent by one Agent component, the method further includes: analyzing the identity information of the Agent component in the heartbeat packet; storing the heartbeat packet into a time queue according to the identity information of the Agent component; and starting threads with preset number, polling the time queue in parallel, and detecting whether request parameters exist in the heartbeat packet according to the time priority sequence. The time queue is a first-in first-out data structure taking a timestamp as priority, and the smaller the timestamp is, the first-out data is. A time stamp is a complete, verifiable piece of data, usually a sequence of characters, that can represent the time at a particular moment in time that a piece of data has existed before that particular time.
Specifically, for heartbeat packets sent by Agent components of the same identity information, the heartbeat packets are stored in a queue of the time queue according to a time stamp sequence (a time sequence in which the API component receives the heartbeat packets), that is, the time queue is formed by a queue formed by heartbeat packets sent by Agent components of a plurality of different identity information.
S23, detecting whether the request parameter exists in the heartbeat packet, and entering the step S24 when the detection result is that the request parameter exists in the heartbeat packet.
In at least one embodiment of the present invention, the step of detecting whether there is a request parameter in the heartbeat packet includes: detecting whether data in a preset format exists in the heartbeat packet or not, and determining that request parameters exist in the heartbeat packet when a detection result is that the data in the preset format exists in the heartbeat packet; or detecting whether a preset label exists in the heartbeat packet, and determining that a request parameter exists in the heartbeat packet when the detection result is that the preset label exists in the heartbeat packet.
And S24, acquiring the current network address of the Agent component carried in the heartbeat packet.
In at least one embodiment of the present invention, when the detection result indicates that the request parameter exists in the heartbeat packet, a network address corresponding to the Agent component carried in the heartbeat packet is obtained, where the network address is an original network address corresponding to the Agent component.
And S25, acquiring target available area information corresponding to the network address of the Agent component from a specified database according to the mapping relation between the network address of the Agent component and the available area.
In at least one embodiment of the present invention, target available area information corresponding to the network address of the Agent component is acquired from a specified database according to a mapping relationship between the network address of the Agent component and the available area.
Specifically, the network address of the Agent component and the available area information are in a mapping relationship, and the mapping relationship between the network address of the Agent component and the available area information is stored in a list of a specified database, wherein the list comprises the available area information and the corresponding network address of the Agent component. The available area information corresponding to the Agent component can be determined through the network address of the Agent component.
And S26, acquiring the latest network address of the Agent component corresponding to the target available area information.
In at least one embodiment of the present invention, the API component obtains the latest network address of the Agent component corresponding to the target available area information. The latest network address of the Agent component corresponding to the available area information can be determined through the available area information.
And S27, taking the latest network address corresponding to the Agent component as response data carried by the heartbeat packet and returning the response data to the Agent component.
In at least one embodiment of the present invention, when the reported network address of the server side corresponding to the API component (that is, the network address corresponding to the Agent component) needs to be migrated or extended, the network address of the server side corresponding to the API component may be changed. And taking the latest network address of the server side corresponding to the API component as response data carried by the heartbeat packet and returning the response data to the Agent component.
The embodiment of the invention provides a network address processing method, which is applied to an API component and used for establishing dynamic periodic heartbeat connection between an Agent component and the API component; receiving a heartbeat packet sent by the Agent component; detecting whether request parameters exist in the heartbeat packet or not; when the detection result is that the request parameters exist in the heartbeat packet, acquiring the network address of the Agent component carried in the heartbeat packet; acquiring target available area information corresponding to the network address of the Agent component from a specified database according to the mapping relation between the network address of the Agent component and the available area; acquiring the latest network address of the Agent component corresponding to the target available area information; and taking the latest network address corresponding to the Agent component as response data carried by the heartbeat packet and returning the response data to the Agent component. By the embodiment of the invention, the network address can be dynamically updated, and the parameter configuration in the Agent component does not need to be modified again every time the network address changes or expands, so that the monitoring service efficiency is improved.
The above is a detailed description of the method provided by the embodiments of the present invention. The order of execution of the blocks in the flowcharts shown may be changed, and some blocks may be omitted, according to various needs. The following describes a computer device 1 provided by an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and as shown in fig. 3, the computer device 1 includes a memory 10, and a network address processing apparatus 100 is stored in the memory 10. The computer device 1 may be an electronic device having functions of data processing, analysis, program execution, display, and the like, such as a computer, a tablet computer, and a personal digital assistant. When the network address processing device 100 is applied to an Agent component, the network address processing device 100 may establish a heartbeat connection with a dynamic period between the Agent component and an API component; sending a heartbeat packet to the API component, wherein the heartbeat packet carries a network address and a request parameter corresponding to the Agent component; receiving a heartbeat packet returned by the API component and acquiring the latest network address in the heartbeat packet; judging whether the network address corresponding to the Agent component is updated or not according to the latest network address; and when the judgment result is that the network address corresponding to the Agent component is updated, updating the network address corresponding to the Agent component to the latest network address.
When the network address processing device 100 is applied to an API component, the network address processing device 100 may establish a dynamic periodic heartbeat connection between an Agent component and the API component; receiving a heartbeat packet sent by the Agent component; detecting whether request parameters exist in the heartbeat packet or not; when the detection result is that the request parameters exist in the heartbeat packet, acquiring the network address of the Agent component carried in the heartbeat packet; acquiring target available area information corresponding to the network address of the Agent component from a specified database according to the mapping relation between the network address of the Agent component and the available area; acquiring the latest network address of the Agent component corresponding to the target available area information; and taking the latest network address corresponding to the Agent component as response data carried by the heartbeat packet and returning the response data to the Agent component. By the embodiment of the invention, the network address can be dynamically updated, and the parameter configuration in the Agent component does not need to be modified again every time the network address changes or expands, so that the monitoring service efficiency is improved.
In this embodiment, the computer device 1 may further include a display screen 20 and a processor 30. The memory 10 and the display screen 20 can be electrically connected with the processor 30 respectively.
The memory 10 may be of different types of memory devices for storing various types of data. For example, the memory and the internal memory of the computer device 1 may be used, and the memory Card may be a memory Card that is externally connected to the computer device 1, such as a flash memory, an SM Card (Smart Media Card), an SD Card (Secure Digital Card), and the like. Further, the memory 10 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other non-volatile solid state storage device. The memory 10 is used for storing various types of data, for example, various types of application programs (Applications) installed in the computer device 1, data set and acquired by applying the above-described network address processing method, and the like.
A display screen 20 is mounted to the computer apparatus 1 for displaying information.
The processor 30 is used for executing the network address processing method and various types of software installed in the computer device 1, such as an operating system and application display software. The processor 30 includes, but is not limited to, a Central Processing Unit (CPU), a Micro Controller Unit (MCU), and other devices for interpreting computer instructions and Processing data in computer software.
The network address processing apparatus 100 may include one or more modules, which are stored in the memory 10 of the computer device 1 and configured to be executed by one or more processors (in this embodiment, one processor 30) to implement the embodiment of the present invention. For example, referring to fig. 4, the network address processing apparatus 100 may include a heartbeat connection module 101, a heartbeat packet sending module 102, a data obtaining module 103, an update determining module 104, an address updating module 105, a heartbeat packet receiving module 106, and an information obtaining module 107. The modules referred to in the embodiments of the present invention may be program segments that perform a specific function, and are more suitable than programs for describing the execution process of software in the processor 30.
It is to be understood that, corresponding to the embodiments of the foregoing network address processing method, the network address processing apparatus 100 may include some or all of the functional modules shown in fig. 4, and the functions of the modules will be described in detail below. It should be noted that the same noun and its specific explanation in the above embodiments of the network address processing method can also be applied to the following functional description of each module. For brevity and to avoid repetition, further description is omitted.
When the network address processing apparatus 100 is applied to an Agent component, the heartbeat connection module 101 may be configured to establish a dynamic periodic heartbeat connection between the Agent component and an API component.
The heartbeat packet sending module 102 may be configured to send a heartbeat packet to the API component, where the heartbeat packet carries a network address and a request parameter corresponding to the Agent component, and the network address corresponds to a reporting address of monitoring data of the Agent component.
The address obtaining module 103 may be configured to receive the heartbeat packet returned by the API component and obtain the latest network address in the heartbeat packet.
The update determining module 104 may be configured to determine whether the network address corresponding to the Agent component is updated according to the latest network address.
The address updating module 105 may be configured to update the network address corresponding to the Agent component to the latest network address when the determination result indicates that the network address corresponding to the Agent component is updated.
When the network address processing apparatus 100 is applied to an API component, the heartbeat connection module 101 may be configured to establish a dynamic periodic heartbeat connection between an Agent component and the API component.
The heartbeat packet receiving module 106 may be configured to receive a heartbeat packet sent by the Agent component.
The data obtaining module 103 may be further configured to detect whether a request parameter exists in the heartbeat packet.
The information obtaining module 107 may be configured to obtain a network address of the Agent component carried in the heartbeat packet when the detection result indicates that the request parameter exists in the heartbeat packet.
The information obtaining module 107 may be further configured to obtain, from a specified database, target available area information corresponding to the network address of the Agent component according to a mapping relationship between the network address of the Agent component and the available area.
The information obtaining module 107 may be further configured to obtain a latest network address of the Agent component corresponding to the target available area information.
The heartbeat packet sending module 102 may be further configured to use the latest network address corresponding to the Agent component as response data carried in the heartbeat packet and return the response data to the Agent component.
The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by the processor 30, implements the steps of the network address processing method in any one of the above embodiments.
The network address processing apparatus 100/computer device 1/computer device integrated module/unit may be stored in a computer readable storage medium if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, all or part of the flow in the method according to the above embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and used by the processor 30 to implement the steps of the above method embodiments. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying said computer program code, a recording medium, a usb-disk, a removable hard disk, a magnetic diskette, an optical disk, a computer Memory, a Read-Only Memory (ROM), etc.
The Processor 30 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor, etc., and the processor 30 is a control center of the network address processing apparatus 100/computer device 1, and various interfaces and lines are used to connect various parts of the whole network address processing apparatus 100/computer device 1.
The memory 10 is used for storing the computer programs and/or modules, and the processor 30 implements various functions of the network address processing apparatus 100/computer device 1 by running or executing the computer programs and/or modules stored in the memory 10 and calling data stored in the memory 10. The memory 10 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data) created according to the use of the computer apparatus 1, and the like.
In the several embodiments provided in the present invention, it should be understood that the disclosed computer apparatus and method may be implemented in other ways. For example, the system embodiments described above are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
It will be evident to those skilled in the art that the embodiments of the present invention are not limited to the details of the foregoing illustrative embodiments, and that the embodiments of the present invention are capable of being embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the embodiments being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Several of the units, modules or means recited in the system, apparatus or computer device claims may also be implemented by one and the same unit, module or means in software or hardware.
Although the embodiments of the present invention have been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the spirit and scope of the embodiments of the present invention.

Claims (9)

1. A network address processing method is applied to an Agent component, and is characterized in that the network address processing method comprises the following steps:
establishing a dynamic periodic heartbeat connection between the Agent component and the API component;
acquiring a monitoring process corresponding to an available area, and determining current load data of the monitoring process;
detecting whether the current load data exceeds a preset load threshold value;
when the detection result is that the current load data exceeds a preset load threshold value, determining that the network address corresponding to the available area meets an updating condition, and outputting a notification that the network address corresponding to the available area meets the updating condition to a corresponding Agent component;
carrying a request parameter in a heartbeat packet according to the notification, and sending the heartbeat packet to the API component, wherein the heartbeat packet carries a network address and a request parameter corresponding to the Agent component, and the network address corresponds to a reporting address of monitoring data of the Agent component;
receiving a heartbeat packet returned by the API component and acquiring the latest network address in the heartbeat packet;
judging whether the network address corresponding to the Agent component is updated or not according to the latest network address;
and when the judgment result is that the network address corresponding to the Agent component is updated, updating the network address corresponding to the Agent component to the latest network address.
2. The method according to claim 1, wherein the step of establishing a dynamic periodic heartbeat connection between the Agent component and the API component comprises:
acquiring sending data of the heartbeat packet sent by the Agent component in the latest detection period;
acquiring the received data of the heartbeat packet received by the API component in the latest detection period;
counting the loss times of the heartbeat packet in the latest detection period according to the sending data and the receiving data;
and adjusting the next sending time interval of the heartbeat packet according to the rule that the loss times and the sending time interval of the heartbeat packet are in negative correlation.
3. The method according to claim 2, wherein the step of adjusting the next transmission time interval of the heartbeat packet according to the rule that the number of losses is negatively correlated to the transmission time interval of the heartbeat packet comprises:
determining the loss level corresponding to the loss times;
obtaining a proportionality coefficient of the sending time interval of the heartbeat packet according to the loss level;
and adjusting the next sending time interval of the heartbeat packet according to the proportionality coefficient.
4. The method according to claim 1, wherein the step of determining whether the network address corresponding to the Agent component is updated according to the latest network address comprises:
judging whether the network address corresponding to the Agent component is consistent with the latest network address carried in the heartbeat packet returned by the API component or not;
when the judgment result is inconsistent, determining that the network address corresponding to the Agent component is updated;
and when the judgment result is consistent, determining that the network address corresponding to the Agent component is not updated.
5. A network address processing method is applied to an API component, and is characterized in that the network address processing method comprises the following steps:
establishing a dynamic periodic heartbeat connection between an Agent component and the API component;
receiving a heartbeat packet sent by the Agent component, wherein the Agent component is used for determining that a network address corresponding to an available area meets an updating condition when current load data exceeds a preset load threshold value, outputting a notice that the network address corresponding to the available area meets the updating condition to the corresponding Agent component, and carrying a request parameter in the heartbeat packet according to the notice;
detecting whether request parameters exist in the heartbeat packet or not;
when the detection result is that the request parameters exist in the heartbeat packet, acquiring the network address of the Agent component carried in the heartbeat packet;
acquiring target available area information corresponding to the network address of the Agent component from a specified database according to the mapping relation between the network address of the Agent component and the available area;
acquiring the latest network address of the Agent component corresponding to the target available area information;
and taking the latest network address corresponding to the Agent component as response data carried by the heartbeat packet and returning the response data to the Agent component.
6. The network address processing method of claim 5, wherein the method further comprises:
analyzing the identity information of the Agent component in the heartbeat packet;
storing the heartbeat packet into a time queue according to the identity information of the Agent component;
and starting a preset number of threads to poll the time queue in parallel, and detecting whether request parameters exist in the heartbeat packet according to the time priority sequence.
7. The method according to claim 5, wherein the step of detecting whether the request parameter exists in the heartbeat packet comprises:
detecting whether data in a preset format exists in the heartbeat packet or not, and determining that request parameters exist in the heartbeat packet when a detection result is that the data in the preset format exists in the heartbeat packet; or
And detecting whether a preset label exists in the heartbeat packet, and determining that a request parameter exists in the heartbeat packet when the detection result is that the preset label exists in the heartbeat packet.
8. A computer device, characterized in that the computer device comprises a processor for implementing the network address processing method according to any one of claims 1 to 4, or for implementing the network address processing method according to any one of claims 5 to 7, when executing a computer program stored in a memory.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a network address processing method according to any one of claims 1 to 4, or carries out a network address processing method according to any one of claims 5 to 7.
CN202010137266.6A 2020-03-02 2020-03-02 Network address processing method, computer device and storage medium Active CN111432042B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010137266.6A CN111432042B (en) 2020-03-02 2020-03-02 Network address processing method, computer device and storage medium
PCT/CN2020/099298 WO2021174730A1 (en) 2020-03-02 2020-06-30 Network address processing method, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010137266.6A CN111432042B (en) 2020-03-02 2020-03-02 Network address processing method, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN111432042A CN111432042A (en) 2020-07-17
CN111432042B true CN111432042B (en) 2022-09-16

Family

ID=71548044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010137266.6A Active CN111432042B (en) 2020-03-02 2020-03-02 Network address processing method, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN111432042B (en)
WO (1) WO2021174730A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114143372B (en) * 2021-12-06 2023-07-25 重庆邮电大学 End network control method and system based on converged network shunt

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453494A (en) * 2008-12-24 2009-06-10 深圳市同洲电子股份有限公司 Server address obtaining method, server and digital television receiving terminal
CN102891873B (en) * 2011-07-21 2017-02-15 腾讯科技(深圳)有限公司 Method for storing log data and log data storage system
CN103338440B (en) * 2013-07-09 2016-03-02 杭州华三通信技术有限公司 Authentication method in Verification System and equipment end
CN104301240B (en) * 2013-07-19 2019-02-22 腾讯科技(深圳)有限公司 Data transmission method and system
EP3041199B1 (en) * 2014-12-30 2019-07-24 Siemens Aktiengesellschaft Method for determining communication device addresses within a communication network of an industrial automation system and communication device
CN106406925A (en) * 2015-08-03 2017-02-15 阿里巴巴集团控股有限公司 An apparatus and a method used for supporting online upgrade
CN106937277B (en) * 2015-12-30 2020-11-17 创新先进技术有限公司 Address updating method and device
CN107577516B (en) * 2017-07-28 2020-08-14 华为技术有限公司 Virtual machine password resetting method, device and system
CN107948249B (en) * 2017-11-02 2019-12-10 华南理工大学 large data platform elastic expansion method based on service discovery and container technology
US10896160B2 (en) * 2018-03-19 2021-01-19 Secure-24, Llc Discovery and migration planning techniques optimized by environmental analysis and criticality
CN108834179B (en) * 2018-05-31 2021-07-09 深圳市酷达通讯有限公司 Method, server and client for adjusting heartbeat cycle
CN110730196B (en) * 2018-07-16 2022-05-27 阿里巴巴集团控股有限公司 Network resource access method, computer equipment and storage medium
CN109995641B (en) * 2019-03-21 2021-05-28 新华三技术有限公司 Information processing method, computing node and storage medium
CN110768862B (en) * 2019-09-23 2021-03-09 烽火通信科技股份有限公司 Cloud platform physical link connectivity detection device, method and system

Also Published As

Publication number Publication date
WO2021174730A1 (en) 2021-09-10
CN111432042A (en) 2020-07-17

Similar Documents

Publication Publication Date Title
US9015315B2 (en) Identification and monitoring of distributed business transactions
US8782215B2 (en) Performance testing in a cloud environment
US20150067146A1 (en) Custom correlation of a distributed business transaction
CN110471749B (en) Task processing method, device, computer readable storage medium and computer equipment
CN101707632A (en) Method for dynamically monitoring performance of server cluster and alarming real-timely
US9658917B2 (en) Server performance correction using remote server actions
CN106911519B (en) Data acquisition monitoring method and device
CN111432042B (en) Network address processing method, computer device and storage medium
WO2021057387A1 (en) Event processing method and apparatus, terminal and computer-readable storage medium
CN112039723A (en) Method and device for detecting state of micro-service network and electronic equipment
CN108011779A (en) The test method of Cloud Server task throughput under limited resources supplIes
CN111930542A (en) Data acquisition method and device, electronic equipment and computer readable storage medium
CN107483280B (en) Method and device for monitoring service node device
CN110275785B (en) Data processing method and device, client and server
CN109298974B (en) System control method, device, computer and computer readable storage medium
CN113535344A (en) Network data processing method and device, server and storage medium
CN109284275B (en) Cloud platform virtual machine file system monitoring method and device
CN111796938A (en) Cluster dynamic concurrency control method and device
CN113079152B (en) Data transmission method, device and medium
CN108829563B (en) Alarm method and alarm device
CN111435320B (en) Data processing method and device
WO2017096791A1 (en) Diagnosis test message processing method and device
CN112463514A (en) Monitoring method and device for distributed cache cluster
US9935856B2 (en) System and method for determining end user timing
CN113055468B (en) Chip management and control method, device and system

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