Method, device and equipment for setting endorsement system, medium and endorsement system

By introducing a flexible endorsement mechanism into the blockchain network and dynamically adjusting the number of chain code containers, the problem of waste or insufficient endorsement resources in the blockchain network under high load conditions has been solved, and the processing capacity and resource utilization have been significantly improved.

CN119690581APending Publication Date: 2025-03-25CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411630545.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When blockchain networks deal with high load and computing-intensive tasks, the performance of endorsement systems is limited by the chain code execution time, resulting in waste or insufficient resources.

Method used

An elastic endorsement mechanism is introduced to periodically obtain the resource utilization rate of chain code containers, and dynamically adjust the number of chain code containers to expand or reduce them to ensure that resource utilization is high and adapt to load changes.

Benefits of technology

It significantly improves the processing capability of blockchain network in endorsement operations, reduces transaction processing delays, improves the utilization rate of chain code container resources, reduces the overall resource consumption of endorsement systems, and ensures the stability and performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690581A_ABST
    Figure CN119690581A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an endorsement system setting method, device and equipment, a medium and an endorsement system. The method is applied to an elastic endorsement node of a block chain network, and the elastic endorsement node is connected with a plurality of chain code containers. The method comprises the following steps: periodically obtaining the resource utilization rate of the chain code container; under the condition that the resource utilization rate of the chain code container is greater than a first threshold value, carrying out first capacity expansion operation on the number of the chain code containers; and / or under the condition that the resource utilization rate of the chain code container is smaller than a second threshold value, performing reduction operation on the number of the chain code containers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communications, and specifically to a method, apparatus, device, medium, and endorsement system for setting up an endorsement system. Background Art

[0002] In a blockchain network, transactions need to go through three stages before they are finally recorded in the ledger: endorsement (execution), sorting, and verification. The endorsement stage is mainly used to ensure the validity of transactions, achieve consistency in business logic, provide data privacy and confidentiality, and enhance network security.

[0003] At present, the performance bottleneck of the endorsement system, especially the chain code execution time, limits the performance of the blockchain network when processing high-load and computationally intensive tasks. In order to solve the above problems, the endorsement system provided by the prior art pre-installs multiple chain code containers and implements parallel endorsement operations through multiple chain code containers. However, the chain code containers are pre-set, which may cause the problem of waste or insufficient endorsement resources under different load conditions. Summary of the invention

[0004] The embodiments of the present application propose a method, apparatus, device, medium and endorsement system for setting up an endorsement system to solve the technical problem of waste or insufficiency of endorsement resources under different load conditions.

[0005] In a first aspect, an embodiment of the present application provides a method for setting an endorsement system, which is applied to an elastic endorsement node of a blockchain network, wherein the elastic endorsement node is connected to multiple chain code containers; the method comprises:

[0006] Periodically obtain the resource usage of the chain code container;

[0007] When the resource usage rate of the chain code container is greater than a first threshold, performing a first capacity expansion operation on the number of the chain code containers; and / or,

[0008] When the resource usage rate of the chain code container is less than a second threshold, a reduction operation is performed on the number of the chain code containers.

[0009] In a second aspect, an embodiment of the present application provides a device for setting an endorsement system, which is applied to an elastic endorsement node of a blockchain network, wherein the elastic endorsement node is connected to multiple chain code containers; the device includes:

[0010] A first acquisition module, used to periodically acquire the resource usage rate of the chain code container;

[0011] an expansion module, configured to perform a first expansion operation on the number of the chain code containers when the resource usage rate of the chain code container is greater than a first threshold; and / or,

[0012] The reduction module is used to reduce the number of the chain code containers when the resource usage rate of the chain code container is less than a second threshold.

[0013] In a third aspect, an embodiment of the present application provides an endorsement system, including: an elastic endorsement node and a plurality of chain code containers, wherein the elastic endorsement node is connected to the chain code container;

[0014] The elastic endorsement node is used to periodically obtain the resource usage of the chain code container, and when the resource usage of the chain code container is greater than a first threshold, perform a first expansion operation on the number of the chain code containers, and / or when the resource usage of the chain code container is less than a second threshold, perform a reduction operation on the number of the chain code containers.

[0015] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any embodiment of the first aspect.

[0016] In a fifth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the first aspect.

