CN112738213A - Block chain-based task demand response method, device, system and storage medium - Google Patents

Block chain-based task demand response method, device, system and storage medium Download PDF

Info

Publication number
CN112738213A
CN112738213A CN202011573438.0A CN202011573438A CN112738213A CN 112738213 A CN112738213 A CN 112738213A CN 202011573438 A CN202011573438 A CN 202011573438A CN 112738213 A CN112738213 A CN 112738213A
Authority
CN
China
Prior art keywords
block chain
demand response
task
preset
blockchain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011573438.0A
Other languages
Chinese (zh)
Other versions
CN112738213B (en
Inventor
赵天钰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202011573438.0A priority Critical patent/CN112738213B/en
Publication of CN112738213A publication Critical patent/CN112738213A/en
Application granted granted Critical
Publication of CN112738213B publication Critical patent/CN112738213B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5066Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

The invention discloses a block chain-based task demand response method, which comprises the following steps: receiving a task participating in demand response based on a preset block chain, and acquiring an evaluation index of the task; selecting a target block from all blocks of the preset block chain based on the evaluation index; and distributing the task to the target block for processing. The invention also discloses a block chain-based task demand response device, a block chain-based task demand response system and a computer-readable storage medium. The invention improves the reliability of data and the response speed of task requirements.

Description

Block chain-based task demand response method, device, system and storage medium
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a method, an apparatus, a system, and a computer-readable storage medium for task demand response based on a block chain.
Background
With the rapid development of the internet of things, the task demand response of the server shows millions of increases, and the credibility requirements of behaviors and data in the task demand response are higher. Servers are currently optimized and regulated manually to handle the ever-increasing task demand response. However, the servers are optimized and regulated manually, the interaction between data still depends on the centralized server too much, so that the reliability of the data is not high, and the task demand response is too slow due to low data interaction efficiency.
Disclosure of Invention
The invention mainly aims to provide a block chain-based task demand response method, a block chain-based task demand response device, a block chain-based task demand response system and a computer-readable storage medium, and aims to improve the reliability of data and improve the response speed of task demands.
In order to achieve the above object, the present invention provides a block chain based task demand response method, which includes the following steps:
receiving a task participating in demand response based on a preset block chain, and acquiring an evaluation index of the task;
selecting a target block from all blocks of the preset block chain based on the evaluation index;
and distributing the task to the target block for processing.
Optionally, the evaluation index includes a plurality of evaluation indexes, and the step of selecting a target block from the blocks of the preset block chain based on the evaluation indexes includes:
carrying out standardization processing on the plurality of evaluation indexes to obtain a plurality of standardized evaluation indexes;
performing weighting operation on the plurality of standardized evaluation indexes to obtain weights of the plurality of evaluation indexes;
and selecting a target block from the blocks of the preset block chain based on the weight.
Optionally, before the step of receiving the task participating in the demand response based on the preset block chain and acquiring the evaluation index of the task, the method further includes:
dividing a preset block chain into side chains corresponding to a plurality of preset evaluation indexes, wherein the number of the side chains is the same as that of the plurality of evaluation indexes, and the side chains comprise nodes for processing tasks;
and constructing a main chain in the preset block chain, and respectively connecting each side chain with the main chain, wherein the main chain comprises a main node with a sharing function.
Optionally, the block chain-based task demand response method further includes:
when a request for adding the application into the preset block chain is detected, verifying whether the application has an adding authority or not;
and if the application has the adding permission, adding the application into the preset block chain so as to allow a plurality of applications to perform information interaction based on the preset block chain.
Optionally, the step of adding the application to the preset block chain includes:
acquiring a unique identifier of the application;
connecting the application to a node in the preset block chain based on the unique identification.
Optionally, the block chain-based task demand response method further includes:
when the preset block link receives a plurality of tasks, similarity calculation is carried out on the tasks;
and connecting the task with the similarity value smaller than a preset similarity threshold value to the same block in the preset block chain based on the similarity calculation result.
Optionally, the step of performing similarity calculation on the plurality of tasks includes:
calculating the occupation ratios of the evaluation indexes of the tasks respectively;
carrying out standardization processing on the ratio to obtain a standardized ratio;
and calculating Euclidean distances among the plurality of tasks based on the normalized occupation ratio, wherein the Euclidean distances are similarity calculation results.
In addition, to achieve the above object, the present invention further provides a task demand response device based on a block chain, where the task demand response device based on a block chain includes:
the index acquisition module is used for receiving a task participating in demand response based on a preset block chain and acquiring an evaluation index of the task;
the block selection module is used for selecting a target block from all blocks of the preset block chain based on the evaluation index;
and the task processing module is used for distributing the tasks to the target blocks for processing.
In addition, to achieve the above object, the present invention further provides a task demand response system based on a block chain, where the task demand response system based on a block chain includes: the system comprises a memory, a processor and a blockchain-based task demand response program stored on the memory and capable of running on the processor, wherein when the blockchain-based task demand response program is executed by the processor, the steps of the blockchain-based task demand response method are realized.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium, on which a task demand response program based on a block chain is stored, and when the task demand response program based on the block chain is executed by a processor, the method implements the steps of the task demand response method based on the block chain as described above.
The invention provides a block chain-based task demand response method, a device and a system and a computer-readable storage medium, which are used for receiving a task participating in demand response based on a preset block chain and acquiring an evaluation index of the task; selecting a target block from all blocks of a preset block chain based on the evaluation index; and allocating the task to the target block for processing. Through the mode, interaction among the nodes is verified through a digital signature technology, mutual trust is not needed, mutual deception cannot be carried out among the nodes, the nodes are distrusted, so that public identity is not needed among the nodes, each participated node is anonymous, in addition, other nodes cannot be tampered by the current node, data interaction among the nodes can be traced, the reliability of the data under the task response requirement is ensured, meanwhile, the corresponding target block is selected according to the evaluation index of the task, and the task requirement can achieve higher response speed under the corresponding target block. Therefore, the invention improves the reliability of data and the response speed of task requirements.
Drawings
Fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a task demand response method based on a block chain according to a first embodiment of the present invention;
FIG. 3 is a block chain architecture according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating block connections of a block chain according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a task request response method based on block chains according to a second embodiment of the present invention;
FIG. 6 is a schematic diagram of a master side chain according to an embodiment of the present invention;
FIG. 7 is a functional block diagram of a task demand response device based on block chains according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal in the embodiment of the present invention is a task demand response device based on a block chain, and the task demand response device based on the block chain may be a terminal device with a processing function, such as a PC (personal computer), a microcomputer, a notebook computer, and a server.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a blockchain-based task demand response program.
In the terminal shown in fig. 1, the processor 1001 may be configured to call a task demand response program based on a block chain stored in the memory 1005, and perform the following operations:
receiving a task participating in demand response based on a preset block chain, and acquiring an evaluation index of the task;
selecting a target block from all blocks of the preset block chain based on the evaluation index;
and distributing the task to the target block for processing.
Further, the evaluation index includes a plurality of indexes, and the processor 1001 may be configured to call the task demand response program based on the block chain stored in the memory 1005, and further perform the following operations:
carrying out standardization processing on the plurality of evaluation indexes to obtain a plurality of standardized evaluation indexes;
performing weighting operation on the plurality of standardized evaluation indexes to obtain weights of the plurality of evaluation indexes;
and selecting a target block from the blocks of the preset block chain based on the weight.
Further, the processor 1001 may be configured to call the blockchain-based task requirement response program stored in the memory 1005, and further perform the following operations:
dividing a preset block chain into side chains corresponding to a plurality of preset evaluation indexes, wherein the number of the side chains is the same as that of the plurality of evaluation indexes, and the side chains comprise nodes for processing tasks;
and constructing a main chain in the preset block chain, and respectively connecting each side chain with the main chain, wherein the main chain comprises a main node with a sharing function.
Further, the processor 1001 may be configured to call the blockchain-based task requirement response program stored in the memory 1005, and further perform the following operations:
when a request for adding the application into the preset block chain is detected, verifying whether the application has an adding authority or not;
and if the application has the adding permission, adding the application into the preset block chain so as to allow a plurality of applications to perform information interaction based on the preset block chain.
Further, the processor 1001 may be configured to call the blockchain-based task requirement response program stored in the memory 1005, and further perform the following operations:
acquiring a unique identifier of the application;
connecting the application to a node in the preset block chain based on the unique identification.
Further, the processor 1001 may be configured to call the blockchain-based task requirement response program stored in the memory 1005, and further perform the following operations:
when the preset block link receives a plurality of tasks, similarity calculation is carried out on the tasks;
and connecting the task with the similarity value smaller than a preset similarity threshold value to the same block in the preset block chain based on the similarity calculation result.
Further, the processor 1001 may be configured to call the blockchain-based task requirement response program stored in the memory 1005, and further perform the following operations:
calculating the occupation ratios of the evaluation indexes of the tasks respectively;
carrying out standardization processing on the ratio to obtain a standardized ratio;
and calculating Euclidean distances among the plurality of tasks based on the normalized occupation ratio, wherein the Euclidean distances are similarity calculation results.
Based on the hardware structure, the invention provides various embodiments of the block chain-based task demand response method.
The invention provides a task demand response method based on a block chain.
Referring to fig. 2, fig. 2 is a flowchart illustrating a task demand response method based on a block chain according to a first embodiment of the present invention.
In this embodiment, the block chain-based task demand response method includes:
step S10, receiving a task participating in demand response based on a preset block chain, and acquiring an evaluation index of the task;
in this embodiment, an architecture of a blockchain system is constructed based on the related art of blockchains, and a preset blockchain is constructed based on the architecture. Specifically, the preset block chain is constructed in a decentralized manner, and the preset block chain can be controlled by a plurality of mechanism centers, that is, the preset block chain is controlled by each entity node. The nodes coordinate to work according to a consensus mechanism so as to jointly maintain the whole preset block chain. The chain of preset blocks may be a continuous increase of participants, i.e. a continuous increase of nodes for applications, devices, organizations, etc. or a connection of applications, devices, organizations, etc. to nodes. After the preliminary construction of the preset block chain is completed, the tasks participating in the demand response are received based on the preset block chain, and the evaluation indexes of the tasks are obtained so as to determine the types of the tasks based on the evaluation indexes.
It should be noted that the task participating in the demand response is generated by nodes such as applications, devices, and organizations in the preset block chain or applications, devices, and organizations connected to the nodes. Certainly, the task participating in the demand response may also be generated by an external application and acquired by a preset block chain.
In an embodiment, the evaluation index is task type information participating in the demand response, for example, the tasks include storage, energy consumption, communication, bandwidth, time, flow and other indexes, each task may have the above indexes, and the tasks may select or establish corresponding indexes according to their own services and demands to meet different service demands. Certainly, the task may select one or more indexes according to its own service requirements, that is, different evaluation indexes are connected to different service requirements. In other embodiments, the evaluation index may also include other indexes, or more or less evaluation indexes, and is not limited herein.
In an embodiment, different index nodes are set in a preset block chain, and data safety is ensured, so that the reliability of task demand data is realized according to different task demands. The index node is used for processing functions of corresponding indexes, such as storing data, transmitting data and the like. In addition, the data interaction between the nodes is verified through a digital signature technology, mutual trust is not needed, the data interaction is only carried out according to the established rule of the preset block chain, and the nodes cannot cheat each other, so that the data security can be ensured. Meanwhile, because the nodes are distrusted, public identity is not required between the nodes, each participated node is anonymous, the current node cannot tamper with other nodes, and data interaction between the nodes can be traced, so that data security can be ensured.
To facilitate understanding of the architecture of the blockchain system, reference is made to fig. 3, and fig. 3 is a schematic diagram of the blockchain architecture according to the embodiment of the present invention, in which smart driving, smart medicine, research institution, load aggregation, smart home, and service company are connected to the blockchain, and the nodes are synchronized to obtain the synchronized blocks. The block chain system structure is controlled by a plurality of organizations (such as intelligent driving, intelligent medical treatment, research organization, load aggregation, intelligent home, service company), the block chain supports point-to-point transaction of massive application demands, information among nodes is public and transparent, and decentralized distributed systems are formed by means of distributed accounting, spreading and the like. Due to the difference of the task requirements of each mechanism, different requirements are required for privacy, safety, supervision and the like of data, and by constructing the system structure, the various requirements can be met, the overall data processing speed in the block chain is improved, more interactive information can be processed in a short time, and therefore the data safety can be ensured, and the processing capacity of a single node in the block chain is improved.
Step S20, selecting a target block from each block of the preset block chain based on the evaluation index;
when the preset block chain is divided into blocks, a plurality of different evaluation indexes, such as storage, energy consumption, communication, bandwidth, time, flow and other indexes, can be set first, and then the occupation ratio of the evaluation indexes in each task requirement is calculated respectively. Since each evaluation index has different properties, usually has different dimensions and magnitude, when the level difference between the evaluation indexes is large, if the original ratio is directly used for analysis, the classification processing will not be accurate enough, and therefore, in order to ensure the reliability of the result, the ratio needs to be standardized, and the standardization processing can be realized by a data standardization algorithm, for example, an extreme value method, a standard deviation method, a three-fold line method, a semi-normal distribution method, and the like, and will not be described herein again. Then, based on the percentage of the normalization process, similarity distances between the tasks are calculated for different indices, for example, euclidean distances, L1 norms, and the like, but not limited thereto. And finally, classifying each task based on the similarity distance, and dividing the blocks of the preset block chain based on the classified blocks. After the classification, a corresponding target block can be selected for a task newly received by the preset block chain. Specifically, based on the task evaluation index, a target block is selected from each block of the preset block chain.
It should be noted that each task has a unique identifier, such as an Identity (ID), and after the target block is selected for the task, the unique identifier and the task can be delivered to the target block together, so that the target block can accurately and quickly process the task.
In addition, it should be noted that, the blocks of the preset block chain are connected to each other, the nodes, tasks, indexes, and the like in the blocks are connected to each other, and based on a consensus mechanism, the nodes or the blocks may share respective messages.
In one embodiment, the target blocks to be connected are determined according to the priority of the evaluation index, and the target blocks can be one or more. Specifically, referring to fig. 4, fig. 4 is a schematic diagram illustrating a connection of block chain blocks according to an embodiment of the present invention, where priorities of storage indexes and bandwidth indexes in related tasks of smart medicine are higher, and therefore two block chain node services are respectively selected as target blocks. The processing procedures of other mechanisms or applications in the figure are basically the same as those of the smart medical treatment, and are not described in detail here. In other embodiments, the target area to be connected may be determined according to factors such as the weight, importance, and ratio of the evaluation index.
Specifically, step S20 includes:
a step a21 of standardizing the evaluation indexes to obtain standardized evaluation indexes;
a22, performing weighting operation on the plurality of standardized evaluation indexes to obtain weights of the plurality of evaluation indexes;
step a23, selecting a target block from the blocks of the preset block chain based on the weight.
After the evaluation indexes of the tasks are obtained, the multiple evaluation indexes are subjected to standardization processing based on a data standardization algorithm, then the multiple evaluation indexes subjected to standardization processing are subjected to weighting operation to obtain the weights of the multiple evaluation indexes, and finally, a target block is selected from all blocks of a preset block chain based on the weights. Wherein the evaluation index includes a plurality of indexes.
It should be noted that, since each evaluation index has different properties, usually has different dimensions and orders of magnitude, when the levels of the evaluation indexes are greatly different, if the original evaluation index is directly used for analysis, the evaluation indexes will not have comparability, and therefore, in order to ensure the reliability of the result, each evaluation index needs to be standardized to eliminate the property difference (dimension difference) of each evaluation index.
The data normalization algorithm may be an extreme value method, a standard deviation method, a three-fold line method, a semi-normal distribution method, or the like. The weighting operation may be a mean square error operation method, or may be other methods for calculating the weight.
In an embodiment, the block corresponding to the index with the largest weight can be selected as the target block, so that the demand response speed corresponding to the index with the largest weight is higher, and the interaction efficiency is higher. In other embodiments, the blocks corresponding to the indexes with weights greater than the preset weight threshold may be selected as the target blocks, in which case, the target blocks may include one or more blocks, and the preset weight threshold may be set according to actual needs, which is not limited herein.
And step S30, allocating the task to the target block for processing.
And after the target block is selected and obtained, distributing the task to the target block for processing. Specifically, the processing is performed by the block link node service in the target block, that is, the response processing is performed by the service node having the corresponding demand response. It should be noted that the task is allocated to the target block and is accompanied by a unique identifier of the task, so that the target block can index the task based on the unique identifier, thereby improving the response speed of the task demand.
In an embodiment, after the task is allocated to the target block, the task and the nodes in the target block form a chained storage network structure, the task and each node in the target block can share information, and based on a preset rule of a preset block chain, data security can be ensured and response speed of task requirements can be improved.
The embodiment of the invention provides a task demand response method based on a block chain, which is characterized in that a task participating in demand response is received based on a preset block chain, and an evaluation index of the task is obtained; selecting a target block from all blocks of a preset block chain based on the evaluation index; and allocating the task to the target block for processing. The embodiment of the invention is based on a decentralized preset block chain, so that interaction between data is carried out according to a set rule, specifically, data interaction between nodes is verified through a digital signature technology, mutual trust is not needed, mutual deception cannot be carried out between the nodes, and the nodes are distrusted so that identities do not need to be disclosed between the nodes, each participated node is anonymous, in addition, other nodes cannot be tampered by the current node, data interaction between the nodes can be traced, the reliability of the data under a task response requirement is ensured, and meanwhile, a corresponding target block is selected according to an evaluation index of a task, so that a task requirement can realize a faster response speed under the corresponding target block. Therefore, the embodiment of the invention improves the reliability of data and the response speed of task requirements.
Further, based on the first embodiment, a second embodiment of the block chain-based task demand response method according to the present invention is provided.
Referring to fig. 5, fig. 5 is a flowchart illustrating a task demand response method based on a block chain according to a second embodiment of the present invention.
In this embodiment, before the step S10, the method for responding to task demands based on block chains further includes:
step S40, dividing a preset blockchain into side chains corresponding to a plurality of preset evaluation indexes, where the number of the side chains is the same as the number of the plurality of evaluation indexes, and the side chains include nodes for processing tasks;
step S50, constructing a main chain in the preset block chain, and respectively connecting each side chain with the main chain, wherein the main chain includes a main node with a sharing function.
In this embodiment, the architecture of the main side chain is further designed based on the preset block chain, and the task may select or establish a corresponding index according to its own service and requirement, so as to implement different service requirements through the main side chain. Specifically, a preset block chain is divided into side chains corresponding to a plurality of preset evaluation indexes, wherein the number of the side chains is the same as that of the plurality of evaluation indexes, the side chains comprise nodes for processing tasks, then a main chain is constructed in the preset block chain, and the side chains are respectively connected with the main chain, wherein the main chain comprises a main node with a sharing function.
It should be noted that the main chain is used as a shared platform of all participants, that is, a shared data channel of all nodes such as applications, task requirements, devices, and organizations, and can implement trading and sharing among each evaluation index, block, and main chain. Specifically, referring to fig. 6, fig. 6 is a schematic diagram of a master side chain according to an embodiment of the present invention, in which a side chain of a bandwidth includes five nodes, and a side chain of a time includes five nodes, of course, the number of nodes of the side chain is set according to an actual situation, and is not limited here, while a main chain is used to connect the side chain of the bandwidth and the side chain of the time, and the main chain includes two master nodes, and the master nodes are used to implement sharing of data, and of course, the number of nodes of the main chain is set according to an actual situation, and is not limited.
In an embodiment, the preset evaluation index may include indexes such as storage, energy consumption, communication, bandwidth, time, and flow, and the task may select or establish a corresponding index according to its own service and requirement to meet different service requirements. Certainly, the task may select one or more indexes according to its own service requirements, that is, different evaluation indexes are connected to different service requirements. In other embodiments, the evaluation index may also include other indexes, or more or less evaluation indexes, and is not limited herein.
In the embodiment, the main side chain is designed according to the evaluation index, so that the interaction efficiency between tasks with the same evaluation index is improved under the same side chain, and the subsequent data processing and linking are facilitated.
Further, based on the first embodiment, a third embodiment of the block chain-based task demand response method according to the present invention is provided.
In this embodiment, the block chain-based task demand response method further includes:
step A, when a request for adding an application into the preset block chain is detected, verifying whether the application has an adding authority or not;
and B, if the application has the adding permission, adding the application into the preset block chain so as to allow information interaction among a plurality of applications based on the preset block chain.
In this embodiment, the preset block chain is controlled by a plurality of mechanism centers, and the application can add the preset block chain only when acquiring the authority. For the preset block chain, when a request of an application for adding into the preset block chain is detected, whether the application has the adding authority is verified, and if the application has the adding authority, the application is added into the preset block chain. After the plurality of applications are added into the preset block chain, based on the established rule of the block chain, the plurality of applications carry out information interaction based on the preset block chain.
In addition, it should be noted that, the blocks of the preset block chain are connected with each other, the applications, nodes, tasks, indexes, etc. in the blocks are connected with each other, and each node may connect different applications, and based on a consensus mechanism, the applications may share respective messages. In addition, the nodes of the preset block chain are mutually synchronous, one node loses data, and other nodes also back up the data, so that the safety of the data can be ensured.
Specifically, in the step B, adding the application to the preset block chain includes:
step B1, obtaining the unique identifier of the application;
and step B2, connecting the application to a node in the preset block chain based on the unique identification.
In this embodiment, the application itself has a unique identifier, and for the preset block chain, the unique identifier of the application is acquired, and then the application is connected to a node in the preset block chain based on the unique identifier. Wherein, the unique identification can be ID identification.
It should be noted that each application has a unique identifier, such as an ID identifier, and when the application joins the preset block chain, the unique identifier and the application can be handed over to the preset block chain together, so that the preset block chain can accurately and quickly index and process the application.
In this embodiment, the permission verification is performed on the added application, so that the allowed application can be added to the preset block chain, thereby ensuring the reliability of the preset block chain.
Further, based on the first embodiment, a fourth embodiment of the block chain-based task demand response method according to the present invention is provided.
In this embodiment, the block chain-based task demand response method further includes:
step C, when the preset block link receives a plurality of tasks, similarity calculation is carried out on the tasks;
and D, connecting the task with the similarity value smaller than a preset similarity threshold value to the same block in the preset block chain based on the similarity calculation result.
In this embodiment, when the preset block chain receives a plurality of tasks, that is, when the preset block chain has a plurality of tasks, similarity calculation is performed on the plurality of tasks, and then, based on a result of the similarity calculation, the task with the calculated similarity smaller than the preset similarity threshold is connected to the same block in the preset block chain. It can be understood that the similarity calculation is performed on a plurality of tasks, that is, the types of the tasks are calculated, then the tasks are classified according to the types, and the classified tasks are respectively connected to the blocks. The preset similarity threshold is set according to actual needs, and is not limited herein, for example, when the euclidean distance is calculated, the preset similarity threshold is an absolute distance.
When tasks are classified, the size of the difference between the tasks needs to be calculated. The similarity calculation is to compare the similarity of two tasks, i.e. to calculate the feature value and the feature distance between the tasks, if the feature distance is small, the similarity is large, and if the feature distance is large, the similarity is small.
In one embodiment, the similarity calculation is performed based on evaluation indexes of tasks, and the evaluation indexes can include storage, energy consumption, communication, bandwidth, time, flow and other indexes. The similarity calculation may be performed by calculating a euclidean distance (euclidean distance), a manhattan distance, a minkowski distance, or the like. In other embodiments, the evaluation index may be set according to actual needs, and is not limited herein.
Specifically, in the step C, the performing similarity calculation on the plurality of tasks includes:
step C1 of calculating the ratios of the evaluation indexes of the plurality of tasks, respectively;
step C2, standardizing the ratio to obtain a standardized ratio;
and step C3, calculating Euclidean distances among the tasks based on the standardized occupation ratio, wherein the Euclidean distances are calculation results of the similarity.
In this embodiment, the occupation ratios of the evaluation indexes of the plurality of tasks are calculated, respectively, then, the occupation ratios are normalized based on a data normalization algorithm, and finally, the euclidean distances between the plurality of tasks are calculated based on the occupation ratios after the normalization, where the euclidean distances are the similarity calculation results. Of course, the duty ratio may also be replaced by a priority, weight, importance, etc.
It should be noted that, because each evaluation index has different properties, and usually has different dimensions and magnitudes, when the level difference between the evaluation indexes is large, if the original ratio is directly used for analysis, the subsequent classification processing will be inaccurate, and therefore, to ensure the reliability of the result, the ratio needs to be standardized, and the standardization processing can be implemented by a data standardization algorithm, for example, an extreme value method, a standard deviation method, a three-fold line method, a semi-normal distribution method, and the like, which is not described herein again.
And then, calculating Euclidean distances among the tasks according to different indexes based on the proportion of the standardized processing, classifying the tasks based on the Euclidean distances, and dividing blocks of a preset block chain based on the classified blocks. After the classification process is completed, a corresponding target block can be selected for a task newly received by the preset block chain. Specifically, based on the task evaluation index, a target block is selected from each block of the preset block chain.
In this embodiment, tasks of similar types are connected to the same block in the preset block chain, so that the interaction efficiency between similar tasks is higher, and the task response speed of the preset block chain is further improved.
The invention also provides a task demand response device based on the block chain.
Referring to fig. 7, fig. 7 is a functional block diagram of a task demand response device based on a block chain according to a first embodiment of the present invention.
In this embodiment, the block chain-based task demand response device includes:
the index obtaining module 10 is configured to receive a task participating in a demand response based on a preset block chain, and obtain an evaluation index of the task;
a block selecting module 20, configured to select a target block from each block of the preset block chain based on the evaluation index;
and a task processing module 30, configured to allocate the task to the target block for processing.
Each virtual function module of the task demand response device based on the blockchain is stored in the memory 1005 of the task demand response device based on the blockchain shown in fig. 1, and is used for implementing all functions of a task demand response program based on the blockchain; when executed by the processor 1001, the modules may implement a task demand response function based on a blockchain.
Further, the block selecting module 20 includes:
an index processing unit, configured to perform normalization processing on the plurality of evaluation indexes to obtain a plurality of normalized evaluation indexes;
a weighting calculation unit configured to perform a weighting calculation on the plurality of normalized evaluation indexes to obtain weights of the plurality of evaluation indexes;
and the block selecting unit is used for selecting a target block from all blocks of the preset block chain based on the weight.
Further, the block chain-based task demand response device further includes:
the side chain dividing module is used for dividing a preset block chain into side chains corresponding to a plurality of preset evaluation indexes, wherein the number of the side chains is the same as that of the plurality of evaluation indexes, and the side chains comprise nodes for processing tasks;
and the main chain construction module is used for constructing a main chain in the preset block chain and respectively connecting each side chain with the main chain, wherein the main chain comprises a main node with a sharing function.
Further, the block chain-based task demand response device further includes:
the permission verification module is used for verifying whether the application has the joining permission or not when a request for joining the application to the preset block chain is detected;
and the application adding module is used for adding the application into the preset block chain if the application has the adding permission so as to perform information interaction among a plurality of applications based on the preset block chain.
Further, the application joining module comprises:
the identification acquisition unit is used for acquiring the unique identification of the application;
and the application connecting unit is used for connecting the application to the nodes in the preset block chain based on the unique identification.
Further, the block chain-based task demand response device further includes:
the similarity calculation module is used for calculating the similarity of a plurality of tasks when the preset block link receives the plurality of tasks;
and the task connecting module is used for connecting the task with the similarity value smaller than a preset similarity threshold value to the same block in the preset block chain based on the similarity calculation result.
Further, the similarity calculation module includes:
a proportion calculation unit configured to calculate proportions of the evaluation indexes of the plurality of tasks, respectively;
the proportion processing unit is used for carrying out standardization processing on the proportion to obtain a standardized proportion;
a distance calculation unit configured to calculate a euclidean distance between the plurality of tasks based on the normalized occupation ratio, wherein the euclidean distance is a similarity calculation result.
The function implementation of each module in the block chain-based task demand response device corresponds to each step in the block chain-based task demand response method embodiment, and the function and implementation process thereof are not described in detail herein.
The invention also provides a block chain-based task demand response system, which comprises: the task demand response program comprises a memory, a processor and a block chain based task demand response program stored on the memory and capable of running on the processor, wherein the block chain based task demand response program realizes the steps of the block chain based task demand response method according to any one of the above embodiments when being executed by the processor.
The specific embodiment of the block chain-based task demand response system of the present invention is basically the same as the embodiments of the block chain-based task demand response method described above, and details thereof are not repeated herein.
The present invention also provides a computer readable storage medium, on which a blockchain based task demand response program is stored, and when being executed by a processor, the blockchain based task demand response program implements the steps of the blockchain based task demand response method according to any one of the above embodiments.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the above task demand response method based on a block chain, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A task demand response method based on a block chain is characterized by comprising the following steps:
receiving a task participating in demand response based on a preset block chain, and acquiring an evaluation index of the task;
selecting a target block from all blocks of the preset block chain based on the evaluation index;
and distributing the task to the target block for processing.
2. The block chain-based task demand response method according to claim 1, wherein the evaluation index includes a plurality of evaluation indexes, and the step of selecting the target block from the blocks of the preset block chain based on the evaluation index includes:
carrying out standardization processing on the plurality of evaluation indexes to obtain a plurality of standardized evaluation indexes;
performing weighting operation on the plurality of standardized evaluation indexes to obtain weights of the plurality of evaluation indexes;
and selecting a target block from the blocks of the preset block chain based on the weight.
3. The method according to claim 1, wherein before the step of receiving the task participating in the demand response based on the preset block chain and obtaining the evaluation index of the task, the method further comprises:
dividing a preset block chain into side chains corresponding to a plurality of preset evaluation indexes, wherein the number of the side chains is the same as that of the plurality of evaluation indexes, and the side chains comprise nodes for processing tasks;
and constructing a main chain in the preset block chain, and respectively connecting each side chain with the main chain, wherein the main chain comprises a main node with a sharing function.
4. The blockchain-based task demand response method according to any one of claims 1 to 3, wherein the blockchain-based task demand response method further comprises:
when a request for adding the application into the preset block chain is detected, verifying whether the application has an adding authority or not;
and if the application has the adding permission, adding the application into the preset block chain so as to allow a plurality of applications to perform information interaction based on the preset block chain.
5. The blockchain-based task demand response method according to claim 4, wherein the step of adding the application to the preset blockchain includes:
acquiring a unique identifier of the application;
connecting the application to a node in the preset block chain based on the unique identification.
6. The blockchain-based task demand response method according to any one of claims 1 to 3, wherein the blockchain-based task demand response method further comprises:
when the preset block link receives a plurality of tasks, similarity calculation is carried out on the tasks;
and connecting the task with the similarity value smaller than a preset similarity threshold value to the same block in the preset block chain based on the similarity calculation result.
7. The blockchain-based task demand response method according to claim 6, wherein the step of performing similarity calculation on the plurality of tasks includes:
calculating the occupation ratios of the evaluation indexes of the tasks respectively;
carrying out standardization processing on the ratio to obtain a standardized ratio;
and calculating Euclidean distances among the plurality of tasks based on the normalized occupation ratio, wherein the Euclidean distances are similarity calculation results.
8. A blockchain-based task demand response apparatus, wherein the blockchain-based task demand response apparatus comprises:
the index acquisition module is used for receiving a task participating in demand response based on a preset block chain and acquiring an evaluation index of the task;
the block selection module is used for selecting a target block from all blocks of the preset block chain based on the evaluation index;
and the task processing module is used for distributing the tasks to the target blocks for processing.
9. A blockchain-based task demand response system, the blockchain-based task demand response system comprising: a memory, a processor and a blockchain based task demand response program stored on the memory and executable on the processor, the blockchain based task demand response program when executed by the processor implementing the steps of the blockchain based task demand response method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein a blockchain-based task demand response program is stored on the computer-readable storage medium, and when the blockchain-based task demand response program is executed by a processor, the steps of the blockchain-based task demand response method according to any one of claims 1 to 7 are implemented.
CN202011573438.0A 2020-12-25 2020-12-25 Task demand response method, device and system based on block chain and storage medium Active CN112738213B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011573438.0A CN112738213B (en) 2020-12-25 2020-12-25 Task demand response method, device and system based on block chain and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011573438.0A CN112738213B (en) 2020-12-25 2020-12-25 Task demand response method, device and system based on block chain and storage medium

Publications (2)

Publication Number Publication Date
CN112738213A true CN112738213A (en) 2021-04-30
CN112738213B CN112738213B (en) 2023-06-30

Family

ID=75617129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011573438.0A Active CN112738213B (en) 2020-12-25 2020-12-25 Task demand response method, device and system based on block chain and storage medium

Country Status (1)

Country Link
CN (1) CN112738213B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114900519A (en) * 2022-05-06 2022-08-12 中国电信股份有限公司 Capability calling method, capability calling device, storage medium and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190149550A1 (en) * 2017-11-16 2019-05-16 International Business Machines Corporation Securing permissioned blockchain network from pseudospoofing network attacks
CN110348242A (en) * 2017-06-12 2019-10-18 腾讯科技(深圳)有限公司 Service request processing method and device
CN110458702A (en) * 2019-07-15 2019-11-15 阿里巴巴集团控股有限公司 Based on the virtual resource allocation method and device of block chain, electronic equipment
CN110633323A (en) * 2019-09-16 2019-12-31 腾讯科技(深圳)有限公司 Business data storage method, device, storage medium and computer equipment
CN111224793A (en) * 2018-11-27 2020-06-02 华为技术有限公司 Data storage method and device, computer equipment and readable storage medium
CN111460504A (en) * 2020-03-31 2020-07-28 腾讯科技(深圳)有限公司 Service processing method, device, node equipment and storage medium
CN111885133A (en) * 2020-07-10 2020-11-03 深圳力维智联技术有限公司 Data processing method and device based on block chain and computer storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110348242A (en) * 2017-06-12 2019-10-18 腾讯科技(深圳)有限公司 Service request processing method and device
US20190149550A1 (en) * 2017-11-16 2019-05-16 International Business Machines Corporation Securing permissioned blockchain network from pseudospoofing network attacks
CN111224793A (en) * 2018-11-27 2020-06-02 华为技术有限公司 Data storage method and device, computer equipment and readable storage medium
CN110458702A (en) * 2019-07-15 2019-11-15 阿里巴巴集团控股有限公司 Based on the virtual resource allocation method and device of block chain, electronic equipment
CN110633323A (en) * 2019-09-16 2019-12-31 腾讯科技(深圳)有限公司 Business data storage method, device, storage medium and computer equipment
CN111460504A (en) * 2020-03-31 2020-07-28 腾讯科技(深圳)有限公司 Service processing method, device, node equipment and storage medium
CN111885133A (en) * 2020-07-10 2020-11-03 深圳力维智联技术有限公司 Data processing method and device based on block chain and computer storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
宫飞翔等: "基于区块链的需求响应系统设计", 《电力信息与通信技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114900519A (en) * 2022-05-06 2022-08-12 中国电信股份有限公司 Capability calling method, capability calling device, storage medium and electronic equipment
CN114900519B (en) * 2022-05-06 2023-12-12 中国电信股份有限公司 Capability calling method, capability calling device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN112738213B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN107896157B (en) Blacklist data exchange method and application server
CN111695675B (en) Federal learning model training method and related equipment
CN113900598B (en) Data storage method, device, equipment and storage medium based on block chain
CN110597719B (en) Image clustering method, device and medium for adaptation test
CN111954173A (en) Method, device, server and computer readable storage medium for sending short message
CN113268336A (en) Service acquisition method, device, equipment and readable medium
CN112035350B (en) Test method and device for block chain system and computer equipment
CN108650289A (en) A kind of method and apparatus of the management data based on block chain
CN110955724A (en) Data processing method and device based on block chain, node equipment and storage medium
CN112307331A (en) Block chain-based college graduate intelligent recruitment information pushing method and system and terminal equipment
CN113177179B (en) Data request connection management method, device, equipment and storage medium
CN112738213A (en) Block chain-based task demand response method, device, system and storage medium
CN115829731A (en) Transaction information processing method and device
CN115470512A (en) Method, device and system for carrying out multi-party algorithm negotiation aiming at privacy calculation
CN111291045A (en) Service isolation data transmission method and device, computer equipment and storage medium
CN112766560A (en) Alliance block chain network optimization method, device and system and electronic equipment
CN111858585A (en) Block chain strategy processing device, computer readable storage medium and terminal equipment
CN107784548B (en) Order processing method and device
CN114092268A (en) User community detection method and device, computer equipment and storage medium
CN115292580A (en) Data query method and device, computer equipment and storage medium
CN116226116A (en) Joint learning task viewing method and device, electronic equipment and storage medium
CN111798315A (en) Intelligent contract system, intelligent contract management method, intelligent contract management device and readable storage medium
CN112039893A (en) Private transaction processing method and device, electronic equipment and readable storage medium
CN117313073B (en) Data processing method, device, medium and electronic equipment related to permission distribution
CN113392138B (en) Statistical analysis method, device, server and storage medium for private data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant