A terminal passive block mining and identification method, medium and device based on flow
By analyzing traffic data and feature vectors and identifying passive block mining IP, the problems of high energy consumption during block mining and difficult to identify passive block mining are solved, and more accurate management and energy conservation and emission reduction are achieved.
Patent Information
- Application Number
- CN202410156630.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-02-04
AI Technical Summary
The block mining process occupies a large amount of computing resources and energy, resulting in high energy consumption and carbon emissions, and it is difficult to accurately identify and manage passive block mining activities, affecting economic and social development and energy conservation and emission reduction.
Using the terminal passive block mining recognition method based on traffic, the characteristic vectors of the target traffic data are analyzed, the job time series and the total number of task submissions are generated, the block mining type recognition degree is calculated, and the currency information and computing power information are combined to determine the passive Block mining IP and send exception information.
It improves the accuracy of identification of passive block mining activities, reduces energy consumption and carbon emissions, achieves more precise management of block mining activities, and reduces financial risks.
Smart Images

Figure QLYQS_1 
Figure GDA0004764791620000031 
Figure GDA0004764791620000081
Abstract
Description
Background Art
[0002] Block mining (also known as the distributed consensus process) is the process of confirming transactions that occur in the blockchain digital currency system over a period of time and recording them on the block to form a new block. Simply put, block mining is the process of bookkeeping: the person or organization that participates in the blockchain network through computing power competition to complete block packaging and verification transactions is the bookkeeper, and the blockchain is the account book. Taking blockchain digital currency as an example, the blockchain digital currency blockchain bookkeeping is decentralized, that is, each person or organization that participates in the blockchain network through computing power competition to complete block packaging and verification transactions has the right to bookkeeping. The person or organization that participates in the blockchain network through computing power competition to complete block packaging and verification transactions uses the hardware computer system and the algorithm to lock the corresponding position of the blockchain digital currency to obtain the right to bookkeeping. After successfully grabbing the right to bookkeeping, the person or organization that participates in the blockchain network through computing power competition to complete block packaging and verification transactions will receive the system's new blockchain digital currency reward.
[0003] However, the block 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 block mining to the national economy, its role in driving industrial development and scientific and technological progress is limited. In addition, the financial risks derived from the production and trading of digital 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.
[0004] Under this influence, it is necessary to restrict and crack down on block mining activities. Currently, there are active block mining and passive block mining in block mining activities. Passive block mining mainly refers to the block mining activities carried out by terminal devices that are hacked and controlled by hackers after the corresponding block mining program is implanted. Usually, due to the low protection ability of personal terminals, hackers usually choose some personal terminals with higher computing power configuration to invade, and implant the corresponding block mining program into the terminal, turning it into the corresponding hardware device for mining digital currency for passive block mining. Because the block mining work characteristics of personal terminals when performing block mining operations are highly similar to the block mining work characteristics of hardware devices for mining digital currency for active block mining when performing block mining operations. Therefore, it is not possible to more accurately determine and distinguish the passive block mining performed by personal terminals, which is not convenient for more accurate and effective investigation and management of block mining activities. Summary of the invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is:
[0006] According to one aspect of the present invention, a method for mining and identifying terminal passive blocks based on traffic is provided, and the method comprises the following steps:
[0007] The multiple target traffic data obtained in the preset collection period are analyzed to generate a feature vector for each target traffic data. The feature vector includes the source IP, traffic generation time and submission task ID.
[0008] Based on the feature vector, the job time series and the total number of task submissions corresponding to each source IP are generated.
[0009] If the interval between any two adjacent traffic generation times in the operation time sequence is greater than the second operation interval threshold, segmentation processing is performed between the two adjacent traffic generation times to generate at least one operation period corresponding to each source IP.
[0010] According to the operation period and total number of task submissions corresponding to each source IP, the first block mining type identification degree corresponding to each source IP is generated. Among them, the first block mining type identification degree B corresponding to the dth source IP d The following conditions must be met:
[0011] B d =K2*(E1 d -K3*E2 d )+K4*T L d / sum j d , K2>K4, K3>1
[0012] Among them, K2, K3 and K4 are the second amplitude adjustment coefficient, the third amplitude adjustment coefficient and the fourth amplitude adjustment coefficient respectively. d E2 is the number of regular working hours among the multiple working hours corresponding to the d-th source IP. 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.
[0013] If B d >Y3, the dth source IP is determined to be a passive block mining IP. Y3 is the third identification threshold.
[0014] Furthermore, the feature vector package also includes a hardware device account ID for mining digital currency, and the hardware device account ID for mining digital currency includes a main account and a sub-device identifier.
[0015] After generating the first block mining type identification corresponding to each source IP according to the operation period and the total number of task submissions corresponding to each source IP, the method further includes:
[0016] In the feature vectors corresponding to all target traffic data, the account IDs of the hardware devices for mining digital currency corresponding to the same source IP are added to the same account set to generate an IP account set corresponding to each source IP.
[0017] According to the IP account set corresponding to each source IP and the first block mining type identification, the second block mining type identification corresponding to each source IP is generated. Among them, the second block mining type identification C corresponding to the dth source IP d The following conditions must be met:
[0018] C d =K5*B d / sum h d .
[0019] Wherein, K5 is the fifth amplitude adjustment coefficient. h d The number of types of hardware device account IDs for mining digital currency contained in the IP account set corresponding to the d-th source IP.
[0020] If C d >Y4, the dth source IP is determined to be a passive block mining IP. Y4 is the fourth identification threshold.
[0021] Further, after determining that the dth source IP is a passive block mining IP, the method further includes:
[0022] Send abnormal information to the terminal corresponding to the passive block mining IP.
[0023] Furthermore, multiple target flow data acquired in a preset collection period are analyzed to generate a feature vector of each target flow data. Including:
[0024] According to the traffic identifier corresponding to the preset block mining communication protocol, the task submission traffic of the hardware device for mining digital currency generated in the preset time period to submit tasks to the block packaging and verification transaction task publishing terminal is obtained.
[0025] Use the corresponding preset block mining communication protocol to parse the task submission traffic and obtain the source IP, traffic generation time and submission task ID of each task submission traffic.
[0026] Furthermore, the preset block mining communication protocols include the Stratum protocol and the Getwork protocol.
[0027] Furthermore, the feature vector also includes: currency information and computing power information.
[0028] After determining that the dth source IP is a passive block mining IP, the method further includes:
[0029] 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 block mining IP is generated. The operation information includes the computing power information and currency information corresponding to each operation period.
[0030] According to the energy efficiency coefficient mapping table, the energy consumption index of the area corresponding to the passive block mining IP and the operation information, the consumption coefficient of the passive block mining IP in the preset collection period is generated. Among them, the consumption coefficient W corresponding to the nth passive block mining IP is n The following conditions must be met:
[0031]
[0032] Among them, Has q It is the computing power value corresponding to the passive block mining IP in the qth operation period. q It is the energy efficiency coefficient corresponding to the currency mined by the passive block 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 block mining IP in the qth operation period.
[0033] If W n >Y2, the nth passive block mining IP is determined to be a passive block mining IP. Y2 is the second identification threshold.
[0034] 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 block mining IP is generated. Including:
[0035] According to the traffic generation time in the feature vector corresponding to the passive block mining IP, the job time series corresponding to the passive block mining IP is generated.
[0036] 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.
[0037] At least one operation period corresponding to the passive block mining IP is generated according to the period segmentation identifier.
[0038] Furthermore, the second operation interval threshold is greater than the first operation interval threshold.
[0039] 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 terminal passive block mining and identification method based on traffic is implemented.
[0040] 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 traffic-based terminal passive block mining and identification method when executing the computer program.
[0041] The present invention has at least the following beneficial effects:
[0042] In order to increase profits, active block mining is usually carried out during low-peak electricity consumption periods (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 electricity consumption periods (routine working hours) when electricity prices are higher. Only at this time can the block mining program implanted in the terminal start working and generate corresponding traffic. As a result, there is a big difference in the communication periods between the two. In addition, the computing power configuration of personal terminals is usually smaller than the computing power configuration of hardware devices dedicated to mining digital currencies for block mining, so the amount of tasks submitted by personal terminals per unit time is also smaller.
[0043] Based on the above characteristics, the present invention adopts B d =K2*(E1 d -K3*E2 d )+K4*T L d / sum j d , the above two distinguishing factors can be converted into two corresponding summing factors to calculate the first block mining type recognition degree corresponding to each device. Specifically, the first block mining type recognition degree corresponding to the personal terminal will be greater than the first block mining type recognition degree corresponding to the hardware device for mining digital currency. Therefore, the first block mining type recognition degree can be compared with the threshold to more accurately determine the personal terminal in the passive block mining state. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] 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.
[0045] Figure 1A flow chart of a method for mining and identifying terminal passive blocks based on traffic is provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0046] 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.
[0047] As a possible embodiment of the present invention, Figure 1 As shown, a terminal passive block mining and identification method based on traffic is provided, and the method comprises the following steps:
[0048] 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.
[0049] 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.
[0050] A200: Generate the job time series and total number of task submissions corresponding to each source IP based on the feature vector.
[0051] Specifically, according to the traffic generation time of multiple traffics submitted by the hardware device for mining digital currency, the job 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.
[0052] 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.
[0053] The specific segmentation process of this step may refer to the processing method from S701 to S703.
[0054] Because when performing block mining on a personal terminal, it will inevitably occupy a large amount of computing resources and will also affect users who are performing normal work. Specifically, the response of the personal terminal becomes slow, and at this time the user usually handles 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 block 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 block packaging and verification transaction task publishing terminal. Therefore, the second job interval threshold can be set to 20 minutes.
[0055] A400: Generate the first block 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 block mining type identification degree corresponding to the dth source IP is B d The following conditions must be met:
[0056] B d =K2*(E1 d -K3*E2 d )+K4*T L d / sum j d , K2>K4, K3>1
[0057] Among them, K2, K3 and K4 are the second amplitude adjustment coefficient, the third amplitude adjustment coefficient and the fourth amplitude adjustment coefficient respectively. d E2 is the number of regular working hours among the multiple working hours corresponding to the d-th source IP. 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.
[0058] A500: If B d >Y3, the dth source IP is determined to be a passive block mining IP. Y3 is the third identification threshold.
[0059] In order to increase profits, active block mining is usually carried out during low-peak electricity consumption periods (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 electricity consumption periods (routine working hours) when electricity prices are higher. Only at this time can the block mining program implanted in the terminal start working and generate corresponding traffic. As a result, there is a big difference in the communication periods between the two. In addition, the computing power configuration of personal terminals is usually smaller than the computing power configuration of hardware devices dedicated to mining digital currencies for block mining, so the amount of tasks submitted by personal terminals per unit time is also smaller.
[0060] Based on the above characteristics, the present invention adopts B d =K2*(E1 d -K3*E2 d )+K4*T L d / sum j d , the above two distinguishing factors can be converted into two corresponding summing factors to calculate the first block mining type recognition degree corresponding to each device. Specifically, the first block mining type recognition degree corresponding to the personal terminal will be greater than the first block mining type recognition degree corresponding to the hardware device for mining digital currency. Therefore, the first block mining type recognition degree can be compared with the threshold to more accurately determine the personal terminal in the passive block mining state.
[0061] Furthermore, the feature vector package also includes a hardware device account ID for mining digital currency, and the hardware device account ID for mining digital currency includes a main account and a sub-device identifier.
[0062] After A400, the method also includes:
[0063] A600: In the feature vectors corresponding to all target traffic data, the account IDs of the hardware devices for mining digital currency corresponding to the same source IP are added to the same account set to generate an IP account set corresponding to each source IP.
[0064] A700: Generate the second block mining type identification corresponding to each source IP according to the IP account set corresponding to each source IP and the first block mining type identification. Among them, the second block mining type identification C corresponding to the dth source IP d The following conditions must be met:
[0065] C d =K5*B d / sum h d .
[0066] Wherein, K5 is the fifth amplitude adjustment coefficient. h d The number of types of hardware device account IDs for mining digital currency contained in the IP account set corresponding to the d-th source IP.
[0067] A800: If C d >Y4, the dth source IP is determined to be a passive block mining IP. An abnormal message is sent to the terminal corresponding to the passive block mining IP. Y4 is the fourth identification threshold.
[0068] Usually, the computing power configuration of a personal terminal can only support the operation of one block mining program, but a block mining device cluster will have a large number of hardware devices for mining digital currencies that can perform block mining. Therefore, the IP of a personal terminal usually only corresponds to one hardware device account ID for mining digital currencies. However, the IP of a block mining device cluster will correspond to multiple hardware device account IDs for mining digital currencies.
[0069] Based on the above characteristics, the first block mining type recognition degree can be further adjusted to increase the difference between the personal terminal and the second block mining type recognition degree corresponding to the block mining device cluster, thereby more accurately distinguishing the personal terminal in the passive block mining state.
[0070] As another possible embodiment of the present invention, the feature vector also includes: currency information, computing power information and traffic generation time.
[0071] The currency information can be obtained by the following methods:
[0072] When a person or organization that participates in the blockchain network and completes the block packaging and verification transaction through computing power competition connects to the block packaging and verification transaction task release terminal for communication, the person or organization that participates in the blockchain network and completes the block packaging and verification transaction through computing power competition will first resolve the block packaging and verification transaction task release terminal IP information to the corresponding block packaging and verification transaction task release terminal domain name through the DNS server. According to the instruction characteristics and communication process of the Stratum protocol, Getwork protocol and other block mining communication protocols, through the block mining instructions of the relevant protocols, the source IP information and source port information or the destination IP information and destination port information in the data message are judged, and the IP and port information of the block packaging and verification transaction task release terminal and the IP and port information of the person or organization that participates in the blockchain network and completes the block packaging and verification transaction through computing power competition are inferred. The IP information of the block packaging and verification transaction task release terminal is subjected to relevant reverse domain name resolution to obtain the domain name information of the block packaging and verification transaction task release terminal to which it is connected. Generally, the subdomain of the block packaging and verification transaction task release terminal can carry its related currency information, such as btc.f2pool.com, eth-asia1.nanopool.org, etc. The subdomain of some block packaging and verification transaction task release terminals does not contain currency or the currency information is not obvious, and its corresponding currency information can also be inferred based on the port number of the domain name and the homepage information of the block packaging and verification transaction task release terminal.
[0073] The hashrate information can be obtained by:
[0074] a) eth_submitHashrate instruction speculation. According to the eth_submitHashrate instruction of the Getwork protocol, the computing power information of people or organizations participating in the blockchain network who complete block packaging and verify transactions through computing power competition during computing tasks can be obtained through data packets. The computing power value is expressed in hexadecimal. Generally, the computing power of a single device or graphics card for block mining is approximately within the unit range of MH / S, and the value with large deviation can be ignored or discarded.
[0075] b) Speculation by 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 people or organizations participating in the blockchain network through computing power competition when completing block packaging and verification transactions during computing tasks can be obtained through data packets. In order to save space for transmitting data, some block packaging and verification transaction task publishing terminals set the difficulty value size of the transmission mining.set_difficulty or mining.suggest_difficulty to 2 bytes, that is, the maximum difficulty value sent by the block packaging and verification transaction task publishing terminal to the people or organizations participating in the blockchain network through computing power competition to complete block packaging and verification transactions 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:
[0076]
[0077] If the block mining time of the IP of the person or organization participating in the blockchain network to complete block packaging and verify transactions through computing power competition is continuous, the unit time t of the block 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_min And the number of times the instruction is submitted is represented, where the time unit is seconds. Factor is the impact factor of the block mining algorithm corresponding to the digital currency. Specifically, the impact factors corresponding to different digital currency block mining algorithms are shown in Table 1:
[0078] Table 1
[0079] Digital currency name Block mining algorithm Impact Factor BCH SHA256 2^32 DCR Blake256 2^32 LTC Scrypt 2^16 ZCash EquiHash 2^13
[0080] After A500, the method also includes:
[0081] S700: Generate operation information corresponding to the passive block 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.
[0082] Specifically, S700 includes:
[0083] S701: Generate a job time sequence corresponding to the passive block mining IP according to the traffic generation time in the feature vector corresponding to the passive block mining IP.
[0084] 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.
[0085] S703: Generate at least one operation period corresponding to the passive block mining IP according to the period segmentation identifier.
[0086] S800: Generate the consumption coefficient of the passive block 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 block mining IP, and the operation information. Among them, the consumption coefficient W corresponding to the nth passive block mining IP n The following conditions must be met:
[0087]
[0088] Among them, Has q It is the computing power value corresponding to the passive block mining IP in the qth operation period. q It is the energy efficiency coefficient corresponding to the currency mined by the passive block 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 block mining IP in the qth operation period.
[0089] The energy efficiency coefficient in this step is the energy efficiency ratio under different computing power when mining a certain block currency, that is, the ratio between power consumption and computing power. This value can be obtained by a technician in this field after investigating the computing power value and energy consumption value of existing block mining. And a corresponding energy efficiency coefficient mapping table can be generated. In this embodiment, the energy efficiency coefficient value range corresponding to the hardware equipment for mining digital currency with common blockchain digital currency 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 common digital currency mining digital currency hardware equipment should be between 0.2-0.9, in units of KWS / MH, and preferably, the energy efficiency coefficient value is 0.37.
[0090] The energy consumption index may be the electricity price of the area corresponding to the IP in each time period.
[0091] S900: If W n >Y2, the nth passive block mining IP is determined to be a passive block mining IP. Y2 is the second identification threshold.
[0092] Since block mining itself is to obtain corresponding benefits by obtaining corresponding digital currency. Therefore, if it is an active block mining behavior. The cost of block 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 block mining, the cost issue will not be considered. The intruder will use the computing resources in the server cluster or personal terminal to perform block mining operations as much as possible before being discovered to obtain more digital currency. Therefore, high-intensity block 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 block mining activities performed by server clusters or personal terminals usually have greater energy consumption and cost expenditures than active block mining behaviors.
[0093] Based on this feature, in this embodiment, by The consumption coefficient corresponding to the passive block 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 block mining. Therefore, the passive block mining IP can be further verified to improve the accuracy of identification.
[0094] As another possible embodiment of the present invention, the method further comprises the following steps:
[0095] S100: Analyze multiple target traffic data obtained in a preset collection period to generate a feature vector for each target traffic data. The feature vector includes a source IP and a hardware device account ID for mining digital currency, and the hardware device account ID for mining digital currency includes a main account and a sub-device identifier.
[0096] Specifically, the preset collection time period can be set according to the actual scenario, such as one day.
[0097] Since the network traffic of most block packaging and verification transaction task issuing terminal communication protocols is mainly in plain text and contains relatively obvious instruction identifiers, it is possible to collect the communication information between the block packaging and verification transaction task issuing terminal and the people or organizations participating in the blockchain network who complete the block packaging and verification transactions through computing power competition and the block packaging and verification transaction task issuing terminal by screening the traffic corresponding to the target block packaging and verification transaction task issuing terminal domain name.
[0098] In this embodiment, the principle flow of mainstream Stratum protocol, Getwork protocol and other block mining communication protocols can be summarized. The flow information content corresponding to the instruction identifier of the terminal protocol for publishing different block packaging and verification transaction tasks can be extracted. Such as currency information, account device quantity information, computing power information, energy consumption information and other block mining features for subsequent calculations.
[0099] Specifically, S100 includes:
[0100] S101: According to the flow identifier corresponding to the preset block mining communication protocol, the task submission flow of the hardware device for mining digital currency generated in the preset period of time to submit tasks to the block packaging and verification transaction task publishing terminal is obtained. The preset block mining communication protocol includes the Stratum protocol and the Getwork protocol.
[0101] At present, mainstream block packaging and verification transaction task release terminals such as blockchain digital currency and Litecoin usually adopt the Stratum protocol, which enables people or organizations participating in the blockchain network who complete block packaging and verification transactions through computing power competition to obtain computing tasks from the block packaging and verification transaction task release terminal more efficiently and reliably. The protocol data is encapsulated in JSON format. Most of the block packaging and verification transaction task release terminals of other currencies also use this protocol for communication, and at the same time, partially modify and adjust the protocol according to their own needs. The block mining block packaging and verification transaction task release terminal mainly uses the Getwork protocol. Some block mining block packaging and verification transaction task release terminals, such as NiceHash, have been improved according to the Stratum protocol specification, and a block mining version of the Stratum protocol has also been formed.
[0102] S102: Use the corresponding preset block mining communication protocol to parse the task submission traffic, obtain the source IP that generates each task submission traffic and the hardware device account ID for mining digital currency.
[0103] Under the restriction of the corresponding communication protocol, when the person or organization participating in the blockchain network who completes the block packaging and verification transaction through computing power competition performs identity authentication, task subscription and submits tasks to the block packaging and verification transaction task publishing terminal, the corresponding communication traffic will be formed 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 person or organization participating in the blockchain network who completes the block packaging and verification transaction through computing power competition calculates the task that meets the shares, the task is submitted to the block packaging and verification transaction task publishing terminal through the mining.submit instruction. The data format of the task submitted by the person or organization participating in the blockchain network who completes the block packaging and verification transaction through computing power competition should at least include the hardware device account ID of the digital currency mining, the generation time (timestamp) of the traffic, and the public network IP address of the person or organization participating in the blockchain network who completes the block packaging and verification transaction through computing power competition.
[0104] Usually, in order to increase the success rate of block mining, a block mining device cluster has multiple hardware devices for mining digital currency, and each hardware device for mining digital currency will correspond to a separate hardware device account ID for mining digital currency. Usually, in order to better distinguish each hardware device for mining digital currency, the hardware device account ID for mining digital currency will be set to two parts, one part is the main account, and the other part is the sub-device identifier, and the two parts are connected by a connector (such as an English period). For example, ABCD.01, ABCD.02, etc.
[0105] S200: In the feature vectors corresponding to all target traffic data, the account IDs of the hardware devices for mining digital currency corresponding to the same source IP are added to the same account set, and an IP account set corresponding to each source IP is generated.
[0106] Usually, not every hardware device for mining digital currency can complete the corresponding computing task within the specified time. Therefore, when sending the task submission information, some of the hardware devices for mining digital currency will not upload information, and the corresponding hardware device account ID for mining digital currency will not appear. Therefore, this step is required to collect all the hardware device IDs for mining digital currency contained in each source IP together to ensure the integrity of the hardware device account ID for mining digital currency.
[0107] S300: Clustering IP account sets according to the main account types of the hardware device account IDs for mining digital currency contained in each IP account set, and generating account groups corresponding to each IP account set.
[0108] Specifically, S300 includes:
[0109] S301: Generate a set identifier corresponding to each IP account set based on the master account of all hardware device account IDs for mining digital currency contained in each IP account set.
[0110] S302: Add the account IDs of the hardware devices for mining digital currency included in all IP account sets corresponding to each set identifier to the same cluster group, and generate an account group corresponding to the main account of each hardware device account ID for mining digital currency.
[0111] 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.
[0112] Since the public IP used by the block mining equipment cluster is basically a proxy IP, other IPs will be replaced after a period of use. Therefore, in the communication traffic between the block mining equipment cluster and the block packaging and verification transaction task publishing terminal, there will be a flow data corresponding to a source IP, and there will be multiple hardware equipment account IDs for mining digital currencies. And due to the replacement of the proxy IP, there will also be situations in the traffic data where different source IPs correspond to the same type of hardware equipment account IDs for mining digital currencies.
[0113] As for the service cluster for passive block mining, the number of servers in the server cluster is much smaller than the number of hardware devices for mining digital currency in the block mining device cluster. Therefore, the types of hardware device account IDs for mining digital currency in the IP account set corresponding to the source IP of the service cluster are smaller than the types of hardware device account IDs for mining digital currency in the IP account set corresponding to the source IP of the block mining device cluster. Moreover, since the public network IP corresponding to the service cluster is a fixed IP, the types of source IPs corresponding to the hardware device account IDs for mining digital currency of the same type (the same IP account set) are even fewer. Usually one or two.
[0114] Therefore, after clustering, the number of types of hardware device account IDs and source IPs for mining digital currency contained in the account group corresponding to the block mining device cluster are greater than the number of types of hardware device account IDs and source IPs for mining digital currency contained in the account group corresponding to the server cluster.
[0115] S400: Generate the block 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:
[0116]
[0117] Among them, A i ID A is the number of sub-device identifiers included in the i-th account group. i IP is the number of types of IP account sets contained in the ith account group. k1 is the first amplitude adjustment coefficient.
[0118] S500: If A i <Y1, then the source IP corresponding to the IP account set included in the i-th account group is determined to be a passive block mining IP. Y1 is the first identification threshold.
[0119] S501: 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 block mining IP.
[0120] S600: Send abnormal information to the terminal corresponding to the passive block mining IP.
[0121] The present invention is achieved by The above two features are converted into corresponding reference factors, and the block 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 for passive block mining. Therefore, by setting the corresponding threshold, the corresponding block mining can be more accurately identified, whether it is passive block mining initiated by the server cluster or active block mining by the block mining device cluster. And send the corresponding early warning reminder information to the corresponding passive block mining terminal through S600 to remind the corresponding security personnel to perform corresponding maintenance on the server cluster.
[0122] 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.
[0123] 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.
[0124] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0125] 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".
[0126] 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.
[0127] 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).
[0128] 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.
[0129] 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).
[0130] 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.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] 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).
[0139] 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.
[0140] 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.
[0141] 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 terminal passive block mining and identification method based on traffic, characterized in that: The method comprises the following steps: Analyze multiple target traffic data obtained in a preset collection period to generate a feature vector for each target traffic data; the feature vector includes a source IP, traffic generation time, and submission task ID; Generate a job time sequence and a total number of task submissions corresponding to each source IP according to the feature vector; If the interval between any two adjacent traffic generation times in the operation time sequence is greater than the 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; According to the operation period and total number of task submissions corresponding to each source IP, the first block mining type identification degree corresponding to each source IP is generated; among which, the first block mining type identification degree B corresponding to the dth source IP is d The following conditions must be met: B d =K2×(E1 d -K3×E2 d )+K4×T L d / sum j d ,K2>K4,K3>1 Among them, K2, K3 and K4 are the second amplitude adjustment coefficient, the third amplitude adjustment coefficient and the fourth amplitude adjustment coefficient respectively; E1 d E2 is the number of operation periods that belong to regular working periods among the multiple operation periods corresponding to the d-th source IP; d is the number of non-routine working hours among the multiple working hours corresponding to the d-th source IP; T 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; If B d >Y3, the dth source IP is determined to be a passive block mining IP; Y3 is the third identification threshold.
2. The method according to claim 1, characterized in that: The feature vector also includes an account ID of a hardware device for mining digital currency, and the account ID of the hardware device for mining digital currency includes a main account and a sub-device identifier; After generating the first block mining type identification corresponding to each source IP according to the operation period and the total number of task submissions corresponding to each source IP, the method further includes: In the feature vectors corresponding to all target traffic data, the account IDs of the hardware devices for mining digital currency corresponding to the same source IP are added to the same account set to generate an IP account set corresponding to each source IP; According to the IP account set corresponding to each source IP and the first block mining type identification, the second block mining type identification corresponding to each source IP is generated; wherein the second block mining type identification C corresponding to the dth source IP d The following conditions must be met: C d =K5×B d / sum h d ; Wherein, K5 is the fifth amplitude adjustment coefficient; sum h d is the number of types of hardware device account IDs for mining digital currency contained in the IP account set corresponding to the dth source IP; If C d >Y4, then the dth source IP is determined to be a passive block mining IP; Y4 is the fourth identification threshold.
3. The method according to claim 1, characterized in that After determining that the dth source IP is a passive block mining IP, the method further includes: Send abnormal information to the terminal corresponding to the passive block 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 traffic identifier corresponding to the preset block mining communication protocol, the task submission traffic of the hardware device for mining digital currency generated in the preset period of time to submit tasks to the block packaging and verification transaction task publishing terminal is obtained; Use the corresponding preset block mining communication protocol to parse the task submission traffic and obtain the source IP, traffic generation time and submission task ID of each task submission traffic.
5. The method according to claim 4, characterized in that The preset block mining communication protocols include the Stratum protocol and the Getwork protocol.
6. The method according to claim 1, characterized in that The feature vector also includes: currency information and computing power information; After determining that the dth source IP is a passive block mining IP, the method further includes: Generate operation information corresponding to the passive block 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 block mining IP and the operation information, the consumption coefficient of the passive block mining IP in the preset collection period is generated; among which, the consumption coefficient W corresponding to the nth passive block mining IP is n The following conditions must be met: Among them, Has q N is the computing power value corresponding to the passive block mining IP in the qth operation period; q T is the energy efficiency coefficient corresponding to the currency mined by the passive block mining IP in the qth operation period; q is the total duration of the qth operation period; R q The energy consumption index of the area corresponding to the passive block mining IP in the qth operation period; If W n >Y2, the nth passive block mining IP is determined to be a passive block mining IP; Y2 is the second identification threshold.
7. The method according to claim 6, characterized in that Generate the job information corresponding to the passive block 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 block mining IP according to the traffic generation time in the feature vector corresponding to the passive block 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 period corresponding to the passive block mining IP is generated according to the period segmentation identifier.
8. The method according to claim 7, characterized in that The second job interval threshold is greater than the first job interval threshold.
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 terminal passive block mining and identification method based on traffic is implemented as described in any one of claims 1 to 8.
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 terminal passive block mining and identification method based on traffic is implemented as described in any one of claims 1 to 8.
