A method, medium and device for identifying cluster passive mining behavior based on traffic

By generating feature vectors and clustering, combined with currency and computing power information, the mining type is identified, which solves the problem of difficult identification of passive mining behavior and achieves precise management and risk control of mining activities.

CN118054941BActive Publication Date: 2024-10-11SHANDONG CLOUD SKY SECURITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410156632.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2024-10-11
Estimated Expiration
2044-02-04

AI Technical Summary

Technical Problem

In existing mining activities, especially passive mining behaviors are difficult to accurately identify, which leads to inconvenience in the investigation and management of mining activities, and affects the control of energy consumption and financial risks.

Method used

Through the traffic-based cluster passive mining behavior identification method, feature vectors are generated and clustered. Combining currency information, computing power information and traffic generation time, the mining type recognition degree is calculated, and thresholds are set to distinguish active and passive mining. behavior, and verify the passive mining IP through abnormal information and job information.

Benefits of technology

It improves the ability to accurately identify passive mining behaviors, enhances the management and monitoring of mining activities, and reduces energy consumption and financial risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118054941B_ABST
    Figure CN118054941B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing, and in particular to a method, medium and device for identifying cluster passive mining behavior based on traffic. It includes: parsing multiple target traffic data obtained in a preset collection period to generate a feature vector for each target traffic data. According to the feature vector, an account group corresponding to each IP account set is generated. According to the number of types of sub-device identifiers contained in each account group and the number of types of IP account sets contained in each account group, a mining type recognition degree of each account group is generated. According to the mining type recognition degree, it is determined whether the corresponding source IP is a passive mining IP. The present invention generates the mining type recognition degree through #imgabs0#. By setting the corresponding threshold, the cluster passive mining behavior can be more accurately identified.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The mining process will occupy a large amount of computing resources and cause a large amount of energy consumption and carbon emissions. At the same time, due to the low contribution of mining to the national economy, the role of mining in driving industrial development and scientific and technological progress is limited. In addition, the financial risks derived from the production and trading of virtual currencies are becoming more and more prominent. Its blind and disorderly development has an adverse impact on promoting high-quality economic and social development and energy conservation and emission reduction.

[0003] Under this influence, it is necessary to restrict and crack down on mining activities. Currently, there are active mining and passive mining activities in mining activities. Passive mining mainly refers to the mining activities carried out by terminal devices that are hacked and controlled by hackers after the corresponding mining programs are implanted. Usually, in order to increase the success rate of mining, hackers will choose some server clusters with high computing power surplus and weak protection capabilities to invade, and implant the corresponding mining programs into each server in the cluster, turning the servers into corresponding mining machines for passive mining. Because the mining work characteristics of the server cluster when performing mining operations are highly similar to the mining work characteristics of the active mining mine when performing mining operations. Therefore, it is not possible to more accurately determine and distinguish the passive mining behavior of the server cluster, which is not convenient for more accurate and effective investigation and management of mining activities. Summary of the invention

[0004] In view of the above technical problems, the technical solution adopted by the present invention is:

[0005] According to a first aspect of the present invention, a method for identifying cluster passive mining behavior based on traffic is provided, and the method comprises the following steps:

[0006] The multiple target flow data obtained in the preset collection period are analyzed to generate a feature vector for each target flow data. The feature vector includes the source IP and the mining machine account ID, and the mining machine account ID includes the main account and the sub-device ID.

[0007] In the feature vectors corresponding to all target traffic data, the mining machine account ID corresponding to the same source IP is added to the same account set to generate an IP account set corresponding to each source IP.

[0008] According to the main account type of the mining machine account ID contained in each IP account set, the IP account set is clustered to generate account groups corresponding to each IP account set.

[0009] According to the number of sub-device identifiers contained in each account group and the number of IP account sets contained in each account group, the mining type recognition degree of each account group is generated. Among them, the mining type recognition degree A corresponding to the i-th account group i The following conditions must be met:

[0010]

[0011] Among them, A i ID A is the number of sub-device identifiers included in the i-th account group. i IP k is the number of types of IP account sets contained in the i-th account group. 1 is the first amplitude adjustment coefficient.

[0012] If A i <Y 1 , then the source IP corresponding to the IP account set contained in the i-th account group is determined to be a passive mining IP. 1 is the first identification threshold.

[0013] Furthermore, after determining that the source IP corresponding to the IP account set included in the i-th account group is a passive mining IP, the method further includes:

[0014] Send abnormal information to the terminal corresponding to the passive mining IP.

[0015] Furthermore, after generating the mining type identification of each account group, the method further includes:

[0016] If A i ≥Y 1 , then the source IP corresponding to the IP account set contained in the i-th account group is determined to be the active mining IP.

[0017] Furthermore, multiple target flow data acquired in a preset collection period are analyzed to generate a feature vector of each target flow data. Including:

[0018] According to the traffic identifier corresponding to the preset mining communication protocol, the task submission traffic generated by the mining machine submitting tasks to the mining pool during the preset time period is obtained.

[0019] Use the corresponding preset mining communication protocol to parse the task submission traffic and obtain the source IP and mining machine account ID that generate each task submission traffic.

[0020] Furthermore, the preset mining communication protocols include the Stratum protocol and the Getwork protocol.

[0021] Furthermore, according to the main account type of the mining machine account ID contained in each IP account set, the IP account set is clustered to generate account groups corresponding to each IP account set. Including:

[0022] A set identifier corresponding to each IP account set is generated based on the master account of all mining machine account IDs contained in each IP account set.

[0023] The mining machine account IDs included in all IP account sets corresponding to each set identifier are added to the same cluster group to generate an account group corresponding to each mining machine account ID master account.

[0024] The source IP corresponding to all IP account sets corresponding to each set identifier is used as the source IP of the IP account set included in each account group.

[0025] Furthermore, the feature vector also includes: currency information, computing power information and traffic generation time.

[0026] After determining that the source IP corresponding to the IP account set included in the i-th account group is a passive mining IP, the method further includes:

[0027] According to the source IP, currency information, computing power information and traffic generation time in the feature vectors corresponding to multiple target traffic data, the operation information corresponding to the passive mining IP is generated. The operation information includes the computing power information and currency information corresponding to each operation period.

[0028] According to the energy efficiency coefficient mapping table, the energy consumption index of the area corresponding to the passive mining IP and the operation information, the consumption coefficient of the passive mining IP in the preset collection period is generated. Among them, the consumption coefficient W corresponding to the nth passive mining IP is n The following conditions must be met:

[0029]

[0030] Among them, Has q N is the computing power value corresponding to the passive mining IP in the qth operation period. q T is the energy efficiency coefficient corresponding to the currency mined by the passive mining IP in the qth operation period. q is the total duration of the qth operation period. q It is the energy consumption index of the area corresponding to the passive mining IP in the qth operation period.

[0031] If W n >Y 2 , then the nth passive mining IP is determined to be a passive mining IP. 2 is the second identification threshold.

[0032] Furthermore, according to the source IP, currency information, computing power information and traffic generation time in the feature vectors corresponding to the multiple target traffic data, the operation information corresponding to the passive mining IP is generated. Including:

[0033] According to the traffic generation time in the feature vector corresponding to the passive mining IP, the job time series corresponding to the passive mining IP is generated.

[0034] When the difference between any two adjacent traffic generation times is greater than the first operation interval threshold, a time period division mark is generated between the two adjacent traffic generation times.

[0035] At least one operation period corresponding to the passive mining IP is generated according to the period segmentation identifier.

[0036] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for identifying cluster passive mining behavior based on traffic is implemented.

[0037] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for identifying cluster passive mining behavior based on traffic when executing the computer program.

[0038] The present invention has at least the following beneficial effects:

[0039] In order to increase mining revenue, conventional active mining farms will set up multiple mining machines to jointly mine. At the same time, in order to avoid the actual location of the mining farm being determined, the public network IP used by the mining farm is basically a proxy IP. After a period of use, other IPs will be replaced. As a result, in the communication traffic between the mining farm and the mining pool, there will be a source IP corresponding to the traffic data, and there will be multiple mining machine account IDs. And due to the replacement of the proxy IP, the same type of mining machine account ID corresponding to different source IPs will also appear in the traffic data.