[0017] The setting method, device, equipment, medium and endorsement system of the endorsement system provided in the embodiment of the present application introduce an elastic endorsement mechanism. The elastic endorsement node can dynamically expand and / or reduce the number of chain code containers according to the resource utilization rate of the chain code container, thereby avoiding the technical problem of waste or insufficient endorsement resources under different load conditions. By dynamically adjusting the number of chain code containers, the processing capacity of the blockchain network for endorsement operations can be significantly improved, and transaction processing delays can be reduced, especially in computing-intensive chain code tasks, which can achieve higher throughput and lower latency. Since the number of chain code containers can be dynamically adjusted, the utilization rate of chain code container resources is improved, the overall resource consumption of the endorsement system is reduced, and the stability and performance of the system are guaranteed under the condition of large load fluctuations. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0019] Figure 1 is one of the flow charts of an embodiment of a method for setting up an endorsement system of the present application;

[0020] Figure 2 yes Figure 1 In the setting method of the endorsement system of the present application shown;

[0021] Figure 3 yes Figure 1 A flowchart of a first capacity expansion operation and / or a second capacity expansion operation in a method for setting up an endorsement system of the present application is shown;

[0022] Figure 4 This is a second flowchart of an embodiment of a method for setting up an endorsement system of the present application;

[0023] Figure 5 is a structural schematic diagram of an embodiment of a setting device of the endorsement system of the present application;

[0024] Figure 6 is a schematic diagram of the structure of an embodiment of the endorsement system of the present application;

[0025] Figure 7 It is a schematic diagram of the structure of an electronic device used to implement an embodiment of the present application. DETAILED DESCRIPTION

[0026] All actions to obtain signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located, and with the authorization given by the owner of the corresponding device.

[0027] The present application 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 relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0028] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0029] Please refer to Figure 1 , which shows a process 100 of an embodiment of a method for setting an endorsement system according to the present application. The method for setting an endorsement system can be applied to various electronic devices with data processing functions. For example, the above electronic devices may include but are not limited to cloud servers, physical servers, etc. The execution subject of the automatic discovery method of the topological relationship may be a processor in the above electronic device.

[0030] In this embodiment, the setting method of the endorsement system is applied to the elastic endorsement node of the blockchain network, and the elastic endorsement node can be connected to multiple chain code containers.

[0031] In this embodiment, the blockchain network may include: peer nodes, sorting nodes and clients. Among them, the peer node can play the role of an elastic endorsement node, and the chain code container is a container on the peer node, which is used for the chain code (smart contract) to run and is responsible for executing specific transaction logic.

[0032] like Figure 1 As shown, the method for setting up the endorsement system includes the following steps:

[0033] Step 101: Periodically obtain the resource usage of the chain code container.

[0034] In this embodiment, the resource usage rate of the chain code container may specifically be the CPU usage rate of the chain code container. Of course, in actual use, the resource usage rate of the chain code container may also be other performance data, and each case will not be described one by one this time.

[0035] It should be noted that this embodiment does not specifically limit the period for obtaining the resource usage rate of the chain code container described in step 101. In actual use, it can be set according to the load situation, which is not elaborated here.

[0036] Step 102: When the resource usage rate of the chain code container is greater than the first threshold, a first capacity expansion operation is performed on the number of chain code containers.

[0037] This embodiment does not limit the specific value of the first threshold, and it can be set according to needs during actual use.

[0038] And / or, step 103: when the resource usage rate of the chain code container is less than the second threshold, the number of chain code containers is reduced.

[0039] This embodiment does not limit the specific value of the second threshold, and it can be set according to needs during actual use.

[0040] In this embodiment, in order to more accurately adjust the number of chain code containers and ensure the rational use of resources. After step 102, it may also include: obtaining the transaction processing rate (Transactions Per Second, TPS) of the blockchain network; when the transaction processing rate is less than the third threshold, performing a second expansion operation on the number of chain code containers. Of course, the above steps are only specific examples of this embodiment. In actual use, the second expansion operation can also be determined based on the improvement effect of the transaction processing rate on the basis of the first expansion operation. For example: after the first expansion operation, if the TPS improvement effect is significantly improved, there is no need to perform the second expansion operation. Otherwise, continue to perform the second expansion operation. Among them, the significant improvement can be achieved by setting a fourth threshold. For example: if the TPS improvement effect is greater than the fourth threshold, it means that the improvement effect is significantly improved.

