Virtual resource early warning processing method, related device and medium
By classifying, statistical and predicting the virtual resource affairs on the blockchain, the problem of insufficient safety in the handling of virtual resource affairs has been solved, and timely early warning and risk management of the total amount of virtual resources are realized.
Patent Information
- Application Number
- CN202411261562.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-10
AI Technical Summary
In the prior art, the security of virtual resource transactions on the blockchain cannot be effectively guaranteed, resulting in risks in virtual resource transaction processing.
By obtaining historical virtual resource affairs on the blockchain, classification and statistics are classified and statistical, correlation parameters are determined, the training predictive models are trained, the current virtual resource is predicted, and early warnings are issued based on the prediction results to improve the safety of virtual resource affairs.
Effectively improve the safety of virtual resource transactions on the blockchain, and timely respond to changes in the total virtual resources through the early warning mechanism, reducing risks.
Smart Images

Figure CN119377063A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a virtual resource early warning processing method, related devices and media. Background Art
[0002] At present, blockchain is often used to record virtual resource transactions. Users participate in virtual resource transactions. Virtual resource transactions are recorded on the blockchain. In the prior art, the security of users participating in virtual resource transactions cannot be guaranteed. A technology that improves the security of virtual resource transaction processing on the blockchain is needed. Summary of the invention
[0003] The disclosed embodiments provide a virtual resource early warning processing method, related devices and media, which can improve the security of virtual resource transaction processing on the blockchain.
[0004] According to one aspect of the present disclosure, a virtual resource early warning processing method is provided, comprising:
[0005] Obtaining a historical virtual resource transaction recorded on the target blockchain, and obtaining a historical transaction attribute from a historical transaction attribute field in the historical virtual resource transaction;
[0006] Classifying the historical virtual resource transactions based on the historical transaction attributes to obtain virtual resource transaction classes;
[0007] Based on each historical virtual resource transaction in the virtual resource transaction class, determining first historical values of multiple on-chain statistical parameters of the virtual resource transaction class;
[0008] For each of the on-chain statistical parameters, based on the first historical value of the on-chain statistical parameter, determine the correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain, and based on the correlation coefficient corresponding to each virtual resource transaction class, determine the overall correlation parameter of the on-chain statistical parameter;
[0009] Determine a target on-chain statistical parameter from among the multiple on-chain statistical parameters based on the overall correlation parameter of each of the on-chain statistical parameters;
[0010] Training a target prediction model based on the first historical value of the statistical parameter on the target chain;
[0011] The actual value of the statistical parameter on the target chain at the current time is obtained, the actual value is input into the target prediction model, the current predicted total amount of virtual resources on the target blockchain is obtained, and an early warning is issued based on the current predicted total amount of virtual resources.
[0012] According to one aspect of the present disclosure, a virtual resource early warning processing device is provided, comprising:
[0013] A first acquisition unit is used to acquire historical virtual resource transactions recorded on a target blockchain, and acquire historical transaction attributes from a historical transaction attribute field in the historical virtual resource transactions;
[0014] A classification unit, used for classifying the historical virtual resource transactions based on the historical transaction attributes to obtain virtual resource transaction classes;
[0015] A first determining unit, configured to determine first historical values of a plurality of on-chain statistical parameters of the virtual resource transaction class based on each historical virtual resource transaction in the virtual resource transaction class;
[0016] A second determination unit is used to determine, for each of the on-chain statistical parameters, a correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain based on the first historical value of the on-chain statistical parameter, and determine an overall correlation parameter of the on-chain statistical parameter based on the correlation coefficient corresponding to each virtual resource transaction class;
[0017] A third determining unit, configured to determine a target on-chain statistical parameter from among the multiple on-chain statistical parameters based on the overall correlation parameter of each of the on-chain statistical parameters;
[0018] A training unit, configured to train a target prediction model based on the first historical value of the statistical parameter on the target chain;
[0019] The second acquisition unit is used to obtain the actual value of the statistical parameter on the target chain at the current time, input the actual value into the target prediction model, obtain the current predicted total amount of virtual resources on the target blockchain, and issue an early warning based on the current predicted total amount of virtual resources.
[0020] Optionally, the first acquiring unit is specifically configured to:
[0021] Obtain the historical virtual resource blocks on the target blockchain;
[0022] The historical virtual resource blocks are decomposed into the historical virtual resource transactions.
[0023] Optionally, the historical transaction attribute is a historical transaction type;
[0024] The classification unit is specifically used for:
[0025] The historical virtual resource transactions of the same historical transaction type are classified into the same virtual resource transaction class.
[0026] Optionally, the historical transaction attribute is a plurality of historical transaction attributes, and the classification unit is specifically used to:
[0027] Based on the multiple historical transaction attributes of the historical virtual resource transactions, the multiple historical virtual resource transactions are clustered using a clustering algorithm to obtain the virtual resource transaction class.
[0028] Optionally, the first determining unit is specifically configured to:
[0029] In each historical time period, based on each historical virtual resource transaction in the virtual resource transaction class obtained in the historical time period, determine the first historical sub-values of the multiple on-chain statistical parameters corresponding to the historical time period;
[0030] For a single on-chain statistical parameter, a first historical sub-value vector is generated based on the first historical sub-values obtained in each historical time period as the first historical value of the on-chain statistical parameter.
[0031] Optionally, the second determining unit is specifically configured to:
[0032] Obtaining a correlation coefficient function, where the correlation coefficient function is a function of the first historical value and the total amount of virtual resources on the target blockchain;
[0033] Obtaining the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0034] Substituting the first historical value and the total amount of virtual resources on the target blockchain into the correlation coefficient function, the correlation coefficient is obtained.
[0035] Optionally, the second determining unit is further configured to:
[0036] Obtain the number of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0037] Obtaining the unit resource quantity represented by a single virtual resource in the historical time period;
[0038] Based on the number of virtual resources on the target blockchain and the unit resource amount, determine the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value.
[0039] Optionally, the second determining unit is further configured to:
[0040] The determining of the overall correlation parameter of the on-chain statistical parameter based on the correlation coefficient corresponding to each virtual resource transaction class includes:
[0041] Get the class weight of each virtual resource transaction class;
[0042] Based on the correlation coefficients and class weights of the various virtual resource transaction classes, the overall correlation parameters of the on-chain statistical parameters are calculated.
[0043] Optionally, the third determining unit is specifically configured to:
[0044] The on-chain statistical parameter with the largest overall correlation parameter is determined as the target on-chain statistical parameter.
[0045] Optionally, the target prediction model is a linear regression model, and the linear regression model has a linear coefficient and an offset;
[0046] The training unit is specifically used for:
[0047] determining a first logarithm of the first historical value;
[0048] Obtaining the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0049] Determining a second logarithm of the total amount of virtual resources on the target blockchain;
[0050] The first logarithm is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model to solve the linear coefficient and the offset.
[0051] Optionally, the target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet predetermined conditions; the linear regression model has multiple linear coefficients corresponding to the multiple target chain statistical parameters respectively;
[0052] The training unit is further specifically used for:
[0053] Determine the first logarithm of each of the plurality of first historical values of the statistical parameters on the plurality of target chains;
[0054] The first logarithm of each of the multiple first historical values of the statistical parameters on the multiple target chains is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model to solve the offset and the linear coefficients corresponding to the statistical parameters on each target chain.
[0055] Optionally, the second acquiring unit is specifically configured to:
[0056] Obtain the actual values of the multiple statistical parameters on the target chain at the current time, input the actual values of the multiple statistical parameters on the target chain into the target prediction model, perform calculations based on the offset and the linear coefficients corresponding to each statistical parameter on the target chain, and obtain the currently predicted total amount of virtual resources.
[0057] Optionally, the target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet predetermined conditions; the linear regression model includes multiple linear regression sub-models, each of which has the linear coefficient and the offset corresponding to one of the target chain statistical parameters;
[0058] The training unit is further specifically used for:
[0059] Determine the first logarithm of each of the plurality of first historical values of the statistical parameters on the plurality of target chains;
[0060] For each statistical parameter on the target chain, the first logarithm of the first historical value of the statistical parameter on the target chain is used as the input of the linear regression sub-model corresponding to the statistical parameter on the target chain, and the second logarithm is used as the output of the linear regression sub-model corresponding to the statistical parameter on the target chain, to solve the linear coefficient and the offset corresponding to the statistical parameter on the target chain.
[0061] Optionally, the second acquiring unit is specifically configured to:
[0062] Acquire the actual values of multiple statistical parameters on the target chain at the current time, input the actual value of each statistical parameter on the target chain into the linear regression sub-model corresponding to the statistical parameter on the target chain, and obtain the total amount of virtual resources predicted corresponding to the statistical parameter on the target chain;
[0063] The currently predicted total amount of virtual resources is determined based on the predicted total amounts of virtual resources corresponding to the statistical parameters on each target chain and the statistical parameter weights of the statistical parameters on each target chain.
[0064] Optionally, the second acquiring unit is further configured to:
[0065] Determine a first difference between the current actual total amount of virtual resources on the target blockchain and the current predicted total amount of virtual resources;
[0066] If the first difference exceeds the risk threshold, the warning is issued.
[0067] Optionally, the virtual resource early warning processing device further includes:
[0068] A third acquisition unit is used to acquire static attributes of a target user currently performing virtual resource transaction processing;
[0069] A fourth acquisition unit, configured to acquire, from the historical virtual resource transactions recorded on the target blockchain, an associated transaction associated with the target user;
[0070] A first input unit, used to input the associated transaction into a tag attribute recognition model to obtain a tag attribute of the target user;
[0071] The second input unit is used to input the static attribute and the tag attribute into a risk threshold prediction model to obtain the risk threshold.
[0072] Optionally, the virtual resource early warning processing device further includes:
[0073] a fourth determining unit, configured to determine a second difference between the first difference and the risk threshold;
[0074] A fifth acquisition unit, configured to acquire a current amount of virtual resources in the resource pool of the target user;
[0075] a fifth determining unit, configured to determine a virtual resource reduction amount based on the current virtual resource amount and the second difference;
[0076] The reducing unit is used to reduce the current virtual resource amount based on the virtual resource reduction amount.
[0077] Optionally, the second acquiring unit is further configured to:
[0078] In the case where the first difference exceeds the risk threshold, detecting a duration for which the first difference exceeds the risk threshold;
[0079] If the duration exceeds a predetermined duration threshold, the warning is issued.
[0080] Optionally, the virtual resource early warning processing method is executed according to a time period;
[0081] The second acquisition unit is further specifically configured to:
[0082] If the first difference exceeds the risk threshold, determining the number of consecutive time periods before the current time period during which the first difference exceeds the risk threshold;
[0083] Determining a warning level based on the number of consecutive time periods;
[0084] Based on the warning level, the warning is issued.
[0085] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the virtual resource early warning processing method as described above when executing the computer program.
[0086] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the virtual resource early warning processing method as described above is implemented.
[0087] According to one aspect of the present disclosure, a computer program product is provided. The computer program product includes a computer program. The computer program is read and executed by a processor of a computer device, so that the computer device executes the virtual resource early warning processing method as described above.
[0088] In the disclosed embodiment, the actual value of the target chain statistical parameter on the target blockchain at the current time is obtained, and the actual value is input into the pre-trained target prediction model to obtain the current predicted total amount of virtual resources on the target blockchain. The security of virtual resource transaction processing on the blockchain is related to the current predicted total amount of virtual resources. Therefore, based on the current predicted total amount of virtual resources, an early warning can be issued when the virtual resource transaction processing is unsafe. In this way, the security of virtual resource transaction processing on the blockchain can be improved. When the target prediction model is trained, the historical virtual resource transactions recorded on the target blockchain are obtained, and the first historical values of multiple chain statistical parameters are determined based on the historical virtual resource transactions, and the overall correlation parameters of each chain statistical parameter are determined accordingly. Based on the overall correlation parameters of the statistical parameters on each chain, the target chain statistical parameters can be determined from the multiple chain statistical parameters, and the target prediction model can be trained accordingly. Since this process uses the overall correlation parameters to determine the target chain statistical parameters from multiple chain statistical parameters, the trained target prediction model has higher accuracy, thereby further improving the security of virtual resource transaction processing on the blockchain. When determining the overall correlation parameter of each on-chain statistical parameter, the historical transaction attributes are obtained from the historical transaction attribute field in the historical virtual resource transaction, and the historical virtual resource transaction is classified accordingly. For each category, the first historical values of multiple on-chain statistical parameters are determined. Based on this, for each on-chain statistical parameter, the correlation coefficients of each category are determined, and then the overall correlation parameter is determined. This process takes into account the different characteristics of each category to determine the correlation coefficients of each category, so that the calculated correlation coefficient is more representative, making the final overall correlation parameter more accurate, and improving the security of virtual resource transaction processing on the blockchain.
[0089] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0091] Figure 1 is a system architecture diagram of a virtual resource early warning processing method according to an embodiment of the present disclosure;
[0092] Figure 2A and Figure 2B is a schematic diagram of an interface in a scenario where an early warning is performed on a virtual resource platform according to an embodiment of the present disclosure;
[0093] Figure 3 is an overall flow chart of a virtual resource early warning processing method according to an embodiment of the present disclosure;
[0094] Figure 4A It is a schematic diagram of determining statistical parameters on a target chain provided by an embodiment of the present disclosure;
[0095] Figure 4B is a schematic diagram of a virtual resource early warning processing method provided by an embodiment of the present disclosure;
[0096] Figure 5 yes Figure 3 Step 310 obtains a flow chart of historical virtual resource transactions;
[0097] Figure 6 yes Figure 3 Step 320 obtains a flow chart of the virtual resource transaction class;
[0098] Figure 7 yes Figure 6 A schematic diagram of the virtual resource transaction class is obtained;
[0099] Figure 8 yes Figure 3 Step 320 obtains another flow chart of the virtual resource transaction class;
[0100] Fig. 9 yes Figure 8 A schematic diagram of the virtual resource transaction class is obtained;
[0101] Fig.10 yes Figure 3A flow chart of determining a first historical value in step 330;
[0102] Fig.11 yes Fig.10 A schematic diagram of determining the first historical value in;
[0103] Fig.12 yes Figure 3 A flowchart of determining the correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain in step 640;
[0104] Fig.13 yes Fig.12 A flowchart of obtaining the total amount of virtual resources on the target blockchain in step 1220;
[0105] Fig.14 yes Figure 3 A flow chart of determining the overall correlation parameter of the on-chain statistical parameter in step 340;
[0106] Fig.15 yes Figure 3 A flowchart of determining a target chain statistical parameter from a plurality of chain statistical parameters in step 350;
[0107] Fig.16 yes Figure 3 A flowchart of step 360 training the target prediction model;
[0108] Fig.17 is a schematic diagram of a linear regression model provided by an embodiment of the present disclosure;
[0109] Fig.18 yes Fig.16 A flowchart of training a target prediction model when a linear regression model has multiple linear coefficients corresponding to multiple target chain statistical parameters;
[0110] Fig.19 yes Fig.18 A schematic diagram of training a target prediction model when a linear regression model has multiple linear coefficients corresponding to multiple target chain statistical parameters;
[0111] Fig. 20 yes Fig.16 A flowchart of training a target prediction model when a linear regression model includes multiple linear regression sub-models;
[0112] Fig.21 yes Fig. 20 A schematic diagram of training a target prediction model when a linear regression model includes multiple linear regression sub-models;
[0113] Fig. 22 yes Figure 3 A flow chart of determining the current predicted total amount of virtual resources in step 370;
[0114] Fig.23 yes Figure 3 Another flow chart of determining the current predicted total amount of virtual resources in step 370;
[0115] Fig.24 yes Figure 3 A flowchart of step 370 of issuing an early warning;
[0116] Fig.25 yes Fig.24 A flowchart of step 2420 of issuing an early warning;
[0117] Fig.26 yes Fig.24 Another flow chart of issuing an early warning in step 2420;
[0118] Fig. 27 yes Fig.24 A schematic diagram of an interface for issuing an early warning;
[0119] Fig.28 is a flow chart of determining a risk threshold provided by an embodiment of the present disclosure;
[0120] Fig.29 yes Fig.28 A schematic diagram of determining the risk threshold in ;
[0121] Fig.30 is a flow chart of virtual resource quantity processing in a warning state provided by an embodiment of the present disclosure;
[0122] Fig.31 yes Fig.30 A schematic diagram of virtual resource volume processing in a warning state;
[0123] Fig.32 is a structural diagram of a virtual resource early warning processing device according to an embodiment of the present disclosure;
[0124] Fig.33 According to the embodiment of the present disclosure, Figure 3 The terminal structure diagram of the virtual resource early warning processing method shown;
[0125] Fig.34 According to the embodiment of the present disclosure, Figure 3 The server structure diagram of the virtual resource early warning processing method is shown. DETAILED DESCRIPTION
[0126] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0127] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0128] Virtual resources: refers to various information and products that exist on the Internet and can be accessed and used by users. These resources usually do not exist in physical form but are provided digitally.
[0129] Blockchain: Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of transaction information, which is used to verify the validity of its information and associate it with the previous block.
[0130] At present, blockchain is often used to record virtual resource transactions. Users participate in virtual resource transactions. Virtual resource transactions are recorded on the blockchain. In the prior art, the security of users participating in virtual resource transactions cannot be guaranteed. A technology that improves the security of virtual resource transaction processing on the blockchain is needed.
[0131] Based on this, the embodiments of the present disclosure provide a virtual resource early warning processing method, related devices and media, which can improve the security of virtual resource transaction processing on the blockchain.
[0132] System architecture and scenario description of the application of the embodiments of the present disclosure
[0133] Figure 1 The system architecture diagram of the virtual resource early warning processing method according to the embodiment of the present disclosure includes: an object terminal 110, the Internet 120, a gateway 130, and a server 140.
[0134] The object terminal 110 is a device used by the object to view the early warning message of the virtual resource. It includes various forms such as desktop computers, laptops, PDAs (personal digital assistants), mobile phones, vehicle-mounted terminals, home theater terminals, and dedicated terminals. In addition, it can be a single device or a collection of multiple devices. For example, multiple devices are connected through a local area network and share a display device to work together, forming a terminal. The object terminal 110 can also communicate with the Internet 120 in a wired or wireless manner to exchange data.
[0135] The gateway 130 is also called an internetwork connector or a protocol converter. The gateway 130 realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. The gateway 130 is a translator between two systems that use different communication protocols, data formats or languages, or even completely different architectures. At the same time, the gateway 130 can also provide filtering and security functions. The message sent by the object terminal 110 to the server 140 is sent to the corresponding server 140 through the gateway 130. The message sent by the server 140 to the object terminal 110 is also sent to the corresponding object terminal 110 through the gateway 130.
[0136] The server 140 refers to a computer system that can provide virtual resource early warning processing services to the target terminal 110. Compared with the target terminal 110, the server 140 has higher requirements in terms of stability, security, performance, etc. The server 140 can be a high-performance computer in a network platform, a cluster of multiple high-performance computers, a part of a high-performance computer (such as a virtual machine), a combination of parts of multiple high-performance computers (such as virtual machines), etc. The server 140 can also communicate with the Internet 120 in a wired or wireless manner to exchange data.
[0137] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2A and Figure 2B The scenario of early warning on the virtual resource platform shown in the figure, etc.
[0138] Figure 2A This is a schematic diagram of the interface of the virtual resource platform provided by the embodiment of the present disclosure. The amount of virtual resources held by user A on the virtual platform is 1000.
[0139] In addition, the virtual resource early warning processing method provided by the embodiment of the present disclosure is applied to Figure 2A The virtual resource platform shown in FIG. 1 is used to process the data on the target blockchain corresponding to the virtual resource platform to generate Figure 2B Warning message shown. Figure 2BThe warning message shown in prompts user A that the total amount of virtual resources corresponding to the amount of virtual resources held by the user A is at a high risk of decreasing, and the security of virtual resource transaction processing is high. For example, the total amount of virtual resources corresponding to the amount of virtual resources held by user A at the current time point is 1500, and one day later, the total amount of virtual resources corresponding to the amount of virtual resources held by user A may drop to 1300, or even lower than 1000, thereby causing losses. Therefore, when the virtual resource platform displays a warning message, user A can choose to withdraw virtual resources to reduce the amount of virtual resources. In the case where the virtual resource platform does not display a warning message, user A can choose to keep the current amount of virtual resources unchanged, or obtain more virtual resources. It can be seen that the virtual resource warning processing method provided by the embodiment of the present disclosure can improve the security of virtual resource transaction processing on the blockchain.
[0140] It should be understood that the above content only illustrates some application scenarios of the present disclosure. The business scenarios to which the present disclosure can be applied may include but are not limited to the specific embodiments listed above.
[0141] General description of the disclosed embodiments
[0142] It should be emphasized that the embodiments of the present disclosure can be applied to a variety of application scenarios, such as the increase and decrease of virtual resources based on virtual resource warnings. In the related art, the security of users participating in virtual resource transactions cannot be guaranteed. Some embodiments of the present disclosure provide a virtual resource warning processing method, related devices and media, which can improve the security of virtual resource transaction processing on the blockchain.
[0143] The virtual resource early warning processing method is to process the data on the target blockchain to obtain the current predicted total amount of virtual resources, and issue an early warning based on the current total amount of virtual resources. This method can improve the security of virtual resource transaction processing on the blockchain.
[0144] The virtual resource early warning processing method of the embodiment of the present disclosure may be executed on the object terminal 110 , may be executed on the server 140 , or may be executed partially on the object terminal 110 and the other partially on the server 140 .
[0145] like Figure 3 As shown, according to an embodiment of the present disclosure, a virtual resource early warning processing method includes:
[0146] Step 310: Obtain historical virtual resource transactions recorded on the target blockchain, and obtain historical transaction attributes from the historical transaction attribute field in the historical virtual resource transactions;
[0147] Step 320: classify historical virtual resource transactions based on historical transaction attributes to obtain virtual resource transaction classes;
[0148] Step 330: Determine first historical values of multiple on-chain statistical parameters of the virtual resource transaction class based on each historical virtual resource transaction in the virtual resource transaction class;
[0149] Step 340: for each on-chain statistical parameter, based on the first historical value of the on-chain statistical parameter, determine the correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain, and based on the correlation coefficient corresponding to each virtual resource transaction class, determine the overall correlation parameter of the on-chain statistical parameter;
[0150] Step 350: Determine a target on-chain statistical parameter from among the multiple on-chain statistical parameters based on the overall correlation parameter of each on-chain statistical parameter;
[0151] Step 360: training a target prediction model based on the first historical value of the statistical parameter on the target chain;
[0152] Step 370: Obtain the actual value of the statistical parameter on the target chain at the current time, input the actual value into the target prediction model, obtain the current predicted total amount of virtual resources on the target blockchain, and issue an early warning based on the current predicted total amount of virtual resources.
[0153] Steps 310 to 370 are described in detail below.
[0154] In step 310, the historical virtual resource transactions recorded on the target blockchain are obtained, and the historical transaction attributes are obtained from the historical transaction attribute field in the historical virtual resource transactions.
[0155] The target blockchain is the blockchain that needs to be processed for virtual resource warning. Blockchain is a distributed database technology that stores data in the form of a chain data structure. It can be said that the blockchain stores data related to virtual resources.
[0156] Historical virtual resource transactions refer to historical transactions related to virtual resources recorded on the target blockchain. Historical virtual resource transactions include the transfer in and out of virtual resources on the target blockchain, the setting of user virtual resource accounts, etc.
[0157] The historical transaction attribute field corresponds to the historical virtual resource transaction. The historical transaction attribute field is a field in the historical virtual resource transaction, which records the historical transaction attributes corresponding to the historical virtual resource transaction.
[0158] It should be noted that the historical transaction attributes can be set as needed to meet different classification requirements. For example, the processing time period, processing organization or processing user, transfer-in and transfer-out of virtual resources, etc. corresponding to the historical virtual resource transaction. Assuming that the historical virtual resource transaction 1 is the transfer of virtual resource 1000 from organization A to organization B at 10:10 am, then the historical transaction attributes corresponding to the historical virtual resource transaction 1 are specifically the transfer-in and transfer-out of organization A and organization B, 10:10 am, and virtual resource 1000, etc.
[0159] In step 320, historical virtual resource transactions are classified based on historical transaction attributes to obtain virtual resource transaction classes.
[0160] The virtual resource transaction class is the classification result of the historical virtual resource transaction class according to the historical transaction attribute. Each virtual resource transaction class includes at least one historical virtual resource transaction. If the historical transaction attribute is the processing time period corresponding to the historical virtual resource transaction class, then the virtual resource transaction class to which the historical virtual resource transaction belongs is determined based on the processing time period of each historical virtual resource transaction class. Assuming that the processing time of historical virtual resource transaction A is 9:10, historical virtual resource transaction B is 10:30, historical virtual resource transaction C is 15:15, and historical virtual resource transaction D is 16:42, the historical virtual resource transactions are classified based on the processing time period corresponding to the historical virtual resource transactions, and two virtual resource transaction classes can be obtained, one of which includes historical virtual resource transactions with processing time in the morning, such as historical virtual resource transaction A and historical virtual resource transaction B, and the other virtual resource transaction class corresponds to historical virtual resource transactions with processing time in the afternoon, such as historical virtual resource transaction C and historical virtual resource transaction D.
[0161] In step 330, based on each historical virtual resource transaction in the virtual resource transaction class, first historical values of multiple on-chain statistical parameters of the virtual resource transaction class are determined.
[0162] The on-chain statistical parameters are the statistical results of the parameters of each historical virtual resource transaction in the virtual resource transaction class on the target blockchain.
[0163] Reference Figure 4A The on-chain statistical parameters include block height, cumulative number of addresses, cumulative computing power hash rate, cumulative number of forwarding resources, and cumulative forwarding resource volume.
[0164] The target blockchain is a chain structure, in which each block occupies a position from the beginning of the blockchain to the latest added block, and this position is arranged in chronological order, and the block height refers to the position number of a block in the target blockchain. It can be said that the block height represents the specific position of the block where the historical virtual resource transaction is located on the target blockchain. Based on the block height, the order of each historical virtual resource transaction in the virtual resource transaction class can be determined.
[0165] The cumulative number of addresses refers to the number of addresses involved in each historical virtual resource transaction in the virtual resource transaction class. Specifically, virtual resources can be forwarded between users. For example, user A can send virtual resources to user B. Then the device address of user A is the transfer-out address of the virtual resource, and the address of user B is the transfer-in address of the virtual resource. Then the cumulative number of addresses is the number of multiple transfer-out addresses and transfer-in addresses involved in each historical virtual resource transaction in the virtual resource transaction class. In addition, the transfer-in addresses and transfer-out addresses corresponding to different historical virtual resource transactions may be repeated, and these repeated addresses will only be recorded as one address number. For example, a certain virtual resource transaction class includes historical virtual resource transaction 1 and historical virtual resource transaction 2. The transfer-in address corresponding to historical virtual resource transaction 1 is addr1 and the transfer-out address is addr2. The transfer-in address corresponding to historical virtual resource transaction 2 is addr3 and the transfer-out address is addr1. Then the cumulative number of addresses corresponding to the virtual resource transaction class is 3.
[0166] Computing power refers to the amount of computing that a computer system can handle, usually referring to the amount of computing tasks per unit time. Computing power is usually expressed in units of hash rates. The hash rate refers to the number of times a computer system performs hash operations per unit time. Therefore, the cumulative computing power hash rate can be considered as the speed at which the computer system performs hash operations during the processing of each historical virtual resource transaction corresponding to the virtual resource transaction class. The computing power hash rate plays a vital role in the security of virtual resource transaction processing. The higher the cumulative computing power hash rate, the more computing power and computing resources are invested in the process of virtual resource transaction processing, which also means that the network where the target blockchain is located is more stable and secure.
[0167] The cumulative number of resource forwarding times refers to the number of virtual resource forwarding times corresponding to each historical virtual resource transaction in the virtual resource transaction class. Historical virtual resource transactions may include virtual resource forwarding, virtual resource account establishment, virtual resource donation, virtual resource acquisition, virtual resource withdrawal and other different transactions. In this case, the cumulative number of resource forwarding times can be regarded as the number of historical virtual resource transactions involving virtual resource forwarding in the virtual resource transaction class.
[0168] The cumulative forwarding resource volume refers to the total amount of forwarded virtual resources corresponding to each historical virtual resource transaction in the virtual resource transaction class. Assume that historical virtual resource transaction 1, historical virtual resource transaction 2, and historical virtual resource transaction 3 in the virtual resource transaction class involve the forwarding of virtual resources, where historical virtual resource transaction 1 is user A forwarding virtual resources 1000 to user B, historical virtual resource transaction 2 is user B forwarding virtual resources 200 to user C, and historical virtual resource transaction 3 is user B forwarding virtual resources 800 to user A, then the cumulative forwarding resource volume of the virtual resource transaction class is 2000.
[0169] The first historical value corresponds to the on-chain statistical parameter. The first historical value is the specific value of the on-chain statistical parameter of each virtual resource transaction class. The first historical value is specifically determined based on each historical virtual resource transaction in the virtual resource transaction class.
[0170] Reference Figure 4A , classify each historical virtual resource transaction according to the historical transaction attributes, and obtain virtual resource transaction class A, virtual resource transaction class B and virtual resource transaction class C. There are multiple on-chain statistical parameters, namely block height, cumulative number of addresses, cumulative computing power hash rate, cumulative number of forwarding resources and cumulative forwarding resource volume. For each virtual resource transaction class, based on each historical virtual resource transaction in the virtual resource transaction class, determine the specific value of the on-chain statistical parameter, so as to obtain the first historical value. For example, the first historical values of the multiple on-chain statistical parameters corresponding to virtual resource transaction class A are block height A, cumulative number of addresses A, cumulative computing power hash rate A, cumulative number of forwarding resources A and cumulative forwarding resource volume A.
[0171] In step 340, for each on-chain statistical parameter, based on the first historical value of the on-chain statistical parameter, the correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain is determined, and based on the correlation coefficients corresponding to each virtual resource transaction class, the overall correlation parameter of the on-chain statistical parameter is determined.
[0172] The total amount of virtual resources on the target blockchain refers to the total value of all virtual resources on the target blockchain. The total amount of virtual resources on the target blockchain is different from the virtual resource amount. The virtual amount on the target blockchain refers to the number of virtual resources on the target blockchain. Even if the virtual amount on the target blockchain is the same, the total amount of virtual resources on the target blockchain is uncertain.
[0173] For the total amount of virtual resources on the target blockchain, each on-chain statistical parameter has a certain impact on it. The correlation coefficient refers to the coefficient used to represent the correlation between the on-chain statistical parameters corresponding to the virtual resource transaction class and the total amount of virtual resources on the target blockchain, and the correlation coefficient can represent the impact of the on-chain statistical parameters on the total amount of virtual resources on the target blockchain. The larger the correlation parameter, the greater the impact of the on-chain statistical parameters of the corresponding virtual resource transaction class on the total amount of virtual resources on the target blockchain.
[0174] The overall correlation parameter corresponds to the on-chain statistical parameter, which refers to the coefficient between the on-chain statistical parameters corresponding to all virtual resource transaction classes on the target blockchain and the total amount of virtual resources on the target blockchain. The larger the overall correlation parameter, the greater the impact of its corresponding on-chain statistical parameter on the total amount of virtual resources on the target blockchain.
[0175] Reference Figure 4A , after determining the first historical value of the on-chain statistical parameter corresponding to each virtual resource transaction class, for each virtual resource transaction class, determine the correlation coefficient between each on-chain statistical parameter and the total amount of virtual resources on the target blockchain. For example, for virtual resource transaction class A, 5 correlation coefficients A are calculated, and the 5 correlation coefficients A are determined based on the block height A, the cumulative number of addresses A, the cumulative computing power hash rate A, the cumulative number of forwarding resources A, and the cumulative forwarding resource amount A. Similarly, for virtual resource transaction class B, 5 correlation coefficients B are determined. For virtual resource transaction class C, 5 correlation coefficients C are determined. Afterwards, for each on-chain statistical parameter, based on its corresponding correlation coefficient in each virtual resource transaction class, the overall correlation parameter between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain is determined, and the number of overall correlation parameters finally determined is 5. For the block height, based on the correlation coefficient A, correlation coefficient B and correlation coefficient C corresponding to the block height, the overall correlation coefficient between the block height and the total amount of virtual resources on the target blockchain is determined.
[0176] In step 350, a target on-chain statistical parameter is determined from among the multiple on-chain statistical parameters based on the overall correlation parameter of each on-chain statistical parameter.
[0177] The target chain statistical parameters are one or more chain statistical parameters that have the highest correlation with the total amount of virtual resources on the target blockchain. The number of target chain statistical parameters can be determined according to actual needs.
[0178] Reference Figure 4AThere are five overall correlation parameters, which correspond to the on-chain statistical parameters block height, cumulative number of addresses, cumulative computing power hash rate, cumulative number of forwarding resources, and cumulative forwarding resource volume. The target chain statistical parameters are determined from multiple on-chain statistical parameters based on the overall correlation parameters. The target chain statistical parameters are specifically one or more of the block height, cumulative number of addresses, cumulative computing power hash rate, cumulative number of forwarding resources, and cumulative forwarding resource volume.
[0179] In step 360, a target prediction model is trained based on the first historical value of the statistical parameter on the target chain.
[0180] After determining the statistical parameters on the target chain, the target prediction model is trained based on the first historical values of the statistical parameters on the target chain.
[0181] The target prediction model is a model for predicting the total amount of virtual resources of the target blockchain, and the input of the model is the value corresponding to the statistical parameter on the target chain. Therefore, the embodiment of the present disclosure uses the first historical value of the statistical parameter on the target chain to train the target prediction model.
[0182] It should be noted that in addition to the first historical value of the statistical parameter on the target chain, the embodiment of the present disclosure also uses the total historical amount of virtual resources corresponding to the first historical value to train the target prediction model, so that when the model input is the first historical value of the statistical parameter on the target chain, the target prediction model can output the total historical amount of virtual resources corresponding to the first historical value.
[0183] It should be noted that historical virtual resource transactions will increase over time, and correspondingly, the first historical value of the statistical parameter on the target chain used to train the target prediction model will also increase. The disclosed embodiment can obtain new historical total virtual resource amounts at preset intervals to train the target prediction model, thereby improving the prediction accuracy of the target prediction model.
[0184] In step 370, the actual value of the statistical parameter on the target chain at the current time is obtained, and the actual value is input into the target prediction model to obtain the current predicted total amount of virtual resources on the target blockchain, and an early warning is issued based on the current predicted total amount of virtual resources.
[0185] The actual value is the value of the statistical parameter on the target blockchain at the current time. The current predicted total amount of virtual resources is the total amount of virtual resources on the target blockchain predicted by the target prediction model based on the actual value.
[0186] After determining the current predicted total amount of virtual resources, an early warning can be issued when virtual resource transaction processing is unsafe based on the current predicted total amount of virtual resources, thereby improving the security of virtual resource transaction processing on the blockchain.
[0187] Reference Figure 4B , the disclosed embodiment first obtains the historical virtual resource transactions on the target blockchain, and then Figure 4A The method shown determines the statistical parameters on the target chain to train the target prediction model based on the first historical value of the statistical parameters on the target chain. After that, the actual value of the statistical parameters on the target chain at the current time is obtained, and the actual value is input into the trained target prediction model to obtain the current predicted total amount of virtual resources on the target blockchain. Based on the current predicted total amount of virtual resources, it can be determined whether the virtual resource transaction processing on the current target blockchain is safe, and an early warning is issued when the virtual resource transaction processing is not safe.
[0188] It should be noted that, refer to Figure 2B When the virtual resource transaction processing is unsafe, an early warning is issued, and the virtual resource platform to which the virtual resource early warning processing method provided in the embodiment of the present disclosure is applied displays an early warning message to remind the user that the current virtual resource transaction processing is unsafe and to reduce the amount of virtual resources obtained on the virtual resource platform.
[0189] The embodiments of the above steps 310 to 370 obtain the actual value of the target chain statistical parameter on the target blockchain at the current time, input the actual value into the pre-trained target prediction model, and obtain the current predicted total amount of virtual resources on the target blockchain. The security of virtual resource transaction processing on the blockchain is related to the current predicted total amount of virtual resources. Therefore, based on the current predicted total amount of virtual resources, an early warning can be issued when the virtual resource transaction processing is unsafe. In this way, the security of virtual resource transaction processing on the blockchain can be improved. When the target prediction model is trained, the historical virtual resource transactions recorded on the target blockchain are obtained, and the first historical values of multiple chain statistical parameters are determined based on the historical virtual resource transactions, and the overall correlation parameters of each chain statistical parameter are determined accordingly. Based on the overall correlation parameters of the statistical parameters on each chain, the target chain statistical parameters can be determined from the multiple chain statistical parameters, and the target prediction model can be trained accordingly. Since this process uses the overall correlation parameters to determine the target chain statistical parameters from multiple chain statistical parameters, the trained target prediction model has higher accuracy, thereby further improving the security of virtual resource transaction processing on the blockchain. When determining the overall correlation parameter of each on-chain statistical parameter, the historical transaction attributes are obtained from the historical transaction attribute field in the historical virtual resource transaction, and the historical virtual resource transaction is classified accordingly. For each category, the first historical values of multiple on-chain statistical parameters are determined. Based on this, for each on-chain statistical parameter, the correlation coefficients of each category are determined, and then the overall correlation parameter is determined. This process takes into account the different characteristics of each category to determine the correlation coefficients of each category, so that the calculated correlation coefficient is more representative, making the final overall correlation parameter more accurate, and improving the security of virtual resource transaction processing on the blockchain.
[0190] The above is a general description of step 310 to step 370. The specific implementation process of step 310 to step 370 is described in detail below.
[0191] Detailed description of step 310
[0192] In step 310, the historical virtual resource transactions recorded on the target blockchain are obtained, and the historical transaction attributes are obtained from the historical transaction attribute field in the historical virtual resource transactions.
[0193] In one embodiment, referring to Figure 5 , step 310 includes:
[0194] Step 510: Obtain historical virtual resource blocks on the target blockchain;
[0195] Step 520: Decompose the historical virtual resource blocks into historical virtual resource transactions.
[0196] Step 510 and step 520 are described in detail below.
[0197] In step 510, the historical virtual resource blocks on the target blockchain are obtained.
[0198] The historical virtual resource block is a blockchain on the target blockchain that records historical virtual resource transactions. The historical virtual resource block is specifically a block formed before the current time.
[0199] The blockchain is a chain structure that combines data blocks in a sequential manner in chronological order, and the block in the blockchain is a data structure that contains relevant data on virtual resource transactions on the target blockchain.
[0200] In step 520, the historical virtual resource blocks are decomposed into historical virtual resource transactions.
[0201] The historical virtual resource records contain relevant data of the historical virtual resource transactions on the target blockchain. By decomposing the historical virtual resource blocks, the historical virtual resource transactions can be obtained.
[0202] The embodiments of step 510 and step 520 above obtain historical virtual resource blocks on the target blockchain, and decompose the historical virtual resource blocks to obtain historical virtual resource transactions. The acquisition of historical virtual resource blocks ensures the correctness of the obtained historical virtual resource transactions, thereby improving the security of virtual resource transaction processing.
[0203] Detailed description of step 320
[0204] In step 320, historical virtual resource transactions are classified based on historical transaction attributes to obtain virtual resource transaction classes.
[0205] In one embodiment, the historical transaction attribute is the historical transaction type, referring to Figure 6 , step 320 includes:
[0206] Step 610: Classify historical virtual resource transactions of the same historical transaction type into the same virtual resource transaction class.
[0207] Step 610 is described in detail below.
[0208] In step 610, historical virtual resource transactions of the same historical transaction type are classified into the same virtual resource transaction class.
[0209] The historical transaction attribute is the historical transaction type. The historical transaction type is the transaction type corresponding to the historical virtual resource transaction. The historical transaction type includes multiple types such as forwarding of virtual resources, establishment of virtual resource accounts, donation of virtual resources, acquisition of virtual resources, and withdrawal of virtual resources. It can be determined that the number of historical transaction types is fixed. Therefore, in the process of classifying historical virtual resource transactions, historical virtual resource transactions of the same historical transaction type can be classified into the same virtual resource transaction class.
[0210] Reference Figure 7 The historical transaction types provided by the embodiments of the present disclosure include historical transaction type A, historical transaction type B, and historical transaction type C, and there are 4 historical virtual resource transactions, namely historical virtual resource transaction 1, historical virtual resource transaction 2, historical virtual resource transaction 3, and historical virtual resource transaction 4. Based on the historical transaction types, multiple historical virtual resource transactions are classified to obtain virtual resource transaction class A, virtual resource transaction class B, and virtual resource transaction class C. Virtual resource transaction class A corresponds to historical transaction type A, which includes historical virtual resource transaction 1 and historical virtual resource transaction 3. Virtual resource transaction class B corresponds to historical transaction type B, which includes historical virtual resource transaction 4. Virtual resource transaction class C corresponds to historical transaction type C, which specifically includes historical virtual resource transaction 2.
[0211] The embodiment of the above-mentioned step 610 classifies historical virtual resource transactions based on historical transaction types. Specifically, historical virtual resource transactions of the same historical transaction type are classified into the same virtual resource transaction class, that is, multiple historical virtual resource transactions corresponding to the same virtual resource transaction class have the same historical transaction type. This method starts from the perspective of historical transaction types, and the correlation coefficients of each class determined by the method include the characteristics of each historical transaction type, so that the final overall correlation parameters are more accurate, further improving the security of virtual resource transaction processing on the blockchain.
[0212] In another embodiment, the historical transaction attribute is a plurality of historical transaction attributes, referring to Figure 8 , step 320 includes:
[0213] Step 810: Based on multiple historical transaction attributes of the historical virtual resource transactions, a clustering algorithm is used to cluster the multiple historical virtual resource transactions to obtain a virtual resource transaction class.
[0214] Step 810 is described in detail below.
[0215] In step 810, based on multiple historical transaction attributes of the historical virtual resource transactions, a clustering algorithm is used to cluster the multiple historical virtual resource transactions to obtain a virtual resource transaction class.
[0216] The historical transaction attribute is a plurality of historical transaction attributes, and the plurality of historical transaction attributes may be the processing user type, time, location, etc. corresponding to the historical virtual resource transaction. There are many values corresponding to the attributes such as user type, time, location, etc., and the values obtained by combining the plurality of attributes are thousands. Therefore, it is impossible to simply classify the plurality of historical transaction attributes with the same historical transaction attributes into the same virtual resource transaction class.
[0217] The disclosed embodiment specifically utilizes a clustering algorithm to cluster multiple historical virtual resource transactions to obtain multiple virtual resource transaction classes.
[0218] It should be noted that the embodiments of the present disclosure can cluster historical virtual resource transactions through a variety of clustering algorithms, such as K-means clustering, mean shift algorithm, density-based clustering algorithm, maximum expectation estimation using Gaussian mixture model, etc.
[0219] Reference Fig. 9 , the user type corresponding to historical virtual resource transaction 1 is individual and the time is 9:00, the user type corresponding to historical virtual resource transaction 2 is institution A and the time is 11:26, the user type corresponding to historical virtual resource transaction 3 is institution B and the time is 13:12, and the user type corresponding to historical virtual resource transaction 4 is institution C and the time is 14:26. Using the clustering algorithm to process multiple historical virtual resource transactions, the user type of historical virtual resource transaction 1 is individual and the time is in the morning, which is quite different from other historical virtual resource transactions. Therefore, historical virtual resource transaction 1 is classified into virtual resource transaction class A. The processing time of historical virtual resource transaction 3 and virtual resource transaction 4 is similar, and institution B and institution C are the same type of institutions. Therefore, historical virtual resource transaction 3 and virtual resource transaction 4 are classified into virtual resource transaction class C. In addition, historical virtual resource transaction 2 can be classified into virtual resource transaction class B.
[0220] In the embodiment of the above step 810, when the historical transaction attribute is multiple historical transaction attributes, a clustering algorithm is used to cluster multiple historical virtual resource transactions based on the multiple historical transaction attributes to obtain a virtual resource transaction class. This method, from the perspective of historical transaction attributes, classifies virtual resource transactions with the same or similar historical transaction attributes into the same class. The correlation coefficient determined in this way is more representative, thereby improving the security of virtual resource transaction processing on the blockchain.
[0221] Detailed description of step 330
[0222] In step 330, based on each historical virtual resource transaction in the virtual resource transaction class, first historical values of multiple on-chain statistical parameters of the virtual resource transaction class are determined.
[0223] In one embodiment, referring to Fig.10 , step 330 includes:
[0224] Step 1010: In each historical time period, based on each historical virtual resource transaction in the virtual resource transaction class obtained in the historical time period, determine the first historical sub-values of multiple on-chain statistical parameters corresponding to the historical time period;
[0225] Step 1020: For a single on-chain statistical parameter, based on the first historical sub-values obtained in each historical time period, generate a first historical sub-value vector as the first historical value of the on-chain statistical parameter.
[0226] Step 1010 and step 1020 are described in detail below.
[0227] In step 1010, in each historical time period, based on each historical virtual resource transaction in the virtual resource transaction class obtained in the historical time period, a first historical sub-value of multiple on-chain statistical parameters corresponding to the historical time period is determined.
[0228] The historical time period is the period for determining the first historical sub-value, and the first historical sub-value corresponds to the on-chain statistical parameter, and the first historical sub-value is the value of the corresponding on-chain statistical parameter within the historical time period. The historical time period can be set as needed. For the convenience of calculation, the embodiment of the present disclosure usually sets the historical time period to 1 day.
[0229] Reference Fig.11, the disclosed embodiment determines four historical time periods before the current time, and for each historical time period, determines the first historical sub-values of multiple on-chain statistical parameters according to each historical virtual resource transaction in the virtual resource transaction class of the target blockchain within the historical time period. For example, in historical time period 1, the first historical sub-values of multiple on-chain statistical parameters such as block height 1 and cumulative number of addresses 1 are determined according to each historical virtual resource transaction 1 in the virtual resource transaction class.
[0230] In step 1020, for a single on-chain statistical parameter, a first historical sub-value vector is generated based on the first historical sub-values obtained in each historical time period as the first historical value of the on-chain statistical parameter.
[0231] The first historical sub-value vector is a vector composed of the first historical sub-values corresponding to each historical time period. Each element of the first historical sub-value vector corresponds to the first historical sub-value, and the first historical sub-value vector corresponds to the on-chain statistical parameter.
[0232] After determining multiple first historical sub-values, for each on-chain statistical parameter, a first historical sub-value vector is generated based on the first historical sub-values obtained in each historical time period, and the first historical sub-value vector is then used as the first historical value of the on-chain statistical parameter.
[0233] Reference Fig.11 , for the block height, it corresponds to 4 first historical sub-values, which are block height 1, block height 2, block height 3 and block height 4, among which block height 1 corresponds to historical time period 1, block height 2 corresponds to historical time period 2, block height 3 corresponds to historical time period 3, and block height 3 corresponds to historical time period 3. Based on the first historical sub-values obtained in each historical time period, a first historical sub-value vector is generated, then the first historical sub-value vector corresponding to the block height is [block height 1, block height 2, block height 3, block height 4], and this vector is used as the first historical value of the block height. Similarly, the first historical value of the cumulative number of addresses can be expressed as [cumulative number of addresses 1, cumulative number of addresses 2, cumulative number of addresses 3, cumulative number of addresses 4].
[0234] The embodiments of the above steps 1010 and 1020 are provided with a historical time period, and in each historical time period, based on each historical virtual resource transaction in the virtual resource transaction class obtained in the historical time period, the first historical sub-values of multiple on-chain statistical parameters corresponding to the historical time period are determined. Afterwards, for a single on-chain statistical parameter, a first historical sub-value vector is generated based on the first historical sub-value obtained in each historical time period, and then the first historical value of the on-chain statistical parameter is determined. The setting of the historical time period can more accurately calculate the historical resource transaction, and the obtained first historical sub-value can reflect the on-chain statistical parameters within the historical time period, so that the obtained first historical value is more accurate, and the security of virtual transaction processing is improved.
[0235] Detailed description of step 340
[0236] In step 340, for each on-chain statistical parameter, based on the first historical value of the on-chain statistical parameter, the correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain is determined, and based on the correlation coefficients corresponding to each virtual resource transaction class, the overall correlation parameter of the on-chain statistical parameter is determined.
[0237] In one embodiment, referring to Fig.12 , step 340 includes:
[0238] Step 1210: Obtain a correlation coefficient function, where the correlation coefficient function is a function of the first historical value and the total amount of virtual resources on the target blockchain;
[0239] Step 1220: Obtain the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0240] Step 1230: Substitute the first historical value and the total amount of virtual resources on the target blockchain into the correlation coefficient function to obtain the correlation coefficient.
[0241] Steps 1210 to 1230 are described in detail below.
[0242] In step 1210, a correlation coefficient function is obtained, where the correlation coefficient function is a function of the first historical value and the total amount of virtual resources on the target blockchain.
[0243] The correlation coefficient function is a function of the first historical value of the on-chain statistical parameter and the total amount of virtual resources on the target blockchain.
[0244] In step 1220, the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value is obtained.
[0245] The total amount of virtual resources on the target blockchain is the total value of the virtual resources on the target blockchain within the historical time period corresponding to the first historical value, and the total amount of virtual resources on the target blockchain corresponds to the first historical value.
[0246] Reference Fig.11 , the first historical value of the on-chain statistical parameter is determined based on the historical resource transactions within the historical time period 1 to the historical time period 4, then the total amount of virtual resources on the target blockchain is the total value of the virtual resources on the target blockchain within the historical time period 1 to the historical time period 4.
[0247] In step 1230, the first historical value and the total amount of virtual resources on the target blockchain are substituted into the correlation coefficient function to obtain the correlation coefficient.
[0248] The correlation coefficient function is a function of the first historical value and the total amount of virtual resources on the target blockchain. After determining the first historical value and the total amount of virtual resources on the target blockchain, they can be substituted into the correlation coefficient function to obtain the correlation coefficient between the on-chain statistical parameters corresponding to the first historical value and the total amount of virtual resources on the target blockchain.
[0249] It should be noted that the correlation coefficient can be expressed as C = CF (M, BD), where M is the total amount of virtual resources on the target blockchain, BD is the first historical value of the on-chain statistical parameter, CF is the correlation coefficient function, and C is the correlation coefficient. Substituting the first historical value and the total amount of virtual resources on the target blockchain into the correlation coefficient function = CF (M, BD), the correlation coefficient C can be obtained.
[0250] It should be noted that the embodiment of the present disclosure uses the Pearson correlation coefficient function as the correlation coefficient function for calculation. The Pearson correlation coefficient can be used to measure the correlation between the first historical value and the total amount of virtual resources on the target blockchain, and the value of the Pearson correlation coefficient is between -1 and 1.
[0251] The above steps 1210 to 1230 are provided with a correlation coefficient function, and the correlation coefficient function is a function of the first historical value and the total amount of virtual resources on the target blockchain. Then, the first historical value and the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value are brought into the correlation coefficient function to obtain the correlation coefficient. The correlation coefficient function is a function of the first historical value and the total amount of virtual resources on the target blockchain. Then, the correlation coefficient determined based on the function can more accurately represent the correlation between the on-chain statistical parameters and the total amount of virtual resources on the target blockchain, thereby improving the accuracy of early warning and the security of virtual resource transaction processing.
[0252] The above is a general description of step 1210 to step 1230. Since step 1210 and step 1230 have been described in detail above, only the specific implementation process of step 1220 will be described in detail below.
[0253] In step 1220, the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value is obtained.
[0254] In one embodiment, referring to Fig.13 , step 1220 includes:
[0255] Step 1310: Obtain the number of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0256] Step 1320: Obtain the unit resource quantity represented by a single virtual resource in a historical time period;
[0257] Step 1330: Based on the number of virtual resources and the unit resource amount on the target blockchain, determine the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value.
[0258] Steps 1310 to 1330 are described in detail below.
[0259] In step 1310, the number of virtual resources on the target blockchain in the historical time period corresponding to the first historical value is obtained.
[0260] The number of virtual resources on the target blockchain is the number of virtual resources on the target blockchain in the historical time period corresponding to the first historical value.
[0261] Reference Fig.11 , the historical time period corresponding to the first historical value is historical time period 1 to historical time period 4, then the number of virtual resources on the target blockchain is the number of virtual resources on the target blockchain within historical time period 1 to historical time period 3.
[0262] In step 1320, the unit resource quantity represented by a single virtual resource in a historical time period is obtained.
[0263] The unit resource volume is the total value of a single virtual resource in the target blockchain during the historical time period.
[0264] In step 1330, based on the number of virtual resources and unit resource amount on the target blockchain, the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value is determined.
[0265] The total amount of virtual resources on the target blockchain in the historical time period is determined based on the number of virtual resources and unit resource amount on the target blockchain.
[0266] Assuming that the number of virtual resources on the target blockchain in the historical time period corresponding to the first historical value is S, and the unit resource volume represented by a single resource in the historical time period is P, then the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value is expressed as M = S * P. If the number of virtual resources on the target blockchain is 1000 and the unit resource volume is 1.5, then the total amount of virtual resources on the target blockchain is 1500.
[0267] The embodiments of steps 1310 to 1330 above determine the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value based on the number of virtual resources and the unit resource amount on the target blockchain, thereby improving the accuracy of the total amount of virtual resources on the target blockchain, thereby improving the accuracy of the correlation coefficient and improving the security of virtual resource transaction processing.
[0268] In another embodiment, referring to Fig.14 , step 340 includes:
[0269] Step 1410: Obtain the class weight of each virtual resource transaction class;
[0270] Step 1420: Calculate the overall correlation parameters of the on-chain statistical parameters based on the correlation coefficients and class weights of each virtual resource transaction class.
[0271] Step 1410 and step 1420 are described in detail below.
[0272] In step 1410, the class weight of each virtual resource transaction class is obtained.
[0273] The class weight corresponds to the virtual resource transaction class. The class weight is the weight of the corresponding virtual resource transaction class among multiple virtual resource transaction classes. Different virtual resource transaction classes have different class weights, and the sum of the class weights of each virtual resource transaction class is 1.
[0274] In step 1420, based on the correlation coefficients and class weights of the various virtual resource transaction classes, the overall correlation parameters of the on-chain statistical parameters are calculated.
[0275] The overall correlation parameter of the on-chain statistical parameter is determined based on the correlation coefficient and class weight of multiple virtual resource transaction classes. Specifically, the product of the correlation coefficient and class weight of each virtual resource transaction class is added to obtain the overall correlation parameter of the on-chain statistical parameter. Assuming that each virtual resource transaction class includes virtual resource transaction class A, virtual resource transaction class B, and virtual resource transaction class C, and the correlation coefficient corresponding to virtual resource transaction class A is 0.8 and the class weight is 0.4, the correlation coefficient corresponding to virtual resource transaction class B is 0.6 and the class weight is 0.3, and the correlation coefficient corresponding to virtual resource transaction class C is 0.5 and the class weight is 0.3, then the overall correlation parameter of the on-chain statistical parameter is 0.65.
[0276] The embodiments of step 1410 and step 1420 above calculate the overall correlation parameters of the on-chain statistical parameters based on the correlation coefficients and class weights of each virtual resource transaction class. The setting of the class weights takes into account the importance of each class, so that the overall correlation parameters calculated are more accurate, further improving the security of virtual resource transaction processing on the blockchain.
[0277] Detailed description of step 350
[0278] In step 350, a target on-chain statistical parameter is determined from among the multiple on-chain statistical parameters based on the overall correlation parameter of each on-chain statistical parameter.
[0279] In one embodiment, referring to Fig.15 , step 350 comprises:
[0280] Step 1510: Determine the on-chain statistical parameter with the largest overall correlation parameter as the target on-chain statistical parameter.
[0281] Step 1510 is described in detail below.
[0282] In step 1510, the on-chain statistical parameter with the largest overall correlation parameter is determined as the target on-chain statistical parameter.
[0283] The target chain statistical parameter is the chain statistical parameter with the highest correlation with the total amount of virtual resources on the target blockchain, and the overall correlation parameter is used to describe the correlation between the chain statistical parameter and the total amount of virtual resources. The larger the overall correlation parameter, the stronger the correlation between the chain statistical parameter and the total amount of virtual resources. Therefore, when there is only one target chain statistical parameter, the embodiment of the present disclosure determines the chain statistical parameter with the largest overall correlation parameter as the target chain statistical parameter.
[0284] Assuming that the overall correlation parameter corresponding to the block height is 0.92, the overall correlation parameter corresponding to the cumulative number of addresses is 0.78, the overall correlation parameter corresponding to the cumulative computing power hash rate is 0.94, the overall correlation parameter corresponding to the cumulative number of forwarding resources is 0.86, and the overall correlation parameter corresponding to the cumulative forwarding resource amount is 0.8, then the cumulative computing power hash rate is used as the statistical parameter on the target chain.
[0285] The statistical parameter on the chain with the largest overall correlation parameter can be expressed as MaxC=Max(C1,C2,C3,…), where MaxC is the statistical parameter on the chain with the largest overall correlation parameter, and C1, C2, C3,… represent the overall correlation parameters of the statistical parameters on each chain. Furthermore, the statistical parameter on the target chain can be expressed as MaxC=CF(M,F), where M is the total amount of virtual resources on the target blockchain, and F is the statistical parameter on the target chain.
[0286] The embodiment of the above step 1510 determines the on-chain statistical parameter with the largest overall correlation parameter as the target on-chain statistical parameter. The target on-chain statistical parameter determined by this method is more accurate, thereby improving the accuracy of the target prediction model and providing the security of virtual resource transaction processing.
[0287] In one embodiment, if the target chain statistical parameter is one of the multiple chain statistical parameters with the highest correlation with the total amount of virtual resources on the target blockchain, a prediction number can be set. After that, the multiple chain statistical parameters are sorted in descending order of the overall correlation parameters, and the first preset number of chain statistical parameters are taken as the target chain statistical parameters.
[0288] In addition, the embodiment of the present disclosure may also set a preset threshold, and use the on-chain statistical parameter whose overall correlation parameter is greater than the preset threshold as the target on-chain statistical parameter.
[0289] Detailed description of step 360
[0290] In step 360, a target prediction model is trained based on the first historical value of the statistical parameter on the target chain.
[0291] In one embodiment, the target prediction model is a linear regression model having linear coefficients and an offset. Fig.16 , step 360 includes:
[0292] Step 1610, determining a first logarithm of a first historical value;
[0293] Step 1620: Obtain the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0294] Step 1630: Determine the second logarithm of the total amount of virtual resources on the target blockchain;
[0295] Step 1640: Use the first logarithm as the input of the linear regression model, use the second logarithm as the output of the linear regression model, and solve for the linear coefficient and the offset.
[0296] Steps 1610 to 1640 are described in detail below.
[0297] In step 1610, a first logarithm of a first historical value is determined.
[0298] The first logarithm is the logarithm of the first historical value. Assuming that the first historical value is F, the first logarithm of the first historical value can be expressed as log n F, where n can be set as needed. For ease of representation, the first logarithm is represented as F_log.
[0299] In step 1620, the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value is obtained.
[0300] The total amount of virtual resources on the target blockchain is the total value of the virtual resources on the target blockchain within the historical time period corresponding to the first historical value, and the total amount of virtual resources on the target blockchain corresponds to the first historical value.
[0301] Reference Fig.11 , the first historical value of the on-chain statistical parameter is determined based on the historical resource transactions within the historical time period 1 to the historical time period 4, then the total amount of virtual resources on the target blockchain is the total value of the virtual resources on the target blockchain within the historical time period 1 to the historical time period 4.
[0302] In step 1630, a second logarithm of the total amount of virtual resources on the target blockchain is determined.
[0303] The second logarithm is the logarithm of the total amount of virtual resources on the target blockchain. Assuming the total amount of virtual resources on the target blockchain is M, the second logarithm can be expressed as log n M, where n can be set as needed, but it must be equal to the base of the first logarithm. For ease of representation, the second logarithm is represented as M_log.
[0304] In step 1640, the first logarithm is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model to solve the linear coefficient and the offset.
[0305] The linear regression model is the original model corresponding to the target prediction model. Therefore, during the training process of the target prediction model, the input of the linear regression model is the first logarithm corresponding to the first historical value of the statistical parameter on the target chain, and the output of the linear regression model is the second logarithm corresponding to the total amount of virtual resources on the target blockchain, thereby determining the linear coefficient and offset of the linear regression model.
[0306] Fig.17 A schematic diagram of a linear regression model provided in an embodiment of the present disclosure. Fig.17 The horizontal axis is the first logarithm F_log, and the vertical axis is the second logarithm M_log. Fig.17 Each point in the middle coordinate system is determined based on the first historical value of the statistical parameter on the target chain and the total amount of virtual resources on the target blockchain corresponding to the first historical value. Through these coordinate points, the linear regression model M_l og=LF(F_l og)=a+b*F_l og is determined so that the linear regression model can pass through as many points as possible, where LF represents a univariate linear regression function, b is the linear coefficient of the linear regression model, and a is the offset of the linear regression model.
[0307] It should be noted that the embodiments of the present disclosure may also adopt other function models as target prediction models, such as a univariate quadratic function model, an exponential function model, etc. However, compared with other models, the linear regression model can more accurately reflect the relationship between the first historical value and the total amount of virtual resources on the target blockchain.
[0308] The embodiment of the above steps 1610 to 1640 uses the linear regression model as the target prediction model, and uses the first logarithm of the first historical value as the input of the linear regression model, and uses the second logarithm as the output of the linear regression model to solve for the linear coefficient and the offset. The target prediction model obtained in this way can accurately reflect the value of the statistical parameter on the target chain and the relationship between the total amount of virtual resources on the target blockchain, thereby improving the prediction accuracy of the target prediction model and improving the security of virtual resource transaction processing.
[0309] In step 1610, a first logarithm of a first historical value is determined.
[0310] In step 1640, the first logarithm is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model to solve the linear coefficient and the offset.
[0311] In one embodiment, the target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet the predetermined conditions, and the linear regression model has multiple linear coefficients corresponding to the multiple target chain statistical parameters. Fig.18 , step 1610 includes:
[0312] Step 1810: determine first logarithms of respective first historical values of statistical parameters on multiple target chains;
[0313] Correspondingly, step 1640 includes:
[0314] Step 1820: Use the first logarithm of each of the multiple first historical values of the statistical parameters on the multiple target chains as the input of the linear regression model, and use the second logarithm as the output of the linear regression model to solve the offset and the linear coefficients corresponding to the statistical parameters on each target chain.
[0315] It should be noted that the predetermined condition is the determination condition of the target chain statistical parameter, and the on-chain statistical parameter that meets the predetermined condition can be used as the target chain statistical parameter. In the case of multiple target chain statistical parameters, the linear regression model has multiple linear coefficients corresponding to the multiple target chain statistical parameters, and the target chain statistical parameters and linear coefficients correspond one to one.
[0316] Step 1810 and step 1820 are described in detail below.
[0317] In step 1810, first logarithms of respective first historical values of statistical parameters on multiple target chains are determined.
[0318] For each target chain statistical parameter, first logarithms of the corresponding multiple first historical values are calculated respectively.
[0319] In step 1820, the first logarithm of each of the multiple first historical values of the statistical parameters on the multiple target chains is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model to solve the offset and the linear coefficients corresponding to the statistical parameters on each target chain.
[0320] The linear regression model has multiple linear coefficients corresponding to the statistical parameters on the target chain, while the offset has only one.
[0321] Reference Fig.19 , the overall related parameters of multiple on-chain statistical parameters that meet the preset conditions include target on-chain statistical parameter 1, target on-chain statistical parameter 2 and target on-chain statistical parameter 3, among which the first logarithm 1 corresponding to the target chain statistical parameter 1 is F1_l og, the first logarithm 2 corresponding to the target chain statistical parameter 2 is F2_l og, and the first logarithm 3 corresponding to the target chain statistical parameter 3 is F3_l og, and then the linear regression model is determined to be M_l og=a+b1*F1_l og+b2*F2_l og+b3*F3_l og, among which M_l og is the second logarithm, a is the offset, and b1, b2, and b3 are the linear coefficients corresponding to the statistical parameters on each target chain respectively.
[0322] In the embodiment of the above-mentioned steps 1810 and 1820, when there are multiple statistical parameters set on the target chain, a single linear regression model is used as the target prediction model, wherein the first logarithm of each of the multiple first historical values of the statistical parameters on the multiple target chains is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model. Then, the linear coefficients correspond to the statistical parameters on each target chain respectively. This method can quickly determine the linear regression model and improve the efficiency of virtual resource early warning processing.
[0323] In one embodiment, the target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet predetermined conditions, and the linear regression model includes multiple linear regression sub-models, each linear regression sub-model having a linear coefficient and offset corresponding to a target chain statistical parameter.
[0324] Reference Fig. 20 , step 1610 includes:
[0325] Step 2010: determine the first logarithm of each of the first historical values of the statistical parameters on the target chains;
[0326] Correspondingly, step 1640 includes:
[0327] Step 2020: For each statistical parameter on the target chain, use the first logarithm of the first historical value of the statistical parameter on the target chain as the input of the linear regression sub-model corresponding to the statistical parameter on the target chain, and use the second logarithm as the output of the linear regression sub-model corresponding to the statistical parameter on the target chain, and solve the linear coefficient and offset corresponding to the statistical parameter on the target chain.
[0328] It should be noted that the predetermined condition is the determination condition of the statistical parameter on the target chain, and the on-chain statistical parameter that meets the predetermined condition can be used as the statistical parameter on the target chain. In the case of multiple statistical parameters on the target chain, the linear regression model includes multiple linear regression sub-models, and the linear regression sub-models correspond to the statistical parameters on the target chain one by one, and the linear regression sub-model has a linear coefficient and offset corresponding to a statistical parameter on the target chain.
[0329] Step 2010 and step 2020 are described in detail below.
[0330] In step 2010, first logarithms of respective first historical values of statistical parameters on multiple target chains are determined.
[0331] For each target chain statistical parameter, first logarithms of the corresponding multiple first historical values are calculated respectively.
[0332] In step 220, for each statistical parameter on the target chain, the first logarithm of the first historical value of the statistical parameter on the target chain is used as the input of the linear regression sub-model corresponding to the statistical parameter on the target chain, and the second logarithm is used as the output of the linear regression sub-model corresponding to the statistical parameter on the target chain, so as to solve the linear coefficient and offset corresponding to the statistical parameter on the target chain.
[0333] For each statistical parameter on the target chain, the first logarithm of the corresponding first historical value is used as the input of the linear regression sub-model, and the second logarithm is used as the output of the linear regression sub-model to solve the linear coefficient and offset corresponding to the statistical parameter on the target chain, thereby determining the linear regression sub-model corresponding to the statistical parameter on the target chain.
[0334] Reference Fig.21 , the overall related parameters of multiple on-chain statistical parameters that meet the preset conditions include target on-chain statistical parameter 1, target on-chain statistical parameter 2 and target on-chain statistical parameter 3, among which the first logarithm 1 corresponding to the target on-chain statistical parameter 1 is F1_log, the first logarithm 2 corresponding to the target on-chain statistical parameter 2 is F2_log, and the first logarithm 3 corresponding to the target on-chain statistical parameter 3 is F3_log. Take F1_log as the input of the linear regression sub-model 1, take the second logarithm M_log as the output of the linear regression sub-model 1, solve the linear coefficient b1 and offset a1 corresponding to the target on-chain statistical parameter 1, and obtain the linear regression sub-model 1 as M_log=a1+b1*F1_log. Similarly, the linear regression sub-model 2 corresponding to the statistical parameter 2 on the target chain is determined to be M_log = a2 + b2 * F2_log, and the linear regression sub-model 3 corresponding to the statistical parameter 3 on the target chain is determined to be M_log = a3 + b3 * F3_log. Then, the linear regression sub-model 1, the linear regression sub-model 2 and the linear regression sub-model 3 are used as linear regression models.
[0335] In the above-mentioned embodiments of step 2010 and step 2020, when there are multiple statistical parameters set on the target chain, multiple linear regression sub-models are used as target prediction models, i.e., linear regression models. The linear regression sub-models correspond to the statistical parameters on the target chain. This method can improve the prediction accuracy of the target prediction model, thereby improving the accuracy of virtual resource transaction processing.
[0336] Detailed description of step 370
[0337] In step 370, the actual value of the statistical parameter on the target chain at the current time is obtained, and the actual value is input into the target prediction model to obtain the current predicted total amount of virtual resources on the target blockchain, and an early warning is issued based on the current predicted total amount of virtual resources.
[0338] In the above-mentioned embodiments of step 1810 and step 1820, the target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet the predetermined conditions, and the linear regression model has multiple linear coefficients corresponding to the multiple target chain statistical parameters. In this case, in one embodiment, refer to Fig. 22 , step 370 includes:
[0339] Step 2210: obtain the actual values of multiple target chain statistical parameters at the current time, input the actual values of multiple target chain statistical parameters into the target prediction model, perform calculations based on the offset and the linear coefficients corresponding to each target chain statistical parameter, and obtain the current predicted total amount of virtual resources.
[0340] Step 2210 is described in detail below.
[0341] When the linear regression model has multiple linear coefficients corresponding to multiple statistical parameters on the target chain, the actual values of the multiple statistical functions on the target chain are input into the target prediction model to perform calculations based on the offset and the multiple linear coefficients corresponding to the statistical functions on the target chain to obtain the current predicted total amount of virtual resources.
[0342] Reference Fig.19 , the linear regression model is M_l og=a+b1*F1_l og+b2*F2_l og+b3*F3_l og. The actual values of the target chain statistical parameter 1, the target chain statistical parameter 2, and the target chain statistical parameter 3 at the current time are input into the linear regression model to obtain the current predicted total amount of virtual resources M_l og.
[0343] In the embodiment of the above step 2210, when there are multiple statistical parameters on the target chain, a single linear regression model is used as the target prediction model, and the actual values of multiple statistical parameters on the target chain at the current time are input into the target prediction model to obtain the current total amount of virtual resources. This method can improve the calculation efficiency of the current total amount of virtual resources, thereby improving the efficiency of virtual resource early warning processing.
[0344] In the embodiments of steps 210 and 220 above, the target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet the predetermined conditions, and the linear regression model library has multiple linear regression sub-models, each of which has a linear coefficient and offset corresponding to a target chain statistical parameter. In this case, in one embodiment, refer to Fig.23 , step 370 includes:
[0345] Step 2310: obtain the actual values of multiple target chain statistical parameters at the current time, input the actual value of each target chain statistical parameter into the linear regression sub-model corresponding to the target chain statistical parameter, and obtain the total amount of virtual resources predicted by the target chain statistical parameter;
[0346] Step 2320: Determine the current predicted total amount of virtual resources based on the predicted total amount of virtual resources corresponding to the statistical parameters on each target chain and the statistical parameter weight of the statistical parameters on each target chain.
[0347] Step 2310 and step 2320 are described in detail below.
[0348] In step 2310, the actual values of multiple target chain statistical parameters at the current time are obtained, and the actual value of each target chain statistical parameter is input into the linear regression sub-model corresponding to the target chain statistical parameter to obtain the predicted total amount of virtual resources corresponding to the target chain statistical parameter.
[0349] The target chain statistical parameters correspond to the linear regression sub-model. For each target chain statistical parameter, the actual value of the target chain statistical parameter at the current time is input into the corresponding linear regression sub-model to obtain the total amount of virtual resources corresponding to the target chain statistical parameter.
[0350] The total amount of virtual resources predicted by each sub-item corresponds to the statistical parameters on the target chain one by one, and the total amount of virtual resources predicted by each sub-item refers to the output result of the linear regression sub-model of the statistical parameters on the corresponding target chain.
[0351] Reference Fig.21 , linear regression sub-model 1 corresponds to statistical parameter 1 on the target chain, and the actual value of statistical parameter 1 on the target chain is input into the linear regression sub-model to obtain the sub-predicted total amount of virtual resources 1. Similarly, the actual value of statistical parameter 2 on the target chain is input into the linear regression sub-model to obtain the sub-predicted total amount of virtual resources 2. The actual value of statistical parameter 3 on the target chain is input into the linear regression sub-model to obtain the sub-predicted total amount of virtual resources 3.
[0352] In step 2320, the current predicted total amount of virtual resources is determined based on the predicted total amount of virtual resources corresponding to the statistical parameters on each target chain and the statistical parameter weight of the statistical parameters on each target chain.
[0353] The statistical parameter weight is the weight of the statistical parameter on the target chain among the statistical parameters on multiple target chains. The statistical parameter weights corresponding to the statistical parameters on different target chains are different, and the statistical parameter weight of the statistical parameters on each target chain is 1.
[0354] The current predicted total amount of virtual resources can be calculated by weighting and summing the total amount of sub-predicted virtual resources corresponding to the statistical parameters on each target chain and the statistical parameter weights of the statistical parameters on each target chain. Specifically, first, for each statistical parameter on the target chain, the product of the sub-predicted total amount of virtual resources corresponding to the statistical parameter on the target chain and the statistical parameter weight is calculated, and then the sum of the products of the statistical parameters on each target chain is taken as the current predicted total amount of virtual resources. Fig.21 If linear regression sub-model 1 outputs the sub-predicted total amount of virtual resources 1, linear regression sub-model 2 outputs the sub-predicted total amount of virtual resources 2, and linear regression sub-model 3 outputs the sub-predicted total amount of virtual resources 3, the statistical parameter weight of statistical parameter 1 on the target chain is 0.2, the statistical parameter weight of statistical parameter 2 on the target chain is 0.5, and the statistical parameter weight of statistical parameter 3 on the target chain is 0.3, then the current predicted total amount of virtual resources = 0.2*sub-predicted total amount of virtual resources 1+0.5*sub-predicted total amount of virtual resources 2+0.3*sub-predicted total amount of virtual resources 3.
[0355] It should be noted that, when the linear regression model includes multiple linear regression sub-models, the embodiments of the present disclosure can also determine the current predicted total amount of virtual resources in other ways, for example, by taking the average of multiple sub-predicted total amounts of virtual resources as the current predicted total amount of virtual resources, or by taking the truncated average of multiple sub-predicted total amounts of virtual resources as the current predicted total amount of virtual resources.
[0356] In the embodiment of the above step 2310 and step 2320, when the linear regression model includes multiple linear regression sub-models, the current predicted total amount of virtual resources is determined based on the total amount of virtual resources predicted by each linear regression sub-model and the statistical parameter weights of the statistical parameters on each target chain. The value of the current predicted total amount of virtual resources determined by this method is more accurate, thereby improving the accuracy of virtual resource transaction processing.
[0357] In one embodiment, referring to Fig.24 , step 370 includes:
[0358] Step 2410: Determine a first difference between the current actual total amount of virtual resources on the target blockchain and the current predicted total amount of virtual resources;
[0359] Step 2420: If the first difference exceeds the risk threshold, issue a warning.
[0360] Step 2410 and step 2420 are described in detail below.
[0361] In step 2410, a first difference between the current actual total amount of virtual resources and the current predicted total amount of virtual resources on the target blockchain is determined.
[0362] The first difference is the first difference between the current actual total amount of virtual resources on the target blockchain and the current predicted total amount of virtual resources.
[0363] If the current actual total amount of virtual resources on the target blockchain is M_l og, and the current predicted total amount of virtual resources on the target blockchain is PM_l og, the first difference can be expressed as MB=M_l og-PM_l og.
[0364] In step 2420, if the first difference exceeds the risk threshold, an early warning is issued.
[0365] The risk threshold is a criterion for determining whether to issue an early warning. If the first difference exceeds the risk threshold, an early warning is issued. Otherwise, if the first difference does not exceed the risk threshold, no early warning is issued.
[0366] It should be noted that the risk threshold can be set as needed, and the risk threshold is greater than 0.
[0367] Assuming that the current actual total amount of virtual resources is 3200 and the current predicted total amount of virtual resources is 2600, the first difference is 600. If the risk threshold is less than 600, such as 500, then an early warning is issued. If the risk threshold is greater than or equal to 600, then no early warning is issued.
[0368] The above-mentioned step 2410 and the embodiment of step 2410 issue a warning when the first difference between the current actual total amount of virtual resources and the current predicted total amount of virtual resources on the target blockchain exceeds the risk threshold. This method can issue a warning in time and improve the security of virtual resource transaction processing.
[0369] The above is a general description of step 2410 and step 2420. Since step 2410 has been described in detail above, only the specific implementation process of step 2420 will be described in detail below.
[0370] In step 2420, if the first difference exceeds the risk threshold, an early warning is issued.
[0371] In one embodiment, referring to Fig.25 , step 2420 includes:
[0372] Step 2510: when the first difference exceeds the risk threshold, detecting the duration of the first difference exceeding the risk threshold;
[0373] Step 2520: If the duration exceeds a predetermined duration threshold, issue a warning.
[0374] Step 2510 and step 2520 are described in detail below.
[0375] In step 2510, when the first difference exceeds the risk threshold, a duration for which the first difference exceeds the risk threshold is detected.
[0376] The duration is the time that the first difference exceeds the risk threshold.
[0377] In step 2520, if the duration exceeds a predetermined duration threshold, an alert is issued.
[0378] The predetermined duration threshold is a judgment condition for whether to issue an early warning. If the first difference exceeds the risk threshold and the duration exceeds the predetermined duration threshold, an early warning is issued. If the first difference is less than the risk threshold, or the first difference exceeds the risk threshold but the duration does not exceed the duration threshold, no early warning is issued.
[0379] Assume that the current predicted total virtual resource amount is 3200, the risk threshold is 600, and the scheduled duration threshold is 2 hours. If the current actual total virtual resource amount is 4000 for 3 hours, an alert is issued. If the current actual total virtual resource amount is 4000 for 1 hour and becomes 3500 at the end of the hour, no alert is issued. If the current actual total virtual resource amount is 3500, no alert is issued.
[0380] The embodiments of step 2510 and step 2520 are provided with a predetermined duration threshold, and an early warning is issued when the first difference exceeds the risk threshold and the duration of the first difference exceeding the risk threshold exceeds the predetermined duration threshold. This method is applicable to the situation where the total amount of virtual resources fluctuates too much in a short period of time, and improves the security of virtual resource transaction processing.
[0381] In another embodiment, the virtual resource early warning processing method is executed according to a time period, referring to Fig.26 , step 2420 includes:
[0382] Step 2610: If the first difference exceeds the risk threshold, determine the number of consecutive time periods before the current time period during which the first difference exceeds the risk threshold;
[0383] Step 2620: Determine the warning level based on the number of consecutive time periods;
[0384] Step 2630: Issue a warning based on the warning level.
[0385] It should be noted that the total amount of virtual resources on the target blockchain changes in real time. In order to improve the efficiency of virtual resource warning processing, the embodiment of the present disclosure executes the virtual resource warning processing method according to the time period. Specifically, at each interval time period, the actual value of the statistical parameter on the target chain at the current time is input into the target prediction model to obtain the current predicted total amount of virtual resources, and the first difference is calculated based on the current predicted total amount of virtual resources and the current actual total amount of virtual resources corresponding to the current time period.
[0386] It should be noted that the time period can be set as needed, and it can be 30 minutes, 1 hour, 2 hours, etc.
[0387] Steps 2610 to 2630 are described in detail below.
[0388] In step 2610, if the first difference exceeds the risk threshold, the number of consecutive time periods before the current time period during which the first difference exceeds the risk threshold is determined.
[0389] The number of continuous time periods is the number of continuous time periods in which the first difference before the current time exceeds the risk threshold. The number of continuous time periods does not include the current time period. Assuming that the current time is 16:00, and the time period for executing the virtual resource early warning processing method is 30 minutes, the first difference of the current time exceeds the risk threshold, and the first difference from 14:00 to the current time exceeds the risk threshold, then the number of continuous time periods is 3.
[0390] In step 2620, the warning level is determined based on the number of consecutive time periods.
[0391] The warning level is determined based on the number of consecutive time periods.
[0392] The embodiment of the present disclosure may be provided with a plurality of cycle number intervals to determine the warning degree according to the interval in which the continuous time cycle number is located.
[0393] Assume that there are three warning levels, namely low, medium and high. The cycle number interval (0,2] corresponds to the low warning level, the cycle number interval (2,6] corresponds to the medium warning level, and the cycle number interval (6,∞] corresponds to the high warning level. If the continuous time is 5, the warning level is medium. If the continuous time is 10, the level of Xu Jing is high.
[0394] In step 2630, an early warning is issued based on the warning level.
[0395] After determining the warning level, a warning can be issued based on the warning level.
[0396] The disclosed embodiment may indicate the warning degree through a variety of display modes of the virtual resource platform interface. Fig. 27The interface shown sets the warning level to five levels, and indicates the warning level by the number of solid five-pointed stars. Fig. 27 The interface shown corresponds to the third level of warning. In addition, the warning level can also be indicated by the color of the warning message, for example, red indicates a high warning level, yellow indicates a medium warning level, and green indicates a low warning level.
[0397] In another embodiment, the disclosed embodiment may also set a time period threshold, and issue a warning when the number of duration periods is greater than the number of consecutive time periods.
[0398] In the embodiment of the above steps 2610 to 2630, the virtual resource warning processing method is executed according to the time period. When the first difference exceeds the risk threshold, the number of consecutive time periods before the current time period in which the first difference exceeds the risk threshold is determined, and then the warning level is determined. This method issues warnings based on the warning level, realizes graded warnings, and can further improve the security of virtual resource transaction processing.
[0399] In one embodiment, the training set of the target prediction model of the embodiment of the present disclosure, that is, the regression sum of squares (R-square) of the first historical values of the statistical parameters on the target chain is as high as 0.9, and the R-square of the verification set is as high as 0.8, indicating that the target prediction model has strong interpretability, the top of the early warning indicator is consistent with the top of the virtual resource, the bottom of the early warning indicator is consistent with the bottom of the virtual resource, the early warning indicator oscillates within a fixed range, and the accuracy of prediction and early warning is very high, which indicates that the security of virtual resource transaction processing is very high.
[0400] Determination of risk threshold
[0401] In the above-mentioned embodiment of step 2410 and step 2420, if the first difference between the current actual total amount of virtual resources and the current predicted total amount of virtual resources exceeds the risk threshold, an early warning is issued. Fig.28 , the risk threshold is determined by:
[0402] Step 2810: Obtain static attributes of the target user currently processing virtual resource transactions;
[0403] Step 2820: Obtain associated transactions associated with the target user from the historical virtual resource transactions recorded on the target blockchain;
[0404] Step 2830: Input the associated transaction into the tag attribute recognition model to obtain the tag attribute of the target user;
[0405] Step 2840: Input the static attributes and label attributes into the risk threshold prediction model to obtain the risk threshold.
[0406] Steps 2810 to 2840 are described in detail below.
[0407] In step 2810, the static attributes of the target user currently performing the virtual resource transaction processing are obtained.
[0408] The target user is the target user who is currently processing virtual resource transactions on the target blockchain. Figure 2A and Figure 2B The target user is a user of the virtual resource platform, and the target user is specifically user A.
[0409] Static attributes are the attributes of the target user, and they are fixed in a short period of time, such as the target user’s age, occupation, and risk tolerance filled in by the user.
[0410] In step 2820, an associated transaction associated with the target user is obtained from the historical virtual resource transactions recorded on the target blockchain.
[0411] An associated transaction is a transaction in the historical virtual resource transaction that is associated with the target user, for example, the target user opens a virtual resource account, the target user forwards virtual resources to other users, the target user receives virtual resources forwarded by other users, etc.
[0412] In step 2830, the associated transaction is input into the tag attribute recognition model to obtain the tag attributes of the target user.
[0413] The tag identification model is a model that identifies the tag attributes of the target user. The tag identification model is the associated transaction, and the output is the tag attributes of the target user. The tag attribute identification model can summarize multiple associated transactions of the user to obtain the tag attributes. For example, the actual risk tolerance of the target user, the amount of virtual assets of the target user, the number of forwarding resources between the target user and other users, and the amount of forwarding resources.
[0414] In step 2840, the static attributes and label attributes are input into the risk threshold prediction model to obtain the risk threshold.
[0415] The risk threshold prediction model is used to set the risk threshold of the target user. The risk threshold prediction model can predict the risk threshold based on the input static attributes and label attributes.
[0416] Reference Fig.29The disclosed embodiment first determines the static attributes of the target user, then determines the associated transactions associated with the target user in multiple historical virtual resource transactions of the target blockchain, and inputs the associated transactions into the tag attribute recognition model to obtain the tag attributes of the target user. Finally, the static attributes and tag attributes are used as inputs to the risk threshold prediction model, so that the risk threshold prediction model outputs the risk threshold.
[0417] The embodiment of the above steps 2810 to 2840 inputs the associated transactions of the target user on the target blockchain into the tag attribute recognition model to determine the tag attributes, and then inputs the tag attributes and the static attributes of the target user into the risk threshold prediction model to obtain the risk threshold. The risk threshold is matched with the target user, thereby realizing personalized early warning and further improving the security of virtual resource transaction processing.
[0418] Virtual resource processing in the warning state
[0419] In the above-mentioned embodiment of step 2410 and step 2420, if the first difference between the current actual total amount of virtual resources and the current predicted total amount of virtual resources exceeds the risk threshold, an early warning is issued. In this case, in one embodiment, refer to Fig.30 After step 2420, the virtual resource early warning processing method further includes:
[0420] Step 3010, determining a second difference between the first difference and the risk threshold;
[0421] Step 3020: Obtain the current amount of virtual resources in the resource pool of the target user;
[0422] Step 3030: Determine a virtual resource reduction amount based on the current virtual resource amount and the second difference;
[0423] Step 3040: based on the virtual resource reduction amount, reduce the current virtual resource amount.
[0424] Steps 3010 to 3040 are described in detail below.
[0425] In step 3010, a second difference between the first difference and the risk threshold is determined.
[0426] The second difference is the difference between the first difference and the risk threshold.
[0427] If the first difference is MB=M_log-PM_log, and the risk threshold is N, then the second difference can be expressed as MB-N.
[0428] In step 3020, the current amount of virtual resources in the resource pool of the target user is obtained.
[0429] The resource pool is the location of the target user's virtual resources on the target blockchain. The current virtual resource amount is the number of virtual resources currently held by the target user on the target blockchain.
[0430] Reference Figure 2A , the current amount of virtual resources of the target user on the target blockchain corresponding to the virtual resource platform is 1000.
[0431] In step 3030, the virtual resource reduction amount is determined based on the current virtual resource amount and the second difference.
[0432] The virtual resource reduction amount is determined based on the current virtual resource amount and the second difference. The virtual resource amount is proportional to the second difference. The larger the second difference, the greater the virtual resource reduction amount.
[0433] It should be noted that the embodiments of the present disclosure can determine the virtual resource reduction amount based on the current virtual resource amount and the second difference in a variety of ways. For example, a table of the second difference and the virtual resource reduction ratio is constructed, and then the virtual resource reduction ratio is determined by searching in the table based on the second difference, and the product of the virtual resource reduction ratio and the current virtual resource amount is used as the virtual resource reduction amount. In addition, a reduction amount prediction model can also be constructed, and the input of the reduction amount prediction model is the current virtual resource amount and the second difference, and the output of the reduction amount prediction model is the virtual resource reduction amount.
[0434] In step 3040, the current amount of virtual resources is reduced based on the virtual resource reduction amount.
[0435] After determining the virtual resource reduction amount, reduce the current virtual resource amount in the resource pool of the target user.
[0436] Reference Fig.11 , the virtual resources are reduced to 400, and the warning message on the virtual resource platform interface prompts user A to reduce the virtual resources by 400. After that, user A can operate by withdrawing the control to reduce the current virtual resources to 600.
[0437] The above-mentioned embodiments of steps 3010 to 3040 can further improve the security of virtual resource transaction processing by determining the amount of virtual resource reduction based on the current amount of virtual resources in the resource pool of the target user and the second difference between the first difference and the risk threshold after issuing an early warning.
[0438] It is to be understood that, although the steps in the above-mentioned flowcharts are sequentially displayed according to the characterization of arrows, these steps are not necessarily executed in sequence according to the order of arrow characterization. Unless there is a clear description in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0439] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to object characteristics such as object attribute information or attribute information sets, the permission or consent of the object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain object attribute information, the object's separate permission or separate consent will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the object's separate permission or separate consent, the necessary object-related data used to enable the normal operation of the embodiment of the present application will be obtained.
[0440] Description of the apparatus and device of the present disclosure
[0441] Fig.32 A schematic diagram of the structure of a virtual resource early warning processing device provided in an embodiment of the present disclosure. The virtual resource early warning processing device 3200 includes:
[0442] The first acquisition unit 3210 is used to acquire the historical virtual resource transactions recorded on the target blockchain, and acquire the historical transaction attributes from the historical transaction attribute field in the historical virtual resource transactions;
[0443] The classification unit 3220 is used to classify the historical virtual resource transactions based on the historical transaction attributes to obtain the virtual resource transaction class;
[0444] The first determining unit 3230 is used to determine first historical values of multiple on-chain statistical parameters of the virtual resource transaction class based on each historical virtual resource transaction in the virtual resource transaction class;
[0445] The second determining unit 3240 is used to determine, for each on-chain statistical parameter, a correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain based on the first historical value of the on-chain statistical parameter, and determine an overall correlation parameter of the on-chain statistical parameter based on the correlation coefficient corresponding to each virtual resource transaction class;
[0446] The third determining unit 3250 is used to determine the target on-chain statistical parameter from the multiple on-chain statistical parameters based on the overall correlation parameter of each on-chain statistical parameter;
[0447] A training unit 3260, configured to train a target prediction model based on a first historical value of a statistical parameter on a target chain;
[0448] The second acquisition unit 3270 is used to obtain the actual value of the statistical parameter on the target chain at the current time, input the actual value into the target prediction model, obtain the current predicted total amount of virtual resources on the target blockchain, and issue an early warning based on the current predicted total amount of virtual resources.
[0449] Optionally, the first acquiring unit 3210 is specifically configured to:
[0450] Obtain the historical virtual resource blocks on the target blockchain;
[0451] Decompose historical virtual resource blocks into historical virtual resource transactions.
[0452] Optionally, the historical transaction attribute is a historical transaction type;
[0453] The classification unit 3220 is specifically used for:
[0454] The historical virtual resource transactions of the same historical transaction type are classified into the same virtual resource transaction class.
[0455] Optionally, the historical transaction attribute is a plurality of historical transaction attributes, and the classification unit 3220 is specifically used to:
[0456] Based on multiple historical transaction attributes of historical virtual resource transactions, a clustering algorithm is used to cluster multiple historical virtual resource transactions to obtain virtual resource transaction classes.
[0457] Optionally, the first determining unit 3230 is specifically configured to:
[0458] In each historical time period, based on each historical virtual resource transaction in the virtual resource transaction class obtained in the historical time period, determine a first historical sub-value of a plurality of on-chain statistical parameters corresponding to the historical time period;
[0459] For a single on-chain statistical parameter, a first historical sub-value vector is generated based on the first historical sub-values obtained in each historical time period as the first historical value of the on-chain statistical parameter.
[0460] Optionally, the second determining unit 3240 is specifically configured to:
[0461] Obtaining a correlation coefficient function, where the correlation coefficient function is a function of the first historical value and the total amount of virtual resources on the target blockchain;
[0462] Obtain the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0463] Substitute the first historical value and the total amount of virtual resources on the target blockchain into the correlation coefficient function to obtain the correlation coefficient.
[0464] Optionally, the second determining unit 3240 is further configured to:
[0465] Obtain the number of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0466] Get the unit resource quantity represented by a single virtual resource in the historical time period;
[0467] Based on the number of virtual resources and the unit resource amount on the target blockchain, the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value is determined.
[0468] Optionally, the second determining unit 3240 is further configured to:
[0469] Based on the correlation coefficients corresponding to each virtual resource transaction class, the overall correlation parameters of the on-chain statistical parameters are determined, including:
[0470] Get the class weight of each virtual resource transaction class;
[0471] Based on the correlation coefficient and class weight of each virtual resource transaction class, the overall correlation parameter of the on-chain statistical parameters is calculated.
[0472] Optionally, the third determining unit 3250 is specifically configured to:
[0473] The on-chain statistical parameter with the largest overall correlation parameter is determined as the target on-chain statistical parameter.
[0474] Optionally, the target prediction model is a linear regression model having linear coefficients and an offset;
[0475] The training unit 3260 is specifically used for:
[0476] determining a first logarithm of a first historical value;
[0477] Obtain the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value;
[0478] Determine the second logarithm of the total amount of virtual resources on the target blockchain;
[0479] The first logarithm is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model to solve the linear coefficient and offset.
[0480] Optionally, the target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet predetermined conditions; the linear regression model has multiple linear coefficients corresponding to the multiple target chain statistical parameters respectively;
[0481] The training unit 3260 is further specifically used for:
[0482] Determine a first logarithm of each of a plurality of first historical values of a statistical parameter on a plurality of target chains;
[0483] The first logarithm of each of the multiple first historical values of the statistical parameters on the multiple target chains is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model to solve the offset and the linear coefficients corresponding to the statistical parameters on each target chain.
[0484] Optionally, the second acquiring unit 3270 is specifically configured to:
[0485] The actual values of multiple target chain statistical parameters at the current time are obtained, and the actual values of multiple target chain statistical parameters are input into the target prediction model. The linear coefficients corresponding to the offset and each target chain statistical parameter are calculated to obtain the current predicted total amount of virtual resources.
[0486] Optionally, the target chain statistical parameter is a plurality of target chain statistical parameters whose overall correlation parameters meet predetermined conditions; the linear regression model includes a plurality of linear regression sub-models, each linear regression sub-model having a linear coefficient and an offset corresponding to a target chain statistical parameter;
[0487] The training unit 3260 is further specifically used for:
[0488] Determine a first logarithm of each of a plurality of first historical values of a statistical parameter on a plurality of target chains;
[0489] For each statistical parameter on the target chain, the first logarithm of the first historical value of the statistical parameter on the target chain is used as the input of the linear regression sub-model corresponding to the statistical parameter on the target chain, and the second logarithm is used as the output of the linear regression sub-model corresponding to the statistical parameter on the target chain to solve the linear coefficient and offset corresponding to the statistical parameter on the target chain.
[0490] Optionally, the second acquiring unit 3270 is specifically configured to:
[0491] Obtain the actual values of multiple target chain statistical parameters at the current time, input the actual value of each target chain statistical parameter into the linear regression sub-model corresponding to the target chain statistical parameter, and obtain the total amount of virtual resources predicted by the target chain statistical parameter;
[0492] Based on the predicted total amount of virtual resources corresponding to the statistical parameters on each target chain and the statistical parameter weights of the statistical parameters on each target chain, the current predicted total amount of virtual resources is determined.
[0493] Optionally, the second acquiring unit 3270 is further configured to:
[0494] Determine the first difference between the current actual total amount of virtual resources on the target blockchain and the current predicted total amount of virtual resources;
[0495] If the first difference exceeds the risk threshold, an early warning is issued.
[0496] Optionally, the virtual resource early warning processing device further includes:
[0497] A third acquisition unit is used to acquire static attributes of a target user currently performing virtual resource transaction processing;
[0498] A fourth acquisition unit, configured to acquire an associated transaction associated with a target user from historical virtual resource transactions recorded on a target blockchain;
[0499] A first input unit is used to input the associated transaction into the tag attribute recognition model to obtain the tag attribute of the target user;
[0500] The second input unit is used to input the static attributes and the label attributes into the risk threshold prediction model to obtain the risk threshold.
[0501] Optionally, the virtual resource early warning processing device further includes:
[0502] A fourth determining unit, configured to determine a second difference between the first difference and a risk threshold;
[0503] A fifth acquisition unit, used to acquire the current amount of virtual resources in the resource pool of the target user;
[0504] A fifth determining unit, configured to determine a virtual resource reduction amount based on the current virtual resource amount and the second difference;
[0505] The reduction unit is used to reduce the current virtual resource amount based on the virtual resource reduction amount.
[0506] Optionally, the second acquiring unit 3270 is further configured to:
[0507] In the case where the first difference exceeds the risk threshold, detecting a duration for which the first difference exceeds the risk threshold;
[0508] If the duration exceeds the preset duration threshold, an alert is issued.
[0509] Optionally, the virtual resource early warning processing method is executed according to a time period;
[0510] The second acquisition unit 3270 is further specifically configured to:
[0511] If the first difference exceeds the risk threshold, determining the number of consecutive time periods before the current time period during which the first difference exceeds the risk threshold;
[0512] Determine the warning level based on the number of consecutive time periods;
[0513] Based on the warning level, an early warning is issued.
[0514] Reference Fig.33 , Fig.33 The structure block diagram of the terminal part for implementing the virtual resource early warning processing method of the embodiment of the present disclosure includes: a radio frequency (RF) circuit 3310, a memory 3315, an input unit 3330, a display unit 3340, a sensor 3350, an audio circuit 3360, a wireless fidelity (WiFi) module 3370, a processor 3380, and a power supply 3390. Those skilled in the art can understand that Fig.33 The terminal structure shown does not constitute a limitation on the mobile phone or computer, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0515] The RF circuit 3310 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 3380 for processing; in addition, the designed uplink data is sent to the base station.
[0516] The memory 3315 may be used to store software programs and modules. The processor 3380 executes various functional applications and data processing of the content terminal by running the software programs and modules stored in the memory 3315 .
[0517] The input unit 3330 may be used to receive input digital or character information and generate key signal input related to the setting and function control of the content terminal. Specifically, the input unit 3330 may include a touch panel 3331 and other input devices 3332.
[0518] The display unit 3340 may be used to display input information or provided information and various menus of the content terminal. The display unit 3340 may include a display panel 3341.
[0519] The audio circuit 3360, the speaker 3361, and the microphone 3362 may provide an audio interface.
[0520] In this embodiment, the processor 3380 included in the terminal can execute the virtual resource early warning processing method of the previous embodiment.
[0521] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to content recommendation, data screening, etc.
[0522] Fig.34 A block diagram of the structure of a portion of a server for implementing the virtual resource early warning processing method of an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 3422 (e.g., one or more processors) and memory 3432, and one or more storage media 3430 (e.g., one or more mass storage devices) storing application programs 3442 or data 3444. Among them, the memory 3432 and the storage medium 3430 may be temporary storage or permanent storage. The program stored in the storage medium 3430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 3422 may be configured to communicate with the storage medium 3430 to execute a series of instruction operations in the storage medium 3430 on the server.
[0523] The server may also include one or more power supplies 3426, one or more wired or wireless network interfaces 3450, one or more input and output interfaces 3458, and / or one or more operating systems 3441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0524] The central processor 3422 in the server can be used to execute the virtual resource early warning processing method of the embodiment of the present disclosure.
[0525] The embodiment of the present disclosure further provides a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the virtual resource early warning processing methods of the aforementioned embodiments.
[0526] The embodiment of the present disclosure also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned virtual resource early warning processing method.
[0527] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar contents, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0528] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated content, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the associated content before and after is in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0529] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.
[0530] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0531] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0532] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0533] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server 130, or network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0534] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0535] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A virtual resource early warning processing method, characterized in that: include: Obtaining a historical virtual resource transaction recorded on the target blockchain, and obtaining a historical transaction attribute from a historical transaction attribute field in the historical virtual resource transaction; Classifying the historical virtual resource transactions based on the historical transaction attributes to obtain virtual resource transaction classes; Based on each historical virtual resource transaction in the virtual resource transaction class, determining first historical values of multiple on-chain statistical parameters of the virtual resource transaction class; For each of the on-chain statistical parameters, based on the first historical value of the on-chain statistical parameter, determine the correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain, and based on the correlation coefficient corresponding to each virtual resource transaction class, determine the overall correlation parameter of the on-chain statistical parameter; Determine a target on-chain statistical parameter from among the multiple on-chain statistical parameters based on the overall correlation parameter of each of the on-chain statistical parameters; Training a target prediction model based on the first historical value of the statistical parameter on the target chain; The actual value of the statistical parameter on the target chain at the current time is obtained, the actual value is input into the target prediction model, the current predicted total amount of virtual resources on the target blockchain is obtained, and an early warning is issued based on the current predicted total amount of virtual resources.
2. The virtual resource early warning processing method according to claim 1, characterized in that: The step of obtaining the historical virtual resource transactions recorded on the target blockchain includes: Obtain the historical virtual resource blocks on the target blockchain; The historical virtual resource blocks are decomposed into the historical virtual resource transactions.
3. The virtual resource early warning processing method according to claim 1, characterized in that: The historical transaction attribute is the historical transaction type; The classifying the historical virtual resource transactions based on the historical transaction attributes to obtain virtual resource transaction classes includes: The historical virtual resource transactions of the same historical transaction type are classified into the same virtual resource transaction class.
4. The virtual resource early warning processing method according to claim 1, characterized in that: The historical transaction attribute is a plurality of historical transaction attributes; The classifying the historical virtual resource transactions based on the historical transaction attributes to obtain virtual resource transaction classes includes: Based on the multiple historical transaction attributes of the historical virtual resource transactions, the multiple historical virtual resource transactions are clustered using a clustering algorithm to obtain the virtual resource transaction class.
5. The virtual resource early warning processing method according to claim 1, characterized in that: The determining, based on each historical virtual resource transaction in the virtual resource transaction class, first historical values of multiple on-chain statistical parameters of the virtual resource transaction class includes: In each historical time period, based on each historical virtual resource transaction in the virtual resource transaction class obtained in the historical time period, determine the first historical sub-values of the multiple on-chain statistical parameters corresponding to the historical time period; For a single on-chain statistical parameter, a first historical sub-value vector is generated based on the first historical sub-values obtained in each historical time period as the first historical value of the on-chain statistical parameter.
6. The virtual resource early warning processing method according to claim 1, characterized in that: The determining, for each of the on-chain statistical parameters, a correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain based on the first historical value of the on-chain statistical parameter, includes: Obtaining a correlation coefficient function, where the correlation coefficient function is a function of the first historical value and the total amount of virtual resources on the target blockchain; Obtaining the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value; Substituting the first historical value and the total amount of virtual resources on the target blockchain into the correlation coefficient function, the correlation coefficient is obtained.
7. The virtual resource early warning processing method according to claim 6 is characterized in that: The obtaining the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value includes: Obtain the number of virtual resources on the target blockchain in the historical time period corresponding to the first historical value; Obtaining the unit resource quantity represented by a single virtual resource in the historical time period; Based on the number of virtual resources on the target blockchain and the unit resource amount, determine the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value.
8. The virtual resource early warning processing method according to claim 1, characterized in that: The determining of the overall correlation parameter of the on-chain statistical parameter based on the correlation coefficient corresponding to each virtual resource transaction class includes: Get the class weight of each virtual resource transaction class; Based on the correlation coefficients and class weights of the various virtual resource transaction classes, the overall correlation parameters of the on-chain statistical parameters are calculated.
9. The virtual resource early warning processing method according to claim 1, characterized in that: The determining of a target on-chain statistical parameter from among the plurality of on-chain statistical parameters based on the overall correlation parameter of each of the on-chain statistical parameters comprises: The on-chain statistical parameter with the largest overall correlation parameter is determined as the target on-chain statistical parameter.
10. The virtual resource early warning processing method according to claim 1, characterized in that: The target prediction model is a linear regression model having a linear coefficient and an offset; The training of a target prediction model based on the first historical value of the statistical parameter on the target chain includes: determining a first logarithm of the first historical value; Obtaining the total amount of virtual resources on the target blockchain in the historical time period corresponding to the first historical value; Determining a second logarithm of the total amount of virtual resources on the target blockchain; The first logarithm is used as the input of the linear regression model, and the second logarithm is used as the output of the linear regression model to solve the linear coefficient and the offset.
11. The virtual resource early warning processing method according to claim 10, characterized in that: The target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet predetermined conditions; The linear regression model has a plurality of linear coefficients corresponding to the plurality of target chain statistical parameters respectively; The determining the first logarithm of the first historical value comprises: determining the first logarithm of each of the plurality of first historical values of the statistical parameters on the plurality of target chains; The using the first logarithm as the input of the linear regression model and the second logarithm as the output of the linear regression model to solve the linear coefficient and the offset includes: using the first logarithm of each of the multiple first historical values of the statistical parameters on the multiple target chains as the input of the linear regression model and the second logarithm as the output of the linear regression model to solve the offset and the linear coefficients corresponding to the statistical parameters on each target chain.
12. The virtual resource early warning processing method according to claim 10, characterized in that: The target chain statistical parameters are multiple target chain statistical parameters whose overall correlation parameters meet predetermined conditions; the linear regression model includes multiple linear regression sub-models, each of which has the linear coefficient and the offset corresponding to one of the target chain statistical parameters; The determining the first logarithm of the first historical value comprises: determining the first logarithm of each of the plurality of first historical values of the statistical parameters on the plurality of target chains; The using the first logarithm as the input of the linear regression model and the second logarithm as the output of the linear regression model to solve the linear coefficient and the offset includes: for each statistical parameter on the target chain, using the first logarithm of the first historical value of the statistical parameter on the target chain as the input of the linear regression sub-model corresponding to the statistical parameter on the target chain, using the second logarithm as the output of the linear regression sub-model corresponding to the statistical parameter on the target chain, and solving the linear coefficient and the offset corresponding to the statistical parameter on the target chain.
13. The virtual resource early warning processing method according to claim 1, characterized in that: The issuing of an early warning based on the current predicted total amount of virtual resources includes: Determine a first difference between the current actual total amount of virtual resources on the target blockchain and the current predicted total amount of virtual resources; If the first difference exceeds the risk threshold, the warning is issued.
14. The virtual resource early warning processing method according to claim 13, characterized in that: The risk threshold is determined by: Obtain static attributes of the target user currently processing virtual resource transactions; Acquire, from the historical virtual resource transactions recorded on the target blockchain, associated transactions associated with the target user; Inputting the associated transaction into a tag attribute recognition model to obtain the tag attribute of the target user; The static attribute and the tag attribute are input into a risk threshold prediction model to obtain the risk threshold.
15. The virtual resource early warning processing method according to claim 13, characterized in that: If the first difference exceeds the risk threshold, after the warning is issued, the virtual resource warning processing method further includes: determining a second difference between the first difference and the risk threshold; Obtaining the current amount of virtual resources in the resource pool of the target user; Determining a virtual resource reduction amount based on the current virtual resource amount and the second difference; Based on the virtual resource reduction amount, the current virtual resource amount is reduced.
16. The virtual resource early warning processing method according to claim 13, characterized in that: The virtual resource early warning processing method is executed according to a time period; If the first difference exceeds a risk threshold, issuing the warning includes: If the first difference exceeds the risk threshold, determining the number of consecutive time periods before the current time period during which the first difference exceeds the risk threshold; Determining a warning level based on the number of consecutive time periods; Based on the warning level, the warning is issued.
17. A virtual resource early warning processing device, characterized in that: include: A first acquisition unit is used to acquire historical virtual resource transactions recorded on a target blockchain, and acquire historical transaction attributes from a historical transaction attribute field in the historical virtual resource transactions; A classification unit, used for classifying the historical virtual resource transactions based on the historical transaction attributes to obtain virtual resource transaction classes; A first determining unit, configured to determine first historical values of a plurality of on-chain statistical parameters of the virtual resource transaction class based on each historical virtual resource transaction in the virtual resource transaction class; A second determination unit is used to determine, for each of the on-chain statistical parameters, a correlation coefficient between the on-chain statistical parameter and the total amount of virtual resources on the target blockchain based on the first historical value of the on-chain statistical parameter, and determine an overall correlation parameter of the on-chain statistical parameter based on the correlation coefficient corresponding to each virtual resource transaction class; A third determining unit, configured to determine a target on-chain statistical parameter from among the multiple on-chain statistical parameters based on the overall correlation parameter of each of the on-chain statistical parameters; A training unit, configured to train a target prediction model based on the first historical value of the statistical parameter on the target chain; The second acquisition unit is used to obtain the actual value of the statistical parameter on the target chain at the current time, input the actual value into the target prediction model, obtain the current predicted total amount of virtual resources on the target blockchain, and issue an early warning based on the current predicted total amount of virtual resources.
18. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the virtual resource early warning processing method according to any one of claims 1 to 16 is implemented.
19. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the virtual resource early warning processing method according to any one of claims 1 to 16 is implemented.
20. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the virtual resource early warning processing method according to any one of claims 1 to 16.
Citation Information
Patent Citations
VOD (Video On Demand) application resource consumption prediction method based on virtual machine
CN102831013A
Resource matching method, device and apparatus
CN110532092A
Data processing method and device, equipment and medium
CN112417327A
Block chain attack transaction alarm method, related device and medium
CN116961989A
Device for adjusting used of system resource and its method
CN1538297A