[0040] As for the service cluster for passive mining, the number of servers is fixed, and the public IP corresponding to the entire service cluster is also a fixed IP applied for by the operator. Therefore, in the communication traffic between the service cluster and the mining pool, there will be a source IP corresponding to the traffic data, and there will be multiple mining machine account IDs. However, since the number of servers in the server cluster is much smaller than the number of mining machines in the mining farm, the types of mining machine account IDs in the IP account set corresponding to the source IP of the service cluster are smaller than the types of mining machine account IDs in the IP account set corresponding to the source IP of the mining farm. Moreover, since the public IP corresponding to the service cluster is a fixed IP, there are fewer types of source IPs corresponding to the same type of mining machine account ID (the same IP account set).

[0041] The present invention is achieved by The above two features are converted into corresponding reference factors, and the mining type recognition is generated by adding them together. i From the calculation formula, we can know that A iThe smaller the value, the more likely it is a server cluster that is passively mining. Therefore, by setting the corresponding threshold, the corresponding mining behavior can be more accurately identified, whether it is a passive mining behavior initiated by a server cluster or an active mining behavior performed by a mining farm. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 A flow chart of a method for identifying cluster passive mining behavior based on traffic provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0045] As a possible embodiment of the present invention, Figure 1 As shown, a method for identifying cluster passive mining behavior based on traffic is provided, and the method includes the following steps:

[0046] S100: Analyze multiple target flow data obtained in a preset collection period to generate a feature vector for each target flow data. The feature vector includes a source IP and a mining machine account ID, and the mining machine account ID includes a main account and a sub-device identifier.

[0047] Specifically, the preset collection time period can be set according to the actual scenario, such as one day.

[0048] Since the network traffic of most mining pool communication protocols is mainly in plain text and contains relatively obvious instruction identifiers, the communication information between miners and mining pools can be collected by filtering the traffic corresponding to the target mining pool domain name.

[0049] In this embodiment, the principle flow of mainstream Stratum protocol, Getwork protocol and other mining communication protocols can be summarized. The flow information content corresponding to the instruction identifiers of different mining pool protocols can be extracted. Mining features such as currency information, account device quantity information, computing power information and energy consumption information can be used for subsequent calculations.

[0050] Specifically, S100 includes:

[0051] S101: According to the flow identifier corresponding to the preset mining communication protocol, the task submission flow generated by the mining machine submitting tasks to the mining pool in the preset period is obtained. The preset mining communication protocol includes the Stratum protocol and the Getwork protocol.

[0052] At present, mainstream mining pools usually use the Stratum protocol, which enables miners to obtain computing tasks from the mining pool more efficiently and reliably. The protocol data is encapsulated in JSON format. Most mining pools of other currencies also use this protocol for communication, and at the same time make some modifications and adjustments to the protocol according to their own needs. Ethereum mining pools mainly use the Getwork protocol. Some Ethereum mining pools, such as NiceHash, have made improvements based on the Stratum protocol specifications and formed the Ethereum version of the Stratum protocol.

[0053] S102: Use the corresponding preset mining communication protocol to parse the task submission traffic and obtain the source IP and mining machine account ID that generate each task submission traffic.

[0054] Under the restrictions of the corresponding communication protocol, when miners authenticate, subscribe to tasks, and submit tasks to the mining pool, they will form corresponding communication traffic according to the instructions specified in the protocol. Therefore, after parsing the traffic information generated by a specific instruction, the corresponding feature vector can be obtained. For example, taking the Stratum protocol as an example. When the miner calculates a task that meets the shares, he submits the task to the mining pool through the mining.submit instruction. The data format of the task submitted by the miner should at least include the mining machine account ID, the generation time (timestamp) of the traffic, and the miner's public network IP address.

[0055] Usually, in order to increase the success rate of mining, there are multiple mining machines in a mine, and each mining machine will correspond to a separate mining machine account ID. Usually, in order to better distinguish each mining machine, the mining machine account ID will be set to two parts, one part is the main account, and the other part is the sub-device ID. The two parts are connected by a connector (such as an English period), such as ABCD.01, ABCD.02, etc.

[0056] S200: Add the mining machine account ID corresponding to the same source IP in the feature vectors corresponding to all target traffic data to the same account set, and generate an IP account set corresponding to each source IP.

[0057] Usually, not every mining machine can complete the corresponding computing task within the specified time. Therefore, when sending task submission information, some mining machines will not upload information, and the corresponding mining machine account ID will not appear. Therefore, this step is required to collect all mining machine IDs contained in each source IP together to ensure the integrity of the mining machine account ID.

[0058] S300: Clustering the IP account sets according to the main account types of the mining machine account IDs contained in each IP account set, and generating account groups corresponding to each IP account set.

[0059] Specifically, S300 includes:

[0060] S301: Generate a set identifier corresponding to each IP account set according to the master account of all mining machine account IDs contained in each IP account set.

[0061] S302: adding the mining machine account IDs included in all IP account sets corresponding to each set identifier to the same cluster group, and generating an account group corresponding to each mining machine account ID master account.

[0062] S303: Use the source IP corresponding to all IP account sets corresponding to each set identifier as the source IP of the IP account set included in each account group.

[0063] Since the public IP used by the mining farm is basically a proxy IP, other IPs will be replaced after a period of use. Therefore, in the communication traffic between the mining farm and the mining pool, there will be a flow data corresponding to a source IP, and there will be multiple mining machine account IDs corresponding to it. And due to the replacement of the proxy IP, there will also be the situation in the traffic data that different source IPs correspond to the same type of mining machine account ID.

[0064] As for the passive mining service cluster, the number of servers in the server cluster is much smaller than the number of mining machines in the mining farm. Therefore, the types of mining machine account IDs in the IP account set corresponding to the source IP of the service cluster are smaller than the types of mining machine account IDs in the IP account set corresponding to the source IP of the mining farm. In addition, since the public network IP corresponding to the service cluster is a fixed IP, the types of source IPs corresponding to the same type of mining machine account ID (the same IP account set) are even fewer. Usually one or two.

[0065] Therefore, after clustering, the number of types of mining machine account IDs and the number of types of source IPs contained in the account group corresponding to the mining farm are greater than the number of types of mining machine account IDs and the number of types of source IPs contained in the account group corresponding to the server cluster.

[0066] S400: Generate the mining type recognition degree of each account group according to the number of types of sub-device identifiers contained in each account group and the number of types of IP account sets contained in each account group. i The following conditions must be met:

[0067]

[0068] Among them, A i ID A is the number of sub-device identifiers included in the i-th account group. i IP k is the number of types of IP account sets contained in the i-th account group. 1 is the first amplitude adjustment coefficient.

[0069] S500: If A i <Y 1 , then the source IP corresponding to the IP account set contained in the i-th account group is determined to be a passive mining IP. 1 is the first identification threshold.

[0070] S501: If A i ≥Y 1 , then the source IP corresponding to the IP account set contained in the i-th account group is determined to be the active mining IP.

[0071] S600: Send abnormal information to the terminal corresponding to the passive mining IP.

[0072] The present invention is achieved by The above two features are converted into corresponding reference factors, and the mining type recognition is generated by adding them together. i From the calculation formula, we can know that A i The smaller the value, the more likely it is a server cluster that is passively mining. Therefore, by setting the corresponding threshold, the corresponding mining behavior can be more accurately identified, whether it is a passive mining behavior initiated by the server cluster or an active mining behavior performed by the mine. And the corresponding early warning reminder information is sent to the corresponding passive mining terminal through S600 to remind the corresponding security personnel to perform corresponding maintenance on the server cluster.

[0073] As another possible embodiment of the present invention, the feature vector also includes: currency information, computing power information and traffic generation time.

[0074] The currency information can be obtained through the following methods:

[0075] When a miner connects to a mining pool for communication, the miner will first resolve the mining pool IP information to the corresponding mining pool domain name through the DNS server. According to the command characteristics and communication process of the Stratum protocol, Getwork protocol and other mining communication protocols, the mining instructions of the relevant protocols are used to determine the source IP information and source port information or the destination IP information and destination port information in the data message, and the IP and port information of the mining pool and the IP and port information of the miner are inferred. The mining pool IP information is subjected to relevant reverse domain name resolution to obtain the domain name information of the mining pool to which it is connected. Generally, the subdomain of the mining pool can carry its related currency information, such as btc.f2pool.com, eth-asia1.nanopool.org, etc. The subdomains of some mining pools do not contain currencies or the currency information is not obvious. The corresponding currency information can also be inferred based on the port number of the domain name and the homepage information of the mining pool.

[0076] The computing power information can be obtained through the following methods:

[0077] a) eth_submitHashrate instruction speculation. According to the eth_submitHashrate instruction of the Getwork protocol, the computing power information of miners when calculating tasks can be obtained through data packets, where the computing power value is expressed in hexadecimal. Generally, the computing power of a single Ethereum device or graphics card is within the unit range of MH / S, and the value with large deviation can be ignored or discarded.

[0078] b) Speculation based on the mining.set_difficulty instruction. According to the mining.set_difficulty or mining.suggest_difficulty instructions of the Stratum protocol, the difficulty value information of the miner when calculating the task can be obtained through the data message. In order to save space for transmitting data, some mining pools set the difficulty value size of mining.set_difficulty or mining.suggest_difficulty to 2 bytes, that is, the maximum difficulty value sent by the mining pool to the miner is 65536. Then the corresponding computing power information can be calculated based on the difficulty value D. The specific computing power value Has meets the following conditions:

[0079]

[0080] If the mining time of the miner IP is continuous, the unit time t of the mining computing power Has can be determined based on the maximum time T of the target message carrying the mining.submit command in the monitored data message. submit_max and minimum time T submit_minAnd the number of times the instruction is submitted is represented, where the time unit is seconds. Factor is the impact factor of the mining algorithm corresponding to the virtual currency. Specifically, the impact factors corresponding to different virtual currency mining algorithms are shown in Table 1:

[0081] Table 1

[0082] Virtual currency name Mining Algorithm Impact Factor BTC / BCH / UBTC / SBTC SHA256 2^32 DCR Blake256 2^32 LTC Scrypt 2^16 ZCash EquiHash 2^13

[0083] After S500: determining that the source IP corresponding to the IP account set included in the i-th account group is a passive mining IP, the method further includes:

[0084] S700: Generate operation information corresponding to the passive mining IP according to the source IP, currency information, computing power information and traffic generation time in the feature vector corresponding to the multiple target traffic data. The operation information includes computing power information and currency information corresponding to each operation period.

[0085] Specifically, S700 includes:

[0086] S701: Generate a job time sequence corresponding to the passive mining IP according to the traffic generation time in the feature vector corresponding to the passive mining IP.

[0087] S702: When the difference between any two adjacent traffic generation times is greater than a first operation interval threshold, a time segmentation mark is generated between the two adjacent traffic generation times. The first operation interval threshold may be 15 minutes.

[0088] S703: Generate at least one operation time period corresponding to the passive mining IP according to the time period segmentation identifier.

[0089] S800: Generate the consumption coefficient of the passive mining IP in the preset collection period according to the energy efficiency coefficient mapping table, the energy consumption index of the area corresponding to the passive mining IP, and the operation information. Among them, the consumption coefficient W corresponding to the nth passive mining IP n The following conditions must be met:

[0090]

[0091] Among them, Has q N is the computing power value corresponding to the passive mining IP in the qth operation period. q T is the energy efficiency coefficient corresponding to the currency mined by the passive mining IP in the qth operation period. q is the total duration of the qth operation period. q It is the energy consumption index of the area corresponding to the passive mining IP in the qth operation period.