[0041] In this embodiment, the elastic endorsement node can set a container resource monitoring scaling component, and the above steps provided in this embodiment ( Figure 1 Steps 101-103 shown in the figure, as well as the additional steps after step 102) can all be completed by the container resource monitoring scaling component.

[0042] In this embodiment, the input data of the container resource monitoring scaling component may include: the CPU usage of the chain code container and the transaction processing rate of the blockchain network, and the output data may include: the result of dynamically adjusting the number of chain code containers, such as: expansion, reduction, and unchanged.

[0043] In this embodiment, the process of container resource monitoring scaling components may include:

[0044] 1. Orchestrator Adapter

[0045] function StartContainerAutoscaling

[0046] 2. Start automatic adjustment of chain code container

[0047] while true do

[0048] 3. Get the list of chaincode container services being monitored.

[0049] Monitor service list = Orchestrator adapter: ListMonitorContainer()

[0050] 4. Traverse the services and determine whether adjustments are needed.

[0051] foreach service in monitoring service list do

[0052] Current CPU usage = OrchestratorAdapter.ContainerCPUtilization(service)

[0053] Current number of chaincode containers = orchestratorAdapter.ContainerReplicaCount(service)

[0054] CurrentTPS=GetCurrentTPS()

[0055] 5. According to the current overall usage rate, the number of chain code containers, the number limit of chain code containers, and other information, check whether the TPS has increased to a certain extent since the first expansion operation to decide whether to perform the second expansion operation.

[0056] Expected number of chaincode containers = Calculate the expected number of chaincode containers (current CPU usage, current number of chaincode containers, current TPS)

[0057] 6. If the expected number of chaincode containers is different from the current number of chaincode containers, adjust the service scale.

[0058] If the expected number of chaincode containers! = the current number of chaincode containers then

[0059] OrchestratorAdapter.ScaleContainerService(service, expected number of chaincode containers)

[0060] end if end foreach

[0061] 7. Sleep for a while until the next monitoring cycle arrives

[0062] Sleep(MONITORING_INTERVAL_SEC)

[0063] end while end function

[0064] In this embodiment, if Figure 2 As shown, the first capacity expansion operation and / or the second capacity expansion operation may include the following steps:

[0065] Step 201: Determine the number of newly added chain code containers, and instruct the external builder to use the external elastic chain code construction mechanism to create newly added chain code containers according to the number of newly added chain code containers.

[0066] Step 202: Use the elastic chain code mechanism to perform a self-registration operation on the newly added chain code container and establish a connection with the newly added chain code container.

[0067] In this embodiment, if Figure 3 As shown, the reduction operation may include the following:

[0068] Step 301: Determine the chain code container to be reduced.

[0069] Step 302: Use the elastic chain code mechanism to perform a self-cancellation operation on the chain code container to be reduced.

[0070] In this embodiment, the elastic chain code mechanism includes a self-registration mechanism and a self-cancellation mechanism of the chain code container. Figure 2 and Figure 3 The input data for self-registration and self-cancellation through the elastic chain code mechanism shown in the steps are: peer address list, chain code ccid, chain code address ipaddress and heartbeat monitoring interval lease; the output data is: chain code service instance (chain code container).

[0071] In this embodiment, the process of self-registering and self-cancelling the chaincode container using the elastic chaincode mechanism may include:

[0072] 1. Register the service to the node and send heartbeats at a certain interval

[0073] RegisterService(PeerAddrList,ccid,ipaddress,lease)

[0074] 2. Self-cancellation

[0075] Parallel execution

[0076] Monitor system signals

[0077] If it is a termination signal

[0078] RevokeService()

[0079] }

[0080] 3. Self-registration

[0081] ChaincodeServer<-ConfigureAndStart()

[0082] In this embodiment, if Figure 4 As shown, the method for setting the multiple system also includes the following steps:

[0083] Step 104: Monitor the activity of the chain code container through the service monitoring maintenance component to obtain the activity monitoring result.

[0084] Step 105: Dynamically manage the chain code container based on the activity monitoring results.

[0085] In this embodiment, the service monitoring maintenance component can not only be used to execute steps 104 and 105, but also to execute the above Figure 2 and Figure 3 The self-registration and self-cancellation steps shown in the figure. At this time, the input data of the service monitoring maintenance component is: registration request, cancellation request or heartbeat request; the output data is: registration confirmation response, cancellation confirmation response or heartbeat receipt.

[0086] In this embodiment, the specific process of the service monitoring maintenance component may include:

[0087] 1. Start the service monitoring and waiting for requests

[0088] Start service listener()

[0089] 2. Start monitoring loop

[0090] Loop

[0091] 3. Receive registration requests, deregistration requests or heartbeat requests.

[0092] Accept registration,unregistration,or heartbeat requests

[0093] 4. If it is a registration request: process registration, check connection information, check TLS certificate, and join the connection pool, where the connection pool consists of multiple chain code containers.

[0094] if registration:Handle registration,check registration,add toconnection pool

[0095] 5. If it is a logout request: close the connection and remove it from the connection pool

[0096] Else if unregistration:Close connection,remove from pool

[0097] 6. If it is a heartbeat request: update timestamp and send confirmation.

[0098] Else if heartbeat:Update timestamp,acknowledge

[0099] 7. Perform connection pool maintenance regularly

[0100] Perform maintenance on connection pool periodically

[0101] 8. Check heartbeat, remove inactive connections, and maintain connection pool

[0102] Check heartbeats,remove inactive connection,maintain pool

[0103] 9. End the monitoring loop

[0104] End Loop

[0105] In order to improve the processing capability of the endorsement stage, in this embodiment, the method for setting up the endorsement system may further include the following steps:

[0106] When the client initiates a transaction proposal, a load balancing component is used to evenly distribute endorsement requests among multiple chaincode containers, and connections of multiple chaincode containers are managed through lock-free queues and atomic operation strategies.

[0107] In this embodiment, the step of managing the connection of multiple chaincode containers through lock-free queues and atomic operation strategies can be specifically implemented by a service connection pool component. By managing the connection of multiple chaincode containers through lock-free queues and atomic operation strategies, the communication connection between the elastic endorsement node and the chaincode container can be efficiently reused in a multi-threaded environment, thereby reducing resource overhead and connection latency.

[0108] In this embodiment, the implementation steps of the service connection pool component and the load balancing component may include:

[0109] 1. Try to get the processor queue of the corresponding chain code from the connection pool

[0110] Procedure distributeRequest(chaincodeName,request)

[0111] 2. Get the processor queue from the connection pool according to the chain code name

[0112] queue<-pools.Get(chaincodeName)

[0113] 3. Determine whether the queue exists

[0114] If(queue≠NULL)Then

[0115] 4. Processor polling allocation using lock-free queues

[0116] 4.1. Remove a processor from the queue to process the request

[0117] handler<-queue.Dequeue()

[0118] 4.2. Process the request using the selected processor

[0119] handler.Execute(request)

[0120] 4.3. Put the processor back into the queue for next use

[0121] queue.Enqueue(handler

[0122] 4.4. End the processing flow

[0123] EndIf EndProcedure

[0124] The method for setting up the endorsement system provided in the embodiment of the present application introduces an elastic endorsement mechanism. The elastic endorsement node can dynamically expand and / or reduce the number of chain code containers according to the resource utilization rate of the chain code container, thereby avoiding the technical problem of waste or insufficient endorsement resources under different load conditions. By dynamically adjusting the number of chain code containers, the processing capacity of the blockchain network for endorsement operations can be significantly improved, and transaction processing delays can be reduced, especially in computationally intensive chain code tasks, which can achieve higher throughput and lower latency. Since the number of chain code containers can be dynamically adjusted, the utilization rate of chain code container resources is improved, the overall resource consumption of the endorsement system is reduced, and the stability and performance of the system are guaranteed under the condition of large load fluctuations.

[0125] Please refer to Figure 5 As an implementation of the methods shown in the figures, the present application provides an embodiment of a device for setting up an endorsement system. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0126] like Figure 5 As shown, the endorsement system setting device 500 of this embodiment is applied to an elastic endorsement node of a blockchain network, and the elastic endorsement node is connected to multiple chain code containers; the endorsement system setting device 500 includes:

[0127] The first acquisition module 501 is used to periodically acquire the resource usage rate of the chain code container;

[0128] The expansion module 502 is used to perform a first expansion operation on the number of the chain code container when the resource usage rate of the chain code container is greater than a first threshold; and / or,

[0129] The reduction module 503 is configured to reduce the number of the chain code containers when the resource usage rate of the chain code container is less than a second threshold.

[0130] Optionally, the expansion module 502 is further used to obtain a transaction processing rate of the blockchain network; when the transaction processing rate is less than a third threshold, a second expansion operation is performed on the number of chain code containers.

