Service access method and device, equipment and storage medium
By determining the access sequence in the power system based on the reputation value and service type of the terminal node in the power system, and accessing the central node after the transaction chain is verified, the problems of limited power equipment resources and access security are solved, and the order of power services is achieved , safe and efficient access.
Patent Information
- Application Number
- CN202411353264.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-03
AI Technical Summary
In the prior art, the resources of power equipment are limited, and it is difficult to handle all service requests, which affects the normal operation of the power system, and the operation cost during the service access process is high and the security cannot be guaranteed.
By determining the service access order based on the reputation value and service type of the terminal node in each shard in the current area, we ensure that high-service priority services are pre-entered, and accessing the central node in turn after the transaction chain is verified, improving service access security and reliability.
It realizes orderly access to power services, ensures the low latency demand for high-service priority services, improves the security and reliability of service access, reduces operating costs, and avoids centralized risks.
Smart Images

Figure CN119071306A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of power electronics technology, and in particular to a service access method, device, equipment and storage medium. Background Art
[0002] The power system is an indispensable infrastructure in modern society and a support for national development. Industrial manufacturing, social production and people's daily life are inseparable from the power system. There is a need for communication between the massive power equipment in the power system, and the power equipment can be connected to the power system through the power communication network.
[0003] In the prior art, power equipment is connected to the power system through a host, and the service requests corresponding to the power equipment are all connected to the power system through the host. However, the resources of the host are limited and it is difficult to process the service requests of all power equipment, which affects the normal operation of the power system.
[0004] Therefore, there is an urgent need for a service access method to enable the service requests of power equipment to be orderly accessed to the power system. Summary of the invention
[0005] The present invention provides a service access method, device, equipment and storage medium to achieve orderly access to power services.
[0006] In a first aspect, an embodiment of the present invention provides a service access method, including:
[0007] In each shard of the current region, the access order of each current service is determined according to the current reputation value of each terminal node in the shard and the service type of the current service;
[0008] When it is determined that the transaction chain includes the transaction blocks of all the shards, the current services in each shard are connected to the central node in each shard in sequence according to the access order of the current services in each shard.
[0009] The technical solution of an embodiment of the present invention provides a business access method, comprising: in each shard of the current area, determining the access order of each current business according to the current reputation value of each terminal node in the shard and the business type of the current business; when it is determined that the transaction chain includes the transaction blocks of all the shards, connecting each current business in each shard to the central node in each shard in turn according to the access order of each current business in each shard. The above technical scheme determines the access order of each current business according to the current reputation value of each terminal node in the shard and the business type of the current business for each shard in the current area. The access order of each current business is determined under the premise of considering the current reputation value of each terminal node in the shard and the business type of the current business applied for. In addition, the current business corresponding to the business type with high business priority is arranged in front of the current business corresponding to the business type with low business priority, thereby ensuring the low latency requirement of the high business priority business. The current reputation value of the corresponding terminal node with the same business priority is arranged in front of the current reputation value of the corresponding terminal node with low current reputation value, thereby improving the security and reliability of business access. When it is determined that the transaction chain includes the transaction blocks of all shards, it is determined that all shards in the current area have been verified, that is, the current businesses accessed by all shards are legal and comply with the rules. Then, each current business in each shard can be connected to the central node in each shard in turn according to the access order of each current business in each shard. Under the premise of ensuring that all current businesses are legal and comply with the rules, each current business can be connected to the corresponding central node.
[0010] Furthermore, it also includes:
[0011] The current area is divided into a plurality of slices according to the location information of each central node and each terminal node in the current area, wherein each slice includes one central node and at least one terminal node.
[0012] Furthermore, the current area is divided into a plurality of slices according to the location information of each of the central nodes and each of the terminal nodes in the current area, including:
[0013] Determine the node distance between each of the terminal nodes and each of the central nodes according to the location information of each of the central nodes and each of the terminal nodes in the current area;
[0014] For each of the terminal nodes, determining the central node corresponding to the minimum node distance as the central node corresponding to the terminal node;
[0015] The current area is divided into a plurality of the shards by dividing each of the central nodes and each of the terminal nodes corresponding to the central nodes into the same shard.
[0016] Further, the access order of each current service is determined according to the current reputation value of each terminal node in the shard and the service type of the current service, including:
[0017] Determining the service priority of the current service according to the service type of the current service of each terminal node;
[0018] Determining a preliminary ranking result of each of the current services according to the service priority of each of the current services;
[0019] In the case where it is determined that there are identical service priorities in the preliminary sorting results, determining the access order of the current services having the same service priority according to the current reputation values of the terminal nodes corresponding to the current services having the same service priority;
[0020] The access order of each current service is determined according to the preliminary sorting result and the access order of each current service with the same service priority.
[0021] Furthermore, before determining the access order of each current service according to the current reputation value of each terminal node in the slice and the service type of the current service, the method further includes:
[0022] The current reputation value of each terminal node is determined in the reputation chain, wherein the reputation chain stores the current reputation value of each terminal node and each central node, the current reputation value of the terminal node is determined based on the current total access business volume, current access frequency and current access success rate of the terminal node and the current total access business volume of the central node corresponding to the terminal node, and the current current reputation value of the central node is determined based on the current total access business volume and current access success rate of the central node and the current total access business volume of all the central nodes in the current area.
[0023] Furthermore, before sequentially connecting each of the current services in each of the slices to the central node in each of the slices according to the access order of each of the current services in each of the slices, the method further includes:
[0024] Determining the current reputation value of each of the central nodes in the reputation chain;
[0025] According to the current reputation value of the central node in each shard, the central node with a high reputation value sequentially verifies the transaction block of the shard corresponding to the central node with a low reputation value, wherein the transaction block is determined by the central node in each shard according to the access sequence and service type of each current service and the address code of each terminal node and broadcasted to other central nodes;
[0026] After determining that the transaction block of the shard has passed verification, the transaction block is added to the transaction chain.
[0027] Further, the central node with a high reputation value sequentially verifies the transaction blocks of the shards corresponding to the central node with a low reputation value, including:
[0028] The central node with a high reputation value determines the time information and the shard hash value in the block header information of the transaction block of the shard corresponding to the central node with a low reputation value, and determines the current hash value according to the time information and the shard hash value;
[0029] When it is determined that the shard hash value is consistent with the current hash value, it is determined that the transaction block of the shard has been verified.
[0030] In a second aspect, an embodiment of the present invention further provides a service access device, including:
[0031] A determination module, configured to determine, in each shard of the current region, an access order of each current service according to the current reputation value of each terminal node in the shard and the service type of the current service;
[0032] The access module is used to connect each current business in each shard to the central node in each shard in sequence according to the access order of each current business in each shard when it is determined that the transaction chain includes the transaction blocks of all the shards.
[0033] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0034] at least one processor; and a memory communicatively coupled to the at least one processor;
[0035] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the service access method as described in any one of the first aspects.
[0036] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the service access method as described in any one of the first aspects.
[0037] In a fifth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on a computer, the computer executes the service access method provided in the first aspect.
[0038] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the service access device, or may be packaged separately from the processor of the service access device, which is not limited in this application.
[0039] The description of the second, third, fourth and fifth aspects in this application can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third, fourth and fifth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.
[0040] In this application, the name of the service access device does not limit the device or function module itself. In actual implementation, these devices or function modules may appear with other names. As long as the functions of each device or function module are similar to those of this application, they fall within the scope of the claims of this application and their equivalent technologies.
[0041] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A flow chart of a service access method provided by an embodiment of the present invention;
[0044] Figure 2 A flow chart of another service access method provided by an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the current area provided by an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of a block header of a sharded transaction block in another service access method provided by an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of the structure of a service access device provided by an embodiment of the present invention;
[0048] Figure 6 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0050] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0051] The terms "first" and "second" and the like in the specification and drawings of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0052] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0053] It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe various operations (or steps) as sequential processes, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of various operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to methods, functions, procedures, subroutines, subprograms, etc. In addition, the embodiments in the present invention and the features in the embodiments can be combined with each other without conflict.
[0054] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0055] In the description of the present application, unless otherwise specified, “plurality” means two or more.
[0056] Figure 1A flowchart of a service access method provided in an embodiment of the present invention is provided. This embodiment is applicable to situations where orderly access to power services is required. The method can be executed by a service access device, such as Figure 1 As shown, the specific steps include:
[0057] Step 110: In each slice of the current area, the access order of each current service is determined according to the current reputation value of each terminal node in the slice and the service type of the current service.
[0058] Among them, the current area can be understood as the current power supply area. There are central nodes and terminal nodes in the current area. Each area of the current area includes a central node and at least one terminal node. The central node is a node with communication and computing capabilities, which can be used for data collection, analysis and control. The terminal node is a node with data collection and communication capabilities, which can be used for data collection and execution of instructions issued by the central node.
[0059] The current service can be understood as the power communication service. Each terminal node is only allowed to apply for one power communication service at a time. The current service of the terminal node can be understood as the power communication service currently applied for by the terminal node. The service type can be real-time monitoring, control instructions, fault alarm, system status report, network maintenance, and user service.
[0060] Specifically, for each shard in the current area, first, the service priority of the current service can be determined based on the service type of the current service applied for by each terminal node in the shard. Secondly, each current service can be sorted according to the service priority of each current service. If there are current services with consistent service priorities, the sorting result of the current services with consistent service priorities can be determined according to the current credibility value of the terminal node corresponding to the current service with consistent service priorities, thereby realizing the sorting of the current services applied for by each terminal node in the shard, and then the sorting result can be determined as the access order of each current service.
[0061] Based on the same steps, the access order of the current service access central node applied by each terminal node in each slice of the current area can be determined.
[0062] In an embodiment of the present invention, each current service is sorted according to its service priority, so that services with high service priority are preferentially connected to the central node, thereby ensuring the low latency requirement of services with high service priority. The sorting results of current services with consistent service priority are determined according to the current credibility value of the terminal node corresponding to the current service with consistent service priority, so that services applied for by terminal nodes with high credibility value are preferentially connected to the central node, thereby improving the security and reliability of service access.
[0063] Step 120: When it is determined that the transaction chain includes the transaction blocks of all the shards, the current services in each shard are connected to the central nodes in each shard in sequence according to the access order of the current services in each shard.
[0064] Specifically, after determining the access order of each current service in each shard, the central node in each shard can determine the transaction block of each shard based on the node access information of each shard, and broadcast the transaction block of each shard to other central nodes. Furthermore, the service access of each shard can be verified based on the transaction block of each shard. If the verification is passed, the transaction block of the shard can be added to the transaction chain.
[0065] Therefore, if the transaction chain includes the transaction blocks of all shards, it is determined that all shards in the current region have passed the verification. When it is determined that the transaction chain includes the transaction blocks of all shards, each current business in each shard can be connected to the central node in each shard in turn according to the access order of each current business in each shard.
[0066] In an embodiment of the present invention, when the transaction chain includes the transaction blocks of all shards, it can be determined that all shards in the current area have passed the verification, that is, the current businesses connected to all shards are legal and comply with the rules. At this time, each current business in each shard is connected to the central node in each shard in turn according to the access order of each current business in each shard. On the premise of ensuring that all current businesses are legal and comply with the rules, each current business is connected to the corresponding central node.
[0067] The business access method provided by the embodiment of the present invention includes: in each shard of the current area, determining the access order of each current business according to the current reputation value of each terminal node in the shard and the business type of the current business; when it is determined that the transaction chain includes the transaction blocks of all the shards, connecting each current business in each shard to the central node in each shard in turn according to the access order of each current business in each shard. The above technical scheme determines the access order of each current business according to the current reputation value of each terminal node in the shard and the business type of the current business for each shard in the current area. The access order of each current business is determined under the premise of considering the current reputation value of each terminal node in the shard and the business type of the current business applied for. In addition, the current business corresponding to the business type with high business priority is arranged in front of the current business corresponding to the business type with low business priority, thereby ensuring the low latency requirement of the high business priority business. The current reputation value of the corresponding terminal node with the same business priority is arranged in front of the current reputation value of the corresponding terminal node with low current reputation value, thereby improving the security and reliability of business access. When it is determined that the transaction chain includes the transaction blocks of all shards, it is determined that all shards in the current area have been verified, that is, the current businesses accessed by all shards are legal and comply with the rules. Then, each current business in each shard can be connected to the central node in each shard in turn according to the access order of each current business in each shard. Under the premise of ensuring that all current businesses are legal and comply with the rules, each current business can be connected to the corresponding central node.
[0068] Figure 2 Flow chart of another service access method provided by an embodiment of the present invention. This embodiment is specific based on the above embodiment. Figure 2 As shown, in this embodiment, the method may further include:
[0069] Step 210: Divide the current area into multiple slices according to the location information of each central node and each terminal node in the current area.
[0070] Wherein, each of the shards includes one central node and at least one terminal node.
[0071] In one implementation, step 210 may specifically include:
[0072] The node distance between each terminal node and each central node is determined according to the location information of each central node and each terminal node in the current area; for each terminal node, the central node corresponding to the minimum node distance is determined as the central node corresponding to the terminal node; and the current area is divided into multiple shards by dividing each central node and each terminal node corresponding to each central node into the same shard.
[0073] Specifically, a node can be determined as a central node or a terminal node according to the capabilities of each node in the current area, that is, when it is determined that the node has communication and computing capabilities, the node is determined as a central node, and when it is determined that the node has data collection and communication capabilities, the node is determined as a terminal node. When the current area is networked, the terminal node can select the nearest central node to access its network.
[0074] Figure 3 A schematic diagram of the current area provided by an embodiment of the present invention, such as Figure 3 As shown in the figure, there are three central nodes in the current area. The node distance between each terminal node and each central node is determined according to the location information of each terminal node and the location information of the three central nodes. For each terminal node, the central node corresponding to the minimum node distance can be determined as the central node corresponding to the terminal node. Then, each central node and each terminal node corresponding to each central node can be divided into the same shard, and each terminal node corresponding to each central node can be connected to the network of each central node to divide the current area into three shards.
[0075] It should be noted that after each terminal node is connected to the network of the corresponding central node, the central node may record the address code of each terminal node connected to its network.
[0076] In an embodiment of the present invention, the terminal nodes corresponding to each central node are determined according to the location information of each central node and each terminal node in the current area, and the terminal nodes corresponding to each central node are connected to the network of each central node, so as to divide the current area into multiple slices.
[0077] Step 220: Determine the current reputation value of each terminal node in the reputation chain.
[0078] Among them, the reputation chain stores the current reputation value of each terminal node and each central node, the current reputation value of the terminal node is determined based on the current total access business volume, current access frequency and current access success rate of the terminal node and the current total access business volume of the central node corresponding to the terminal node, and the current current reputation value of the central node is determined based on the current total access business volume and current access success rate of the central node and the current total access business volume of all the central nodes in the current area.
[0079] Each central node and terminal node is configured with an initial reputation value, for example, the initial reputation value T of each central node and terminal node is configured as 75. In addition, the reputation values of the central node and the terminal node can be dynamically adjusted according to the behavior of the terminal node in the process of connecting its applied service to the central node.
[0080] Specifically, the reputation value R of the central node c is c It can be determined by the current total access business volume and current access success rate of the central node and the current total access business volume of all central nodes in the current area, that is, R c =0.5*V c +0.5*S c -P c , where P c Represents the penalty factor. When the central node submits forged data, refuses to verify transactions, or submits blocks repeatedly, the penalty factor value is 10. Otherwise, the penalty factor is 0. c Indicates the percentage of the current access business volume of the central node to the current access business volume of all central nodes in the current area. c Indicates the current access success rate of the central node. V c and S c The weights are all set to 0.5.
[0081] Specifically, the reputation value R of terminal node t t It can be determined by the current total access service volume, current access frequency and current access success rate of the terminal node and the current total access service volume of the central node corresponding to the terminal node, that is, R t =0.4*V t +0.3*F t +0.3*S t -P t , where P t Represents the penalty factor. When the terminal node does not respond for a long time or violates the priority setting rules, the penalty factor value is 10, otherwise the penalty factor is 0. t Indicates the percentage of the total amount of current access services of the terminal node to the total amount of current access services of the central node corresponding to the terminal node.t Indicates the current access frequency of the terminal node, S t Indicates the current access success rate of the terminal node. In order to improve the enthusiasm of the terminal node to participate in communication, V t The weight of F is set to 0.4. t and S t The weight of is set to 0.3.
[0082] The reputation values of the central node and each terminal node in the shard are respectively stored in the temporary reputation blocks corresponding to the central node and each terminal node. The reputation block corresponding to the shard can be determined based on the temporary reputation block. The reputation block stores the reputation values of the central node and each terminal node in the form of a reputation value table. The reputation blocks corresponding to each shard can form a reputation chain.
[0083] Specifically, firstly, the reputation block corresponding to each shard can be determined in the reputation chain according to the identifier of each shard, and secondly, the current reputation value of each terminal node can be determined according to the identifier of each terminal node in the reputation block corresponding to each block.
[0084] In the embodiment of the present invention, the current reputation value of each terminal node is determined in the reputation chain.
[0085] Step 230: In each slice of the current area, the access order of each current service is determined according to the current reputation value of each terminal node in the slice and the service type of the current service.
[0086] In one implementation, step 230 may specifically include:
[0087] Determine the service priority of the current service according to the service type of the current service of each terminal node; determine the preliminary sorting result of each current service according to the service priority of each current service; when it is determined that there is the same service priority in the preliminary sorting result, determine the access order of each current service with the same service priority according to the current credibility value of the terminal node corresponding to each current service with the same service priority; determine the access order of each current service according to the preliminary sorting result and the access order of each current service with the same service priority.
[0088] Among them, when the service priority range is 0-5, the service priority of fault alarm is configured to 0, the service priority of control instruction is configured to 1, the service priority of real-time monitoring is configured to 2, the service priority of user service is configured to 3, the service priority of system status report is configured to 4, and the service priority of network maintenance is configured to 5.
[0089] Specifically, for each shard in the current area, after each terminal node determines the current service it has applied for, it can determine the service priority based on the service type of the current service. Since different services have different service priorities and each service sends different data, the terminal node cannot forge the service priority, otherwise it will affect the judgment of the central node and further affect the access success rate of the current service.
[0090] Prioritizing the access of high-priority services to the central node can ensure the low latency requirements of high-priority services. Therefore, each current service can be sorted according to the service priority of each current service to obtain a preliminary sorting result. When it is determined that the service priorities of each current service are different, the access order of each current service can be determined according to the initial order. When it is determined that there are current services with consistent service priorities, since the current reputation value of the terminal node corresponding to the current service can reflect the reliability and stability of the terminal node, the security and reliability of service access can be improved by giving priority to the service applied by the high-reputation terminal node. Therefore, the current services with consistent service priorities can be sorted according to the current reputation value of the terminal node corresponding to the service. Specifically, first, the current reputation value of the terminal node corresponding to the current service with consistent service priority can be obtained in the reputation chain, and the sorting result of the current service with consistent service priority can be determined according to the current reputation value of the terminal node corresponding to the current service with consistent service priority, and then the preliminary sorting result can be updated according to the sorting result of the current service with consistent service priority to obtain the target sorting result, and then the target sorting result can be determined as the access order of each current service.
[0091] As described above, based on the same steps, the access order of the current service access central node applied by each terminal node in each slice of the current area can be determined.
[0092] Nodes can be divided into abnormal nodes, ordinary nodes and excellent nodes according to their reputation values. The reputation value of abnormal nodes is T∈[0,50), the reputation value of ordinary nodes is T∈[50,100], and the reputation value of excellent nodes is T∈(100,150). Abnormal nodes have high failure rates and instability, ordinary nodes are basically reliable but have no significant advantages, and excellent nodes have extremely high stability and responsiveness.
[0093] The central node has the right to reject the service access request of abnormal terminal nodes. Therefore, after determining the access order of each current service, the reputation value of the terminal node corresponding to each current service can be obtained in the reputation chain. When it is determined that the reputation value of the terminal node falls into [0,50), the current service corresponding to the terminal node can be eliminated to restrict malicious deception of the terminal node and avoid the terminal node failure that causes the power system to fail to work properly, thereby improving the security and reliability of service access, ensuring the security of service access and avoiding the centralization risk of service access.
[0094] In the embodiment of the present invention, high-priority services are preferentially accessed to the central node, which ensures the low latency requirement of high-priority services and meets the hierarchical access of multiple service priorities. Services applied for by high-credibility terminal nodes are preferentially accessed to the central node, which improves the security and reliability of service access.
[0095] Step 240: Determine the current reputation value of each central node in the reputation chain.
[0096] Specifically, firstly, the reputation block corresponding to each shard can be determined in the reputation chain according to the identifier of each shard, and secondly, the current reputation value of the central node can be determined according to the identifier of the central node in the reputation block corresponding to each block.
[0097] In the embodiment of the present invention, the current reputation value of each central node is determined in the reputation chain.
[0098] Step 250: According to the current reputation value of the central node in each shard, the central node with a high reputation value verifies the transaction block of the shard corresponding to the central node with a low reputation value in turn.
[0099] The transaction block is determined by the central node in each shard according to the access sequence and service type of each current service and the address code of each terminal node and broadcasted to other central nodes.
[0100] In one implementation, step 250 may specifically include:
[0101] The central node with a high reputation value determines the time information and the shard hash value in the block header information of the transaction block of the shard corresponding to the central node with a low reputation value, and determines the current hash value based on the time information and the shard hash value; when it is determined that the shard hash value and the current hash value are consistent, it is determined that the transaction block of the shard has been verified.
[0102] As described in the first embodiment, the central node in each shard can determine the transaction block of each shard based on the node access information of each shard, and broadcast the transaction block of each shard to other central nodes.
[0103] Furthermore, the transaction blocks of the shards can be verified based on the DPoS consensus mechanism. Specifically, the central nodes of each shard can be used as representative nodes to package and verify the transaction blocks. Specifically, the transaction blocks of the shards corresponding to the central nodes with low reputation values can be verified by the central nodes with high reputation values in turn according to the current reputation values of the central nodes. First, the central nodes can be sorted from high to low according to the current reputation values of the central nodes. Secondly, the transaction areas of the shards corresponding to the central nodes with low reputation values can be verified based on the central nodes with high reputation values. Specifically, for any central node, the transaction blocks of the shards corresponding to the central nodes with a current reputation value higher than it can be verified.
[0104] Figure 4 A schematic diagram of a block header of a sharded transaction block in another service access method provided by an embodiment of the present invention, such as Figure 4 As shown, the information contained in the block header includes: time information, address code of the central node corresponding to the shard, shard hash value, signature information and transaction verification history of the shard.
[0105] The verification process includes: determining the time information and the shard hash value of the shard in the block header information of the shard transaction block, splicing the time information and the shard hash value to obtain the spliced data, and using the cryptographic hash algorithm to calculate the hash value of the spliced data. For example, the cryptographic hash algorithm can use the SHA-256 algorithm to fill the spliced data with 1 bit and an appropriate number of 0 bits to make its length a multiple of 512 bits, and then divide the padded spliced data into 512-bit blocks. For each data block, 64 rounds of hash calculations are performed, and each round uses bit operations and logical operations to update the current hash state. After processing all data blocks, the final 8 32-bit hash values are spliced into a 256-bit hash value as the current hash value of the shard. When it is determined that the shard hash value of the shard is consistent with the current hash value, it is determined that the transaction block of the shard has been verified.
[0106] It should be noted that after the central node generates the transaction block of its corresponding shard, its reputation value increases. If the central node submits forged data, refuses to verify transactions, or submits blocks repeatedly, its reputation value decreases. The central node's behavior is used to adjust its reputation value, thereby adjusting a new round of business access in the central node's corresponding shard.
[0107] In the embodiment of the present invention, the central node only needs to verify the transaction block of the shard corresponding to the central node whose current reputation value is one level higher than its own, thereby improving the verification efficiency.
[0108] Step 260: After determining that the transaction block of the shard has passed verification, add the transaction block to the transaction chain.
[0109] Specifically, after it is determined that the transaction block of the shard has passed the verification, the transaction block of the shard can be added to the transaction chain.
[0110] In actual applications, after the transaction blocks of each shard are verified, each shard can sign other shards. When it is determined that all shards in the current area have signatures of other shards, it can also be determined that all shards in the current area have been verified.
[0111] In the embodiment of the present invention, the storage of transaction blocks of verified shards is implemented based on the transaction chain.
[0112] Step 270: When it is determined that the transaction chain includes the transaction blocks of all the shards, the current services in each shard are connected to the central nodes in each shard in sequence according to the access order of the current services in each shard.
[0113] Specifically, when it is determined that the transaction chain includes the transaction blocks of all shards, it can be determined that all shards in the current area have passed the verification. Furthermore, each current business in each shard can be connected to the central node in each shard in sequence according to the access order of each current business in each shard, so that the central node in each shard processes each current business in sequence according to the access order of each current business in each shard.
[0114] In the embodiment of the present invention, each current service is connected to the corresponding central node under the premise of ensuring that all current services are legal and comply with the rules.
[0115] The service access method provided by the embodiment of the present invention includes: dividing the current area into multiple shards according to the location information of each central node and each terminal node in the current area; determining the current reputation value of each terminal node in the reputation chain; in each shard of the current area, determining the access order of each current business according to the current reputation value of each terminal node in the shard and the business type of the current business; determining the current reputation value of each central node in the reputation chain; according to the current reputation value of the central node in each shard, the central node with a high reputation value sequentially verifies the transaction block of the shard corresponding to the central node with a low reputation value; after the central node with a high reputation value determines that the transaction block of the shard corresponding to the central node with a low reputation value has passed the verification, the transaction block is added to the transaction chain; when it is determined that the transaction chain includes the transaction blocks of all the shards, sequentially connecting each current business in each shard to the central node in each shard according to the access order of each current business in each shard. The above technical scheme can first determine the terminal nodes corresponding to each central node according to the location information of each central node and each terminal node in the current area, connect the terminal nodes corresponding to each central node to the network of each central node, and realize dividing the current area into multiple shards. Secondly, the current reputation value of each central node and each terminal node can be determined in the reputation chain. For each shard in the current area, the access order of each current business is determined according to the current reputation value of each terminal node in the shard and the business type of the current business. The access order of each current business is determined on the premise of considering the current reputation value of each terminal node in the shard and the business type of the current business applied for. In addition, the current business corresponding to the business type with high business priority is arranged in front of the current business corresponding to the business type with low business priority, thereby ensuring the low latency requirement of high business priority business, and the current business with the same business priority The corresponding terminal node with a high current reputation value is arranged at the top of the corresponding terminal node. The current reputation value of the central node with the lower one is placed in front, which improves the security and reliability of business access. According to the current reputation value of the central node in each shard, the central node with the higher reputation value verifies the transaction block of the shard corresponding to the central node with the lower reputation value in turn. After determining that the transaction block of the shard has been verified, the transaction block is added to the transaction chain. The central node only needs to verify the transaction block of the shard corresponding to the central node with a current reputation value higher than it, which improves the verification efficiency. In addition, the transaction blocks of the verified shards are stored based on the transaction chain. When it is determined that the transaction chain includes the transaction blocks of all shards, it is determined that all shards in the current area have been verified, that is, the current businesses connected to all shards are legal and comply with the rules. Then, each current business in each shard can be connected to the central node in each shard in turn according to the access order of each current business in each shard. On the premise of ensuring that all current businesses are legal and comply with the rules, each current business can be connected to the corresponding central node.
[0116] To solve the problems of high operating costs and lack of security in the traditional business access process, distributed access to the current business applied for by each terminal node is realized based on multiple central nodes. In addition, security feedback of the access process is realized based on the reputation value of the central node and each terminal node, making the business access process more flexible and improving business access security.
[0117] Figure 5 A schematic diagram of the structure of a service access device provided by an embodiment of the present invention is provided. The device can be applied to situations where orderly access to power services is required to improve the timeliness, reliability and security of power service access. The device can be implemented by software and / or hardware and is generally integrated in electronic equipment, such as computer equipment.
[0118] like Figure 5 As shown, the device comprises:
[0119] A determination module 510 is used to determine, in each slice of the current area, the access order of each current service according to the current reputation value of each terminal node in the slice and the service type of the current service;
[0120] The access module 520 is used to connect each current business in each shard to the central node in each shard in sequence according to the access order of each current business in each shard when it is determined that the transaction chain includes the transaction blocks of all the shards.
[0121] The service access device provided in this embodiment determines, in each shard of the current area, the access order of each current service according to the current reputation value of each terminal node in the shard and the service type of the current service; when it is determined that the transaction chain includes the transaction blocks of all the shards, each current service in each shard is connected to the central node in each shard in turn according to the access order of each current service in each shard. The above technical scheme determines the access order of each current business according to the current reputation value of each terminal node in the shard and the business type of the current business for each shard in the current area. The access order of each current business is determined under the premise of considering the current reputation value of each terminal node in the shard and the business type of the current business applied for. In addition, the current business corresponding to the business type with high business priority is arranged in front of the current business corresponding to the business type with low business priority, thereby ensuring the low latency requirement of the high business priority business. The current reputation value of the corresponding terminal node with the same business priority is arranged in front of the current reputation value of the corresponding terminal node with low current reputation value, thereby improving the security and reliability of business access. When it is determined that the transaction chain includes the transaction blocks of all shards, it is determined that all shards in the current area have been verified, that is, the current businesses accessed by all shards are legal and comply with the rules. Then, each current business in each shard can be connected to the central node in each shard in turn according to the access order of each current business in each shard. Under the premise of ensuring that all current businesses are legal and comply with the rules, each current business can be connected to the corresponding central node.
[0122] Based on the above embodiment, the device further includes:
[0123] A partitioning module is used to divide the current area into multiple slices according to the location information of each central node and each terminal node in the current area, wherein each slice includes one central node and at least one terminal node.
[0124] In one implementation, the partitioning module is specifically used for:
[0125] The node distance between each terminal node and each central node is determined according to the location information of each central node and each terminal node in the current area; for each terminal node, the central node corresponding to the minimum node distance is determined as the central node corresponding to the terminal node; and the current area is divided into multiple shards by dividing each central node and each terminal node corresponding to each central node into the same shard.
[0126] Based on the above embodiment, the determination module 510 is specifically used for:
[0127] In each slice of the current area, the business priority of the current business is determined according to the business type of the current business of each terminal node; the preliminary sorting result of each current business is determined according to the business priority of each current business; when it is determined that the same business priority exists in the preliminary sorting result, the access order of each current business with the same business priority is determined according to the current credibility value of the terminal node corresponding to each current business with the same business priority; the access order of each current business is determined according to the preliminary sorting result and the access order of each current business with the same business priority.
[0128] Based on the above embodiment, the determination module 510 is further used for:
[0129] Before determining the access order of each current service according to the current reputation value of each terminal node in the slice and the service type of the current service, the current reputation value of each terminal node is determined in the reputation chain, wherein the reputation chain stores the current reputation value of each terminal node and each central node, the current reputation value of the terminal node is determined according to the current total access service volume, current access frequency and current access success rate of the terminal node and the current total access service volume of the central node corresponding to the terminal node, and the current current reputation value of the central node is determined according to the current total access service volume and current access success rate of the central node and the current total access service volume of all the central nodes in the current area.
[0130] Based on the above embodiment, the device further includes:
[0131] An execution module is used to determine the current reputation value of each central node in the reputation chain before connecting each current business in each shard to the central node in each shard in turn according to the access order of each current business in each shard; according to the current reputation value of the central node in each shard, the central node with a high reputation value verifies the transaction block of the shard corresponding to the central node with a low reputation value in turn, wherein the transaction block is determined by the central node in each shard according to the access order and business type of each current business and the address code of each terminal node and broadcasted to other central nodes; after determining that the transaction block of the shard has passed the verification, the transaction block is added to the transaction chain.
[0132] In one implementation, the central node with a high reputation value sequentially verifies the transaction blocks of the shards corresponding to the central node with a low reputation value, including:
[0133] The central node with a high reputation value determines the time information and the shard hash value in the block header information of the transaction block of the shard corresponding to the central node with a low reputation value, and determines the current hash value based on the time information and the shard hash value; when it is determined that the shard hash value and the current hash value are consistent, it is determined that the transaction block of the shard has been verified.
[0134] The service access device provided in the embodiment of the present invention can execute the service access method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the service access method.
[0135] It is worth noting that in the embodiment of the above-mentioned service access device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0136] Figure 6 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. Figure 6 A block diagram of an exemplary electronic device 6 suitable for implementing embodiments of the present invention is shown. Figure 6 The electronic device 6 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0137] like Figure 6 As shown, the electronic device 6 is in the form of a general purpose computing electronic device. The components of the electronic device 6 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0138] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0139] The electronic device 6 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 6, including volatile and non-volatile media, removable and non-removable media.
[0140] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 6 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0141] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0142] The electronic device 6 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the electronic device 6, and / or any device that enables the electronic device 6 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 6 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. Figure 6 As shown, the network adapter 20 communicates with other modules of the electronic device 6 via the bus 18. It should be understood that although Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 6, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0143] The processing unit 16 executes various functional applications and page displays by running the program stored in the system memory 28, for example, implementing the service access method provided in the embodiment of the present invention, the method comprising:
[0144] In each shard of the current region, the access order of each current service is determined according to the current reputation value of each terminal node in the shard and the service type of the current service;
[0145] When it is determined that the transaction chain includes the transaction blocks of all the shards, the current services in each shard are connected to the central node in each shard in sequence according to the access order of the current services in each shard.
[0146] The system memory 28 is also used to store the reputation chain and transaction chain storing the current reputation value of each node.
[0147] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the service access method provided by any embodiment of the present invention.
[0148] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, a service access method provided by an embodiment of the present invention is implemented, for example, and the method includes:
[0149] In each shard of the current region, the access order of each current service is determined according to the current reputation value of each terminal node in the shard and the service type of the current service;
[0150] When it is determined that the transaction chain includes the transaction blocks of all the shards, the current services in each shard are connected to the central node in each shard in sequence according to the access order of the current services in each shard.
[0151] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0152] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0153] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0154] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0155] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0156] In addition, the acquisition, storage, use, and processing of data in the technical solution of the present invention are in compliance with the relevant provisions of national laws and regulations.
[0157] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A service access method, characterized in that: include: In each shard of the current region, the access order of each current service is determined according to the current reputation value of each terminal node in the shard and the service type of the current service; When it is determined that the transaction chain includes the transaction blocks of all the shards, the current services in each shard are connected to the central node in each shard in sequence according to the access order of the current services in each shard.
2. The service access method according to claim 1, characterized in that: Also includes: The current area is divided into a plurality of slices according to the location information of each central node and each terminal node in the current area, wherein each slice includes one central node and at least one terminal node.
3. The service access method according to claim 2, characterized in that: Dividing the current area into a plurality of slices according to the location information of each central node and each terminal node in the current area includes: Determine the node distance between each of the terminal nodes and each of the central nodes according to the location information of each of the central nodes and each of the terminal nodes in the current area; For each of the terminal nodes, determining the central node corresponding to the minimum node distance as the central node corresponding to the terminal node; The current area is divided into a plurality of the shards by dividing each of the central nodes and each of the terminal nodes corresponding to the central nodes into the same shard.
4. The service access method according to claim 1, characterized in that: Determining the access order of each current service according to the current reputation value of each terminal node in the shard and the service type of the current service includes: Determining the service priority of the current service according to the service type of the current service of each terminal node; Determining a preliminary ranking result of each of the current services according to the service priority of each of the current services; In the case where it is determined that there are identical service priorities in the preliminary sorting results, determining the access order of the current services having the same service priority according to the current reputation values of the terminal nodes corresponding to the current services having the same service priority; The access order of each current service is determined according to the preliminary sorting result and the access order of each current service with the same service priority.
5. The service access method according to claim 4, characterized in that: Before determining the access order of each current service according to the current reputation value of each terminal node in the slice and the service type of the current service, the method further includes: The current reputation value of each terminal node is determined in the reputation chain, wherein the reputation chain stores the current reputation value of each terminal node and each central node, the current reputation value of the terminal node is determined based on the current total access business volume, current access frequency and current access success rate of the terminal node and the current total access business volume of the central node corresponding to the terminal node, and the current current reputation value of the central node is determined based on the current total access business volume and current access success rate of the central node and the current total access business volume of all the central nodes in the current area.
6. The service access method according to claim 5, characterized in that: Before sequentially connecting each of the current services in each of the slices to the central nodes in each of the slices according to the access order of each of the current services in each of the slices, the method further includes: Determining the current reputation value of each of the central nodes in the reputation chain; According to the current reputation value of the central node in each shard, the central node with a high reputation value sequentially verifies the transaction block of the shard corresponding to the central node with a low reputation value, wherein the transaction block is determined by the central node in each shard according to the access sequence and service type of each current service and the address code of each terminal node and broadcasted to other central nodes; After determining that the transaction block of the shard has passed verification, the transaction block is added to the transaction chain.
7. The service access method according to claim 6, characterized in that: The central node with a high reputation value sequentially verifies the transaction blocks of the shards corresponding to the central node with a low reputation value, including: The central node with a high reputation value determines the time information and the shard hash value in the block header information of the transaction block of the shard corresponding to the central node with a low reputation value, and determines the current hash value according to the time information and the shard hash value; When it is determined that the shard hash value is consistent with the current hash value, it is determined that the transaction block of the shard has been verified.
8. A service access device, characterized in that: include: A determination module, configured to determine, in each shard of the current region, an access order of each current service according to the current reputation value of each terminal node in the shard and the service type of the current service; The access module is used to connect each current business in each shard to the central node in each shard in sequence according to the access order of each current business in each shard when it is determined that the transaction chain includes the transaction blocks of all the shards.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the service access method as described in any one of claims 1-7.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the service access method according to any one of claims 1 to 7 when executed by a computer processor.