[0092] The energy efficiency coefficient in this step is the energy efficiency ratio under different computing power when mining a certain currency, that is, the ratio between the power consumption and the computing power. This value can be obtained by a technician in this field after investigating the computing power value and energy consumption value of the existing mining behavior. And a corresponding energy efficiency coefficient mapping table can be generated. In this embodiment, the energy efficiency coefficient value range corresponding to the common Bitcoin (BTC) mining machine provided should be between 0.01-0.03, in units of KWS / TH, and preferably, the energy efficiency coefficient value is 0.02. The energy efficiency coefficient value range of the common Ethereum (ETH) mining machine should be between 0.2-0.9, in units of KWS / MH, and preferably, the energy efficiency coefficient value is 0.37.

[0093] The energy consumption index may be the electricity price of the area corresponding to the IP in each time period.

[0094] S900: If W n >Y 2 , then the nth passive mining IP is determined to be a passive mining IP. 2 is the second identification threshold.

[0095] Since mining itself is to obtain corresponding benefits by obtaining corresponding virtual currency. Therefore, if it is an active mining behavior. The cost caused by mining (mainly electricity costs) needs to be as low as possible to increase the benefits. Therefore, it generally chooses areas with lower electricity prices and periods with lower electricity prices to operate. However, if it is passive mining, the cost issue will not be considered. The intruder will use the computing resources in the server cluster or personal terminal to mine as much as possible before being discovered to obtain more virtual currency. Therefore, high-intensity mining operations will continue during periods with higher electricity prices. At the same time, the higher the electricity price, the stronger the economic development capacity of the corresponding area, and there will be server clusters or personal terminals with higher computing power, so it is also easier to be invaded. Therefore, passive mining activities performed by server clusters or personal terminals usually have greater energy consumption and cost expenditures than active mining behaviors.

[0096] Based on this feature, in this embodiment, by The consumption coefficient corresponding to the passive mining IP can be calculated. When the consumption coefficient is greater than the threshold, it further indicates that the server cluster or personal terminal corresponding to the IP is performing passive mining. Therefore, the passive mining IP can be further verified to improve the accuracy of identification.

[0097] As another possible embodiment of the present invention, the method further comprises the following steps:

[0098] A100: Analyze multiple target traffic data obtained in a preset collection period to generate a feature vector of each target traffic data. The feature vector includes the source IP, traffic generation time and submission task ID.

[0099] In this step, the method of acquiring the feature vector is the same as the method of acquiring the corresponding information by parsing the effective load in the corresponding traffic in S100 below, and will not be repeated here.

[0100] A200: Generate the job time series and total number of task submissions corresponding to each source IP based on the feature vector.

[0101] Specifically, according to the traffic generation time of multiple traffics of the mining machine submitted tasks, the operation time sequence corresponding to each source IP can be generated. In addition, the total number of corresponding task submissions can also be determined according to the obtained submitted task ID.

[0102] A300: If the interval between any two adjacent traffic generation times in the operation time sequence is greater than a second operation interval threshold, a segmentation process is performed between the two adjacent traffic generation times to generate at least one operation period corresponding to each source IP. Further, the second operation interval threshold is greater than the first operation interval threshold.

[0103] The specific segmentation process of this step may refer to the processing method from S701 to S703.

[0104] Because mining on a personal terminal will inevitably take up a large amount of computing resources and will also affect users who are doing normal work. Specifically, the response of the personal terminal becomes slow, and the user will usually deal with the personal terminal in a timely manner. Since users have little professional knowledge of personal terminal protection, they usually restore the fluency of the personal terminal by restarting the personal terminal, clearing the memory, etc. This operation process will cause the implanted mining program to not work properly, thereby reducing the number of completed tasks. The corresponding feature of the traffic for submitting tasks is that the interval between two task submissions is usually greater than the time specified by the conventional mining pool. Therefore, the second job interval threshold can be set to 20 minutes.

[0105] A400: Generate the first mining type identification degree corresponding to each source IP according to the operation period and the total number of task submissions corresponding to each source IP. Among them, the first mining type identification degree corresponding to the dth source IP is B d The following conditions must be met:

[0106] B d =K 2 *(E 1 d -K 3 *E 2 d )+K 4 *T L d / sum jd , K 2 >K 4 , K 3 >1