[0131] Optionally, the expansion module 502 is further used to determine the number of newly added chain code containers, instruct the external builder to use an external elastic chain code construction mechanism to create the newly added chain code containers according to the number of the newly added chain code containers; use the elastic chain code mechanism to perform a self-registration operation on the newly added chain code container, and establish a connection with the newly added chain code container.

[0132] Optionally, the endorsement system setting device 500 may further include:

[0133] The monitoring management module is used to monitor the activity of the chain code container through the service monitoring maintenance component to obtain the activity monitoring result; and dynamically manage the chain code container according to the activity monitoring result.

[0134] Optionally, the reduction module 503 is further used to determine the chain code container to be reduced; and use the elastic chain code mechanism to perform a self-cancellation operation on the chain code container to be reduced.

[0135] Optionally, the endorsement system setting device 500 may further include:

[0136] The balancing management module is used to evenly distribute endorsement requests among multiple chain code containers using a load balancing component when a client initiates a transaction proposal, and to manage connections for multiple chain code containers through a lock-free queue and an atomic operation strategy.

[0137] The specific implementation method of the device for setting up the endorsement system provided in this embodiment can refer to the method for setting up the endorsement system described in the above embodiment, which will not be repeated here.

[0138] The setting device of the endorsement system provided in the embodiment of the present application introduces an elastic endorsement mechanism. The elastic endorsement node can dynamically expand and / or reduce the number of chain code containers according to the resource utilization rate of the chain code container, thereby avoiding the technical problem of waste or insufficient endorsement resources under different load conditions. By dynamically adjusting the number of chain code containers, the processing capacity of the blockchain network for endorsement operations can be significantly improved, and transaction processing delays can be reduced, especially in computing-intensive chain code tasks, which can achieve higher throughput and lower latency. Since the number of chain code containers can be dynamically adjusted, the utilization rate of chain code container resources is improved, the overall resource consumption of the endorsement system is reduced, and the stability and performance of the system are guaranteed under the condition of large load fluctuations.

[0139] Please refer to Figure 6As an implementation of the methods shown in the figures, the present application provides an embodiment of an endorsement system. Figure 1 The method embodiments shown correspond.

[0140] like Figure 6 As shown, the endorsement system of this embodiment may include: an elastic endorsement node 601 and multiple chain code containers 602, wherein the elastic endorsement node 601 is connected to the chain code container 602;

[0141] The elastic endorsement node 601 is used to periodically obtain the resource usage rate of the chain code container 602, and when the resource usage rate of the chain code container 602 is greater than a first threshold, perform a first capacity expansion operation on the number of the chain code containers 602, and / or when the resource usage rate of the chain code container 602 is less than a second threshold, perform a reduction operation on the number of the chain code containers 602.

[0142] Optionally, the elastic endorsement node 601 is further used to obtain a transaction processing rate of the blockchain network; when the transaction processing rate is less than a third threshold, a second expansion operation is performed on the number of chain code containers.

[0143] Optionally, the elastic endorsement node 601 is further used to determine the number of newly added chain code containers, instruct the external builder to use an external elastic chain code construction mechanism to create the newly added chain code containers according to the number of the newly added chain code containers; use the elastic chain code mechanism to perform a self-registration operation on the newly added chain code container, and establish a connection with the newly added chain code container.

[0144] Optionally, the elastic endorsement node 601 is further used to monitor the activity of the chain code container through a service monitoring maintenance component to obtain an activity monitoring result; and dynamically manage the chain code container according to the activity monitoring result.

[0145] Optionally, the elastic endorsement node 601 is further used to determine the chain code container to be reduced; and use the elastic chain code mechanism to perform a self-cancellation operation on the chain code container to be reduced.

[0146] Optionally, the elastic endorsement node 601 is also used to use a load balancing component to evenly distribute endorsement requests among multiple chain code containers when a client initiates a transaction proposal, and to manage connections for multiple chain code containers through a lock-free queue and an atomic operation strategy.