[0107] Among them, K 2 , K 3 and K 4 are the second amplitude adjustment coefficient, the third amplitude adjustment coefficient and the fourth amplitude adjustment coefficient respectively. 1 d is the number of operation periods that belong to the regular working period among the multiple operation periods corresponding to the d-th source IP. 2 d is the number of non-routine working hours among the multiple working hours corresponding to the d-th source IP. L d is the cumulative operation duration corresponding to the dth source IP. sum j d The total number of task submissions corresponding to the d-th source IP.

[0108] A500: If B d >Y 3 , then the dth source IP is determined to be a passive mining IP. 3 is the third identification threshold.

[0109] In order to increase profits during active mining, mining is usually carried out during low-peak hours (non-routine working hours) when electricity prices are low, so the corresponding traffic is usually generated during this period. For personal terminals, their startup period is usually during peak or off-peak hours (routine working hours) when electricity prices are high. Only at this time can the mining program implanted in the terminal start working and generate corresponding traffic. As a result, there is a big difference in the communication time periods between the two. In addition, the computing power configuration of personal terminals is usually smaller than that of mining machines dedicated to mining, so the amount of tasks submitted by personal terminals per unit time is also smaller.

[0110] Based on the above characteristics, the present invention adopts B d =K 2 *(E 1 d -K 3 *E 2 d )+K 4 *T L d / sum j d, the above two distinguishing factors can be converted into two corresponding summing factors to calculate the first mining type recognition degree corresponding to each device. Specifically, the first mining type recognition degree corresponding to the personal terminal will be greater than the first mining type recognition degree corresponding to the mining machine. Therefore, the personal terminal in the passive mining state can be more accurately determined by comparing the first mining type recognition degree with the threshold.

[0111] Furthermore, the feature vector package also includes a mining machine account ID, and the mining machine account ID includes a main account and a sub-device identifier.

[0112] After A400, the method also includes:

[0113] A600: Add the mining machine account ID corresponding to the same source IP in the feature vector corresponding to all target traffic data to the same account set to generate an IP account set corresponding to each source IP.

[0114] A700: Generate a second mining type identification corresponding to each source IP according to the IP account set corresponding to each source IP and the first mining type identification. Among them, the second mining type identification corresponding to the dth source IP is C d The following conditions must be met:

[0115] C d =K 5 *B d / sum h d .

[0116] Among them, K 5 is the fifth amplitude adjustment coefficient. h d The number of mining machine account ID types contained in the IP account set corresponding to the d-th source IP.

[0117] A800: If C d >Y 4 , then determine that the dth source IP is a passive mining IP. Send abnormal information to the terminal corresponding to the passive mining IP. 4 is the fourth identification threshold.

[0118] Usually, the computing power configuration of a personal terminal can only support the operation of one mining program, but there will be a large number of mining machines in a mining farm that can complete the mining. Therefore, the IP of a personal terminal usually only corresponds to one mining machine account ID. However, the IP of a mining farm will correspond to multiple mining machine account IDs.

[0119] Based on the above characteristics, the first mining type recognition degree can be further adjusted to increase the difference between the personal terminal and the second mining type recognition degree corresponding to the mining farm, thereby more accurately distinguishing the personal terminal in the passive mining state.

[0120] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0121] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0122] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0123] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0124] The electronic device according to this embodiment of the present invention is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0125] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor mentioned above, the at least one storage device mentioned above, and a bus connecting different system components (including storage devices and processors).

[0126] The storage stores program codes, which can be executed by the processor, so that the processor executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.

[0127] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).

[0128] The storage may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0129] The bus may represent one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.