[0147] The endorsement system provided in the embodiment of the present application introduces an elastic endorsement mechanism. The elastic endorsement node can dynamically expand and / or reduce the number of chain code containers according to the resource utilization rate of the chain code container, thereby avoiding the technical problem of waste or insufficient endorsement resources under different load conditions. By dynamically adjusting the number of chain code containers, the processing capacity of the blockchain network for endorsement operations can be significantly improved, and transaction processing delays can be reduced, especially in computationally intensive chain code tasks, which can achieve higher throughput and lower latency. Since the number of chain code containers can be dynamically adjusted, the utilization rate of chain code container resources is improved, the overall resource consumption of the endorsement system is reduced, and the stability and performance of the system are guaranteed under the condition of large load fluctuations.

[0148] Reference below Figure 7 , which shows a schematic structural diagram of an electronic device for implementing some embodiments of the present application. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0149] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0150] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a disk, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 4 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0151] In particular, according to some embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of some embodiments of the present application are executed.

[0152] It should be noted that the computer-readable medium described in some embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: 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 some embodiments of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium 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. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0153] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0154] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: upon receiving a message sending request, obtains the message to be tested in the message sending request; extracts the text content in the message to be tested; detects the text content based on the keywords of historical spam messages, the hash values ​​of historical spam messages, and the large language model to determine whether the message to be tested is a spam message; and intercepts the message to be tested in response to the message to be tested being a spam message.

[0155] Computer program code for performing the operations of some embodiments of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++; and also conventional procedural programming languages ​​such as "C" language 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, or may be connected to an external computer (e.g., through the Internet using an Internet service provider), including a local area network (LAN) or a wide area network (WAN).

[0156] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0157] The units described in some embodiments of the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a first determination unit, a second determination unit, a selection unit, and a third determination unit. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0158] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0159] The above description is only some preferred embodiments of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with (but not limited to) the technical features with similar functions disclosed in the embodiments of the present application to form a technical solution.

Claims

1. A method for setting up an endorsement system, characterized in that: An elastic endorsement node applied to a blockchain network, wherein the elastic endorsement node is connected to a plurality of chain code containers; the method comprises: Periodically obtain the resource usage of the chain code container; When the resource usage rate of the chain code container is greater than a first threshold, performing a first capacity expansion operation on the number of the chain code containers; and / or, When the resource usage rate of the chain code container is less than a second threshold, a reduction operation is performed on the number of the chain code containers.

2. The method according to claim 1, characterized in that After performing the first expansion operation on the number of chain code containers, the method further includes: Obtaining a transaction processing rate of the blockchain network; When the transaction processing rate is less than a third threshold, a second capacity expansion operation is performed on the number of chain code containers.

3. The method according to claim 2, characterized in that The first capacity expansion operation and / or the second capacity expansion operation includes: Determine the number of newly added chain code containers, and instruct the external builder to use the external elastic chain code construction mechanism to create the newly added chain code containers according to the number of the newly added chain code containers; A flexible chain code mechanism is used to perform a self-registration operation on the newly added chain code container, and a connection is established with the newly added chain code container.

4. The method according to claim 1, characterized in that: The method further comprises: Monitor the activity of the chain code container through the service monitoring maintenance component to obtain the activity monitoring result; The chaincode container is dynamically managed according to the activity monitoring result.

5. The method according to claim 1, characterized in that The reduction operation includes: Determine the chaincode container to be reduced; The elastic chain code mechanism is used to perform a self-cancellation operation on the chain code container to be reduced.

6. The method according to claim 1, characterized in that The method further comprises: When a client initiates a transaction proposal, a load balancing component is used to evenly distribute endorsement requests among multiple chain code containers, and connection management of multiple chain code containers is performed through a lock-free queue and an atomic operation strategy.

7. A device for setting up an endorsement system, characterized in that: An elastic endorsement node applied to a blockchain network, wherein the elastic endorsement node is connected to a plurality of chain code containers; the device comprises: A first acquisition module, used to periodically acquire the resource usage rate of the chain code container; an expansion module, configured to perform a first expansion operation on the number of the chain code containers when the resource usage rate of the chain code container is greater than a first threshold; and / or, The reduction module is used to reduce the number of the chain code containers when the resource usage rate of the chain code container is less than a second threshold.

8. An endorsement system, characterized in that: include: An elastic endorsement node and multiple chain code containers, wherein the elastic endorsement node is connected to the chain code container; The elastic endorsement node is used to periodically obtain the resource usage of the chain code container, and when the resource usage of the chain code container is greater than a first threshold, perform a first expansion operation on the number of the chain code containers, and / or when the resource usage of the chain code container is less than a second threshold, perform a reduction operation on the number of the chain code containers.

9. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.