[0130] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device (e.g., routers, modems, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0131] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0132] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0133] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0134] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0135] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0136] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0137] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0138] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0139] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for identifying cluster passive mining behavior based on traffic, characterized in that: The method comprises the following steps: Analyze multiple target flow data obtained in a preset collection period to generate a feature vector for each target flow data; the feature vector includes a source IP and a mining machine account ID, and the mining machine account ID includes a main account and a sub-device identifier; In the feature vectors corresponding to all target traffic data, the mining machine account ID corresponding to the same source IP is added to the same account set to generate an IP account set corresponding to each source IP; According to the main account type of the mining machine account ID contained in each IP account set, the IP account set is clustered to generate account groups corresponding to each IP account set; According to the number of sub-device identifiers contained in each account group and the number of IP account sets contained in each account group, the mining type recognition degree of each account group is generated; among which, the mining type recognition degree A corresponding to the i-th account group i The following conditions must be met: , Among them, A i ID A is the number of types of sub-device identifiers contained in the i-th account group; i IP is the number of types of IP account sets contained in the i-th account group; k1 is the first amplitude adjustment coefficient; If A i <Y1, it is determined that the source IP corresponding to the IP account set contained in the i-th account group is a passive mining IP; Y1 is the first identification threshold.

2. The method according to claim 1, characterized in that After determining that the source IP corresponding to the IP account set included in the i-th account group is a passive mining IP, the method further includes: Send abnormal information to the terminal corresponding to the passive mining IP.

3. The method according to claim 1, characterized in that After generating the mining type identification of each account group, the method further includes: If A i ≥Y1, then the source IP corresponding to the IP account set contained in the i-th account group is determined to be the active mining IP.

4. The method according to claim 1, characterized in that: Analyze multiple target flow data obtained in a preset collection period to generate a feature vector for each target flow data; including: According to the flow identifier corresponding to the preset mining communication protocol, the task submission flow generated by the mining machine submitting tasks to the mining pool during the preset period is obtained; Use the corresponding preset mining communication protocol to parse the task submission traffic and obtain the source IP and mining machine account ID that generate each task submission traffic.

5. The method according to claim 4, characterized in that The preset mining communication protocols include the Stratum protocol and the Getwork protocol.

6. The method according to claim 1, characterized in that According to the main account type of the mining machine account ID contained in each IP account set, the IP account set is clustered to generate account groups corresponding to each IP account set; including: Generate a set identifier corresponding to each IP account set based on the master account of all mining machine account IDs contained in each IP account set; Add the mining machine account IDs included in all IP account sets corresponding to each set identifier to the same cluster group, and generate an account group corresponding to each mining machine account ID master account; The source IP corresponding to all IP account sets corresponding to each set identifier is used as the source IP of the IP account set included in each account group.

7. The method according to claim 1, characterized in that The feature vector also includes: currency information, computing power information and traffic generation time; After determining that the source IP corresponding to the IP account set included in the i-th account group is a passive mining IP, the method further includes: Generate operation information corresponding to the passive mining IP according to the source IP, currency information, computing power information and traffic generation time in the feature vectors corresponding to the multiple target traffic data; the operation information includes computing power information and currency information corresponding to each operation period; According to the energy efficiency coefficient mapping table, the energy consumption index of the area corresponding to the passive mining IP and the operation information, the consumption coefficient of the passive mining IP in the preset collection period is generated; among which, the consumption coefficient W corresponding to the nth passive mining IP is n The following conditions must be met: , Among them, Has q N is the computing power value corresponding to the passive mining IP in the qth operation period; q T is the energy efficiency coefficient corresponding to the currency mined by the passive mining IP in the qth operation period; q is the total duration of the qth operation period; R q is the energy consumption index of the area corresponding to the passive mining IP in the qth operation period; If W n >Y2, the nth passive mining IP is determined to be a passive mining IP; Y2 is the second identification threshold.

8. The method according to claim 7, characterized in that Generate the operation information corresponding to the passive mining IP according to the source IP, currency information, computing power information and traffic generation time in the feature vector corresponding to the multiple target traffic data; including: Generate a job time sequence corresponding to the passive mining IP according to the traffic generation time in the feature vector corresponding to the passive mining IP; When the difference between any two adjacent traffic generation times is greater than the first operation interval threshold, a time segmentation mark is generated between the two adjacent traffic generation times; At least one operation time period corresponding to the passive mining IP is generated according to the time period segmentation identifier.

9. A non-transitory computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for identifying cluster passive mining behavior based on traffic is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for identifying cluster passive mining behavior based on traffic is implemented as described in any one of claims 1 to 8.